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

Method render

packages/sanddance/src/viewer.ts:427–450  ·  view source on GitHub ↗

* Render data into a visualization. * @param insight Object to create a visualization specification. * @param data Array of data objects. * @param view Optional View to specify camera type. * @param ordinalMap Optional map of ordinals to assign to the data such that the same cube

(insight: Insight, data: object[], options: RenderOptions = {})

Source from the content-addressed store, hash-verified

425 * @param ordinalMap Optional map of ordinals to assign to the data such that the same cubes can be re-used for new data.
426 */
427 async render(insight: Insight, data: object[], options: RenderOptions = {}) {
428 let result: RenderResult;
429 //see if refine expression has changed
430 if (!searchExpression.compare(insight.filter, this.insight.filter)) {
431 const allowAsyncRenderTime = 100;
432 if (insight.filter) {
433 //refining
434 result = await this._render(insight, data, options, true);
435 this.presenter.animationQueue(() => {
436 this.filter(insight.filter, options.rebaseFilter && options.rebaseFilter());
437 }, allowAsyncRenderTime, { waitingLabel: 'layout before refine', handlerLabel: 'refine after layout' });
438 } else {
439 //not refining
440 this._dataScope.setFilteredData(null);
441 result = await this._render(insight, data, options, true);
442 this.presenter.animationQueue(() => {
443 this.reset();
444 }, allowAsyncRenderTime, { waitingLabel: 'layout before reset', handlerLabel: 'reset after layout' });
445 }
446 } else {
447 result = await this._render(insight, data, options, false);
448 }
449 return result;
450 }
451
452 private shouldViewstateTransition(newInsight: Insight, oldInsight: Insight) {
453 if (!oldInsight.columns) return false;

Callers 3

_renderMethod · 0.45
activateMethod · 0.45
deActivateMethod · 0.45

Calls 5

_renderMethod · 0.95
filterMethod · 0.95
resetMethod · 0.95
animationQueueMethod · 0.45
setFilteredDataMethod · 0.45

Tested by

no test coverage detected