* Render the same layout with new options. * @param newViewerOptions New options object.
(newViewerOptions)
| 154511 | |
| 154512 | |
| 154513 | renderSameLayout(newViewerOptions) { |
| 154514 | const colorContext = this.colorContexts[this.currentColorContext]; |
| 154515 | const clonedCubes = this.presenter.getCubeData().map(cube => { |
| 154516 | return Object.assign({}, cube); |
| 154517 | }); |
| 154518 | this.applyLegendColorContext(colorContext); |
| 154519 | let { |
| 154520 | axes, |
| 154521 | textData |
| 154522 | } = this.presenter.stage; |
| 154523 | let recoloredAxes; |
| 154524 | |
| 154525 | if (newViewerOptions) { |
| 154526 | if (newViewerOptions.colors) { |
| 154527 | recoloredAxes = (0, _axes.recolorAxes)(this.presenter.stage, this._lastColorOptions, newViewerOptions.colors); |
| 154528 | axes = recoloredAxes.axes || axes; |
| 154529 | textData = recoloredAxes.textData || textData; |
| 154530 | } |
| 154531 | |
| 154532 | this.options = VegaDeckGl.util.deepMerge(this.options, newViewerOptions); |
| 154533 | } |
| 154534 | |
| 154535 | let colorMaps = [colorContext.colorMap]; |
| 154536 | let colorMethod; |
| 154537 | |
| 154538 | const hasSelectedData = this._dataScope.hasSelectedData(); |
| 154539 | |
| 154540 | const hasActive = !!this._dataScope.active; |
| 154541 | |
| 154542 | if (hasSelectedData || hasActive) { |
| 154543 | const selectedColorMap = (0, _colorCubes.getSelectedColorMap)(this._dataScope.currentData(), hasSelectedData, hasActive, this.options); |
| 154544 | colorMaps.push(selectedColorMap); |
| 154545 | colorMethod = this.options.colors.unselectedColorMethod; |
| 154546 | } |
| 154547 | |
| 154548 | (0, _colorCubes.applyColorMapToCubes)(colorMaps, clonedCubes, colorMethod); |
| 154549 | const stage = { |
| 154550 | cubeData: clonedCubes, |
| 154551 | axes, |
| 154552 | textData |
| 154553 | }; |
| 154554 | this.vegaViewGl.presenter.rePresent(stage, this.createConfig().presenterConfig); |
| 154555 | } |
| 154556 | |
| 154557 | getView(view) { |
| 154558 | if (view === undefined) { |
no test coverage detected