(currentData, showSelectedData, showActive, viewerOptions)
| 10402 | var _sanddanceSpecs = require("@msrvida/sanddance-specs"); |
| 10403 | var _constants = require("./constants"); |
| 10404 | function getSelectedColorMap(currentData, showSelectedData, showActive, viewerOptions) { |
| 10405 | function getSelectionColorItem(datum) { |
| 10406 | let item; |
| 10407 | if (showSelectedData) item = datum[(0, _sanddanceSpecs.FieldNames).Selected] ? { |
| 10408 | color: _vegaDeckGl.util.colorFromString(viewerOptions.colors.selectedCube) |
| 10409 | } : { |
| 10410 | unSelected: true |
| 10411 | }; |
| 10412 | if (showActive && datum[(0, _sanddanceSpecs.FieldNames).Active]) item = { |
| 10413 | color: _vegaDeckGl.util.colorFromString(viewerOptions.colors.activeCube) |
| 10414 | }; |
| 10415 | return item; |
| 10416 | } |
| 10417 | const colorMap = {}; |
| 10418 | currentData.forEach((datum)=>{ |
| 10419 | const selectionColor = getSelectionColorItem(datum); |
| 10420 | if (selectionColor) { |
| 10421 | const ordinal = datum[0, _constants.GL_ORDINAL]; |
| 10422 | colorMap[ordinal] = selectionColor; |
| 10423 | } |
| 10424 | }); |
| 10425 | return colorMap; |
| 10426 | } |
| 10427 | function colorMapFromCubes(cubes) { |
| 10428 | const map = {}; |
| 10429 | cubes.forEach((cube)=>{ |
nothing calls this directly
no test coverage detected