(c)
| 154835 | } |
| 154836 | |
| 154837 | createConfig(c) { |
| 154838 | const { |
| 154839 | getTextColor, |
| 154840 | getTextHighlightColor, |
| 154841 | onTextClick |
| 154842 | } = this.options; |
| 154843 | const defaultPresenterConfig = { |
| 154844 | getTextColor, |
| 154845 | getTextHighlightColor, |
| 154846 | onTextClick, |
| 154847 | onCubeClick: this.onCubeClick.bind(this), |
| 154848 | onCubeHover: this.onCubeHover.bind(this), |
| 154849 | onTextHover: this.onTextHover.bind(this), |
| 154850 | preStage: this.preStage.bind(this), |
| 154851 | onPresent: this.options.onPresent, |
| 154852 | onLayerClick: (info, pickedInfos, e) => { |
| 154853 | if (!info) { |
| 154854 | this.deselect(); |
| 154855 | } |
| 154856 | }, |
| 154857 | onLegendClick: (e, legend, clickedIndex) => { |
| 154858 | const legendRow = clickedIndex !== null && legend.rows[clickedIndex]; |
| 154859 | |
| 154860 | if (legendRow) { |
| 154861 | if (this.options.onLegendRowClick) { |
| 154862 | this.options.onLegendRowClick(e, legendRow); |
| 154863 | } else { |
| 154864 | this.select(legendRow.search); |
| 154865 | } |
| 154866 | } else if (this.options.onLegendHeaderClick) { |
| 154867 | //header clicked |
| 154868 | this.options.onLegendHeaderClick(e); |
| 154869 | } |
| 154870 | } |
| 154871 | }; |
| 154872 | |
| 154873 | if (this.options.onBeforeCreateLayers) { |
| 154874 | defaultPresenterConfig.preLayer = stage => this.options.onBeforeCreateLayers(stage, this.specCapabilities); |
| 154875 | } |
| 154876 | |
| 154877 | const config = { |
| 154878 | presenter: this.presenter, |
| 154879 | presenterConfig: Object.assign(defaultPresenterConfig, c) |
| 154880 | }; |
| 154881 | |
| 154882 | if (this.options.transitionDurations) { |
| 154883 | config.presenterConfig.transitionDurations = this.options.transitionDurations; |
| 154884 | } |
| 154885 | |
| 154886 | return config; |
| 154887 | } |
| 154888 | /** |
| 154889 | * Filter the data and animate. |
| 154890 | * @param search Filter expression, see https://vega.github.io/vega/docs/expressions/ |
no test coverage detected