* Instantiate a new Viewer. * @param element Parent HTMLElement to present within. * @param options Optional viewer options object.
(public element: HTMLElement, options?: Partial<ViewerOptions>)
| 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; |
nothing calls this directly
no test coverage detected