MCPcopy
hub / github.com/microsoft/SandDance / getSelectionColorItem

Function getSelectionColorItem

packages/sanddance/src/colorCubes.ts:15–27  ·  view source on GitHub ↗
(datum: object)

Source from the content-addressed store, hash-verified

13
14export function getSelectedColorMap(currentData: object[], showSelectedData: boolean, showActive: boolean, viewerOptions: ViewerOptions) {
15 function getSelectionColorItem(datum: object) {
16 let item: ColorMappedItem;
17 if (showSelectedData) {
18 item = datum[FieldNames.Selected] ?
19 { color: VegaDeckGl.util.colorFromString(viewerOptions.colors.selectedCube) }
20 :
21 { unSelected: true };
22 }
23 if (showActive && datum[FieldNames.Active]) {
24 item = { color: VegaDeckGl.util.colorFromString(viewerOptions.colors.activeCube) };
25 }
26 return item;
27 }
28 const colorMap: ColorMap = {};
29 currentData.forEach(datum => {
30 const selectionColor = getSelectionColorItem(datum);

Callers 1

getSelectedColorMapFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected