Skip to content

Commit

Permalink
Add colour map binder, fixes #1508
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Sep 22, 2023
1 parent f8b8960 commit a9fed29
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/gui/stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ export class WindowLevelBinder {
};
}

/**
* Colour map binder.
*/
export class ColourMapBinder {
getEventType = function () {
return 'colourmapchange';
};
getCallback = function (layerGroup) {
return function (event) {
const viewLayers = layerGroup.getViewLayersByDataId(event.dataid);
if (viewLayers.length !== 0) {
const vc = viewLayers[0].getViewController();
vc.setColourMap(event.value[0]);
}
};
};
}

/**
* Position binder.
*/
Expand Down Expand Up @@ -133,7 +151,8 @@ export const binderList = {
PositionBinder,
ZoomBinder,
OffsetBinder,
OpacityBinder
OpacityBinder,
ColourMapBinder
};

/**
Expand Down

0 comments on commit a9fed29

Please sign in to comment.