@neo4j-ndl/react-charts 1.1.1 → 1.1.3
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/lib/cjs/charts/Chart.js +56 -462
- package/lib/cjs/charts/Chart.js.map +1 -1
- package/lib/cjs/charts/ChartContainer.js +71 -0
- package/lib/cjs/charts/ChartContainer.js.map +1 -0
- package/lib/cjs/charts/ChartEmpty.js.map +1 -1
- package/lib/cjs/charts/ChartRender.js +97 -0
- package/lib/cjs/charts/ChartRender.js.map +1 -0
- package/lib/cjs/charts/ChartTooltip.js.map +1 -1
- package/lib/cjs/charts/Legend.js +32 -246
- package/lib/cjs/charts/Legend.js.map +1 -1
- package/lib/cjs/charts/LegendItem.js +68 -0
- package/lib/cjs/charts/LegendItem.js.map +1 -0
- package/lib/cjs/charts/LegendLayout.js +363 -0
- package/lib/cjs/charts/LegendLayout.js.map +1 -0
- package/lib/cjs/charts/hooks/use-chart-instance.js +133 -0
- package/lib/cjs/charts/hooks/use-chart-instance.js.map +1 -0
- package/lib/cjs/charts/hooks/use-chart-option.js +79 -0
- package/lib/cjs/charts/hooks/use-chart-option.js.map +1 -0
- package/lib/cjs/charts/hooks/use-chart-refs.js +52 -0
- package/lib/cjs/charts/hooks/use-chart-refs.js.map +1 -0
- package/lib/cjs/charts/hooks/use-chart-zoom.js +117 -0
- package/lib/cjs/charts/hooks/use-chart-zoom.js.map +1 -0
- package/lib/cjs/charts/hooks/use-legend-interactions.js +149 -0
- package/lib/cjs/charts/hooks/use-legend-interactions.js.map +1 -0
- package/lib/cjs/charts/hooks/use-legend-series.js +181 -0
- package/lib/cjs/charts/hooks/use-legend-series.js.map +1 -0
- package/lib/cjs/charts/hooks/use-legend-visibility.js +91 -0
- package/lib/cjs/charts/hooks/use-legend-visibility.js.map +1 -0
- package/lib/cjs/charts/index.js +1 -1
- package/lib/cjs/charts/index.js.map +1 -1
- package/lib/cjs/charts/tests/chart-test-utils.js +56 -9
- package/lib/cjs/charts/tests/chart-test-utils.js.map +1 -1
- package/lib/cjs/charts/themes/ndl-echarts-theme.js.map +1 -1
- package/lib/cjs/charts/{aria-description.js → utils/aria-description.js} +4 -45
- package/lib/cjs/charts/utils/aria-description.js.map +1 -0
- package/lib/cjs/charts/utils/build-chart-option.js +74 -0
- package/lib/cjs/charts/utils/build-chart-option.js.map +1 -0
- package/lib/cjs/charts/utils/chart-tooltip-formatter.js +86 -0
- package/lib/cjs/charts/utils/chart-tooltip-formatter.js.map +1 -0
- package/lib/cjs/charts/utils/chart-types.js.map +1 -0
- package/lib/cjs/charts/utils/defaults.js.map +1 -0
- package/lib/cjs/charts/{utils.js → utils/format-utils.js} +3 -19
- package/lib/cjs/charts/utils/format-utils.js.map +1 -0
- package/lib/cjs/charts/utils/legend-layout.js +65 -0
- package/lib/cjs/charts/utils/legend-layout.js.map +1 -0
- package/lib/cjs/charts/{legend-utils.js → utils/legend-utils.js} +1 -78
- package/lib/cjs/charts/utils/legend-utils.js.map +1 -0
- package/lib/cjs/charts/utils/threshold.js +114 -0
- package/lib/cjs/charts/utils/threshold.js.map +1 -0
- package/lib/cjs/charts/{user-option-utils.js → utils/user-option-utils.js} +7 -16
- package/lib/cjs/charts/utils/user-option-utils.js.map +1 -0
- package/lib/esm/charts/Chart.js +50 -457
- package/lib/esm/charts/Chart.js.map +1 -1
- package/lib/esm/charts/ChartContainer.js +67 -0
- package/lib/esm/charts/ChartContainer.js.map +1 -0
- package/lib/esm/charts/ChartEmpty.js.map +1 -1
- package/lib/esm/charts/ChartRender.js +93 -0
- package/lib/esm/charts/ChartRender.js.map +1 -0
- package/lib/esm/charts/ChartTooltip.js.map +1 -1
- package/lib/esm/charts/Legend.js +32 -243
- package/lib/esm/charts/Legend.js.map +1 -1
- package/lib/esm/charts/LegendItem.js +61 -0
- package/lib/esm/charts/LegendItem.js.map +1 -0
- package/lib/esm/charts/LegendLayout.js +323 -0
- package/lib/esm/charts/LegendLayout.js.map +1 -0
- package/lib/esm/charts/hooks/use-chart-instance.js +128 -0
- package/lib/esm/charts/hooks/use-chart-instance.js.map +1 -0
- package/lib/esm/charts/hooks/use-chart-option.js +76 -0
- package/lib/esm/charts/hooks/use-chart-option.js.map +1 -0
- package/lib/esm/charts/hooks/use-chart-refs.js +48 -0
- package/lib/esm/charts/hooks/use-chart-refs.js.map +1 -0
- package/lib/esm/charts/hooks/use-chart-zoom.js +114 -0
- package/lib/esm/charts/hooks/use-chart-zoom.js.map +1 -0
- package/lib/esm/charts/hooks/use-legend-interactions.js +145 -0
- package/lib/esm/charts/hooks/use-legend-interactions.js.map +1 -0
- package/lib/esm/charts/hooks/use-legend-series.js +178 -0
- package/lib/esm/charts/hooks/use-legend-series.js.map +1 -0
- package/lib/esm/charts/hooks/use-legend-visibility.js +87 -0
- package/lib/esm/charts/hooks/use-legend-visibility.js.map +1 -0
- package/lib/esm/charts/index.js +1 -1
- package/lib/esm/charts/index.js.map +1 -1
- package/lib/esm/charts/tests/chart-test-utils.js +53 -8
- package/lib/esm/charts/tests/chart-test-utils.js.map +1 -1
- package/lib/esm/charts/themes/ndl-echarts-theme.js.map +1 -1
- package/lib/esm/charts/{aria-description.js → utils/aria-description.js} +4 -45
- package/lib/esm/charts/utils/aria-description.js.map +1 -0
- package/lib/esm/charts/utils/build-chart-option.js +69 -0
- package/lib/esm/charts/utils/build-chart-option.js.map +1 -0
- package/lib/esm/charts/utils/chart-tooltip-formatter.js +82 -0
- package/lib/esm/charts/utils/chart-tooltip-formatter.js.map +1 -0
- package/lib/esm/charts/utils/chart-types.js.map +1 -0
- package/lib/esm/charts/utils/defaults.js.map +1 -0
- package/lib/esm/charts/{utils.js → utils/format-utils.js} +2 -17
- package/lib/esm/charts/utils/format-utils.js.map +1 -0
- package/lib/esm/charts/utils/legend-layout.js +59 -0
- package/lib/esm/charts/utils/legend-layout.js.map +1 -0
- package/lib/esm/charts/{legend-utils.js → utils/legend-utils.js} +1 -75
- package/lib/esm/charts/utils/legend-utils.js.map +1 -0
- package/lib/esm/charts/utils/threshold.js +106 -0
- package/lib/esm/charts/utils/threshold.js.map +1 -0
- package/lib/esm/charts/{user-option-utils.js → utils/user-option-utils.js} +5 -14
- package/lib/esm/charts/utils/user-option-utils.js.map +1 -0
- package/lib/types/charts/Chart.d.ts +2 -2
- package/lib/types/charts/Chart.d.ts.map +1 -1
- package/lib/{esm/charts/types.js → types/charts/ChartContainer.d.ts} +14 -1
- package/lib/types/charts/ChartContainer.d.ts.map +1 -0
- package/lib/types/charts/ChartEmpty.d.ts +1 -1
- package/lib/types/charts/ChartEmpty.d.ts.map +1 -1
- package/lib/types/charts/ChartRender.d.ts +36 -0
- package/lib/types/charts/ChartRender.d.ts.map +1 -0
- package/lib/types/charts/ChartTooltip.d.ts +1 -1
- package/lib/types/charts/ChartTooltip.d.ts.map +1 -1
- package/lib/types/charts/Legend.d.ts +15 -3
- package/lib/types/charts/Legend.d.ts.map +1 -1
- package/lib/{cjs/charts/types.js → types/charts/LegendItem.d.ts} +10 -3
- package/lib/types/charts/LegendItem.d.ts.map +1 -0
- package/lib/types/charts/LegendLayout.d.ts +38 -0
- package/lib/types/charts/LegendLayout.d.ts.map +1 -0
- package/lib/types/charts/hooks/use-chart-instance.d.ts +62 -0
- package/lib/types/charts/hooks/use-chart-instance.d.ts.map +1 -0
- package/lib/types/charts/hooks/use-chart-option.d.ts +48 -0
- package/lib/types/charts/hooks/use-chart-option.d.ts.map +1 -0
- package/lib/types/charts/hooks/use-chart-refs.d.ts +38 -0
- package/lib/types/charts/hooks/use-chart-refs.d.ts.map +1 -0
- package/lib/types/charts/hooks/use-chart-zoom.d.ts +36 -0
- package/lib/types/charts/hooks/use-chart-zoom.d.ts.map +1 -0
- package/lib/types/charts/hooks/use-legend-interactions.d.ts +56 -0
- package/lib/types/charts/hooks/use-legend-interactions.d.ts.map +1 -0
- package/lib/types/charts/hooks/use-legend-series.d.ts +42 -0
- package/lib/types/charts/hooks/use-legend-series.d.ts.map +1 -0
- package/lib/types/charts/hooks/use-legend-visibility.d.ts +24 -0
- package/lib/types/charts/hooks/use-legend-visibility.d.ts.map +1 -0
- package/lib/types/charts/index.d.ts +2 -2
- package/lib/types/charts/index.d.ts.map +1 -1
- package/lib/types/charts/tests/chart-test-utils.d.ts +7 -1
- package/lib/types/charts/tests/chart-test-utils.d.ts.map +1 -1
- package/lib/types/charts/themes/ndl-echarts-theme.d.ts +1 -1
- package/lib/types/charts/themes/ndl-echarts-theme.d.ts.map +1 -1
- package/lib/types/charts/utils/aria-description.d.ts.map +1 -0
- package/lib/types/charts/utils/build-chart-option.d.ts +52 -0
- package/lib/types/charts/utils/build-chart-option.d.ts.map +1 -0
- package/lib/types/charts/utils/chart-tooltip-formatter.d.ts +37 -0
- package/lib/types/charts/utils/chart-tooltip-formatter.d.ts.map +1 -0
- package/lib/types/charts/{chart-types.d.ts → utils/chart-types.d.ts} +23 -22
- package/lib/types/charts/utils/chart-types.d.ts.map +1 -0
- package/lib/types/charts/utils/defaults.d.ts.map +1 -0
- package/lib/types/charts/{utils.d.ts → utils/format-utils.d.ts} +2 -4
- package/lib/types/charts/utils/format-utils.d.ts.map +1 -0
- package/lib/types/charts/utils/legend-layout.d.ts +37 -0
- package/lib/types/charts/utils/legend-layout.d.ts.map +1 -0
- package/lib/types/charts/{legend-utils.d.ts → utils/legend-utils.d.ts} +1 -11
- package/lib/types/charts/utils/legend-utils.d.ts.map +1 -0
- package/lib/types/charts/utils/threshold.d.ts +45 -0
- package/lib/types/charts/utils/threshold.d.ts.map +1 -0
- package/lib/types/charts/utils/user-option-utils.d.ts.map +1 -0
- package/package.json +3 -3
- package/lib/cjs/charts/aria-description.js.map +0 -1
- package/lib/cjs/charts/chart-types.js.map +0 -1
- package/lib/cjs/charts/defaults.js.map +0 -1
- package/lib/cjs/charts/legend-utils.js.map +0 -1
- package/lib/cjs/charts/types.js.map +0 -1
- package/lib/cjs/charts/user-option-utils.js.map +0 -1
- package/lib/cjs/charts/utils.js.map +0 -1
- package/lib/esm/charts/aria-description.js.map +0 -1
- package/lib/esm/charts/chart-types.js.map +0 -1
- package/lib/esm/charts/defaults.js.map +0 -1
- package/lib/esm/charts/legend-utils.js.map +0 -1
- package/lib/esm/charts/types.js.map +0 -1
- package/lib/esm/charts/user-option-utils.js.map +0 -1
- package/lib/esm/charts/utils.js.map +0 -1
- package/lib/types/charts/aria-description.d.ts.map +0 -1
- package/lib/types/charts/chart-types.d.ts.map +0 -1
- package/lib/types/charts/defaults.d.ts.map +0 -1
- package/lib/types/charts/legend-utils.d.ts.map +0 -1
- package/lib/types/charts/types.d.ts +0 -44
- package/lib/types/charts/types.d.ts.map +0 -1
- package/lib/types/charts/user-option-utils.d.ts.map +0 -1
- package/lib/types/charts/utils.d.ts.map +0 -1
- /package/lib/cjs/charts/{chart-types.js → utils/chart-types.js} +0 -0
- /package/lib/cjs/charts/{defaults.js → utils/defaults.js} +0 -0
- /package/lib/esm/charts/{chart-types.js → utils/chart-types.js} +0 -0
- /package/lib/esm/charts/{defaults.js → utils/defaults.js} +0 -0
- /package/lib/types/charts/{aria-description.d.ts → utils/aria-description.d.ts} +0 -0
- /package/lib/types/charts/{defaults.d.ts → utils/defaults.d.ts} +0 -0
- /package/lib/types/charts/{user-option-utils.d.ts → utils/user-option-utils.d.ts} +0 -0
|
@@ -18,5 +18,18 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
+
import type React from 'react';
|
|
22
|
+
type ChartContainerProps = {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Provides the chart grid shell and CSS variables shared by the ECharts canvas
|
|
28
|
+
* and legend rows.
|
|
29
|
+
*
|
|
30
|
+
* The container owns the measurement ref for the full chart area so the legend
|
|
31
|
+
* can cap expanded height relative to the available chart height.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ChartContainer: ({ children, style }: ChartContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
34
|
export {};
|
|
22
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=ChartContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartContainer.d.ts","sourceRoot":"","sources":["../../../src/charts/ChartContainer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwC/B,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,qBAAqB,mBAAmB,4CAsBtE,CAAC"}
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { type ChartEmptyProps } from './chart-types';
|
|
22
|
+
import { type ChartEmptyProps } from './utils/chart-types';
|
|
23
23
|
export declare function ChartEmpty({ action, message, type, }: ChartEmptyProps): React.JSX.Element;
|
|
24
24
|
//# sourceMappingURL=ChartEmpty.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartEmpty.d.ts","sourceRoot":"","sources":["../../../src/charts/ChartEmpty.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ChartEmpty.d.ts","sourceRoot":"","sources":["../../../src/charts/ChartEmpty.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAW3D,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,OAA6B,EAC7B,IAAa,GACd,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAUrC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import type { EChartsOption } from 'echarts';
|
|
22
|
+
import type { ChartProps } from './utils/chart-types';
|
|
23
|
+
type ChartRenderProps = Omit<ChartProps, 'legend' | 'style'> & {
|
|
24
|
+
onChartOptionChange: (chartOption: EChartsOption | undefined) => void;
|
|
25
|
+
onFirstResizeChange: (isWaitingForFirstResize: boolean) => void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Owns the ECharts instance element and coordinates chart-specific hooks.
|
|
29
|
+
*
|
|
30
|
+
* The component normalizes user props into Needle-themed ECharts options,
|
|
31
|
+
* initializes/resizes the chart instance, applies loading and zoom behavior, and
|
|
32
|
+
* reports derived chart state back to `Chart` for legend rendering.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ChartRender: ({ callbacks, dataset, isChartZoomDisabled, isLoading, onChartOptionChange, onFirstResizeChange, option: userOption, palette, series: propsSeries, settings, xAxis: propXAxis, yAxis: propYAxis, }: ChartRenderProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=ChartRender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartRender.d.ts","sourceRoot":"","sources":["../../../src/charts/ChartRender.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAe7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAetD,KAAK,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG;IAC7D,mBAAmB,EAAE,CAAC,WAAW,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC;IACtE,mBAAmB,EAAE,CAAC,uBAAuB,EAAE,OAAO,KAAK,IAAI,CAAC;CACjE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,mMAazB,gBAAgB,4CA+DlB,CAAC"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { TextLink } from '@neo4j-ndl/react';
|
|
22
22
|
import type React from 'react';
|
|
23
|
-
import { type ChartTooltipContentProps, type ChartTooltipProps } from './chart-types';
|
|
23
|
+
import { type ChartTooltipContentProps, type ChartTooltipProps } from './utils/chart-types';
|
|
24
24
|
export declare const ChartTooltipComponent: ({ children, isOpen, style, anchorPosition, ref, }: ChartTooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
type ChartTooltipTitleProps = {
|
|
26
26
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTooltip.d.ts","sourceRoot":"","sources":["../../../src/charts/ChartTooltip.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAGL,QAAQ,EAET,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"ChartTooltip.d.ts","sourceRoot":"","sources":["../../../src/charts/ChartTooltip.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAGL,QAAQ,EAET,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,qBAAqB,GAAkC,mDAMjE,iBAAiB,4CAYnB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAClC,CAAC;AAwFF,QAAA,MAAM,YAAY,uDAzGf,iBAAiB;2FAsCjB,wBAAwB;kCA+DxB,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC;gCA/ErC,sBAAsB;CAuFvB,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -18,7 +18,19 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
import { type LegendProps } from './chart-types';
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
import { type CommonProps, type LegendProps } from './utils/chart-types';
|
|
22
|
+
type LegendComponentProps = LegendProps & {
|
|
23
|
+
isLayoutReady?: boolean;
|
|
24
|
+
onLayoutReady?: () => void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Renders the interactive chart legend and keeps legend state synchronized with
|
|
28
|
+
* ECharts.
|
|
29
|
+
*
|
|
30
|
+
* The component owns the React-side selected-series state, mirrors it into the
|
|
31
|
+
* shared ref consumed when rebuilding chart options, and wires item hover/click
|
|
32
|
+
* interactions back to the ECharts instance.
|
|
33
|
+
*/
|
|
34
|
+
export declare const Legend: ({ className, series, isLayoutReady, onLayoutReady, htmlAttributes, ...restProps }: Omit<CommonProps<"div", LegendComponentProps>, "ref">) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export {};
|
|
24
36
|
//# sourceMappingURL=Legend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../src/charts/Legend.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../src/charts/Legend.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEzE,KAAK,oBAAoB,GAAG,WAAW,GAAG;IACxC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GAAI,mFAOpB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,oBAAoB,CAAC,EAAE,KAAK,CAAC,4CA+DvD,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
*
|
|
4
3
|
* Copyright (c) "Neo4j"
|
|
@@ -19,5 +18,13 @@
|
|
|
19
18
|
* You should have received a copy of the GNU General Public License
|
|
20
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
import { type LegendItemProps } from './utils/chart-types';
|
|
22
|
+
/**
|
|
23
|
+
* Renders a single legend entry with its series color, selection indicator, and
|
|
24
|
+
* optional button semantics.
|
|
25
|
+
*
|
|
26
|
+
* Threshold-line series are intentionally skipped because they are chart
|
|
27
|
+
* annotations rather than user-toggleable data series.
|
|
28
|
+
*/
|
|
29
|
+
export declare const LegendItem: ({ children, as, className, name, selected, deSelected, onLegendItemClick, color, hasButtons, ref, onLegendItemMouseEnter, onLegendItemMouseLeave, ...restProps }: LegendItemProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
30
|
+
//# sourceMappingURL=LegendItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendItem.d.ts","sourceRoot":"","sources":["../../../src/charts/LegendItem.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,kKAcxB,eAAe,mDA8CjB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { type CommonProps } from './utils/chart-types';
|
|
23
|
+
type LegendLayoutProps = {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
isLayoutReady?: boolean;
|
|
26
|
+
itemCount: number;
|
|
27
|
+
onLayoutReady?: () => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Renders the responsive legend layout shell.
|
|
31
|
+
*
|
|
32
|
+
* The component switches between a two-row collapsed view, an invisible
|
|
33
|
+
* measurement view, and an expanded scrollable view while keeping the
|
|
34
|
+
* "View more"/"View less" action wired to the measured overflow state.
|
|
35
|
+
*/
|
|
36
|
+
export declare const LegendLayout: ({ children, className, isLayoutReady, itemCount, onLayoutReady, htmlAttributes, ...restProps }: Omit<CommonProps<"div", LegendLayoutProps>, "ref">) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=LegendLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendLayout.d.ts","sourceRoot":"","sources":["../../../src/charts/LegendLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAQvD,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAqSF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,gGAQ1B,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,KAAK,CAAC,4CAuJpD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import type { HexColor } from '../utils/chart-types';
|
|
22
|
+
type UseChartLifecycleParams = {
|
|
23
|
+
palette?: HexColor[];
|
|
24
|
+
theme: 'light' | 'dark';
|
|
25
|
+
};
|
|
26
|
+
type UseChartLoadingParams = {
|
|
27
|
+
isLoading?: boolean;
|
|
28
|
+
isWaitingForFirstResize: boolean;
|
|
29
|
+
theme: 'light' | 'dark';
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Registers Needle ECharts themes and initializes the chart instance.
|
|
33
|
+
*
|
|
34
|
+
* Theme registration runs with the active palette so ECharts can resolve Needle
|
|
35
|
+
* colors before options are applied. The hook only calls `init` when the DOM
|
|
36
|
+
* element does not already have an ECharts instance, allowing later renders to
|
|
37
|
+
* update registered theme data without replacing the existing chart.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useChartLifecycle({ palette, theme }: UseChartLifecycleParams): void;
|
|
40
|
+
/**
|
|
41
|
+
* Mirrors React loading state into ECharts' loading overlay.
|
|
42
|
+
*
|
|
43
|
+
* The overlay also stays visible while the chart waits for its first resize,
|
|
44
|
+
* preventing users from seeing an unmeasured SVG before ECharts has been sized
|
|
45
|
+
* to its container. Loading colors come from the active Needle theme.
|
|
46
|
+
*/
|
|
47
|
+
export declare function useChartLoading({ isLoading, isWaitingForFirstResize, theme, }: UseChartLoadingParams): void;
|
|
48
|
+
/**
|
|
49
|
+
* Keeps the ECharts canvas sized to the DOM box assigned by the chart layout.
|
|
50
|
+
*
|
|
51
|
+
* The hook listens to both window resize events and direct element resize
|
|
52
|
+
* observations because the chart can change size through parent layout changes
|
|
53
|
+
* that do not emit a window resize. It exposes `isWaitingForFirstResize` so the
|
|
54
|
+
* rest of the chart can delay rendering dependent UI until ECharts has been
|
|
55
|
+
* given its initial dimensions.
|
|
56
|
+
*/
|
|
57
|
+
export declare function useChartResize(): {
|
|
58
|
+
isWaitingForFirstResize: boolean;
|
|
59
|
+
resizeChart: () => void;
|
|
60
|
+
};
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=use-chart-instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-chart-instance.d.ts","sourceRoot":"","sources":["../../../../src/charts/hooks/use-chart-instance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrD,KAAK,uBAAuB,GAAG;IAC7B,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uBAAuB,EAAE,OAAO,CAAC;IACjC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,uBAAuB,QAqB5E;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,uBAAuB,EACvB,KAAK,GACN,EAAE,qBAAqB,QAwBvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc;;;EA0C7B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import type { EChartsOption } from 'echarts';
|
|
22
|
+
import type { ChartProps, EchartsSeries } from '../utils/chart-types';
|
|
23
|
+
import type { NormalizedThresholdLine } from '../utils/threshold';
|
|
24
|
+
export type UseChartOptionParams = {
|
|
25
|
+
dataZoom: EChartsOption['dataZoom'];
|
|
26
|
+
dataset: ChartProps['dataset'];
|
|
27
|
+
hasCategoryXAxis: boolean;
|
|
28
|
+
hasSliderZoom: boolean;
|
|
29
|
+
propsSeries: ChartProps['series'];
|
|
30
|
+
series: EchartsSeries;
|
|
31
|
+
settings: ChartProps['settings'];
|
|
32
|
+
thresholdLines: NormalizedThresholdLine[];
|
|
33
|
+
toolboxOptions: EChartsOption['toolbox'];
|
|
34
|
+
userOption: ChartProps['option'];
|
|
35
|
+
xAxis: EChartsOption['xAxis'];
|
|
36
|
+
yAxis: EChartsOption['yAxis'];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Builds, applies, and exposes the ECharts option for the current React props.
|
|
40
|
+
*
|
|
41
|
+
* `buildChartOption` merges Needle defaults, normalized axes/series, threshold
|
|
42
|
+
* lines, zoom settings, toolbox options, user overrides, and the current legend
|
|
43
|
+
* selection. After `setOption`, the hook returns ECharts' normalized option so
|
|
44
|
+
* downstream code, especially the custom legend, can read the final series and
|
|
45
|
+
* dataset shape ECharts is actually using.
|
|
46
|
+
*/
|
|
47
|
+
export declare function useChartOption({ dataZoom, dataset, hasCategoryXAxis, hasSliderZoom, propsSeries, series, settings, thresholdLines, toolboxOptions, userOption, xAxis, yAxis, }: UseChartOptionParams): EChartsOption | undefined;
|
|
48
|
+
//# sourceMappingURL=use-chart-option.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-chart-option.d.ts","sourceRoot":"","sources":["../../../../src/charts/hooks/use-chart-option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAGlE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACpC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IACjC,cAAc,EAAE,uBAAuB,EAAE,CAAC;IAC1C,cAAc,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACzC,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACjC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9B,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CAC/B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,MAAM,EACN,QAAQ,EACR,cAAc,EACd,cAAc,EACd,UAAU,EACV,KAAK,EACL,KAAK,GACN,EAAE,oBAAoB,6BA+CtB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import { type ReactNode } from 'react';
|
|
22
|
+
export type ChartRefs = {
|
|
23
|
+
chartEchartRef: React.RefObject<HTMLDivElement | null>;
|
|
24
|
+
legendColorCacheRef: React.RefObject<Map<string, string>>;
|
|
25
|
+
legendSelectedRef: React.RefObject<Record<string, boolean>>;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Creates the mutable refs shared between `ChartRender` and legend components.
|
|
29
|
+
*
|
|
30
|
+
* `chartEchartRef` points at the ECharts host element, while the legend refs act
|
|
31
|
+
* as a bridge for state that ECharts needs synchronously during option rebuilds
|
|
32
|
+
* without forcing extra React renders.
|
|
33
|
+
*/
|
|
34
|
+
export declare function ChartRefsProvider({ children }: {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): import("react").FunctionComponentElement<import("react").ProviderProps<ChartRefs | undefined>>;
|
|
37
|
+
export declare function useChartRefsContext(): ChartRefs;
|
|
38
|
+
//# sourceMappingURL=use-chart-refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-chart-refs.d.ts","sourceRoot":"","sources":["../../../../src/charts/hooks/use-chart-refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,SAAS,GAAG;IACtB,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACvD,mBAAmB,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1D,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC7D,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,kGActE;AAED,wBAAgB,mBAAmB,cASlC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import type { ChartProps } from '../utils/chart-types';
|
|
22
|
+
type UseChartZoomParams = {
|
|
23
|
+
callbacks: ChartProps['callbacks'];
|
|
24
|
+
isChartZoomDisabled: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Owns ECharts zoom interactions and forwards zoom changes to consumers.
|
|
28
|
+
*
|
|
29
|
+
* The hook subscribes to ECharts `datazoom` events, enables drag-to-zoom through
|
|
30
|
+
* ECharts' global cursor API, resets zoom on double click, and clears ECharts'
|
|
31
|
+
* SVG cursor override after mouse movement so Needle's default cursor styling is
|
|
32
|
+
* preserved.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useChartZoom({ callbacks, isChartZoomDisabled, }: UseChartZoomParams): void;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=use-chart-zoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-chart-zoom.d.ts","sourceRoot":"","sources":["../../../../src/charts/hooks/use-chart-zoom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACnC,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,mBAAmB,GACpB,EAAE,kBAAkB,QA+FpB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import type { LegendProps } from '../utils/chart-types';
|
|
22
|
+
type LegendSeries = LegendProps['series'];
|
|
23
|
+
type UseLegendHoverHighlightParams = {
|
|
24
|
+
selectedSeries: Record<string, boolean>;
|
|
25
|
+
series: LegendSeries;
|
|
26
|
+
};
|
|
27
|
+
type UseLegendSelectionParams = {
|
|
28
|
+
series: LegendProps['series'];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Owns React legend selection and keeps it synchronized with ECharts.
|
|
32
|
+
*
|
|
33
|
+
* Current series changes preserve existing selection by name, new series default
|
|
34
|
+
* to visible, removed series are dropped, and ECharts legend events update the
|
|
35
|
+
* React state used to render legend items.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useLegendSelection({ series }: UseLegendSelectionParams): {
|
|
38
|
+
renderedSelectedSeries: Record<string, boolean>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Creates a delayed ECharts highlighter for legend item hover state.
|
|
42
|
+
*
|
|
43
|
+
* Legend hover moves often happen as a quick leave/enter pair between adjacent
|
|
44
|
+
* items. Keeping separate highlight and downplay timers lets the next hover
|
|
45
|
+
* cancel the previous opposite action, preventing the chart from flickering
|
|
46
|
+
* between emphasized and reset states. Deselected legend items are ignored so
|
|
47
|
+
* hidden series do not get emphasized through hover.
|
|
48
|
+
*/
|
|
49
|
+
export declare function useLegendHoverHighlight({ selectedSeries, series, }: UseLegendHoverHighlightParams): {
|
|
50
|
+
toggleHighlight: (seriesToUpdate: {
|
|
51
|
+
name: string;
|
|
52
|
+
color: string;
|
|
53
|
+
}, shouldHighlight: boolean) => void;
|
|
54
|
+
};
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=use-legend-interactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-legend-interactions.d.ts","sourceRoot":"","sources":["../../../../src/charts/hooks/use-legend-interactions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAcH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAgBxD,KAAK,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;AAO1C,KAAK,6BAA6B,GAAG;IACnC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CAC/B,CAAC;AA6DF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,wBAAwB;;EA0DtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,cAAc,EACd,MAAM,GACP,EAAE,6BAA6B;sCAcV;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,mBAC9B,OAAO;EAkC7B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import type { EChartsOption } from 'echarts';
|
|
22
|
+
import type { LegendProps } from '../utils/chart-types';
|
|
23
|
+
type UseLegendSeriesParams = {
|
|
24
|
+
chartOption: EChartsOption | undefined;
|
|
25
|
+
isWaitingForFirstResize: boolean;
|
|
26
|
+
};
|
|
27
|
+
type LegendSeries = LegendProps['series'];
|
|
28
|
+
/**
|
|
29
|
+
* Derives Needle legend rows from ECharts' normalized option and visual state.
|
|
30
|
+
*
|
|
31
|
+
* Standard series map one-to-one with legend items. Pie charts instead create a
|
|
32
|
+
* legend item for each data row, so the hook reads the encoded item-name column
|
|
33
|
+
* from the dataset and asks ECharts for each slice color. Fresh colors are
|
|
34
|
+
* cached while all slices are visible because ECharts reports dimmed colors for
|
|
35
|
+
* deselected slices.
|
|
36
|
+
*
|
|
37
|
+
* The hook waits until the first chart resize has completed so color lookups run
|
|
38
|
+
* against an initialized ECharts instance.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useLegendSeries({ chartOption, isWaitingForFirstResize, }: UseLegendSeriesParams): LegendSeries | undefined;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=use-legend-series.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-legend-series.d.ts","sourceRoot":"","sources":["../../../../src/charts/hooks/use-legend-series.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EACV,WAAW,EAGZ,MAAM,sBAAsB,CAAC;AAI9B,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,aAAa,GAAG,SAAS,CAAC;IACvC,uBAAuB,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,KAAK,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;AAwK1C;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,uBAAuB,GACxB,EAAE,qBAAqB,GAAG,YAAY,GAAG,SAAS,CA6DlD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useLegendVisibility: (selectedSeries: Record<string, boolean>) => {
|
|
22
|
+
toggleLegendVisibility: (name: string | undefined, isAllSeriesSelected: boolean, isOnlyVisible: boolean) => void;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=use-legend-visibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-legend-visibility.d.ts","sourceRoot":"","sources":["../../../../src/charts/hooks/use-legend-visibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAQH,eAAO,MAAM,mBAAmB,GAC9B,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;mCAwD7B,MAAM,GAAG,SAAS,uBACH,OAAO,iBACb,OAAO;CAuB3B,CAAC"}
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export * from './Chart';
|
|
22
22
|
export * from './ChartEmpty';
|
|
23
|
-
export { defaultThresholdLineSeriesOption } from './defaults';
|
|
24
|
-
export { type ChartEmptyProps, type ThresholdLineSeriesOption, type Values, type SeriesOption, type EchartsSeries, type NeedleSeries, } from './chart-types';
|
|
23
|
+
export { defaultThresholdLineSeriesOption } from './utils/defaults';
|
|
24
|
+
export { type ChartEmptyProps, type ThresholdLineSeriesOption, type Values, type SeriesOption, type EchartsSeries, type NeedleSeries, } from './utils/chart-types';
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/charts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,gCAAgC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/charts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,qBAAqB,CAAC"}
|
|
@@ -75,7 +75,6 @@ export declare const multiSeriesChartProps: {
|
|
|
75
75
|
};
|
|
76
76
|
legend: {
|
|
77
77
|
show: boolean;
|
|
78
|
-
wrappingType: "wrapping";
|
|
79
78
|
};
|
|
80
79
|
option: {};
|
|
81
80
|
series: {
|
|
@@ -123,6 +122,13 @@ export declare const barChart: ({ seriesName, value, rgbSeriesColor, chartProps,
|
|
|
123
122
|
rgbSeriesColor: string;
|
|
124
123
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
125
124
|
export declare const expectChartElementVisible: (page: Page) => Promise<void>;
|
|
125
|
+
export declare const startLegendMeasuringObserver: (page: Page, options?: {
|
|
126
|
+
chartLayoutSelector?: string;
|
|
127
|
+
}) => Promise<void>;
|
|
128
|
+
export declare const getLegendMeasuringObserverResult: (page: Page) => Promise<{
|
|
129
|
+
chartHeightDuringMeasurement: number | undefined;
|
|
130
|
+
didAddMeasuringClass: boolean;
|
|
131
|
+
}>;
|
|
126
132
|
/**
|
|
127
133
|
* Checks so a single series is not blurred.
|
|
128
134
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-test-utils.d.ts","sourceRoot":"","sources":["../../../../src/charts/tests/chart-test-utils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAoB5C,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa/D,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,YAAY,MAAM,EAClB,OAAO,MAAM,EACb,gBAAgB,MAAM;;;;;;;;;;;;;;;;;;;CA2BtB,CAAC;AAEH,eAAO,MAAM,aAAa,GACxB,YAAY,MAAM,EAClB,OAAO,MAAM,EACb,gBAAgB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;CA4BtB,CAAC;AAEH,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"chart-test-utils.d.ts","sourceRoot":"","sources":["../../../../src/charts/tests/chart-test-utils.tsx"],"names":[],"mappings":"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"}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import { type HexColor } from '../chart-types';
|
|
22
|
+
import { type HexColor } from '../utils/chart-types';
|
|
23
23
|
export declare const ndlEchartsTheme: (theme: "light" | "dark", palette?: HexColor[]) => {
|
|
24
24
|
darkMode: boolean;
|
|
25
25
|
color: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ndl-echarts-theme.d.ts","sourceRoot":"","sources":["../../../../src/charts/themes/ndl-echarts-theme.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ndl-echarts-theme.d.ts","sourceRoot":"","sources":["../../../../src/charts/themes/ndl-echarts-theme.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAwCrD,eAAO,MAAM,eAAe,GAC1B,OAAO,OAAO,GAAG,MAAM,EACvB,UAAU,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2GrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aria-description.d.ts","sourceRoot":"","sources":["../../../../src/charts/utils/aria-description.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,SAAS,CAAC;AAE3D,OAAO,KAAK,EAEV,YAAY,EAGb,MAAM,eAAe,CAAC;AAsKvB;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,GAChC,MAAM,GAAG,SAAS,CAgHpB"}
|