@neo4j-ndl/react-charts 1.3.0 → 1.3.1-alpha.585cb7c.16.1

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.
@@ -48,10 +48,10 @@ const ChartTooltipTitle = function ChartTooltipTitle({ children, ref, }) {
48
48
  };
49
49
  const ChartTooltipContent = function ChartTooltipContent({ leadingElement, trailingElement, indentSquareColor, notifications, ref, }) {
50
50
  const classes = (0, classnames_1.default)(`ndl-charts-chart-tooltip-content`);
51
- return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: classes, children: [(0, jsx_runtime_1.jsxs)("div", { className: "ndl-charts-chart-tooltip-content-line", children: [indentSquareColor && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-charts-chart-tooltip-content-indent-square", style: { backgroundColor: indentSquareColor } })), leadingElement && ((0, jsx_runtime_1.jsx)(react_1.Typography, { variant: trailingElement ? 'body-medium' : 'label', className: "ndl-charts-chart-tooltip-content-left-element", children: leadingElement })), trailingElement && ((0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", className: "ndl-charts-chart-tooltip-content-trailing-element", children: trailingElement }))] }), notifications &&
51
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: classes, children: [(0, jsx_runtime_1.jsxs)("div", { className: "ndl-charts-chart-tooltip-content-line", children: [indentSquareColor && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-charts-chart-tooltip-content-indent-square", style: { backgroundColor: indentSquareColor } })), leadingElement && ((0, jsx_runtime_1.jsx)(react_1.Typography, { variant: trailingElement ? 'body-medium' : 'label', className: "ndl-charts-chart-tooltip-content-left-element", children: leadingElement })), trailingElement && ((0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "title-3", className: "ndl-charts-chart-tooltip-content-trailing-element", children: trailingElement }))] }), notifications &&
52
52
  notifications.map((notification) => {
53
53
  const { id, notificationType, leadingElement, trailingElement } = notification;
54
- return ((0, jsx_runtime_1.jsxs)("div", { className: `ndl-charts-chart-tooltip-content-notification ndl-notification-${notificationType}`, children: [(0, jsx_runtime_1.jsx)(react_1.StatusIndicator, { variant: notificationType }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", className: "ndl-charts-chart-tooltip-content-notification-left-element", children: leadingElement }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "label", className: "ndl-charts-chart-tooltip-content-notification-trailing-element", children: trailingElement })] }, `notification-${id}`));
54
+ return ((0, jsx_runtime_1.jsxs)("div", { className: `ndl-charts-chart-tooltip-content-notification ndl-notification-${notificationType}`, children: [(0, jsx_runtime_1.jsx)(react_1.StatusIndicator, { variant: notificationType }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", className: "ndl-charts-chart-tooltip-content-notification-left-element", children: leadingElement }), (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "title-3", className: "ndl-charts-chart-tooltip-content-notification-trailing-element", children: trailingElement })] }, `notification-${id}`));
55
55
  })] }));
56
56
  };
57
57
  const ChartTooltipLink = function ChartTooltipAction(_a) {
@@ -1 +1 @@
1
- {"version":3,"file":"ChartTooltip.js","sourceRoot":"","sources":["../../../src/charts/ChartTooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAK0B;AAC1B,4DAAoC;AAQ7B,MAAM,qBAAqB,GAAG,SAAS,qBAAqB,CAAC,EAClE,QAAQ,EACR,MAAM,EACN,KAAK,EACL,cAAc,EACd,GAAG,GACe;IAClB,OAAO,CACL,uBAAC,eAAO,IACN,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAC,yBAAyB,YAEnC,uBAAC,eAAO,CAAC,OAAO,IAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,YACpC,QAAQ,GACO,GACV,CACX,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,qBAAqB,yBAkBhC;AAOF,MAAM,iBAAiB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IACT,OAAO,EAAC,aAAa,EACrB,SAAS,EAAC,4DAA4D,YAErE,cAAc,GACJ,EACb,uBAAC,kBAAU,IACT,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,gEAAgE,YAEzE,eAAe,GACL,KAfR,gBAAgB,EAAE,EAAE,CAgBrB,CACP,CAAC;gBACJ,CAAC,CAAC,IACA,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,SAAS,kBAAkB,CAAC,EAGb;QAHa,EACnD,GAAG,OAEmC,EADnC,SAAS,cAFuC,OAGpD,CADa;IAEZ,OAAO,uBAAC,gBAAQ,kBAAC,GAAG,EAAE,GAAG,IAAM,SAAS,EAAI,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,6BAAqB,EAAE;IACxD,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;CACzB,CAAC,CAAC;AAEM,oCAAY","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n Popover,\n StatusIndicator,\n TextLink,\n Typography,\n} from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport {\n type ChartTooltipContentProps,\n type ChartTooltipProps,\n} from './utils/chart-types';\n\nexport const ChartTooltipComponent = function ChartTooltipComponent({\n children,\n isOpen,\n style,\n anchorPosition,\n ref,\n}: ChartTooltipProps) {\n return (\n <Popover\n isOpen={isOpen}\n anchorPosition={anchorPosition}\n placement=\"middle-end-middle-start\"\n >\n <Popover.Content ref={ref} style={style}>\n {children}\n </Popover.Content>\n </Popover>\n );\n};\n\ntype ChartTooltipTitleProps = {\n children: React.ReactNode;\n ref?: React.Ref<HTMLSpanElement>;\n};\n\nconst ChartTooltipTitle = function ChartTooltipTitle({\n children,\n ref,\n}: ChartTooltipTitleProps) {\n const classes = classNames(`ndl-charts-chart-tooltip-title`);\n\n return (\n <Typography ref={ref} variant=\"body-small\" className={classes}>\n {children}\n </Typography>\n );\n};\n\nconst ChartTooltipContent = function ChartTooltipContent({\n leadingElement,\n trailingElement,\n indentSquareColor,\n notifications,\n ref,\n}: ChartTooltipContentProps) {\n const classes = classNames(`ndl-charts-chart-tooltip-content`);\n\n return (\n <div ref={ref} className={classes}>\n <div className=\"ndl-charts-chart-tooltip-content-line\">\n {indentSquareColor && (\n <div\n className=\"ndl-charts-chart-tooltip-content-indent-square\"\n style={{ backgroundColor: indentSquareColor }}\n />\n )}\n {leadingElement && (\n <Typography\n variant={trailingElement ? 'body-medium' : 'label'}\n className=\"ndl-charts-chart-tooltip-content-left-element\"\n >\n {leadingElement}\n </Typography>\n )}\n {trailingElement && (\n <Typography\n variant=\"label\"\n className=\"ndl-charts-chart-tooltip-content-trailing-element\"\n >\n {trailingElement}\n </Typography>\n )}\n </div>\n\n {notifications &&\n notifications.map((notification) => {\n const { id, notificationType, leadingElement, trailingElement } =\n notification;\n\n return (\n <div\n key={`notification-${id}`}\n className={`ndl-charts-chart-tooltip-content-notification ndl-notification-${notificationType}`}\n >\n <StatusIndicator variant={notificationType} />\n <Typography\n variant=\"body-medium\"\n className=\"ndl-charts-chart-tooltip-content-notification-left-element\"\n >\n {leadingElement}\n </Typography>\n <Typography\n variant=\"label\"\n className=\"ndl-charts-chart-tooltip-content-notification-trailing-element\"\n >\n {trailingElement}\n </Typography>\n </div>\n );\n })}\n </div>\n );\n};\n\nconst ChartTooltipLink = function ChartTooltipAction({\n ref,\n ...restProps\n}: React.ComponentProps<typeof TextLink>) {\n return <TextLink ref={ref} {...restProps} />;\n};\n\nconst ChartTooltip = Object.assign(ChartTooltipComponent, {\n Content: ChartTooltipContent,\n Link: ChartTooltipLink,\n Title: ChartTooltipTitle,\n});\n\nexport { ChartTooltip };\n"]}
1
+ {"version":3,"file":"ChartTooltip.js","sourceRoot":"","sources":["../../../src/charts/ChartTooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAK0B;AAC1B,4DAAoC;AAQ7B,MAAM,qBAAqB,GAAG,SAAS,qBAAqB,CAAC,EAClE,QAAQ,EACR,MAAM,EACN,KAAK,EACL,cAAc,EACd,GAAG,GACe;IAClB,OAAO,CACL,uBAAC,eAAO,IACN,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAC,yBAAyB,YAEnC,uBAAC,eAAO,CAAC,OAAO,IAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,YACpC,QAAQ,GACO,GACV,CACX,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,qBAAqB,yBAkBhC;AAOF,MAAM,iBAAiB,GAAG,SAAS,iBAAiB,CAAC,EACnD,QAAQ,EACR,GAAG,GACoB;IACvB,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,gCAAgC,CAAC,CAAC;IAE7D,OAAO,CACL,uBAAC,kBAAU,IAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAC,YAAY,EAAC,SAAS,EAAE,OAAO,YAC1D,QAAQ,GACE,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,SAAS,mBAAmB,CAAC,EACvD,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,GAAG,GACsB;IACzB,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,kCAAkC,CAAC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AC/C,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,6BAAqB,EAAE;IACxD,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;CACzB,CAAC,CAAC;AAEM,oCAAY","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n Popover,\n StatusIndicator,\n TextLink,\n Typography,\n} from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport {\n type ChartTooltipContentProps,\n type ChartTooltipProps,\n} from './utils/chart-types';\n\nexport const ChartTooltipComponent = function ChartTooltipComponent({\n children,\n isOpen,\n style,\n anchorPosition,\n ref,\n}: ChartTooltipProps) {\n return (\n <Popover\n isOpen={isOpen}\n anchorPosition={anchorPosition}\n placement=\"middle-end-middle-start\"\n >\n <Popover.Content ref={ref} style={style}>\n {children}\n </Popover.Content>\n </Popover>\n );\n};\n\ntype ChartTooltipTitleProps = {\n children: React.ReactNode;\n ref?: React.Ref<HTMLSpanElement>;\n};\n\nconst ChartTooltipTitle = function ChartTooltipTitle({\n children,\n ref,\n}: ChartTooltipTitleProps) {\n const classes = classNames(`ndl-charts-chart-tooltip-title`);\n\n return (\n <Typography ref={ref} variant=\"body-small\" className={classes}>\n {children}\n </Typography>\n );\n};\n\nconst ChartTooltipContent = function ChartTooltipContent({\n leadingElement,\n trailingElement,\n indentSquareColor,\n notifications,\n ref,\n}: ChartTooltipContentProps) {\n const classes = classNames(`ndl-charts-chart-tooltip-content`);\n\n return (\n <div ref={ref} className={classes}>\n <div className=\"ndl-charts-chart-tooltip-content-line\">\n {indentSquareColor && (\n <div\n className=\"ndl-charts-chart-tooltip-content-indent-square\"\n style={{ backgroundColor: indentSquareColor }}\n />\n )}\n {leadingElement && (\n <Typography\n variant={trailingElement ? 'body-medium' : 'label'}\n className=\"ndl-charts-chart-tooltip-content-left-element\"\n >\n {leadingElement}\n </Typography>\n )}\n {trailingElement && (\n <Typography\n variant=\"title-3\"\n className=\"ndl-charts-chart-tooltip-content-trailing-element\"\n >\n {trailingElement}\n </Typography>\n )}\n </div>\n\n {notifications &&\n notifications.map((notification) => {\n const { id, notificationType, leadingElement, trailingElement } =\n notification;\n\n return (\n <div\n key={`notification-${id}`}\n className={`ndl-charts-chart-tooltip-content-notification ndl-notification-${notificationType}`}\n >\n <StatusIndicator variant={notificationType} />\n <Typography\n variant=\"body-medium\"\n className=\"ndl-charts-chart-tooltip-content-notification-left-element\"\n >\n {leadingElement}\n </Typography>\n <Typography\n variant=\"title-3\"\n className=\"ndl-charts-chart-tooltip-content-notification-trailing-element\"\n >\n {trailingElement}\n </Typography>\n </div>\n );\n })}\n </div>\n );\n};\n\nconst ChartTooltipLink = function ChartTooltipAction({\n ref,\n ...restProps\n}: React.ComponentProps<typeof TextLink>) {\n return <TextLink ref={ref} {...restProps} />;\n};\n\nconst ChartTooltip = Object.assign(ChartTooltipComponent, {\n Content: ChartTooltipContent,\n Link: ChartTooltipLink,\n Title: ChartTooltipTitle,\n});\n\nexport { ChartTooltip };\n"]}
@@ -71,9 +71,9 @@ function useChartLoading({ isLoading, isWaitingForFirstResize, theme, }) {
71
71
  if (isLoading === true || isWaitingForFirstResize) {
72
72
  chart === null || chart === void 0 ? void 0 : chart.showLoading({
73
73
  color: base_1.tokens.theme[theme].color.primary.bg.status,
74
- fontFamily: base_1.tokens.typography['label'].fontFamily,
75
- fontSize: base_1.tokens.typography['label'].fontSize,
76
- fontWeight: base_1.tokens.typography['label'].fontWeight,
74
+ fontFamily: base_1.tokens.typography['title-4'].fontFamily,
75
+ fontSize: base_1.tokens.typography['title-4'].fontSize,
76
+ fontWeight: base_1.tokens.typography['title-4'].fontWeight,
77
77
  maskColor: `rgb( from ${base_1.tokens.theme[theme].color.neutral.text.inverse} r g b / 0.8)`,
78
78
  text: 'Loading',
79
79
  textColor: base_1.tokens.theme[theme].color.neutral.text.default,
@@ -1 +1 @@
1
- {"version":3,"file":"use-chart-instance.js","sourceRoot":"","sources":["../../../../src/charts/hooks/use-chart-instance.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AA6BH,8CAqBC;AASD,0CA4BC;AAWD,wCA0CC;AA1ID,0CAAyC;AACzC,qCAAgE;AAChE,iCAAyD;AAEzD,mEAA8D;AAE9D,qDAAuD;AAavD;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAA2B;IAC3E,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,oCAAmB,GAAE,CAAC;IAEjD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,cAAc,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YACpC,OAAO;QACT,CAAC;QAED,IAAA,uBAAa,EAAC,WAAW,EAAE,IAAA,mCAAe,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC9D,IAAA,uBAAa,EAAC,UAAU,EAAE,IAAA,mCAAe,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAE5D,MAAM,YAAY,GAAG,IAAA,0BAAgB,EAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,MAAM,YAAY,GAAG,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;QA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YACV,oBAAoB,CAAC,cAAc,CAAC,CAAC;YACrC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAClD,cAAc,CAAC,UAAU,EAAE,CAAC;QAC9B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAElC,OAAO;QACL,uBAAuB;QACvB,WAAW;KACZ,CAAC;AACJ,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { tokens } from '@neo4j-ndl/base';\nimport { getInstanceByDom, init, registerTheme } from 'echarts';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ndlEchartsTheme } from '../themes/ndl-echarts-theme';\nimport type { HexColor } from '../utils/chart-types';\nimport { useChartRefsContext } from './use-chart-refs';\n\ntype UseChartLifecycleParams = {\n palette?: HexColor[];\n theme: 'light' | 'dark';\n};\n\ntype UseChartLoadingParams = {\n isLoading?: boolean;\n isWaitingForFirstResize: boolean;\n theme: 'light' | 'dark';\n};\n\n/**\n * Registers Needle ECharts themes and initializes the chart instance.\n *\n * Theme registration runs with the active palette so ECharts can resolve Needle\n * colors before options are applied. The hook only calls `init` when the DOM\n * element does not already have an ECharts instance, allowing later renders to\n * update registered theme data without replacing the existing chart.\n */\nexport function useChartLifecycle({ palette, theme }: UseChartLifecycleParams) {\n const { chartEchartRef } = useChartRefsContext();\n\n useEffect(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n registerTheme('ndl-light', ndlEchartsTheme('light', palette));\n registerTheme('ndl-dark', ndlEchartsTheme('dark', palette));\n\n const currentChart = getInstanceByDom(chartEchartRef.current);\n if (currentChart) {\n return;\n }\n\n const echartsTheme = theme === 'light' ? 'ndl-light' : 'ndl-dark';\n init(chartEchartRef.current, echartsTheme, {\n renderer: 'svg',\n });\n });\n}\n\n/**\n * Mirrors React loading state into ECharts' loading overlay.\n *\n * The overlay also stays visible while the chart waits for its first resize,\n * preventing users from seeing an unmeasured SVG before ECharts has been sized\n * to its container. Loading colors come from the active Needle theme.\n */\nexport function useChartLoading({\n isLoading,\n isWaitingForFirstResize,\n theme,\n}: UseChartLoadingParams) {\n const { chartEchartRef } = useChartRefsContext();\n\n useEffect(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n const chart = getInstanceByDom(chartEchartRef.current);\n\n if (isLoading === true || isWaitingForFirstResize) {\n chart?.showLoading({\n color: tokens.theme[theme].color.primary.bg.status,\n fontFamily: tokens.typography['label'].fontFamily,\n fontSize: tokens.typography['label'].fontSize,\n fontWeight: tokens.typography['label'].fontWeight,\n maskColor: `rgb( from ${tokens.theme[theme].color.neutral.text.inverse} r g b / 0.8)`,\n text: 'Loading',\n textColor: tokens.theme[theme].color.neutral.text.default,\n });\n } else {\n chart?.hideLoading();\n }\n }, [chartEchartRef, isLoading, isWaitingForFirstResize, theme]);\n}\n\n/**\n * Keeps the ECharts canvas sized to the DOM box assigned by the chart layout.\n *\n * The hook listens to both window resize events and direct element resize\n * observations because the chart can change size through parent layout changes\n * that do not emit a window resize. It exposes `isWaitingForFirstResize` so the\n * rest of the chart can delay rendering dependent UI until ECharts has been\n * given its initial dimensions.\n */\nexport function useChartResize() {\n const { chartEchartRef } = useChartRefsContext();\n const [isWaitingForFirstResize, setIsWaitingForFirstResize] = useState(true);\n\n const resizeChart = useCallback(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n const chart = getInstanceByDom(chartEchartRef.current);\n const { clientHeight: height, clientWidth: width } = chartEchartRef.current;\n\n chart?.resize({\n height,\n width,\n });\n }, [chartEchartRef]);\n\n useEffect(() => {\n window.addEventListener('resize', resizeChart);\n const resizeObserver = new ResizeObserver(() => {\n resizeChart();\n });\n if (chartEchartRef.current) {\n resizeObserver.observe(chartEchartRef.current);\n }\n const animationFrame = requestAnimationFrame(() => {\n resizeChart();\n setIsWaitingForFirstResize(false);\n });\n\n return () => {\n cancelAnimationFrame(animationFrame);\n window.removeEventListener('resize', resizeChart);\n resizeObserver.disconnect();\n };\n }, [chartEchartRef, resizeChart]);\n\n return {\n isWaitingForFirstResize,\n resizeChart,\n };\n}\n"]}
1
+ {"version":3,"file":"use-chart-instance.js","sourceRoot":"","sources":["../../../../src/charts/hooks/use-chart-instance.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AA6BH,8CAqBC;AASD,0CA4BC;AAWD,wCA0CC;AA1ID,0CAAyC;AACzC,qCAAgE;AAChE,iCAAyD;AAEzD,mEAA8D;AAE9D,qDAAuD;AAavD;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAA2B;IAC3E,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,oCAAmB,GAAE,CAAC;IAEjD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,cAAc,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YACpC,OAAO;QACT,CAAC;QAED,IAAA,uBAAa,EAAC,WAAW,EAAE,IAAA,mCAAe,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC9D,IAAA,uBAAa,EAAC,UAAU,EAAE,IAAA,mCAAe,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAE5D,MAAM,YAAY,GAAG,IAAA,0BAAgB,EAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO;QACT,CA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AW,EAAE,CAAC;YACd,0BAA0B,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,oBAAoB,CAAC,cAAc,CAAC,CAAC;YACrC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAClD,cAAc,CAAC,UAAU,EAAE,CAAC;QAC9B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAElC,OAAO;QACL,uBAAuB;QACvB,WAAW;KACZ,CAAC;AACJ,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { tokens } from '@neo4j-ndl/base';\nimport { getInstanceByDom, init, registerTheme } from 'echarts';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ndlEchartsTheme } from '../themes/ndl-echarts-theme';\nimport type { HexColor } from '../utils/chart-types';\nimport { useChartRefsContext } from './use-chart-refs';\n\ntype UseChartLifecycleParams = {\n palette?: HexColor[];\n theme: 'light' | 'dark';\n};\n\ntype UseChartLoadingParams = {\n isLoading?: boolean;\n isWaitingForFirstResize: boolean;\n theme: 'light' | 'dark';\n};\n\n/**\n * Registers Needle ECharts themes and initializes the chart instance.\n *\n * Theme registration runs with the active palette so ECharts can resolve Needle\n * colors before options are applied. The hook only calls `init` when the DOM\n * element does not already have an ECharts instance, allowing later renders to\n * update registered theme data without replacing the existing chart.\n */\nexport function useChartLifecycle({ palette, theme }: UseChartLifecycleParams) {\n const { chartEchartRef } = useChartRefsContext();\n\n useEffect(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n registerTheme('ndl-light', ndlEchartsTheme('light', palette));\n registerTheme('ndl-dark', ndlEchartsTheme('dark', palette));\n\n const currentChart = getInstanceByDom(chartEchartRef.current);\n if (currentChart) {\n return;\n }\n\n const echartsTheme = theme === 'light' ? 'ndl-light' : 'ndl-dark';\n init(chartEchartRef.current, echartsTheme, {\n renderer: 'svg',\n });\n });\n}\n\n/**\n * Mirrors React loading state into ECharts' loading overlay.\n *\n * The overlay also stays visible while the chart waits for its first resize,\n * preventing users from seeing an unmeasured SVG before ECharts has been sized\n * to its container. Loading colors come from the active Needle theme.\n */\nexport function useChartLoading({\n isLoading,\n isWaitingForFirstResize,\n theme,\n}: UseChartLoadingParams) {\n const { chartEchartRef } = useChartRefsContext();\n\n useEffect(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n const chart = getInstanceByDom(chartEchartRef.current);\n\n if (isLoading === true || isWaitingForFirstResize) {\n chart?.showLoading({\n color: tokens.theme[theme].color.primary.bg.status,\n fontFamily: tokens.typography['title-4'].fontFamily,\n fontSize: tokens.typography['title-4'].fontSize,\n fontWeight: tokens.typography['title-4'].fontWeight,\n maskColor: `rgb( from ${tokens.theme[theme].color.neutral.text.inverse} r g b / 0.8)`,\n text: 'Loading',\n textColor: tokens.theme[theme].color.neutral.text.default,\n });\n } else {\n chart?.hideLoading();\n }\n }, [chartEchartRef, isLoading, isWaitingForFirstResize, theme]);\n}\n\n/**\n * Keeps the ECharts canvas sized to the DOM box assigned by the chart layout.\n *\n * The hook listens to both window resize events and direct element resize\n * observations because the chart can change size through parent layout changes\n * that do not emit a window resize. It exposes `isWaitingForFirstResize` so the\n * rest of the chart can delay rendering dependent UI until ECharts has been\n * given its initial dimensions.\n */\nexport function useChartResize() {\n const { chartEchartRef } = useChartRefsContext();\n const [isWaitingForFirstResize, setIsWaitingForFirstResize] = useState(true);\n\n const resizeChart = useCallback(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n const chart = getInstanceByDom(chartEchartRef.current);\n const { clientHeight: height, clientWidth: width } = chartEchartRef.current;\n\n chart?.resize({\n height,\n width,\n });\n }, [chartEchartRef]);\n\n useEffect(() => {\n window.addEventListener('resize', resizeChart);\n const resizeObserver = new ResizeObserver(() => {\n resizeChart();\n });\n if (chartEchartRef.current) {\n resizeObserver.observe(chartEchartRef.current);\n }\n const animationFrame = requestAnimationFrame(() => {\n resizeChart();\n setIsWaitingForFirstResize(false);\n });\n\n return () => {\n cancelAnimationFrame(animationFrame);\n window.removeEventListener('resize', resizeChart);\n resizeObserver.disconnect();\n };\n }, [chartEchartRef, resizeChart]);\n\n return {\n isWaitingForFirstResize,\n resizeChart,\n };\n}\n"]}
@@ -41,10 +41,10 @@ const ChartTooltipTitle = function ChartTooltipTitle({ children, ref, }) {
41
41
  };
42
42
  const ChartTooltipContent = function ChartTooltipContent({ leadingElement, trailingElement, indentSquareColor, notifications, ref, }) {
43
43
  const classes = classNames(`ndl-charts-chart-tooltip-content`);
44
- return (_jsxs("div", { ref: ref, className: classes, children: [_jsxs("div", { className: "ndl-charts-chart-tooltip-content-line", children: [indentSquareColor && (_jsx("div", { className: "ndl-charts-chart-tooltip-content-indent-square", style: { backgroundColor: indentSquareColor } })), leadingElement && (_jsx(Typography, { variant: trailingElement ? 'body-medium' : 'label', className: "ndl-charts-chart-tooltip-content-left-element", children: leadingElement })), trailingElement && (_jsx(Typography, { variant: "label", className: "ndl-charts-chart-tooltip-content-trailing-element", children: trailingElement }))] }), notifications &&
44
+ return (_jsxs("div", { ref: ref, className: classes, children: [_jsxs("div", { className: "ndl-charts-chart-tooltip-content-line", children: [indentSquareColor && (_jsx("div", { className: "ndl-charts-chart-tooltip-content-indent-square", style: { backgroundColor: indentSquareColor } })), leadingElement && (_jsx(Typography, { variant: trailingElement ? 'body-medium' : 'label', className: "ndl-charts-chart-tooltip-content-left-element", children: leadingElement })), trailingElement && (_jsx(Typography, { variant: "title-3", className: "ndl-charts-chart-tooltip-content-trailing-element", children: trailingElement }))] }), notifications &&
45
45
  notifications.map((notification) => {
46
46
  const { id, notificationType, leadingElement, trailingElement } = notification;
47
- return (_jsxs("div", { className: `ndl-charts-chart-tooltip-content-notification ndl-notification-${notificationType}`, children: [_jsx(StatusIndicator, { variant: notificationType }), _jsx(Typography, { variant: "body-medium", className: "ndl-charts-chart-tooltip-content-notification-left-element", children: leadingElement }), _jsx(Typography, { variant: "label", className: "ndl-charts-chart-tooltip-content-notification-trailing-element", children: trailingElement })] }, `notification-${id}`));
47
+ return (_jsxs("div", { className: `ndl-charts-chart-tooltip-content-notification ndl-notification-${notificationType}`, children: [_jsx(StatusIndicator, { variant: notificationType }), _jsx(Typography, { variant: "body-medium", className: "ndl-charts-chart-tooltip-content-notification-left-element", children: leadingElement }), _jsx(Typography, { variant: "title-3", className: "ndl-charts-chart-tooltip-content-notification-trailing-element", children: trailingElement })] }, `notification-${id}`));
48
48
  })] }));
49
49
  };
50
50
  const ChartTooltipLink = function ChartTooltipAction(_a) {
@@ -1 +1 @@
1
- {"version":3,"file":"ChartTooltip.js","sourceRoot":"","sources":["../../../src/charts/ChartTooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,OAAO,EACP,eAAe,EACf,QAAQ,EACR,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAQpC,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,qBAAqB,CAAC,EAClE,QAAQ,EACR,MAAM,EACN,KAAK,EACL,cAAc,EACd,GAAG,GACe;IAClB,OAAO,CACL,KAAC,OAAO,IACN,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAC,yBAAyB,YAEnC,KAAC,OAAO,CAAC,OAAO,IAA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BAAgB,EAAE,aAE/F,KAAC,eAAe,IAAC,OAAO,EAAE,gBAAgB,GAAI,EAC9C,KAAC,UAAU,IACT,OAAO,EAAC,aAAa,EACrB,SAAS,EAAC,4DAA4D,YAErE,cAAc,GACJ,EACb,KAAC,UAAU,IACT,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,gEAAgE,YAEzE,eAAe,GACL,KAfR,gBAAgB,EAAE,EAAE,CAgBrB,CACP,CAAC;gBACJ,CAAC,CAAC,IACA,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,SAAS,kBAAkB,CAAC,EAGb;QAHa,EACnD,GAAG,OAEmC,EADnC,SAAS,cAFuC,OAGpD,CADa;IAEZ,OAAO,KAAC,QAAQ,kBAAC,GAAG,EAAE,GAAG,IAAM,SAAS,EAAI,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;IACxD,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;CACzB,CAAC,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n Popover,\n StatusIndicator,\n TextLink,\n Typography,\n} from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport {\n type ChartTooltipContentProps,\n type ChartTooltipProps,\n} from './utils/chart-types';\n\nexport const ChartTooltipComponent = function ChartTooltipComponent({\n children,\n isOpen,\n style,\n anchorPosition,\n ref,\n}: ChartTooltipProps) {\n return (\n <Popover\n isOpen={isOpen}\n anchorPosition={anchorPosition}\n placement=\"middle-end-middle-start\"\n >\n <Popover.Content ref={ref} style={style}>\n {children}\n </Popover.Content>\n </Popover>\n );\n};\n\ntype ChartTooltipTitleProps = {\n children: React.ReactNode;\n ref?: React.Ref<HTMLSpanElement>;\n};\n\nconst ChartTooltipTitle = function ChartTooltipTitle({\n children,\n ref,\n}: ChartTooltipTitleProps) {\n const classes = classNames(`ndl-charts-chart-tooltip-title`);\n\n return (\n <Typography ref={ref} variant=\"body-small\" className={classes}>\n {children}\n </Typography>\n );\n};\n\nconst ChartTooltipContent = function ChartTooltipContent({\n leadingElement,\n trailingElement,\n indentSquareColor,\n notifications,\n ref,\n}: ChartTooltipContentProps) {\n const classes = classNames(`ndl-charts-chart-tooltip-content`);\n\n return (\n <div ref={ref} className={classes}>\n <div className=\"ndl-charts-chart-tooltip-content-line\">\n {indentSquareColor && (\n <div\n className=\"ndl-charts-chart-tooltip-content-indent-square\"\n style={{ backgroundColor: indentSquareColor }}\n />\n )}\n {leadingElement && (\n <Typography\n variant={trailingElement ? 'body-medium' : 'label'}\n className=\"ndl-charts-chart-tooltip-content-left-element\"\n >\n {leadingElement}\n </Typography>\n )}\n {trailingElement && (\n <Typography\n variant=\"label\"\n className=\"ndl-charts-chart-tooltip-content-trailing-element\"\n >\n {trailingElement}\n </Typography>\n )}\n </div>\n\n {notifications &&\n notifications.map((notification) => {\n const { id, notificationType, leadingElement, trailingElement } =\n notification;\n\n return (\n <div\n key={`notification-${id}`}\n className={`ndl-charts-chart-tooltip-content-notification ndl-notification-${notificationType}`}\n >\n <StatusIndicator variant={notificationType} />\n <Typography\n variant=\"body-medium\"\n className=\"ndl-charts-chart-tooltip-content-notification-left-element\"\n >\n {leadingElement}\n </Typography>\n <Typography\n variant=\"label\"\n className=\"ndl-charts-chart-tooltip-content-notification-trailing-element\"\n >\n {trailingElement}\n </Typography>\n </div>\n );\n })}\n </div>\n );\n};\n\nconst ChartTooltipLink = function ChartTooltipAction({\n ref,\n ...restProps\n}: React.ComponentProps<typeof TextLink>) {\n return <TextLink ref={ref} {...restProps} />;\n};\n\nconst ChartTooltip = Object.assign(ChartTooltipComponent, {\n Content: ChartTooltipContent,\n Link: ChartTooltipLink,\n Title: ChartTooltipTitle,\n});\n\nexport { ChartTooltip };\n"]}
1
+ {"version":3,"file":"ChartTooltip.js","sourceRoot":"","sources":["../../../src/charts/ChartTooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,OAAO,EACP,eAAe,EACf,QAAQ,EACR,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AAQpC,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,qBAAqB,CAAC,EAClE,QAAQ,EACR,MAAM,EACN,KAAK,EACL,cAAc,EACd,GAAG,GACe;IAClB,OAAO,CACL,KAAC,OAAO,IACN,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAC,yBAAyB,YAEnC,KAAC,OAAO,CAAC,OAAO,IAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,YACpC,QAAQ,GACO,GACV,CACX,CAAC;AACJ,CAAC,CAAC;AAOF,MAAM,iBAAiB,GAAG,SAAS,iBAAiB,CAAC,EACnD,QAAQ,EACR,GAAG,GACoB;IACvB,MAAM,OAAO,GAAG,UAAU,CAAC,gCAAgC,CAAC,CAAC;IAE7D,OAAO,CACL,KAAC,UAAU,IAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAC,YAAY,EAAC,SAAS,EAAE,OAAO,YAC1D,QAAQ,GACE,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAA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nD,GAAG,OAEmC,EADnC,SAAS,cAFuC,OAGpD,CADa;IAEZ,OAAO,KAAC,QAAQ,kBAAC,GAAG,EAAE,GAAG,IAAM,SAAS,EAAI,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;IACxD,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,iBAAiB;CACzB,CAAC,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n Popover,\n StatusIndicator,\n TextLink,\n Typography,\n} from '@neo4j-ndl/react';\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport {\n type ChartTooltipContentProps,\n type ChartTooltipProps,\n} from './utils/chart-types';\n\nexport const ChartTooltipComponent = function ChartTooltipComponent({\n children,\n isOpen,\n style,\n anchorPosition,\n ref,\n}: ChartTooltipProps) {\n return (\n <Popover\n isOpen={isOpen}\n anchorPosition={anchorPosition}\n placement=\"middle-end-middle-start\"\n >\n <Popover.Content ref={ref} style={style}>\n {children}\n </Popover.Content>\n </Popover>\n );\n};\n\ntype ChartTooltipTitleProps = {\n children: React.ReactNode;\n ref?: React.Ref<HTMLSpanElement>;\n};\n\nconst ChartTooltipTitle = function ChartTooltipTitle({\n children,\n ref,\n}: ChartTooltipTitleProps) {\n const classes = classNames(`ndl-charts-chart-tooltip-title`);\n\n return (\n <Typography ref={ref} variant=\"body-small\" className={classes}>\n {children}\n </Typography>\n );\n};\n\nconst ChartTooltipContent = function ChartTooltipContent({\n leadingElement,\n trailingElement,\n indentSquareColor,\n notifications,\n ref,\n}: ChartTooltipContentProps) {\n const classes = classNames(`ndl-charts-chart-tooltip-content`);\n\n return (\n <div ref={ref} className={classes}>\n <div className=\"ndl-charts-chart-tooltip-content-line\">\n {indentSquareColor && (\n <div\n className=\"ndl-charts-chart-tooltip-content-indent-square\"\n style={{ backgroundColor: indentSquareColor }}\n />\n )}\n {leadingElement && (\n <Typography\n variant={trailingElement ? 'body-medium' : 'label'}\n className=\"ndl-charts-chart-tooltip-content-left-element\"\n >\n {leadingElement}\n </Typography>\n )}\n {trailingElement && (\n <Typography\n variant=\"title-3\"\n className=\"ndl-charts-chart-tooltip-content-trailing-element\"\n >\n {trailingElement}\n </Typography>\n )}\n </div>\n\n {notifications &&\n notifications.map((notification) => {\n const { id, notificationType, leadingElement, trailingElement } =\n notification;\n\n return (\n <div\n key={`notification-${id}`}\n className={`ndl-charts-chart-tooltip-content-notification ndl-notification-${notificationType}`}\n >\n <StatusIndicator variant={notificationType} />\n <Typography\n variant=\"body-medium\"\n className=\"ndl-charts-chart-tooltip-content-notification-left-element\"\n >\n {leadingElement}\n </Typography>\n <Typography\n variant=\"title-3\"\n className=\"ndl-charts-chart-tooltip-content-notification-trailing-element\"\n >\n {trailingElement}\n </Typography>\n </div>\n );\n })}\n </div>\n );\n};\n\nconst ChartTooltipLink = function ChartTooltipAction({\n ref,\n ...restProps\n}: React.ComponentProps<typeof TextLink>) {\n return <TextLink ref={ref} {...restProps} />;\n};\n\nconst ChartTooltip = Object.assign(ChartTooltipComponent, {\n Content: ChartTooltipContent,\n Link: ChartTooltipLink,\n Title: ChartTooltipTitle,\n});\n\nexport { ChartTooltip };\n"]}
@@ -66,9 +66,9 @@ export function useChartLoading({ isLoading, isWaitingForFirstResize, theme, })
66
66
  if (isLoading === true || isWaitingForFirstResize) {
67
67
  chart === null || chart === void 0 ? void 0 : chart.showLoading({
68
68
  color: tokens.theme[theme].color.primary.bg.status,
69
- fontFamily: tokens.typography['label'].fontFamily,
70
- fontSize: tokens.typography['label'].fontSize,
71
- fontWeight: tokens.typography['label'].fontWeight,
69
+ fontFamily: tokens.typography['title-4'].fontFamily,
70
+ fontSize: tokens.typography['title-4'].fontSize,
71
+ fontWeight: tokens.typography['title-4'].fontWeight,
72
72
  maskColor: `rgb( from ${tokens.theme[theme].color.neutral.text.inverse} r g b / 0.8)`,
73
73
  text: 'Loading',
74
74
  textColor: tokens.theme[theme].color.neutral.text.default,
@@ -1 +1 @@
1
- {"version":3,"file":"use-chart-instance.js","sourceRoot":"","sources":["../../../../src/charts/hooks/use-chart-instance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAavD;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAA2B;IAC3E,MAAM,EAAE,cAAc,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,cAAc,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YACpC,OAAO;QACT,CAAC;QAED,aAAa,CAAC,WAAW,EAAE,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC9D,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC,MAAM,EAAE,O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CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,cAAc,GAAG,qBAAqB,CAAC,GAAG,EAAE;YAChD,WAAW,EAAE,CAAC;YACd,0BAA0B,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,oBAAoB,CAAC,cAAc,CAAC,CAAC;YACrC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAClD,cAAc,CAAC,UAAU,EAAE,CAAC;QAC9B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAElC,OAAO;QACL,uBAAuB;QACvB,WAAW;KACZ,CAAC;AACJ,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { tokens } from '@neo4j-ndl/base';\nimport { getInstanceByDom, init, registerTheme } from 'echarts';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ndlEchartsTheme } from '../themes/ndl-echarts-theme';\nimport type { HexColor } from '../utils/chart-types';\nimport { useChartRefsContext } from './use-chart-refs';\n\ntype UseChartLifecycleParams = {\n palette?: HexColor[];\n theme: 'light' | 'dark';\n};\n\ntype UseChartLoadingParams = {\n isLoading?: boolean;\n isWaitingForFirstResize: boolean;\n theme: 'light' | 'dark';\n};\n\n/**\n * Registers Needle ECharts themes and initializes the chart instance.\n *\n * Theme registration runs with the active palette so ECharts can resolve Needle\n * colors before options are applied. The hook only calls `init` when the DOM\n * element does not already have an ECharts instance, allowing later renders to\n * update registered theme data without replacing the existing chart.\n */\nexport function useChartLifecycle({ palette, theme }: UseChartLifecycleParams) {\n const { chartEchartRef } = useChartRefsContext();\n\n useEffect(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n registerTheme('ndl-light', ndlEchartsTheme('light', palette));\n registerTheme('ndl-dark', ndlEchartsTheme('dark', palette));\n\n const currentChart = getInstanceByDom(chartEchartRef.current);\n if (currentChart) {\n return;\n }\n\n const echartsTheme = theme === 'light' ? 'ndl-light' : 'ndl-dark';\n init(chartEchartRef.current, echartsTheme, {\n renderer: 'svg',\n });\n });\n}\n\n/**\n * Mirrors React loading state into ECharts' loading overlay.\n *\n * The overlay also stays visible while the chart waits for its first resize,\n * preventing users from seeing an unmeasured SVG before ECharts has been sized\n * to its container. Loading colors come from the active Needle theme.\n */\nexport function useChartLoading({\n isLoading,\n isWaitingForFirstResize,\n theme,\n}: UseChartLoadingParams) {\n const { chartEchartRef } = useChartRefsContext();\n\n useEffect(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n const chart = getInstanceByDom(chartEchartRef.current);\n\n if (isLoading === true || isWaitingForFirstResize) {\n chart?.showLoading({\n color: tokens.theme[theme].color.primary.bg.status,\n fontFamily: tokens.typography['label'].fontFamily,\n fontSize: tokens.typography['label'].fontSize,\n fontWeight: tokens.typography['label'].fontWeight,\n maskColor: `rgb( from ${tokens.theme[theme].color.neutral.text.inverse} r g b / 0.8)`,\n text: 'Loading',\n textColor: tokens.theme[theme].color.neutral.text.default,\n });\n } else {\n chart?.hideLoading();\n }\n }, [chartEchartRef, isLoading, isWaitingForFirstResize, theme]);\n}\n\n/**\n * Keeps the ECharts canvas sized to the DOM box assigned by the chart layout.\n *\n * The hook listens to both window resize events and direct element resize\n * observations because the chart can change size through parent layout changes\n * that do not emit a window resize. It exposes `isWaitingForFirstResize` so the\n * rest of the chart can delay rendering dependent UI until ECharts has been\n * given its initial dimensions.\n */\nexport function useChartResize() {\n const { chartEchartRef } = useChartRefsContext();\n const [isWaitingForFirstResize, setIsWaitingForFirstResize] = useState(true);\n\n const resizeChart = useCallback(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n const chart = getInstanceByDom(chartEchartRef.current);\n const { clientHeight: height, clientWidth: width } = chartEchartRef.current;\n\n chart?.resize({\n height,\n width,\n });\n }, [chartEchartRef]);\n\n useEffect(() => {\n window.addEventListener('resize', resizeChart);\n const resizeObserver = new ResizeObserver(() => {\n resizeChart();\n });\n if (chartEchartRef.current) {\n resizeObserver.observe(chartEchartRef.current);\n }\n const animationFrame = requestAnimationFrame(() => {\n resizeChart();\n setIsWaitingForFirstResize(false);\n });\n\n return () => {\n cancelAnimationFrame(animationFrame);\n window.removeEventListener('resize', resizeChart);\n resizeObserver.disconnect();\n };\n }, [chartEchartRef, resizeChart]);\n\n return {\n isWaitingForFirstResize,\n resizeChart,\n };\n}\n"]}
1
+ {"version":3,"file":"use-chart-instance.js","sourceRoot":"","sources":["../../../../src/charts/hooks/use-chart-instance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAavD;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAA2B;IAC3E,MAAM,EAAE,cAAc,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,cAAc,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AC,CAAC;QAC/C,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE;YAC7C,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;YAC3B,cAAc,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,cAAc,GAAG,qBAAqB,CAAC,GAAG,EAAE;YAChD,WAAW,EAAE,CAAC;YACd,0BAA0B,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,oBAAoB,CAAC,cAAc,CAAC,CAAC;YACrC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAClD,cAAc,CAAC,UAAU,EAAE,CAAC;QAC9B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAElC,OAAO;QACL,uBAAuB;QACvB,WAAW;KACZ,CAAC;AACJ,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { tokens } from '@neo4j-ndl/base';\nimport { getInstanceByDom, init, registerTheme } from 'echarts';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ndlEchartsTheme } from '../themes/ndl-echarts-theme';\nimport type { HexColor } from '../utils/chart-types';\nimport { useChartRefsContext } from './use-chart-refs';\n\ntype UseChartLifecycleParams = {\n palette?: HexColor[];\n theme: 'light' | 'dark';\n};\n\ntype UseChartLoadingParams = {\n isLoading?: boolean;\n isWaitingForFirstResize: boolean;\n theme: 'light' | 'dark';\n};\n\n/**\n * Registers Needle ECharts themes and initializes the chart instance.\n *\n * Theme registration runs with the active palette so ECharts can resolve Needle\n * colors before options are applied. The hook only calls `init` when the DOM\n * element does not already have an ECharts instance, allowing later renders to\n * update registered theme data without replacing the existing chart.\n */\nexport function useChartLifecycle({ palette, theme }: UseChartLifecycleParams) {\n const { chartEchartRef } = useChartRefsContext();\n\n useEffect(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n registerTheme('ndl-light', ndlEchartsTheme('light', palette));\n registerTheme('ndl-dark', ndlEchartsTheme('dark', palette));\n\n const currentChart = getInstanceByDom(chartEchartRef.current);\n if (currentChart) {\n return;\n }\n\n const echartsTheme = theme === 'light' ? 'ndl-light' : 'ndl-dark';\n init(chartEchartRef.current, echartsTheme, {\n renderer: 'svg',\n });\n });\n}\n\n/**\n * Mirrors React loading state into ECharts' loading overlay.\n *\n * The overlay also stays visible while the chart waits for its first resize,\n * preventing users from seeing an unmeasured SVG before ECharts has been sized\n * to its container. Loading colors come from the active Needle theme.\n */\nexport function useChartLoading({\n isLoading,\n isWaitingForFirstResize,\n theme,\n}: UseChartLoadingParams) {\n const { chartEchartRef } = useChartRefsContext();\n\n useEffect(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n const chart = getInstanceByDom(chartEchartRef.current);\n\n if (isLoading === true || isWaitingForFirstResize) {\n chart?.showLoading({\n color: tokens.theme[theme].color.primary.bg.status,\n fontFamily: tokens.typography['title-4'].fontFamily,\n fontSize: tokens.typography['title-4'].fontSize,\n fontWeight: tokens.typography['title-4'].fontWeight,\n maskColor: `rgb( from ${tokens.theme[theme].color.neutral.text.inverse} r g b / 0.8)`,\n text: 'Loading',\n textColor: tokens.theme[theme].color.neutral.text.default,\n });\n } else {\n chart?.hideLoading();\n }\n }, [chartEchartRef, isLoading, isWaitingForFirstResize, theme]);\n}\n\n/**\n * Keeps the ECharts canvas sized to the DOM box assigned by the chart layout.\n *\n * The hook listens to both window resize events and direct element resize\n * observations because the chart can change size through parent layout changes\n * that do not emit a window resize. It exposes `isWaitingForFirstResize` so the\n * rest of the chart can delay rendering dependent UI until ECharts has been\n * given its initial dimensions.\n */\nexport function useChartResize() {\n const { chartEchartRef } = useChartRefsContext();\n const [isWaitingForFirstResize, setIsWaitingForFirstResize] = useState(true);\n\n const resizeChart = useCallback(() => {\n if (chartEchartRef.current === null) {\n return;\n }\n\n const chart = getInstanceByDom(chartEchartRef.current);\n const { clientHeight: height, clientWidth: width } = chartEchartRef.current;\n\n chart?.resize({\n height,\n width,\n });\n }, [chartEchartRef]);\n\n useEffect(() => {\n window.addEventListener('resize', resizeChart);\n const resizeObserver = new ResizeObserver(() => {\n resizeChart();\n });\n if (chartEchartRef.current) {\n resizeObserver.observe(chartEchartRef.current);\n }\n const animationFrame = requestAnimationFrame(() => {\n resizeChart();\n setIsWaitingForFirstResize(false);\n });\n\n return () => {\n cancelAnimationFrame(animationFrame);\n window.removeEventListener('resize', resizeChart);\n resizeObserver.disconnect();\n };\n }, [chartEchartRef, resizeChart]);\n\n return {\n isWaitingForFirstResize,\n resizeChart,\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-ndl/react-charts",
3
- "version": "1.3.0",
3
+ "version": "1.3.1-alpha.585cb7c.16.1",
4
4
  "sideEffects": false,
5
5
  "description": "React implementation of charts from Neo4j Design System",
6
6
  "keywords": [
@@ -56,8 +56,8 @@
56
56
  "peerDependencies": {
57
57
  "react": ">=19.0.0",
58
58
  "react-dom": ">=19.0.0",
59
- "@neo4j-ndl/react": "^4.21.1",
60
- "@neo4j-ndl/base": "^4.20.1"
59
+ "@neo4j-ndl/base": "^4.20.2-alpha.585cb7c.16.1",
60
+ "@neo4j-ndl/react": "^4.21.2-alpha.585cb7c.16.1"
61
61
  },
62
62
  "dependencies": {
63
63
  "classnames": "2.5.1",