(c)
| 9810 | return !_vegaDeckGl.util.colorIsEqual(this.options.getTextColor(t), this.options.getTextHighlightColor(t)); |
| 9811 | } |
| 9812 | createConfig(c) { |
| 9813 | const { getTextColor , getTextHighlightColor , getTextHighlightAlphaCutoff , onTextClick } = this.options; |
| 9814 | const defaultPresenterConfig = { |
| 9815 | zAxisZindex, |
| 9816 | getCharacterSet: (stage)=>this._characterSet.getCharacterSet(stage), |
| 9817 | getTextColor, |
| 9818 | getTextHighlightColor, |
| 9819 | getTextHighlightAlphaCutoff, |
| 9820 | onTextClick: (e, t)=>{ |
| 9821 | if (t.metaData && t.metaData.search) { |
| 9822 | const search = (0, _search.getSearchGroupFromVegaValue)(t.metaData.search); |
| 9823 | if (this.options.onAxisClick) this.options.onAxisClick(e, search); |
| 9824 | else this.select(search); |
| 9825 | } |
| 9826 | if (onTextClick) onTextClick(e, t); |
| 9827 | }, |
| 9828 | onCubeClick: this.onCubeClick.bind(this), |
| 9829 | onCubeHover: this.onCubeHover.bind(this), |
| 9830 | onTextHover: this.onTextHover.bind(this), |
| 9831 | preStage: this.preStage.bind(this), |
| 9832 | onPresent: this.options.onPresent, |
| 9833 | onLayerClick: (info, e)=>{ |
| 9834 | if (!info || !info.object) this.deselect(); |
| 9835 | }, |
| 9836 | onLegendClick: (e, legend, clickedIndex)=>{ |
| 9837 | const legendRow = clickedIndex !== null && legend.rows[clickedIndex]; |
| 9838 | if (legendRow) { |
| 9839 | if (this.options.onLegendRowClick) this.options.onLegendRowClick(e, legendRow); |
| 9840 | else this.select(legendRow.search); |
| 9841 | } else if (this.options.onLegendHeaderClick) //header clicked |
| 9842 | this.options.onLegendHeaderClick(e); |
| 9843 | }, |
| 9844 | onSceneRectAssignCubeOrdinal: (datum)=>{ |
| 9845 | //TODO see if datum is a facet selection rect |
| 9846 | return datum[0, _constants.GL_ORDINAL]; |
| 9847 | }, |
| 9848 | onTargetViewState: (h, w)=>{ |
| 9849 | const { height , width } = this.insight.size; |
| 9850 | let newViewStateTarget; |
| 9851 | if (this.options.onNewViewStateTarget) newViewStateTarget = this.options.onNewViewStateTarget(); |
| 9852 | return { |
| 9853 | height, |
| 9854 | width, |
| 9855 | newViewStateTarget |
| 9856 | }; |
| 9857 | }, |
| 9858 | preserveDrawingBuffer: this.options.preserveDrawingBuffer |
| 9859 | }; |
| 9860 | if (this.options.onBeforeCreateLayers) defaultPresenterConfig.preLayer = (stage)=>{ |
| 9861 | this.options.onBeforeCreateLayers(stage, this.specCapabilities); |
| 9862 | }; |
| 9863 | const config = { |
| 9864 | presenter: this.presenter, |
| 9865 | presenterConfig: Object.assign(defaultPresenterConfig, c) |
| 9866 | }; |
| 9867 | if (this.options.transitionDurations) config.presenterConfig.transitionDurations = this.options.transitionDurations; |
| 9868 | return config; |
| 9869 | } |
no test coverage detected