MCPcopy Create free account
hub / github.com/microsoft/SandDance / renderSameLayout

Method renderSameLayout

docs/tests/v2/es6/js/sanddance.js:154513–154555  ·  view source on GitHub ↗

* Render the same layout with new options. * @param newViewerOptions New options object.

(newViewerOptions)

Source from the content-addressed store, hash-verified

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) {

Callers 2

constructorMethod · 0.95
onDataChangedMethod · 0.95

Calls 6

createConfigMethod · 0.95
getCubeDataMethod · 0.45
hasSelectedDataMethod · 0.45
currentDataMethod · 0.45
rePresentMethod · 0.45

Tested by

no test coverage detected