@gravity-ui/charts 1.51.7 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/ChartInner/useChartInnerHandlers.d.ts +3 -2
- package/dist/cjs/components/ChartInner/useChartInnerHandlers.js +1 -3
- package/dist/cjs/components/ChartInner/useChartInnerProps.d.ts +3 -2
- package/dist/cjs/components/ChartInner/useDefaultState.d.ts +3 -2
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/core/series/plugin.d.ts +47 -2
- package/dist/cjs/core/series/types.d.ts +4 -0
- package/dist/cjs/core/shapes/area/prepare-data.js +29 -19
- package/dist/cjs/core/shapes/area/renderer.d.ts +0 -5
- package/dist/cjs/core/shapes/area/renderer.js +0 -75
- package/dist/cjs/core/shapes/area/types.d.ts +2 -8
- package/dist/cjs/core/shapes/bar-x/prepare-data.js +18 -7
- package/dist/cjs/core/shapes/bar-x/renderer.d.ts +0 -1
- package/dist/cjs/core/shapes/bar-x/renderer.js +0 -18
- package/dist/cjs/core/shapes/bar-x/types.d.ts +2 -1
- package/dist/cjs/core/shapes/bar-y/get-tooltip-data.js +4 -2
- package/dist/cjs/core/shapes/bar-y/prepare-data.js +8 -2
- package/dist/cjs/core/shapes/funnel/prepare-data.js +121 -68
- package/dist/cjs/core/shapes/heatmap/prepare-data.js +11 -2
- package/dist/cjs/core/shapes/line/prepare-data.js +27 -17
- package/dist/cjs/core/shapes/line/renderer.d.ts +0 -5
- package/dist/cjs/core/shapes/line/renderer.js +0 -75
- package/dist/cjs/core/shapes/line/types.d.ts +2 -8
- package/dist/cjs/core/shapes/marker.d.ts +30 -0
- package/dist/cjs/core/shapes/marker.js +68 -0
- package/dist/cjs/core/shapes/pie/prepare-data.js +24 -9
- package/dist/cjs/core/shapes/radar/prepare-data.js +3 -0
- package/dist/cjs/core/shapes/sankey/prepare-data.js +10 -1
- package/dist/cjs/core/shapes/scatter/prepare-data.js +8 -1
- package/dist/cjs/core/shapes/scatter/renderer.js +3 -2
- package/dist/cjs/core/shapes/scatter/types.d.ts +1 -1
- package/dist/cjs/core/shapes/treemap/prepare-data.js +9 -1
- package/dist/cjs/core/shapes/types.d.ts +35 -0
- package/dist/cjs/core/shapes/waterfall/prepare-data.js +5 -2
- package/dist/cjs/core/shapes/x-range/prepare-data.js +7 -2
- package/dist/cjs/core/types/chart/base.d.ts +22 -2
- package/dist/cjs/core/types/chart/funnel.d.ts +25 -1
- package/dist/cjs/core/types/chart/tooltip.d.ts +6 -1
- package/dist/cjs/core/utils/data-labels.d.ts +34 -0
- package/dist/cjs/core/utils/data-labels.js +26 -0
- package/dist/cjs/core/utils/get-closest-data.d.ts +2 -2
- package/dist/cjs/core/utils/get-closest-data.js +14 -34
- package/dist/cjs/core/utils/tooltip-helpers.d.ts +16 -0
- package/dist/cjs/core/utils/tooltip-helpers.js +12 -0
- package/dist/cjs/hooks/useShapes/AnnotationLayer.d.ts +9 -0
- package/dist/cjs/hooks/useShapes/AnnotationLayer.js +17 -0
- package/dist/cjs/hooks/useShapes/HoverMarkerLayer.d.ts +10 -0
- package/dist/cjs/hooks/useShapes/HoverMarkerLayer.js +22 -0
- package/dist/cjs/hooks/useShapes/MarkerLayer.d.ts +7 -0
- package/dist/cjs/hooks/useShapes/MarkerLayer.js +12 -0
- package/dist/cjs/hooks/useShapes/SeriesShapes.d.ts +18 -0
- package/dist/cjs/hooks/useShapes/SeriesShapes.js +32 -0
- package/dist/cjs/hooks/useShapes/index.d.ts +5 -18
- package/dist/cjs/hooks/useShapes/index.js +39 -229
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/plugins/area/index.js +42 -0
- package/dist/cjs/plugins/bar-x/index.js +42 -0
- package/dist/cjs/plugins/bar-y/index.js +26 -0
- package/dist/cjs/plugins/funnel/index.js +18 -0
- package/dist/cjs/plugins/funnel/prepare.js +17 -12
- package/dist/cjs/plugins/heatmap/index.js +23 -0
- package/dist/cjs/plugins/line/index.js +28 -0
- package/dist/cjs/plugins/pie/index.js +18 -0
- package/dist/cjs/plugins/radar/index.js +18 -0
- package/dist/cjs/plugins/sankey/index.js +18 -0
- package/dist/cjs/plugins/scatter/index.js +26 -0
- package/dist/cjs/plugins/treemap/index.js +18 -0
- package/dist/cjs/plugins/waterfall/index.js +39 -0
- package/dist/cjs/plugins/x-range/index.js +25 -0
- package/dist/cjs/setup-jsdom.d.ts +0 -1
- package/dist/cjs/setup-jsdom.js +1 -1
- package/dist/esm/components/ChartInner/useChartInnerHandlers.d.ts +3 -2
- package/dist/esm/components/ChartInner/useChartInnerHandlers.js +1 -3
- package/dist/esm/components/ChartInner/useChartInnerProps.d.ts +3 -2
- package/dist/esm/components/ChartInner/useDefaultState.d.ts +3 -2
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/core/series/plugin.d.ts +47 -2
- package/dist/esm/core/series/types.d.ts +4 -0
- package/dist/esm/core/shapes/area/prepare-data.js +29 -19
- package/dist/esm/core/shapes/area/renderer.d.ts +0 -5
- package/dist/esm/core/shapes/area/renderer.js +0 -75
- package/dist/esm/core/shapes/area/types.d.ts +2 -8
- package/dist/esm/core/shapes/bar-x/prepare-data.js +18 -7
- package/dist/esm/core/shapes/bar-x/renderer.d.ts +0 -1
- package/dist/esm/core/shapes/bar-x/renderer.js +0 -18
- package/dist/esm/core/shapes/bar-x/types.d.ts +2 -1
- package/dist/esm/core/shapes/bar-y/get-tooltip-data.js +4 -2
- package/dist/esm/core/shapes/bar-y/prepare-data.js +8 -2
- package/dist/esm/core/shapes/funnel/prepare-data.js +121 -68
- package/dist/esm/core/shapes/heatmap/prepare-data.js +11 -2
- package/dist/esm/core/shapes/line/prepare-data.js +27 -17
- package/dist/esm/core/shapes/line/renderer.d.ts +0 -5
- package/dist/esm/core/shapes/line/renderer.js +0 -75
- package/dist/esm/core/shapes/line/types.d.ts +2 -8
- package/dist/esm/core/shapes/marker.d.ts +30 -0
- package/dist/esm/core/shapes/marker.js +68 -0
- package/dist/esm/core/shapes/pie/prepare-data.js +24 -9
- package/dist/esm/core/shapes/radar/prepare-data.js +3 -0
- package/dist/esm/core/shapes/sankey/prepare-data.js +10 -1
- package/dist/esm/core/shapes/scatter/prepare-data.js +8 -1
- package/dist/esm/core/shapes/scatter/renderer.js +3 -2
- package/dist/esm/core/shapes/scatter/types.d.ts +1 -1
- package/dist/esm/core/shapes/treemap/prepare-data.js +9 -1
- package/dist/esm/core/shapes/types.d.ts +35 -0
- package/dist/esm/core/shapes/waterfall/prepare-data.js +5 -2
- package/dist/esm/core/shapes/x-range/prepare-data.js +7 -2
- package/dist/esm/core/types/chart/base.d.ts +22 -2
- package/dist/esm/core/types/chart/funnel.d.ts +25 -1
- package/dist/esm/core/types/chart/tooltip.d.ts +6 -1
- package/dist/esm/core/utils/data-labels.d.ts +34 -0
- package/dist/esm/core/utils/data-labels.js +26 -0
- package/dist/esm/core/utils/get-closest-data.d.ts +2 -2
- package/dist/esm/core/utils/get-closest-data.js +14 -34
- package/dist/esm/core/utils/tooltip-helpers.d.ts +16 -0
- package/dist/esm/core/utils/tooltip-helpers.js +12 -0
- package/dist/esm/hooks/useShapes/AnnotationLayer.d.ts +9 -0
- package/dist/esm/hooks/useShapes/AnnotationLayer.js +17 -0
- package/dist/esm/hooks/useShapes/HoverMarkerLayer.d.ts +10 -0
- package/dist/esm/hooks/useShapes/HoverMarkerLayer.js +22 -0
- package/dist/esm/hooks/useShapes/MarkerLayer.d.ts +7 -0
- package/dist/esm/hooks/useShapes/MarkerLayer.js +12 -0
- package/dist/esm/hooks/useShapes/SeriesShapes.d.ts +18 -0
- package/dist/esm/hooks/useShapes/SeriesShapes.js +32 -0
- package/dist/esm/hooks/useShapes/index.d.ts +5 -18
- package/dist/esm/hooks/useShapes/index.js +39 -229
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/plugins/area/index.js +42 -0
- package/dist/esm/plugins/bar-x/index.js +42 -0
- package/dist/esm/plugins/bar-y/index.js +26 -0
- package/dist/esm/plugins/funnel/index.js +18 -0
- package/dist/esm/plugins/funnel/prepare.js +17 -12
- package/dist/esm/plugins/heatmap/index.js +23 -0
- package/dist/esm/plugins/line/index.js +28 -0
- package/dist/esm/plugins/pie/index.js +18 -0
- package/dist/esm/plugins/radar/index.js +18 -0
- package/dist/esm/plugins/sankey/index.js +18 -0
- package/dist/esm/plugins/scatter/index.js +26 -0
- package/dist/esm/plugins/treemap/index.js +18 -0
- package/dist/esm/plugins/waterfall/index.js +39 -0
- package/dist/esm/plugins/x-range/index.js +25 -0
- package/dist/esm/setup-jsdom.d.ts +0 -1
- package/dist/esm/setup-jsdom.js +1 -1
- package/package.json +2 -3
- package/dist/cjs/hooks/useShapes/area/index.d.ts +0 -15
- package/dist/cjs/hooks/useShapes/area/index.js +0 -52
- package/dist/cjs/hooks/useShapes/bar-x/index.d.ts +0 -16
- package/dist/cjs/hooks/useShapes/bar-x/index.js +0 -45
- package/dist/cjs/hooks/useShapes/bar-y/index.d.ts +0 -13
- package/dist/cjs/hooks/useShapes/bar-y/index.js +0 -19
- package/dist/cjs/hooks/useShapes/funnel/index.d.ts +0 -13
- package/dist/cjs/hooks/useShapes/funnel/index.js +0 -21
- package/dist/cjs/hooks/useShapes/heatmap/index.d.ts +0 -13
- package/dist/cjs/hooks/useShapes/heatmap/index.js +0 -20
- package/dist/cjs/hooks/useShapes/line/index.d.ts +0 -15
- package/dist/cjs/hooks/useShapes/line/index.js +0 -38
- package/dist/cjs/hooks/useShapes/pie/index.d.ts +0 -12
- package/dist/cjs/hooks/useShapes/pie/index.js +0 -20
- package/dist/cjs/hooks/useShapes/radar/index.d.ts +0 -12
- package/dist/cjs/hooks/useShapes/radar/index.js +0 -19
- package/dist/cjs/hooks/useShapes/sankey/index.d.ts +0 -12
- package/dist/cjs/hooks/useShapes/sankey/index.js +0 -18
- package/dist/cjs/hooks/useShapes/scatter/index.d.ts +0 -13
- package/dist/cjs/hooks/useShapes/scatter/index.js +0 -22
- package/dist/cjs/hooks/useShapes/treemap/index.d.ts +0 -12
- package/dist/cjs/hooks/useShapes/treemap/index.js +0 -18
- package/dist/cjs/hooks/useShapes/waterfall/index.d.ts +0 -14
- package/dist/cjs/hooks/useShapes/waterfall/index.js +0 -31
- package/dist/cjs/hooks/useShapes/x-range/index.d.ts +0 -14
- package/dist/cjs/hooks/useShapes/x-range/index.js +0 -20
- package/dist/esm/hooks/useShapes/area/index.d.ts +0 -15
- package/dist/esm/hooks/useShapes/area/index.js +0 -52
- package/dist/esm/hooks/useShapes/bar-x/index.d.ts +0 -16
- package/dist/esm/hooks/useShapes/bar-x/index.js +0 -45
- package/dist/esm/hooks/useShapes/bar-y/index.d.ts +0 -13
- package/dist/esm/hooks/useShapes/bar-y/index.js +0 -19
- package/dist/esm/hooks/useShapes/funnel/index.d.ts +0 -13
- package/dist/esm/hooks/useShapes/funnel/index.js +0 -21
- package/dist/esm/hooks/useShapes/heatmap/index.d.ts +0 -13
- package/dist/esm/hooks/useShapes/heatmap/index.js +0 -20
- package/dist/esm/hooks/useShapes/line/index.d.ts +0 -15
- package/dist/esm/hooks/useShapes/line/index.js +0 -38
- package/dist/esm/hooks/useShapes/pie/index.d.ts +0 -12
- package/dist/esm/hooks/useShapes/pie/index.js +0 -20
- package/dist/esm/hooks/useShapes/radar/index.d.ts +0 -12
- package/dist/esm/hooks/useShapes/radar/index.js +0 -19
- package/dist/esm/hooks/useShapes/sankey/index.d.ts +0 -12
- package/dist/esm/hooks/useShapes/sankey/index.js +0 -18
- package/dist/esm/hooks/useShapes/scatter/index.d.ts +0 -13
- package/dist/esm/hooks/useShapes/scatter/index.js +0 -22
- package/dist/esm/hooks/useShapes/treemap/index.d.ts +0 -12
- package/dist/esm/hooks/useShapes/treemap/index.js +0 -18
- package/dist/esm/hooks/useShapes/waterfall/index.d.ts +0 -14
- package/dist/esm/hooks/useShapes/waterfall/index.js +0 -31
- package/dist/esm/hooks/useShapes/x-range/index.d.ts +0 -14
- package/dist/esm/hooks/useShapes/x-range/index.js +0 -20
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderTreemap } from '../../../core/shapes/treemap/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
const b = block('treemap');
|
|
6
|
-
export const TreemapSeriesShape = (props) => {
|
|
7
|
-
const { dispatcher, preparedData, seriesOptions, htmlLayout } = props;
|
|
8
|
-
const ref = React.useRef(null);
|
|
9
|
-
React.useEffect(() => {
|
|
10
|
-
if (!ref.current) {
|
|
11
|
-
return () => { };
|
|
12
|
-
}
|
|
13
|
-
return renderTreemap({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
14
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
15
|
-
return (React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement("g", { ref: ref, className: b() }),
|
|
17
|
-
React.createElement(HtmlLayer, { preparedData: { htmlElements: preparedData.htmlLabels }, htmlLayout: htmlLayout })));
|
|
18
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedWaterfallData } from '../../../core/shapes/waterfall/types';
|
|
5
|
-
export { prepareWaterfallData } from '../../../core/shapes/waterfall/prepare-data';
|
|
6
|
-
export * from '../../../core/shapes/waterfall/types';
|
|
7
|
-
type Args = {
|
|
8
|
-
clipPathId: string;
|
|
9
|
-
htmlLayout: HTMLElement | null;
|
|
10
|
-
preparedData: PreparedWaterfallData[];
|
|
11
|
-
seriesOptions: PreparedSeriesOptions;
|
|
12
|
-
dispatcher?: Dispatch<object>;
|
|
13
|
-
};
|
|
14
|
-
export declare const WaterfallSeriesShapes: (args: Args) => React.JSX.Element;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderWaterfall } from '../../../core/shapes/waterfall/renderer';
|
|
3
|
-
import { filterOverlappingLabels } from '../../../core/utils';
|
|
4
|
-
import { block } from '../../../utils';
|
|
5
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
6
|
-
export { prepareWaterfallData } from '../../../core/shapes/waterfall/prepare-data';
|
|
7
|
-
export * from '../../../core/shapes/waterfall/types';
|
|
8
|
-
const b = block('waterfall');
|
|
9
|
-
export const WaterfallSeriesShapes = (args) => {
|
|
10
|
-
const { dispatcher, preparedData, seriesOptions, htmlLayout, clipPathId } = args;
|
|
11
|
-
const ref = React.useRef(null);
|
|
12
|
-
const allowOverlapDataLabels = React.useMemo(() => {
|
|
13
|
-
return preparedData.some((d) => d === null || d === void 0 ? void 0 : d.series.dataLabels.allowOverlap);
|
|
14
|
-
}, [preparedData]);
|
|
15
|
-
React.useEffect(() => {
|
|
16
|
-
if (!ref.current) {
|
|
17
|
-
return () => { };
|
|
18
|
-
}
|
|
19
|
-
return renderWaterfall({ plot: ref.current }, preparedData, seriesOptions, allowOverlapDataLabels, dispatcher);
|
|
20
|
-
}, [allowOverlapDataLabels, dispatcher, preparedData, seriesOptions]);
|
|
21
|
-
const htmlLayerData = React.useMemo(() => {
|
|
22
|
-
const items = preparedData.map((d) => d === null || d === void 0 ? void 0 : d.htmlLabels).flat();
|
|
23
|
-
if (allowOverlapDataLabels) {
|
|
24
|
-
return { htmlElements: items };
|
|
25
|
-
}
|
|
26
|
-
return { htmlElements: filterOverlappingLabels(items) };
|
|
27
|
-
}, [allowOverlapDataLabels, preparedData]);
|
|
28
|
-
return (React.createElement(React.Fragment, null,
|
|
29
|
-
React.createElement("g", { ref: ref, className: b(), clipPath: `url(#${clipPathId})` }),
|
|
30
|
-
React.createElement(HtmlLayer, { preparedData: htmlLayerData, htmlLayout: htmlLayout })));
|
|
31
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedXRangeData } from '../../../core/shapes/x-range/types';
|
|
5
|
-
export { prepareXRangeData } from '../../../core/shapes/x-range/prepare-data';
|
|
6
|
-
export type { PreparedXRangeData } from '../../../core/shapes/x-range/types';
|
|
7
|
-
type Args = {
|
|
8
|
-
clipPathId: string;
|
|
9
|
-
htmlLayout: HTMLElement | null;
|
|
10
|
-
preparedData: PreparedXRangeData[];
|
|
11
|
-
seriesOptions: PreparedSeriesOptions;
|
|
12
|
-
dispatcher?: Dispatch<object>;
|
|
13
|
-
};
|
|
14
|
-
export declare function XRangeSeriesShapes(args: Args): React.JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderXRange } from '../../../core/shapes/x-range/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
export { prepareXRangeData } from '../../../core/shapes/x-range/prepare-data';
|
|
6
|
-
const b = block('x-range');
|
|
7
|
-
export function XRangeSeriesShapes(args) {
|
|
8
|
-
const { dispatcher, preparedData, seriesOptions, htmlLayout, clipPathId } = args;
|
|
9
|
-
const ref = React.useRef(null);
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
if (!ref.current) {
|
|
12
|
-
return () => { };
|
|
13
|
-
}
|
|
14
|
-
return renderXRange({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
15
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
16
|
-
const htmlLayerData = React.useMemo(() => ({ htmlElements: preparedData.flatMap((d) => d.htmlLabels) }), [preparedData]);
|
|
17
|
-
return (React.createElement(React.Fragment, null,
|
|
18
|
-
React.createElement("g", { ref: ref, className: b(), clipPath: `url(#${clipPathId})` }),
|
|
19
|
-
React.createElement(HtmlLayer, { preparedData: htmlLayerData, htmlLayout: htmlLayout })));
|
|
20
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedAreaData } from '../../../core/shapes/area/types';
|
|
5
|
-
type Args = {
|
|
6
|
-
boundsHeight: number;
|
|
7
|
-
boundsWidth: number;
|
|
8
|
-
clipPathId: string;
|
|
9
|
-
htmlLayout: HTMLElement | null;
|
|
10
|
-
preparedData: PreparedAreaData[];
|
|
11
|
-
seriesOptions: PreparedSeriesOptions;
|
|
12
|
-
dispatcher?: Dispatch<object>;
|
|
13
|
-
};
|
|
14
|
-
export declare const AreaSeriesShapes: (args: Args) => React.JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderArea } from '../../../core/shapes/area/renderer';
|
|
3
|
-
import { filterOverlappingLabels } from '../../../core/utils';
|
|
4
|
-
import { block } from '../../../utils';
|
|
5
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
6
|
-
const b = block('area');
|
|
7
|
-
export const AreaSeriesShapes = (args) => {
|
|
8
|
-
const { boundsHeight, boundsWidth, dispatcher, preparedData, seriesOptions, htmlLayout, clipPathId, } = args;
|
|
9
|
-
const plotRef = React.useRef(null);
|
|
10
|
-
const markersRef = React.useRef(null);
|
|
11
|
-
const hoverMarkersRef = React.useRef(null);
|
|
12
|
-
const annotationsRef = React.useRef(null);
|
|
13
|
-
const allowOverlapDataLabels = React.useMemo(() => {
|
|
14
|
-
return preparedData.some((d) => d === null || d === void 0 ? void 0 : d.series.dataLabels.allowOverlap);
|
|
15
|
-
}, [preparedData]);
|
|
16
|
-
React.useEffect(() => {
|
|
17
|
-
if (!plotRef.current ||
|
|
18
|
-
!markersRef.current ||
|
|
19
|
-
!hoverMarkersRef.current ||
|
|
20
|
-
!annotationsRef.current) {
|
|
21
|
-
return () => { };
|
|
22
|
-
}
|
|
23
|
-
return renderArea({
|
|
24
|
-
plot: plotRef.current,
|
|
25
|
-
markers: markersRef.current,
|
|
26
|
-
hoverMarkers: hoverMarkersRef.current,
|
|
27
|
-
annotations: annotationsRef.current,
|
|
28
|
-
boundsWidth,
|
|
29
|
-
boundsHeight,
|
|
30
|
-
}, preparedData, seriesOptions, allowOverlapDataLabels, dispatcher);
|
|
31
|
-
}, [
|
|
32
|
-
allowOverlapDataLabels,
|
|
33
|
-
boundsHeight,
|
|
34
|
-
boundsWidth,
|
|
35
|
-
dispatcher,
|
|
36
|
-
preparedData,
|
|
37
|
-
seriesOptions,
|
|
38
|
-
]);
|
|
39
|
-
const htmlLayerData = React.useMemo(() => {
|
|
40
|
-
const items = preparedData.map((d) => d === null || d === void 0 ? void 0 : d.htmlLabels).flat();
|
|
41
|
-
if (allowOverlapDataLabels) {
|
|
42
|
-
return { htmlElements: items };
|
|
43
|
-
}
|
|
44
|
-
return { htmlElements: filterOverlappingLabels(items) };
|
|
45
|
-
}, [allowOverlapDataLabels, preparedData]);
|
|
46
|
-
return (React.createElement(React.Fragment, null,
|
|
47
|
-
React.createElement("g", { ref: plotRef, className: b(), clipPath: `url(#${clipPathId})` }),
|
|
48
|
-
React.createElement("g", { ref: markersRef }),
|
|
49
|
-
React.createElement("g", { ref: hoverMarkersRef }),
|
|
50
|
-
React.createElement("g", { ref: annotationsRef }),
|
|
51
|
-
React.createElement(HtmlLayer, { preparedData: htmlLayerData, htmlLayout: htmlLayout })));
|
|
52
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedBarXData } from '../../../core/shapes/bar-x/types';
|
|
5
|
-
export { prepareBarXData } from '../../../core/shapes/bar-x/prepare-data';
|
|
6
|
-
export * from '../../../core/shapes/bar-x/types';
|
|
7
|
-
type Args = {
|
|
8
|
-
boundsHeight: number;
|
|
9
|
-
boundsWidth: number;
|
|
10
|
-
clipPathId: string;
|
|
11
|
-
htmlLayout: HTMLElement | null;
|
|
12
|
-
preparedData: PreparedBarXData[];
|
|
13
|
-
seriesOptions: PreparedSeriesOptions;
|
|
14
|
-
dispatcher?: Dispatch<object>;
|
|
15
|
-
};
|
|
16
|
-
export declare const BarXSeriesShapes: (args: Args) => React.JSX.Element;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderBarX } from '../../../core/shapes/bar-x/renderer';
|
|
3
|
-
import { filterOverlappingLabels } from '../../../core/utils';
|
|
4
|
-
import { block } from '../../../utils';
|
|
5
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
6
|
-
export { prepareBarXData } from '../../../core/shapes/bar-x/prepare-data';
|
|
7
|
-
export * from '../../../core/shapes/bar-x/types';
|
|
8
|
-
const b = block('bar-x');
|
|
9
|
-
export const BarXSeriesShapes = (args) => {
|
|
10
|
-
const { boundsHeight, boundsWidth, dispatcher, preparedData, seriesOptions, htmlLayout, clipPathId, } = args;
|
|
11
|
-
const ref = React.useRef(null);
|
|
12
|
-
const annotationsRef = React.useRef(null);
|
|
13
|
-
const allowOverlapDataLabels = React.useMemo(() => {
|
|
14
|
-
return preparedData.some((d) => d === null || d === void 0 ? void 0 : d.series.dataLabels.allowOverlap);
|
|
15
|
-
}, [preparedData]);
|
|
16
|
-
React.useEffect(() => {
|
|
17
|
-
if (!ref.current || !annotationsRef.current) {
|
|
18
|
-
return () => { };
|
|
19
|
-
}
|
|
20
|
-
return renderBarX({
|
|
21
|
-
plot: ref.current,
|
|
22
|
-
annotations: annotationsRef.current,
|
|
23
|
-
boundsWidth,
|
|
24
|
-
boundsHeight,
|
|
25
|
-
}, preparedData, seriesOptions, allowOverlapDataLabels, dispatcher);
|
|
26
|
-
}, [
|
|
27
|
-
allowOverlapDataLabels,
|
|
28
|
-
boundsHeight,
|
|
29
|
-
boundsWidth,
|
|
30
|
-
dispatcher,
|
|
31
|
-
preparedData,
|
|
32
|
-
seriesOptions,
|
|
33
|
-
]);
|
|
34
|
-
const htmlLayerData = React.useMemo(() => {
|
|
35
|
-
const items = preparedData.map((d) => d === null || d === void 0 ? void 0 : d.htmlLabels).flat();
|
|
36
|
-
if (allowOverlapDataLabels) {
|
|
37
|
-
return { htmlElements: items };
|
|
38
|
-
}
|
|
39
|
-
return { htmlElements: filterOverlappingLabels(items) };
|
|
40
|
-
}, [allowOverlapDataLabels, preparedData]);
|
|
41
|
-
return (React.createElement(React.Fragment, null,
|
|
42
|
-
React.createElement("g", { ref: ref, className: b(), clipPath: `url(#${clipPathId})` }),
|
|
43
|
-
React.createElement("g", { ref: annotationsRef }),
|
|
44
|
-
React.createElement(HtmlLayer, { preparedData: htmlLayerData, htmlLayout: htmlLayout })));
|
|
45
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { BarYShapesArgs } from '../../../core/shapes/bar-y/types';
|
|
5
|
-
export { prepareBarYData } from '../../../core/shapes/bar-y/prepare-data';
|
|
6
|
-
type Args = {
|
|
7
|
-
clipPathId: string;
|
|
8
|
-
htmlLayout: HTMLElement | null;
|
|
9
|
-
preparedData: BarYShapesArgs;
|
|
10
|
-
seriesOptions: PreparedSeriesOptions;
|
|
11
|
-
dispatcher?: Dispatch<object>;
|
|
12
|
-
};
|
|
13
|
-
export declare function BarYSeriesShapes(args: Args): React.JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderBarY } from '../../../core/shapes/bar-y/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
export { prepareBarYData } from '../../../core/shapes/bar-y/prepare-data';
|
|
6
|
-
const b = block('bar-y');
|
|
7
|
-
export function BarYSeriesShapes(args) {
|
|
8
|
-
const { dispatcher, preparedData: { htmlLabels: htmlElements }, seriesOptions, htmlLayout, clipPathId, } = args;
|
|
9
|
-
const ref = React.useRef(null);
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
if (!ref.current) {
|
|
12
|
-
return () => { };
|
|
13
|
-
}
|
|
14
|
-
return renderBarY({ plot: ref.current }, args.preparedData, seriesOptions, dispatcher);
|
|
15
|
-
}, [args.preparedData, dispatcher, seriesOptions]);
|
|
16
|
-
return (React.createElement(React.Fragment, null,
|
|
17
|
-
React.createElement("g", { ref: ref, className: b(), clipPath: `url(#${clipPathId})` }),
|
|
18
|
-
React.createElement(HtmlLayer, { preparedData: { htmlElements }, htmlLayout: htmlLayout })));
|
|
19
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedFunnelData } from '../../../core/shapes/funnel/types';
|
|
5
|
-
export { prepareFunnelData } from '../../../core/shapes/funnel/prepare-data';
|
|
6
|
-
export * from '../../../core/shapes/funnel/types';
|
|
7
|
-
type Args = {
|
|
8
|
-
dispatcher?: Dispatch<object>;
|
|
9
|
-
preparedData: PreparedFunnelData;
|
|
10
|
-
seriesOptions: PreparedSeriesOptions;
|
|
11
|
-
htmlLayout: HTMLElement | null;
|
|
12
|
-
};
|
|
13
|
-
export declare const FunnelSeriesShapes: (args: Args) => React.JSX.Element;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderFunnel } from '../../../core/shapes/funnel/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
export { prepareFunnelData } from '../../../core/shapes/funnel/prepare-data';
|
|
6
|
-
export * from '../../../core/shapes/funnel/types';
|
|
7
|
-
const b = block('funnel');
|
|
8
|
-
export const FunnelSeriesShapes = (args) => {
|
|
9
|
-
const { dispatcher, htmlLayout, preparedData, seriesOptions } = args;
|
|
10
|
-
const ref = React.useRef(null);
|
|
11
|
-
React.useEffect(() => {
|
|
12
|
-
if (!ref.current) {
|
|
13
|
-
return () => { };
|
|
14
|
-
}
|
|
15
|
-
return renderFunnel({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
16
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
17
|
-
const htmlLayerData = React.useMemo(() => ({ htmlElements: preparedData.htmlLabels }), [preparedData.htmlLabels]);
|
|
18
|
-
return (React.createElement(React.Fragment, null,
|
|
19
|
-
React.createElement("g", { ref: ref, className: b() }),
|
|
20
|
-
React.createElement(HtmlLayer, { preparedData: htmlLayerData, htmlLayout: htmlLayout })));
|
|
21
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedHeatmapData } from '../../../core/shapes/heatmap/types';
|
|
5
|
-
export { prepareHeatmapData } from '../../../core/shapes/heatmap/prepare-data';
|
|
6
|
-
export * from '../../../core/shapes/heatmap/types';
|
|
7
|
-
type Args = {
|
|
8
|
-
htmlLayout: HTMLElement | null;
|
|
9
|
-
preparedData: PreparedHeatmapData;
|
|
10
|
-
seriesOptions: PreparedSeriesOptions;
|
|
11
|
-
dispatcher?: Dispatch<object>;
|
|
12
|
-
};
|
|
13
|
-
export declare const HeatmapSeriesShapes: (args: Args) => React.JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderHeatmap } from '../../../core/shapes/heatmap/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
export { prepareHeatmapData } from '../../../core/shapes/heatmap/prepare-data';
|
|
6
|
-
export * from '../../../core/shapes/heatmap/types';
|
|
7
|
-
const b = block('heatmap');
|
|
8
|
-
export const HeatmapSeriesShapes = (args) => {
|
|
9
|
-
const { dispatcher, preparedData, seriesOptions, htmlLayout } = args;
|
|
10
|
-
const ref = React.useRef(null);
|
|
11
|
-
React.useEffect(() => {
|
|
12
|
-
if (!ref.current) {
|
|
13
|
-
return () => { };
|
|
14
|
-
}
|
|
15
|
-
return renderHeatmap({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
16
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
17
|
-
return (React.createElement(React.Fragment, null,
|
|
18
|
-
React.createElement("g", { ref: ref, className: b() }),
|
|
19
|
-
React.createElement(HtmlLayer, { preparedData: { htmlElements: preparedData.htmlLabels }, htmlLayout: htmlLayout })));
|
|
20
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedLineData } from '../../../core/shapes/line/types';
|
|
5
|
-
type Args = {
|
|
6
|
-
boundsHeight: number;
|
|
7
|
-
boundsWidth: number;
|
|
8
|
-
clipPathId: string;
|
|
9
|
-
htmlLayout: HTMLElement | null;
|
|
10
|
-
preparedData: PreparedLineData[];
|
|
11
|
-
seriesOptions: PreparedSeriesOptions;
|
|
12
|
-
dispatcher?: Dispatch<object>;
|
|
13
|
-
};
|
|
14
|
-
export declare const LineSeriesShapes: (args: Args) => React.JSX.Element;
|
|
15
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderLine } from '../../../core/shapes/line/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
const b = block('line');
|
|
6
|
-
export const LineSeriesShapes = (args) => {
|
|
7
|
-
const { boundsHeight, boundsWidth, dispatcher, preparedData, seriesOptions, htmlLayout, clipPathId, } = args;
|
|
8
|
-
const plotRef = React.useRef(null);
|
|
9
|
-
const markersRef = React.useRef(null);
|
|
10
|
-
const hoverMarkersRef = React.useRef(null);
|
|
11
|
-
const annotationsRef = React.useRef(null);
|
|
12
|
-
React.useEffect(() => {
|
|
13
|
-
if (!plotRef.current ||
|
|
14
|
-
!markersRef.current ||
|
|
15
|
-
!hoverMarkersRef.current ||
|
|
16
|
-
!annotationsRef.current) {
|
|
17
|
-
return () => { };
|
|
18
|
-
}
|
|
19
|
-
return renderLine({
|
|
20
|
-
plot: plotRef.current,
|
|
21
|
-
markers: markersRef.current,
|
|
22
|
-
hoverMarkers: hoverMarkersRef.current,
|
|
23
|
-
annotations: annotationsRef.current,
|
|
24
|
-
boundsWidth,
|
|
25
|
-
boundsHeight,
|
|
26
|
-
}, preparedData, seriesOptions, dispatcher);
|
|
27
|
-
}, [boundsHeight, boundsWidth, dispatcher, preparedData, seriesOptions]);
|
|
28
|
-
const htmlLayerData = React.useMemo(() => {
|
|
29
|
-
const items = preparedData.flatMap((d) => d.htmlLabels);
|
|
30
|
-
return { htmlElements: items };
|
|
31
|
-
}, [preparedData]);
|
|
32
|
-
return (React.createElement(React.Fragment, null,
|
|
33
|
-
React.createElement("g", { ref: plotRef, className: b(), clipPath: `url(#${clipPathId})` }),
|
|
34
|
-
React.createElement("g", { ref: markersRef }),
|
|
35
|
-
React.createElement("g", { ref: hoverMarkersRef }),
|
|
36
|
-
React.createElement("g", { ref: annotationsRef }),
|
|
37
|
-
React.createElement(HtmlLayer, { preparedData: htmlLayerData, htmlLayout: htmlLayout })));
|
|
38
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedPieData } from '../../../core/shapes/pie/types';
|
|
5
|
-
export { getHaloVisibility } from '../../../core/shapes/pie/renderer';
|
|
6
|
-
type PreparePieSeriesArgs = {
|
|
7
|
-
htmlLayout: HTMLElement | null;
|
|
8
|
-
preparedData: PreparedPieData[];
|
|
9
|
-
seriesOptions: PreparedSeriesOptions;
|
|
10
|
-
dispatcher?: Dispatch<object>;
|
|
11
|
-
};
|
|
12
|
-
export declare function PieSeriesShapes(args: PreparePieSeriesArgs): React.JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderPie } from '../../../core/shapes/pie/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
export { getHaloVisibility } from '../../../core/shapes/pie/renderer';
|
|
6
|
-
const b = block('pie');
|
|
7
|
-
export function PieSeriesShapes(args) {
|
|
8
|
-
const { dispatcher, preparedData, seriesOptions, htmlLayout } = args;
|
|
9
|
-
const ref = React.useRef(null);
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
if (!ref.current) {
|
|
12
|
-
return () => { };
|
|
13
|
-
}
|
|
14
|
-
return renderPie({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
15
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
16
|
-
const htmlElements = preparedData.map((d) => d.htmlLabels).flat();
|
|
17
|
-
return (React.createElement(React.Fragment, null,
|
|
18
|
-
React.createElement("g", { ref: ref, className: b(), style: { zIndex: 9 } }),
|
|
19
|
-
React.createElement(HtmlLayer, { preparedData: { htmlElements }, htmlLayout: htmlLayout })));
|
|
20
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedRadarData } from '../../../core/shapes/radar/types';
|
|
5
|
-
type PrepareRadarSeriesArgs = {
|
|
6
|
-
htmlLayout: HTMLElement | null;
|
|
7
|
-
series: PreparedRadarData[];
|
|
8
|
-
seriesOptions: PreparedSeriesOptions;
|
|
9
|
-
dispatcher?: Dispatch<object>;
|
|
10
|
-
};
|
|
11
|
-
export declare function RadarSeriesShapes(args: PrepareRadarSeriesArgs): React.JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderRadar } from '../../../core/shapes/radar/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
const b = block('radar');
|
|
6
|
-
export function RadarSeriesShapes(args) {
|
|
7
|
-
const { dispatcher, series: preparedData, seriesOptions, htmlLayout } = args;
|
|
8
|
-
const ref = React.useRef(null);
|
|
9
|
-
React.useEffect(() => {
|
|
10
|
-
if (!ref.current) {
|
|
11
|
-
return () => { };
|
|
12
|
-
}
|
|
13
|
-
return renderRadar({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
14
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
15
|
-
const htmlElements = preparedData.map((d) => d.htmlLabels).flat();
|
|
16
|
-
return (React.createElement(React.Fragment, null,
|
|
17
|
-
React.createElement("g", { ref: ref, className: b() }),
|
|
18
|
-
React.createElement(HtmlLayer, { preparedData: { htmlElements }, htmlLayout: htmlLayout })));
|
|
19
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedSankeyData } from '../../../core/shapes/sankey/types';
|
|
5
|
-
type ShapeProps = {
|
|
6
|
-
htmlLayout: HTMLElement | null;
|
|
7
|
-
preparedData: PreparedSankeyData;
|
|
8
|
-
seriesOptions: PreparedSeriesOptions;
|
|
9
|
-
dispatcher?: Dispatch<object>;
|
|
10
|
-
};
|
|
11
|
-
export declare const SankeySeriesShape: (props: ShapeProps) => React.JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderSankey } from '../../../core/shapes/sankey/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
const b = block('sankey');
|
|
6
|
-
export const SankeySeriesShape = (props) => {
|
|
7
|
-
const { dispatcher, preparedData, seriesOptions, htmlLayout } = props;
|
|
8
|
-
const ref = React.useRef(null);
|
|
9
|
-
React.useEffect(() => {
|
|
10
|
-
if (!ref.current) {
|
|
11
|
-
return () => { };
|
|
12
|
-
}
|
|
13
|
-
return renderSankey({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
14
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
15
|
-
return (React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement("g", { ref: ref, className: b() }),
|
|
17
|
-
React.createElement(HtmlLayer, { preparedData: { htmlElements: preparedData.htmlLabels }, htmlLayout: htmlLayout })));
|
|
18
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedScatterShapeData } from '../../../core/shapes/scatter/types';
|
|
5
|
-
export { prepareScatterData } from '../../../core/shapes/scatter/prepare-data';
|
|
6
|
-
type ScatterSeriesShapeProps = {
|
|
7
|
-
htmlLayout: HTMLElement | null;
|
|
8
|
-
preparedData: PreparedScatterShapeData;
|
|
9
|
-
seriesOptions: PreparedSeriesOptions;
|
|
10
|
-
clipPathId?: string;
|
|
11
|
-
dispatcher?: Dispatch<object>;
|
|
12
|
-
};
|
|
13
|
-
export declare function ScatterSeriesShape(props: ScatterSeriesShapeProps): React.JSX.Element;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderScatter } from '../../../core/shapes/scatter/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
export { prepareScatterData } from '../../../core/shapes/scatter/prepare-data';
|
|
6
|
-
const b = block('scatter');
|
|
7
|
-
export function ScatterSeriesShape(props) {
|
|
8
|
-
const { clipPathId, dispatcher, preparedData, seriesOptions, htmlLayout } = props;
|
|
9
|
-
const ref = React.useRef(null);
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
if (!ref.current) {
|
|
12
|
-
return () => { };
|
|
13
|
-
}
|
|
14
|
-
return renderScatter({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
15
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
16
|
-
const htmlLayerData = React.useMemo(() => {
|
|
17
|
-
return { htmlElements: preparedData.htmlLabels };
|
|
18
|
-
}, [preparedData]);
|
|
19
|
-
return (React.createElement(React.Fragment, null,
|
|
20
|
-
React.createElement("g", { ref: ref, className: b(), clipPath: clipPathId ? `url(#${clipPathId})` : undefined }),
|
|
21
|
-
React.createElement(HtmlLayer, { preparedData: htmlLayerData, htmlLayout: htmlLayout })));
|
|
22
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedTreemapData } from '../../../core/shapes/treemap/types';
|
|
5
|
-
type ShapeProps = {
|
|
6
|
-
htmlLayout: HTMLElement | null;
|
|
7
|
-
preparedData: PreparedTreemapData;
|
|
8
|
-
seriesOptions: PreparedSeriesOptions;
|
|
9
|
-
dispatcher?: Dispatch<object>;
|
|
10
|
-
};
|
|
11
|
-
export declare const TreemapSeriesShape: (props: ShapeProps) => React.JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderTreemap } from '../../../core/shapes/treemap/renderer';
|
|
3
|
-
import { block } from '../../../utils';
|
|
4
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
5
|
-
const b = block('treemap');
|
|
6
|
-
export const TreemapSeriesShape = (props) => {
|
|
7
|
-
const { dispatcher, preparedData, seriesOptions, htmlLayout } = props;
|
|
8
|
-
const ref = React.useRef(null);
|
|
9
|
-
React.useEffect(() => {
|
|
10
|
-
if (!ref.current) {
|
|
11
|
-
return () => { };
|
|
12
|
-
}
|
|
13
|
-
return renderTreemap({ plot: ref.current }, preparedData, seriesOptions, dispatcher);
|
|
14
|
-
}, [dispatcher, preparedData, seriesOptions]);
|
|
15
|
-
return (React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement("g", { ref: ref, className: b() }),
|
|
17
|
-
React.createElement(HtmlLayer, { preparedData: { htmlElements: preparedData.htmlLabels }, htmlLayout: htmlLayout })));
|
|
18
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedWaterfallData } from '../../../core/shapes/waterfall/types';
|
|
5
|
-
export { prepareWaterfallData } from '../../../core/shapes/waterfall/prepare-data';
|
|
6
|
-
export * from '../../../core/shapes/waterfall/types';
|
|
7
|
-
type Args = {
|
|
8
|
-
clipPathId: string;
|
|
9
|
-
htmlLayout: HTMLElement | null;
|
|
10
|
-
preparedData: PreparedWaterfallData[];
|
|
11
|
-
seriesOptions: PreparedSeriesOptions;
|
|
12
|
-
dispatcher?: Dispatch<object>;
|
|
13
|
-
};
|
|
14
|
-
export declare const WaterfallSeriesShapes: (args: Args) => React.JSX.Element;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { renderWaterfall } from '../../../core/shapes/waterfall/renderer';
|
|
3
|
-
import { filterOverlappingLabels } from '../../../core/utils';
|
|
4
|
-
import { block } from '../../../utils';
|
|
5
|
-
import { HtmlLayer } from '../HtmlLayer';
|
|
6
|
-
export { prepareWaterfallData } from '../../../core/shapes/waterfall/prepare-data';
|
|
7
|
-
export * from '../../../core/shapes/waterfall/types';
|
|
8
|
-
const b = block('waterfall');
|
|
9
|
-
export const WaterfallSeriesShapes = (args) => {
|
|
10
|
-
const { dispatcher, preparedData, seriesOptions, htmlLayout, clipPathId } = args;
|
|
11
|
-
const ref = React.useRef(null);
|
|
12
|
-
const allowOverlapDataLabels = React.useMemo(() => {
|
|
13
|
-
return preparedData.some((d) => d === null || d === void 0 ? void 0 : d.series.dataLabels.allowOverlap);
|
|
14
|
-
}, [preparedData]);
|
|
15
|
-
React.useEffect(() => {
|
|
16
|
-
if (!ref.current) {
|
|
17
|
-
return () => { };
|
|
18
|
-
}
|
|
19
|
-
return renderWaterfall({ plot: ref.current }, preparedData, seriesOptions, allowOverlapDataLabels, dispatcher);
|
|
20
|
-
}, [allowOverlapDataLabels, dispatcher, preparedData, seriesOptions]);
|
|
21
|
-
const htmlLayerData = React.useMemo(() => {
|
|
22
|
-
const items = preparedData.map((d) => d === null || d === void 0 ? void 0 : d.htmlLabels).flat();
|
|
23
|
-
if (allowOverlapDataLabels) {
|
|
24
|
-
return { htmlElements: items };
|
|
25
|
-
}
|
|
26
|
-
return { htmlElements: filterOverlappingLabels(items) };
|
|
27
|
-
}, [allowOverlapDataLabels, preparedData]);
|
|
28
|
-
return (React.createElement(React.Fragment, null,
|
|
29
|
-
React.createElement("g", { ref: ref, className: b(), clipPath: `url(#${clipPathId})` }),
|
|
30
|
-
React.createElement(HtmlLayer, { preparedData: htmlLayerData, htmlLayout: htmlLayout })));
|
|
31
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Dispatch } from 'd3-dispatch';
|
|
3
|
-
import type { PreparedSeriesOptions } from '../../../core/series/types';
|
|
4
|
-
import type { PreparedXRangeData } from '../../../core/shapes/x-range/types';
|
|
5
|
-
export { prepareXRangeData } from '../../../core/shapes/x-range/prepare-data';
|
|
6
|
-
export type { PreparedXRangeData } from '../../../core/shapes/x-range/types';
|
|
7
|
-
type Args = {
|
|
8
|
-
clipPathId: string;
|
|
9
|
-
htmlLayout: HTMLElement | null;
|
|
10
|
-
preparedData: PreparedXRangeData[];
|
|
11
|
-
seriesOptions: PreparedSeriesOptions;
|
|
12
|
-
dispatcher?: Dispatch<object>;
|
|
13
|
-
};
|
|
14
|
-
export declare function XRangeSeriesShapes(args: Args): React.JSX.Element;
|