MCPcopy Index your code
hub / github.com/microsoft/SandDance / renderSameLayout

Method renderSameLayout

docs/app/js/sanddance-app.js:9553–9588  ·  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

9551 * Render the same layout with new options.
9552 * @param newViewerOptions New options object.
9553 */ renderSameLayout(newViewerOptions) {
9554 const colorContext = this.colorContexts[this.currentColorContext];
9555 const clonedCubes = this.presenter.getCubeData().map((cube)=>{
9556 return Object.assign({}, cube);
9557 });
9558 this.applyLegendColorContext(colorContext);
9559 let { axes , textData } = this.presenter.stage;
9560 let recoloredAxes;
9561 if (newViewerOptions) {
9562 if (newViewerOptions.colors) {
9563 recoloredAxes = (0, _axes.recolorAxes)(this.presenter.stage, this._lastColorOptions, newViewerOptions.colors);
9564 this._lastColorOptions = _vegaDeckGl.util.clone(newViewerOptions.colors);
9565 axes = recoloredAxes.axes || axes;
9566 textData = recoloredAxes.textData || textData;
9567 }
9568 this.options = _vegaDeckGl.util.deepMerge(this.options, newViewerOptions);
9569 }
9570 let colorMaps = [
9571 colorContext.colorMap
9572 ];
9573 let colorMethod;
9574 const hasSelectedData = this._dataScope.hasSelectedData();
9575 const hasActive = !!this._dataScope.active;
9576 if (hasSelectedData || hasActive) {
9577 const selectedColorMap = (0, _colorCubes.getSelectedColorMap)(this._dataScope.currentData(), hasSelectedData, hasActive, this.options);
9578 colorMaps.push(selectedColorMap);
9579 colorMethod = this.options.colors.unselectedColorMethod;
9580 }
9581 (0, _colorCubes.applyColorMapToCubes)(colorMaps, clonedCubes, colorMethod);
9582 const stage = {
9583 cubeData: clonedCubes,
9584 axes,
9585 textData
9586 };
9587 this.vegaViewGl.presenter.rePresent(stage, this.createConfig().presenterConfig);
9588 }
9589 getView(view) {
9590 if (view === undefined) {
9591 if (this.presenter.view === null) return defaultView;

Callers 5

constructorMethod · 0.95
onDataChangedMethod · 0.95
checkForDarkThemeMethod · 0.45
manageColorToolbarMethod · 0.45
changeColorSchemeMethod · 0.45

Calls 7

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

Tested by

no test coverage detected