(currentData, showSelectedData, showActive, viewerOptions)
| 148239 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 148240 | // Licensed under the MIT license. |
| 148241 | function getSelectedColorMap(currentData, showSelectedData, showActive, viewerOptions) { |
| 148242 | function getSelectionColorItem(datum) { |
| 148243 | let item; |
| 148244 | |
| 148245 | if (showSelectedData) { |
| 148246 | item = datum[_constants.FieldNames.Selected] ? { |
| 148247 | color: viewerOptions.colors.selectedCube |
| 148248 | } : { |
| 148249 | unSelected: true |
| 148250 | }; |
| 148251 | } |
| 148252 | |
| 148253 | if (showActive && datum[_constants.FieldNames.Active]) { |
| 148254 | item = { |
| 148255 | color: viewerOptions.colors.activeCube |
| 148256 | }; |
| 148257 | } |
| 148258 | |
| 148259 | return item; |
| 148260 | } |
| 148261 | |
| 148262 | const colorMap = {}; |
| 148263 | currentData.forEach(datum => { |
| 148264 | const selectionColor = getSelectionColorItem(datum); |
| 148265 | |
| 148266 | if (selectionColor) { |
| 148267 | const ordinal = datum[VegaDeckGl.constants.GL_ORDINAL]; |
| 148268 | colorMap[ordinal] = selectionColor; |
| 148269 | } |
| 148270 | }); |
| 148271 | return colorMap; |
| 148272 | } |
| 148273 | |
| 148274 | function colorMapFromCubes(cubes) { |
| 148275 | const map = {}; |
nothing calls this directly
no test coverage detected