feat: Adds drill to detail context menu for ECharts visualizations (#20891)

* feat: Adds drill to detail context menu for ECharts visualizations

* Rebases and adds time grain

* Fixes selected gauge values

* Fixes Treemap edge click

* Adds right click to big number trendline

* Address some comments
This commit is contained in:
Michael S. Molina
2022-08-09 17:02:31 -03:00
committed by GitHub
parent 0042ade66f
commit 3df8335f87
38 changed files with 734 additions and 249 deletions

View File

@@ -18,19 +18,20 @@
*/
import React, { useCallback } from 'react';
import Echart from '../components/Echart';
import { EventHandlers } from '../types';
import { allEventHandlers } from '../utils/eventHandlers';
import { BoxPlotChartTransformedProps } from './types';
export default function EchartsBoxPlot({
height,
width,
echartOptions,
setDataMask,
labelMap,
groupby,
selectedValues,
formData,
}: BoxPlotChartTransformedProps) {
export default function EchartsBoxPlot(props: BoxPlotChartTransformedProps) {
const {
height,
width,
echartOptions,
setDataMask,
labelMap,
groupby,
selectedValues,
formData,
} = props;
const handleChange = useCallback(
(values: string[]) => {
if (!formData.emitFilter) {
@@ -67,17 +68,7 @@ export default function EchartsBoxPlot({
[groupby, labelMap, setDataMask, selectedValues],
);
const eventHandlers: EventHandlers = {
click: props => {
const { name } = props;
const values = Object.values(selectedValues);
if (values.includes(name)) {
handleChange(values.filter(v => v !== name));
} else {
handleChange([name]);
}
},
};
const eventHandlers = allEventHandlers(props, handleChange);
return (
<Echart