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

Method renderNewLayout

docs/app/js/sanddance-app.js:9497–9549  ·  view source on GitHub ↗
(signalValues, presenterConfig, view)

Source from the content-addressed store, hash-verified

9495 return specColumns;
9496 }
9497 renderNewLayout(signalValues, presenterConfig, view) {
9498 return __awaiter(this, void 0, void 0, function*() {
9499 const currData = this._dataScope.currentData();
9500 const context = {
9501 specColumns: this.getSpecColumnsWithFilteredStats(),
9502 insight: this.insight,
9503 specViewOptions: Object.assign(Object.assign({}, this.options), {
9504 zAxisOptions: {
9505 showZAxis: true,
9506 zIndex: zAxisZindex
9507 }
9508 })
9509 };
9510 const specResult = (0, _sanddanceSpecs.build)(context, currData);
9511 if (!specResult.errors) {
9512 const uiValues = (0, _signals.extractSignalValuesFromView)(this.vegaViewGl, this.vegaSpec);
9513 (0, _signals.applySignalValues)(Object.assign(Object.assign({}, uiValues), signalValues), specResult.vegaSpec);
9514 this.vegaSpec = specResult.vegaSpec;
9515 this.options.onVegaSpec && this.options.onVegaSpec(this.vegaSpec);
9516 this.specCapabilities = specResult.specCapabilities;
9517 const config = this.createConfig(presenterConfig);
9518 if (view) config.getView = ()=>view;
9519 if (!didRegisterColorSchemes) {
9520 (0, _colorSchemes.registerColorSchemes)(_vegaDeckGl.base.vega);
9521 didRegisterColorSchemes = true;
9522 }
9523 try {
9524 if (this.vegaViewGl) this.vegaViewGl.finalize();
9525 const runtime = _vegaDeckGl.base.vega.parse(this.vegaSpec);
9526 this.vegaViewGl = new _vegaDeckGl.ViewGl(runtime, config).renderer("deck.gl").initialize(this.element);
9527 yield this.vegaViewGl.runAsync();
9528 const handler = (n, v)=>{
9529 this._characterSet.resetCharacterSet(true);
9530 };
9531 this.vegaSpec.signals.forEach((s)=>{
9532 this.vegaViewGl.addSignalListener(s.name, handler);
9533 });
9534 //capture new color color contexts via signals
9535 this.configForSignalCapture(config.presenterConfig);
9536 } catch (e) {
9537 specResult.errors = [
9538 e.message
9539 ];
9540 }
9541 if (!specResult.errors) (0, _headers.ensureHeaders)(this.presenter, this.options.language.headers);
9542 }
9543 if (specResult.errors) {
9544 if (this.options.onError) this.options.onError(specResult.errors);
9545 else if (this.presenter.logger) this.presenter.logger(`errors rendering Vega spec:${specResult.errors.join("\n")}`);
9546 }
9547 return specResult;
9548 });
9549 }
9550 /**
9551 * Render the same layout with new options.
9552 * @param newViewerOptions New options object.

Callers 3

onAnimateDataChangeMethod · 0.95
onDataChangedMethod · 0.95
_renderMethod · 0.95

Calls 9

createConfigMethod · 0.95
__awaiterFunction · 0.85
initializeMethod · 0.65
currentDataMethod · 0.45
finalizeMethod · 0.45
rendererMethod · 0.45
forEachMethod · 0.45

Tested by

no test coverage detected