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

Method constructor

packages/sanddance/src/viewer.ts:126–149  ·  view source on GitHub ↗

* Instantiate a new Viewer. * @param element Parent HTMLElement to present within. * @param options Optional viewer options object.

(public element: HTMLElement, options?: Partial<ViewerOptions>)

Source from the content-addressed store, hash-verified

124 * @param options Optional viewer options object.
125 */
126 constructor(public element: HTMLElement, options?: Partial<ViewerOptions>) {
127 this.options = VegaDeckGl.util.deepMerge<ViewerOptions>(defaultViewerOptions, options as ViewerOptions);
128 this.presenter = new VegaDeckGl.Presenter(element, getPresenterStyle(this.options));
129 this._characterSet = new CharacterSet();
130 this._dataScope = new DataScope();
131 this._animator = new Animator(
132 this._dataScope,
133 {
134 onDataChanged: this.onDataChanged.bind(this),
135 onAnimateDataChange: this.onAnimateDataChange.bind(this),
136 });
137 this._details = new Details(
138 this.presenter.getElement(VegaDeckGl.PresenterElement.panel),
139 this.options.language,
140 this._animator,
141 this._dataScope,
142 remap => {
143 this.currentColorContext = ~~remap;
144 this.renderSameLayout();
145 },
146 () => this.insight && this.insight.columns && !!this.insight.columns.color && this.colorContexts && this.colorContexts.length > 1,
147 );
148 this.insight = {} as Insight;
149 }
150
151 private changeColorContexts(colorContexts: ColorContext[]) {
152 this.colorContexts = colorContexts;

Callers

nothing calls this directly

Calls 3

renderSameLayoutMethod · 0.95
getPresenterStyleFunction · 0.90
getElementMethod · 0.45

Tested by

no test coverage detected