@sproutsocial/seeds-react-data-viz 0.27.3 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/{annotations-CjFoRPXf.d.mts → annotations-YfJndb5S.d.mts} +2 -2
  2. package/dist/{annotations-CjFoRPXf.d.ts → annotations-YfJndb5S.d.ts} +2 -2
  3. package/dist/{axis-DVx6Mn1k.d.mts → axis-Byl9vNMR.d.mts} +9 -9
  4. package/dist/{axis-DQXvjzBs.d.ts → axis-Cn8NAgwb.d.ts} +9 -9
  5. package/dist/bar/index.d.mts +25 -47
  6. package/dist/bar/index.d.ts +25 -47
  7. package/dist/bar/index.js +14 -14
  8. package/dist/bar/index.js.map +1 -1
  9. package/dist/bubble/index.d.mts +29 -40
  10. package/dist/bubble/index.d.ts +29 -40
  11. package/dist/bubble/index.js +18 -20
  12. package/dist/bubble/index.js.map +1 -1
  13. package/dist/{chartExport-CKYpuhik.d.mts → chartExport-B0imEQ8Y.d.mts} +4 -4
  14. package/dist/{chartExport-CKYpuhik.d.ts → chartExport-B0imEQ8Y.d.ts} +4 -4
  15. package/dist/{chartBase-Cd405GIA.d.mts → chartProps-BgGx1GTo.d.mts} +67 -23
  16. package/dist/{chartBase-BYipK7MZ.d.ts → chartProps-C2Lxty-_.d.ts} +67 -23
  17. package/dist/{chunk-WMKO3RGT.js → chunk-2S7XMWJ4.js} +3 -3
  18. package/dist/chunk-2S7XMWJ4.js.map +1 -0
  19. package/dist/{chunk-6EIJCJCN.js → chunk-I72SSPMX.js} +1 -1
  20. package/dist/chunk-I72SSPMX.js.map +1 -0
  21. package/dist/{chunk-CV45MD47.js → chunk-RDS2VCPO.js} +3 -3
  22. package/dist/chunk-RDS2VCPO.js.map +1 -0
  23. package/dist/{chunk-5TWNMPQU.js → chunk-V5EXL244.js} +73 -63
  24. package/dist/chunk-V5EXL244.js.map +1 -0
  25. package/dist/{chunk-34OKRQET.js → chunk-XH7ZKGHD.js} +5 -5
  26. package/dist/{chunk-34OKRQET.js.map → chunk-XH7ZKGHD.js.map} +1 -1
  27. package/dist/donut/index.d.mts +21 -36
  28. package/dist/donut/index.d.ts +21 -36
  29. package/dist/donut/index.js +8 -8
  30. package/dist/donut/index.js.map +1 -1
  31. package/dist/esm/bar/index.js +5 -5
  32. package/dist/esm/bar/index.js.map +1 -1
  33. package/dist/esm/bubble/index.js +10 -12
  34. package/dist/esm/bubble/index.js.map +1 -1
  35. package/dist/esm/{chunk-P3MVYSHX.js → chunk-37QVUJXM.js} +1 -1
  36. package/dist/esm/chunk-37QVUJXM.js.map +1 -0
  37. package/dist/esm/{chunk-332X77M5.js → chunk-JNQC3ZRQ.js} +3 -3
  38. package/dist/esm/chunk-JNQC3ZRQ.js.map +1 -0
  39. package/dist/esm/{chunk-MVNO5UV6.js → chunk-NBMVFYDJ.js} +2 -2
  40. package/dist/esm/chunk-NBMVFYDJ.js.map +1 -0
  41. package/dist/esm/{chunk-AL3OTBTT.js → chunk-THDIQMFN.js} +2 -2
  42. package/dist/esm/chunk-THDIQMFN.js.map +1 -0
  43. package/dist/esm/{chunk-CYCKJ5ML.js → chunk-YCYACOQU.js} +34 -24
  44. package/dist/esm/chunk-YCYACOQU.js.map +1 -0
  45. package/dist/esm/donut/index.js +3 -3
  46. package/dist/esm/donut/index.js.map +1 -1
  47. package/dist/esm/export/index.js.map +1 -1
  48. package/dist/esm/index.js +4 -4
  49. package/dist/esm/index.js.map +1 -1
  50. package/dist/esm/line-area/index.js +5 -5
  51. package/dist/esm/line-area/index.js.map +1 -1
  52. package/dist/esm/sparkline/index.js +3 -3
  53. package/dist/esm/sparkline/index.js.map +1 -1
  54. package/dist/esm/wordcloud/index.js +4 -3
  55. package/dist/esm/wordcloud/index.js.map +1 -1
  56. package/dist/export/index.d.mts +5 -5
  57. package/dist/export/index.d.ts +5 -5
  58. package/dist/export/index.js.map +1 -1
  59. package/dist/index.js +92 -92
  60. package/dist/index.js.map +1 -1
  61. package/dist/{interactions-pEXA1XxF.d.ts → interactions-D2a4O6iM.d.mts} +8 -8
  62. package/dist/{interactions-pEXA1XxF.d.mts → interactions-D2a4O6iM.d.ts} +8 -8
  63. package/dist/line-area/index.d.mts +22 -48
  64. package/dist/line-area/index.d.ts +22 -48
  65. package/dist/line-area/index.js +14 -14
  66. package/dist/line-area/index.js.map +1 -1
  67. package/dist/pointerClick-4LUDwS3L.d.mts +15 -0
  68. package/dist/pointerClick-4LUDwS3L.d.ts +15 -0
  69. package/dist/sparkline/index.d.mts +24 -33
  70. package/dist/sparkline/index.d.ts +24 -33
  71. package/dist/sparkline/index.js +7 -7
  72. package/dist/sparkline/index.js.map +1 -1
  73. package/dist/wordcloud/index.d.mts +22 -20
  74. package/dist/wordcloud/index.d.ts +22 -20
  75. package/dist/wordcloud/index.js +11 -10
  76. package/dist/wordcloud/index.js.map +1 -1
  77. package/package.json +2 -2
  78. package/dist/chunk-5TWNMPQU.js.map +0 -1
  79. package/dist/chunk-6EIJCJCN.js.map +0 -1
  80. package/dist/chunk-CV45MD47.js.map +0 -1
  81. package/dist/chunk-WMKO3RGT.js.map +0 -1
  82. package/dist/esm/chunk-332X77M5.js.map +0 -1
  83. package/dist/esm/chunk-AL3OTBTT.js.map +0 -1
  84. package/dist/esm/chunk-CYCKJ5ML.js.map +0 -1
  85. package/dist/esm/chunk-MVNO5UV6.js.map +0 -1
  86. package/dist/esm/chunk-P3MVYSHX.js.map +0 -1
@@ -1,60 +1,45 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { V as ValueFormat, C as ChartTooltipProps, a as ChartTooltipDataRow } from '../chartBase-Cd405GIA.mjs';
4
- import { C as ChartColorableEntity, a as ChartIconableEntity, b as ChartClickHandler, c as ChartHoverHandler } from '../interactions-pEXA1XxF.mjs';
5
- import { C as ChartExportHandle } from '../chartExport-CKYpuhik.mjs';
3
+ import { T as TypeChartBaseProps, a as TypeChartSizingProps, b as TypeChartTooltipDisplayProps, c as TypeChartTooltipClickFooterProps, d as TypeValueFormat, e as TypeChartTooltipRenderProps, f as TypeChartTooltipDataRow } from '../chartProps-BgGx1GTo.mjs';
4
+ import { T as TypeChartColorableEntity, a as TypeChartIconableEntity, b as TypeChartClickHandler, c as TypeChartHoverHandler } from '../interactions-D2a4O6iM.mjs';
5
+ export { T as TypeChartExportHandle } from '../chartExport-B0imEQ8Y.mjs';
6
6
  import '@sproutsocial/seeds-react-icon';
7
7
  import '../types-DxrhdAdn.mjs';
8
8
  import 'highcharts';
9
9
 
10
- interface DonutDataPoint extends ChartColorableEntity, ChartIconableEntity {
10
+ interface TypeDonutDataPoint extends TypeChartColorableEntity, TypeChartIconableEntity {
11
11
  value: number | null;
12
12
  }
13
13
  /** A donut tooltip row — always carries `percent` (Highcharts computes it for pie series). */
14
- interface DonutChartTooltipRow extends ChartTooltipDataRow {
14
+ interface TypeDonutChartTooltipRow extends TypeChartTooltipDataRow {
15
15
  percent: number;
16
16
  }
17
17
  /** Tooltip render-prop signature for DonutChart. `data` rows always include `percent`. */
18
- interface DonutChartTooltipProps extends Omit<ChartTooltipProps, "data"> {
19
- data: DonutChartTooltipRow[];
18
+ interface TypeDonutChartTooltipProps extends Omit<TypeChartTooltipRenderProps, "data"> {
19
+ data: TypeDonutChartTooltipRow[];
20
20
  }
21
- interface DonutChartProps {
22
- /** Wired into Highcharts' `accessibility.description`. */
23
- description: string;
24
- data: Array<DonutDataPoint>;
25
- /** Applied to the outermost container element for layout/spacing overrides. */
26
- className?: string;
27
- /** Chart height in pixels. Defaults to the donut baseline (270). */
28
- height?: number;
21
+ /**
22
+ * `tooltip` is narrowed to donut's row-typed signature, hence the `Omit` on the
23
+ * tooltip tier (see `shared/chartProps.ts`).
24
+ */
25
+ interface TypeDonutChartProps extends TypeChartBaseProps, TypeChartSizingProps, Omit<TypeChartTooltipDisplayProps, "tooltip">, TypeChartTooltipClickFooterProps {
26
+ data: TypeDonutDataPoint[];
29
27
  /** Controls number/currency/locale formatting for slice values and the center total. */
30
- format?: ValueFormat;
31
- /** Override for the default tooltip content. Receives `DonutChartTooltipProps` including `percent` per row. */
32
- tooltip?: (args: DonutChartTooltipProps) => ReactNode;
33
- /** Footer content shown in the default tooltip when `onClick` is set. */
34
- tooltipClickLabel?: ReactNode;
35
- /** Override for the value shown when a data point is `null`. Defaults to an em-dash. */
36
- invalidNumberLabel?: ReactNode;
28
+ format?: TypeValueFormat;
29
+ /** Override for the default tooltip content. Receives `TypeDonutChartTooltipProps` including `percent` per row. */
30
+ tooltip?: (args: TypeDonutChartTooltipProps) => ReactNode;
37
31
  /** Click handler invoked with the `name` of the clicked slice. */
38
- onClick?: ChartClickHandler<string>;
32
+ onClick?: TypeChartClickHandler<string>;
39
33
  /**
40
34
  * Fired when the pointer enters a slice (also on keyboard focus), with the
41
35
  * slice `name` as `position`.
42
36
  */
43
- onMouseEnter?: ChartHoverHandler<string>;
37
+ onMouseEnter?: TypeChartHoverHandler<string>;
44
38
  /**
45
39
  * Fired when the pointer leaves a slice (also on keyboard blur), with the
46
40
  * slice `name` as `position`.
47
41
  */
48
- onMouseLeave?: ChartHoverHandler<string>;
49
- /**
50
- * Chart title included in the exported image (PNG/SVG/PDF) only — it does
51
- * *not* render on screen. The on-screen title is a React sibling outside the
52
- * chart SVG and can't be captured on export, so `exportTitle` is baked into
53
- * the export clone as a themed native Highcharts title. Omit for no title.
54
- */
55
- exportTitle?: string;
56
- /** Fired once per chart instance with a handle for PNG/SVG/PDF/CSV exports. */
57
- onReady?: (handle: ChartExportHandle) => void;
42
+ onMouseLeave?: TypeChartHoverHandler<string>;
58
43
  }
59
44
 
60
45
  /**
@@ -65,6 +50,6 @@ interface DonutChartProps {
65
50
  * `@sproutsocial/seeds-react-data-viz/chart-styles.css` and `.../donut.css` once
66
51
  * (the component never self-imports its CSS).
67
52
  */
68
- declare const DonutChart: react.NamedExoticComponent<DonutChartProps>;
53
+ declare const DonutChart: react.NamedExoticComponent<TypeDonutChartProps>;
69
54
 
70
- export { ChartClickHandler, ChartExportHandle, ChartHoverHandler, DonutChart, type DonutChartProps, type DonutChartTooltipProps, type DonutChartTooltipRow, type DonutDataPoint, ValueFormat };
55
+ export { DonutChart, TypeChartClickHandler, TypeChartHoverHandler, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeDonutChartTooltipRow, type TypeDonutDataPoint, TypeValueFormat };
@@ -1,60 +1,45 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { V as ValueFormat, C as ChartTooltipProps, a as ChartTooltipDataRow } from '../chartBase-BYipK7MZ.js';
4
- import { C as ChartColorableEntity, a as ChartIconableEntity, b as ChartClickHandler, c as ChartHoverHandler } from '../interactions-pEXA1XxF.js';
5
- import { C as ChartExportHandle } from '../chartExport-CKYpuhik.js';
3
+ import { T as TypeChartBaseProps, a as TypeChartSizingProps, b as TypeChartTooltipDisplayProps, c as TypeChartTooltipClickFooterProps, d as TypeValueFormat, e as TypeChartTooltipRenderProps, f as TypeChartTooltipDataRow } from '../chartProps-C2Lxty-_.js';
4
+ import { T as TypeChartColorableEntity, a as TypeChartIconableEntity, b as TypeChartClickHandler, c as TypeChartHoverHandler } from '../interactions-D2a4O6iM.js';
5
+ export { T as TypeChartExportHandle } from '../chartExport-B0imEQ8Y.js';
6
6
  import '@sproutsocial/seeds-react-icon';
7
7
  import '../types-DxrhdAdn.js';
8
8
  import 'highcharts';
9
9
 
10
- interface DonutDataPoint extends ChartColorableEntity, ChartIconableEntity {
10
+ interface TypeDonutDataPoint extends TypeChartColorableEntity, TypeChartIconableEntity {
11
11
  value: number | null;
12
12
  }
13
13
  /** A donut tooltip row — always carries `percent` (Highcharts computes it for pie series). */
14
- interface DonutChartTooltipRow extends ChartTooltipDataRow {
14
+ interface TypeDonutChartTooltipRow extends TypeChartTooltipDataRow {
15
15
  percent: number;
16
16
  }
17
17
  /** Tooltip render-prop signature for DonutChart. `data` rows always include `percent`. */
18
- interface DonutChartTooltipProps extends Omit<ChartTooltipProps, "data"> {
19
- data: DonutChartTooltipRow[];
18
+ interface TypeDonutChartTooltipProps extends Omit<TypeChartTooltipRenderProps, "data"> {
19
+ data: TypeDonutChartTooltipRow[];
20
20
  }
21
- interface DonutChartProps {
22
- /** Wired into Highcharts' `accessibility.description`. */
23
- description: string;
24
- data: Array<DonutDataPoint>;
25
- /** Applied to the outermost container element for layout/spacing overrides. */
26
- className?: string;
27
- /** Chart height in pixels. Defaults to the donut baseline (270). */
28
- height?: number;
21
+ /**
22
+ * `tooltip` is narrowed to donut's row-typed signature, hence the `Omit` on the
23
+ * tooltip tier (see `shared/chartProps.ts`).
24
+ */
25
+ interface TypeDonutChartProps extends TypeChartBaseProps, TypeChartSizingProps, Omit<TypeChartTooltipDisplayProps, "tooltip">, TypeChartTooltipClickFooterProps {
26
+ data: TypeDonutDataPoint[];
29
27
  /** Controls number/currency/locale formatting for slice values and the center total. */
30
- format?: ValueFormat;
31
- /** Override for the default tooltip content. Receives `DonutChartTooltipProps` including `percent` per row. */
32
- tooltip?: (args: DonutChartTooltipProps) => ReactNode;
33
- /** Footer content shown in the default tooltip when `onClick` is set. */
34
- tooltipClickLabel?: ReactNode;
35
- /** Override for the value shown when a data point is `null`. Defaults to an em-dash. */
36
- invalidNumberLabel?: ReactNode;
28
+ format?: TypeValueFormat;
29
+ /** Override for the default tooltip content. Receives `TypeDonutChartTooltipProps` including `percent` per row. */
30
+ tooltip?: (args: TypeDonutChartTooltipProps) => ReactNode;
37
31
  /** Click handler invoked with the `name` of the clicked slice. */
38
- onClick?: ChartClickHandler<string>;
32
+ onClick?: TypeChartClickHandler<string>;
39
33
  /**
40
34
  * Fired when the pointer enters a slice (also on keyboard focus), with the
41
35
  * slice `name` as `position`.
42
36
  */
43
- onMouseEnter?: ChartHoverHandler<string>;
37
+ onMouseEnter?: TypeChartHoverHandler<string>;
44
38
  /**
45
39
  * Fired when the pointer leaves a slice (also on keyboard blur), with the
46
40
  * slice `name` as `position`.
47
41
  */
48
- onMouseLeave?: ChartHoverHandler<string>;
49
- /**
50
- * Chart title included in the exported image (PNG/SVG/PDF) only — it does
51
- * *not* render on screen. The on-screen title is a React sibling outside the
52
- * chart SVG and can't be captured on export, so `exportTitle` is baked into
53
- * the export clone as a themed native Highcharts title. Omit for no title.
54
- */
55
- exportTitle?: string;
56
- /** Fired once per chart instance with a handle for PNG/SVG/PDF/CSV exports. */
57
- onReady?: (handle: ChartExportHandle) => void;
42
+ onMouseLeave?: TypeChartHoverHandler<string>;
58
43
  }
59
44
 
60
45
  /**
@@ -65,6 +50,6 @@ interface DonutChartProps {
65
50
  * `@sproutsocial/seeds-react-data-viz/chart-styles.css` and `.../donut.css` once
66
51
  * (the component never self-imports its CSS).
67
52
  */
68
- declare const DonutChart: react.NamedExoticComponent<DonutChartProps>;
53
+ declare const DonutChart: react.NamedExoticComponent<TypeDonutChartProps>;
69
54
 
70
- export { ChartClickHandler, ChartExportHandle, ChartHoverHandler, DonutChart, type DonutChartProps, type DonutChartTooltipProps, type DonutChartTooltipRow, type DonutDataPoint, ValueFormat };
55
+ export { DonutChart, TypeChartClickHandler, TypeChartHoverHandler, type TypeDonutChartProps, type TypeDonutChartTooltipProps, type TypeDonutChartTooltipRow, type TypeDonutDataPoint, TypeValueFormat };
@@ -1,21 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunk6EIJCJCNjs = require('../chunk-6EIJCJCN.js');
3
+ var _chunkI72SSPMXjs = require('../chunk-I72SSPMX.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunk5TWNMPQUjs = require('../chunk-5TWNMPQU.js');
8
+ var _chunkV5EXL244js = require('../chunk-V5EXL244.js');
9
9
 
10
10
 
11
- var _chunk34OKRQETjs = require('../chunk-34OKRQET.js');
11
+ var _chunkXH7ZKGHDjs = require('../chunk-XH7ZKGHD.js');
12
12
 
13
13
  // src/charts/donut/DonutChart.tsx
14
14
  var _react = require('react');
15
15
 
16
16
  // src/charts/donut/adapter.ts
17
17
  function buildDonutOptions(props, colors) {
18
- const base = _chunk5TWNMPQUjs.buildBaseChartOptions.call(void 0, {
18
+ const base = _chunkV5EXL244js.buildBaseChartOptions.call(void 0, {
19
19
  type: "pie",
20
20
  description: props.description
21
21
  });
@@ -28,7 +28,7 @@ function buildDonutOptions(props, colors) {
28
28
  // Height only — width is left fluid so the chart fills its container and
29
29
  // the pie auto-centers. The container bounds the width (see styles.ts) so
30
30
  // the legend below wraps to the donut and centers with it.
31
- height: _nullishCoalesce(props.height, () => ( _chunk34OKRQETjs.DONUT_CHART_HEIGHT)),
31
+ height: _nullishCoalesce(props.height, () => ( _chunkXH7ZKGHDjs.DONUT_CHART_HEIGHT)),
32
32
  // Drop Highcharts' default spacing so the donut uses the full height.
33
33
  spacing: [0, 0, 0, 0]
34
34
  },
@@ -74,7 +74,7 @@ function buildDonutOptions(props, colors) {
74
74
  // src/charts/donut/DonutChart.tsx
75
75
  var _jsxruntime = require('react/jsx-runtime');
76
76
  var DonutChart = _react.memo.call(void 0, function DonutChart2(props) {
77
- const { colors } = _chunk5TWNMPQUjs.useSeedsChartSetup.call(void 0, {
77
+ const { colors } = _chunkV5EXL244js.useSeedsChartSetup.call(void 0, {
78
78
  series: props.data.map((d) => ({ color: d.color }))
79
79
  });
80
80
  const options = _react.useMemo.call(void 0,
@@ -82,7 +82,7 @@ var DonutChart = _react.memo.call(void 0, function DonutChart2(props) {
82
82
  [props, colors]
83
83
  );
84
84
  const hasOnClick = Boolean(props.onClick);
85
- const containerProps = _chunk6EIJCJCNjs.getChartContainerProps.call(void 0, {
85
+ const containerProps = _chunkI72SSPMXjs.getChartContainerProps.call(void 0, {
86
86
  familyClasses: ["seeds-chart-donut"],
87
87
  colors: props.data.map((d) => d.color),
88
88
  hasOnClick,
@@ -90,7 +90,7 @@ var DonutChart = _react.memo.call(void 0, function DonutChart2(props) {
90
90
  });
91
91
  const tooltip = props.tooltip ? (args) => props.tooltip(args) : void 0;
92
92
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ...containerProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
93
- _chunk5TWNMPQUjs.ChartRenderer,
93
+ _chunkV5EXL244js.ChartRenderer,
94
94
  {
95
95
  options,
96
96
  series: props.data.map((d, i) => ({
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/donut/index.js","../../src/charts/donut/DonutChart.tsx","../../src/charts/donut/adapter.ts"],"names":["DonutChart"],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACA;ACZA,8BAA8B;ADc9B;AACA;AEVO,SAAS,iBAAA,CACd,KAAA,EACA,MAAA,EACmB;AACnB,EAAA,MAAM,KAAA,EAAO,oDAAA;AAAsB,IACjC,IAAA,EAAM,KAAA;AAAA,IACN,WAAA,EAAa,KAAA,CAAM;AAAA,EACrB,CAAC,CAAA;AACD,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,KAAA;AAAA,MACN,UAAA,EAAY,IAAA;AAAA,MACZ,SAAA,EAAW,KAAA;AAAA;AAAA;AAAA;AAAA,MAIX,MAAA,mBAAQ,KAAA,CAAM,MAAA,UAAU,qCAAA;AAAA;AAAA,MAExB,OAAA,EAAS,CAAC,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAC;AAAA,IACtB,CAAA;AAAA,IACA,WAAA,EAAa;AAAA,MACX,GAAA,EAAK;AAAA,QACH,SAAA,EAAW,KAAA;AAAA;AAAA;AAAA,QAGX,YAAA,EAAc,CAAA;AAAA,QACd,UAAA,EAAY,EAAE,OAAA,EAAS,MAAM,CAAA;AAAA,QAC7B,SAAA,EAAW,KAAA;AAAA,QACX,GAAI,KAAA,CAAM,QAAA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ACV,CAAA,CAAE,CAAA;AAAA,MACF,MAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,iBAAA,EAAmB,KAAA,CAAM,iBAAA;AAAA,MACzB,kBAAA,EAAoB,KAAA,CAAM,kBAAA;AAAA,MAC1B,WAAA,EAAa,KAAA,CAAM,MAAA;AAAA,MACnB,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,MACnB,OAAA,EAAS,KAAA,CAAM;AAAA,IAAA;AAAA,EACjB,EAAA,CACF,CAAA;AAEJ,CAAC,CAAA;ADwCD;AACE;AACF,gCAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/donut/index.js","sourcesContent":[null,"import { memo, useMemo } from \"react\";\nimport {\n useSeedsChartSetup,\n ChartRenderer,\n type ChartTooltipProps,\n} from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildDonutOptions } from \"./adapter\";\nimport type { DonutChartProps, DonutChartTooltipProps } from \"./types\";\n\n/**\n * DonutChart renders a donut (ring) chart from a flat list of named values.\n *\n * Like SparklineChart, it carries no `styled-components`: the wrapper is a plain\n * `<div>` and the Highcharts styling ships as static CSS. Consumers import both\n * `@sproutsocial/seeds-react-data-viz/chart-styles.css` and `.../donut.css` once\n * (the component never self-imports its CSS).\n */\nexport const DonutChart = memo(function DonutChart(props: DonutChartProps) {\n // Map each data item to { color? } so useSeedsChartSetup resolves the palette\n // used for the Highcharts options and the legend swatches.\n const { colors } = useSeedsChartSetup({\n series: props.data.map((d) => ({ color: d.color })),\n });\n\n // Memoize to avoid spurious Highcharts redraws on parent re-renders.\n const options = useMemo(\n () => buildDonutOptions(props, colors),\n [props, colors]\n );\n const hasOnClick = Boolean(props.onClick);\n\n // Container props from the shared contract. RAW per-series colors only —\n // an unset series falls through to chart-styles.css's --highcharts-color-N\n // default (the DS data-viz palette, light/dark-correct), matching the\n // bar/line-area convention. Only an explicit consumer override is inlined.\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-donut\"],\n colors: props.data.map((d) => d.color),\n hasOnClick,\n className: props.className,\n });\n\n // `ChartRenderer` expects `(ChartTooltipProps) => ReactNode`. The consumer's\n // function expects the narrower `DonutChartTooltipProps` (required `percent`).\n // Wrap rather than cast the function type so the intent is explicit.\n const tooltip = props.tooltip\n ? (args: ChartTooltipProps) =>\n props.tooltip!(args as unknown as DonutChartTooltipProps)\n : undefined;\n\n return (\n <div {...containerProps}>\n <ChartRenderer\n options={options}\n series={props.data.map((d, i) => ({\n name: d.name,\n color: colors[i],\n icon: d.icon,\n }))}\n colors={colors}\n tooltip={tooltip}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.format}\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import type { SeedsChartOptions } from \"../shared/chartBase\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport { DONUT_CHART_HEIGHT } from \"../../constants/chartOptions\";\nimport type { DonutChartProps } from \"./types\";\n\nexport function buildDonutOptions(\n props: DonutChartProps,\n colors: ReadonlyArray<string>\n): SeedsChartOptions {\n const base = buildBaseChartOptions({\n type: \"pie\",\n description: props.description,\n });\n return {\n ...base,\n chart: {\n type: \"pie\" as const,\n styledMode: true,\n animation: false,\n // Height only — width is left fluid so the chart fills its container and\n // the pie auto-centers. The container bounds the width (see styles.ts) so\n // the legend below wraps to the donut and centers with it.\n height: props.height ?? DONUT_CHART_HEIGHT,\n // Drop Highcharts' default spacing so the donut uses the full height.\n spacing: [0, 0, 0, 0],\n },\n plotOptions: {\n pie: {\n animation: false,\n // borderRadius must be set in JS, not CSS, because Highcharts computes\n // the arc path before applying it — CSS border-radius has no effect.\n borderRadius: 0,\n dataLabels: { enabled: false },\n innerSize: \"50%\",\n ...(props.onClick || props.onMouseEnter || props.onMouseLeave\n ? {\n point: {\n events: {\n click: props.onClick\n ? function (this: { name: string }) {\n props.onClick!({ position: this.name });\n }\n : undefined,\n mouseOver: props.onMouseEnter\n ? function (this: { name: string }) {\n props.onMouseEnter!({ position: this.name });\n }\n : undefined,\n mouseOut: props.onMouseLeave\n ? function (this: { name: string }) {\n props.onMouseLeave!({ position: this.name });\n }\n : undefined,\n },\n },\n }\n : {}),\n },\n },\n series: [\n {\n type: \"pie\",\n name: \"Data\",\n data: props.data.map((d, i) => ({\n name: d.name,\n y: d.value,\n color: d.color ?? colors[i] ?? \"\",\n })),\n },\n ],\n };\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/donut/index.js","../../src/charts/donut/DonutChart.tsx","../../src/charts/donut/adapter.ts"],"names":["DonutChart"],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACA;ACZA,8BAA8B;ADc9B;AACA;AEVO,SAAS,iBAAA,CACd,KAAA,EACA,MAAA,EACuB;AACvB,EAAA,MAAM,KAAA,EAAO,oDAAA;AAAsB,IACjC,IAAA,EAAM,KAAA;AAAA,IACN,WAAA,EAAa,KAAA,CAAM;AAAA,EACrB,CAAC,CAAA;AACD,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,KAAA;AAAA,MACN,UAAA,EAAY,IAAA;AAAA,MACZ,SAAA,EAAW,KAAA;AAAA;AAAA;AAAA;AAAA,MAIX,MAAA,mBAAQ,KAAA,CAAM,MAAA,UAAU,qCAAA;AAAA;AAAA,MAExB,OAAA,EAAS,CAAC,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAC;AAAA,IACtB,CAAA;AAAA,IACA,WAAA,EAAa;AAAA,MACX,GAAA,EAAK;AAAA,QACH,SAAA,EAAW,KAAA;AAAA;AAAA;AAAA,QAGX,YAAA,EAAc,CAAA;AAAA,QACd,UAAA,EAAY,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IAAA;AAAA,QACR,KAAA,EAAO,MAAA,CAAO,CAAC,CAAA;AAAA,QACf,IAAA,EAAM,CAAA,CAAE;AAAA,MACV,CAAA,CAAE,CAAA;AAAA,MACF,MAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,iBAAA,EAAmB,KAAA,CAAM,iBAAA;AAAA,MACzB,kBAAA,EAAoB,KAAA,CAAM,kBAAA;AAAA,MAC1B,WAAA,EAAa,KAAA,CAAM,MAAA;AAAA,MACnB,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,MACnB,OAAA,EAAS,KAAA,CAAM;AAAA,IAAA;AAAA,EACjB,EAAA,CACF,CAAA;AAEJ,CAAC,CAAA;AD2CD;AACE;AACF,gCAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/donut/index.js","sourcesContent":[null,"import { memo, useMemo } from \"react\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport type { TypeChartTooltipRenderProps } from \"../shared/chartTooltip\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildDonutOptions } from \"./adapter\";\nimport type { TypeDonutChartProps, TypeDonutChartTooltipProps } from \"./types\";\n\n/**\n * DonutChart renders a donut (ring) chart from a flat list of named values.\n *\n * Like SparklineChart, it carries no `styled-components`: the wrapper is a plain\n * `<div>` and the Highcharts styling ships as static CSS. Consumers import both\n * `@sproutsocial/seeds-react-data-viz/chart-styles.css` and `.../donut.css` once\n * (the component never self-imports its CSS).\n */\nexport const DonutChart = memo(function DonutChart(props: TypeDonutChartProps) {\n // Map each data item to { color? } so useSeedsChartSetup resolves the palette\n // used for the Highcharts options and the legend swatches.\n const { colors } = useSeedsChartSetup({\n series: props.data.map((d) => ({ color: d.color })),\n });\n\n // Memoize to avoid spurious Highcharts redraws on parent re-renders.\n const options = useMemo(\n () => buildDonutOptions(props, colors),\n [props, colors]\n );\n const hasOnClick = Boolean(props.onClick);\n\n // Container props from the shared contract. RAW per-series colors only —\n // an unset series falls through to chart-styles.css's --highcharts-color-N\n // default (the DS data-viz palette, light/dark-correct), matching the\n // bar/line-area convention. Only an explicit consumer override is inlined.\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-donut\"],\n colors: props.data.map((d) => d.color),\n hasOnClick,\n className: props.className,\n });\n\n // `ChartRenderer` expects `(TypeChartTooltipRenderProps) => ReactNode`. The consumer's\n // function expects the narrower `TypeDonutChartTooltipProps` (required `percent`).\n // Wrap rather than cast the function type so the intent is explicit.\n const tooltip = props.tooltip\n ? (args: TypeChartTooltipRenderProps) =>\n props.tooltip!(args as unknown as TypeDonutChartTooltipProps)\n : undefined;\n\n return (\n <div {...containerProps}>\n <ChartRenderer\n options={options}\n series={props.data.map((d, i) => ({\n name: d.name,\n color: colors[i],\n icon: d.icon,\n }))}\n colors={colors}\n tooltip={tooltip}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.format}\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import type { TypeSeedsChartOptions } from \"../shared/chartBase\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport { DONUT_CHART_HEIGHT } from \"../../constants/chartOptions\";\nimport type { TypeDonutChartProps } from \"./types\";\n\nexport function buildDonutOptions(\n props: TypeDonutChartProps,\n colors: readonly string[]\n): TypeSeedsChartOptions {\n const base = buildBaseChartOptions({\n type: \"pie\",\n description: props.description,\n });\n return {\n ...base,\n chart: {\n type: \"pie\" as const,\n styledMode: true,\n animation: false,\n // Height only — width is left fluid so the chart fills its container and\n // the pie auto-centers. The container bounds the width (see styles.ts) so\n // the legend below wraps to the donut and centers with it.\n height: props.height ?? DONUT_CHART_HEIGHT,\n // Drop Highcharts' default spacing so the donut uses the full height.\n spacing: [0, 0, 0, 0],\n },\n plotOptions: {\n pie: {\n animation: false,\n // borderRadius must be set in JS, not CSS, because Highcharts computes\n // the arc path before applying it — CSS border-radius has no effect.\n borderRadius: 0,\n dataLabels: { enabled: false },\n innerSize: \"50%\",\n ...(props.onClick || props.onMouseEnter || props.onMouseLeave\n ? {\n point: {\n events: {\n click: props.onClick\n ? function (this: { name: string }) {\n props.onClick!({ position: this.name });\n }\n : undefined,\n mouseOver: props.onMouseEnter\n ? function (this: { name: string }) {\n props.onMouseEnter!({ position: this.name });\n }\n : undefined,\n mouseOut: props.onMouseLeave\n ? function (this: { name: string }) {\n props.onMouseLeave!({ position: this.name });\n }\n : undefined,\n },\n },\n }\n : {}),\n },\n },\n series: [\n {\n type: \"pie\",\n name: \"Data\",\n data: props.data.map((d, i) => ({\n name: d.name,\n y: d.value,\n color: d.color ?? colors[i] ?? \"\",\n })),\n },\n ],\n };\n}\n"]}
@@ -2,22 +2,22 @@ import {
2
2
  buildAnnotationConfig,
3
3
  defaultValueAxisLabelFormatter,
4
4
  makeValueAxisLabelFormatter
5
- } from "../chunk-MVNO5UV6.js";
5
+ } from "../chunk-NBMVFYDJ.js";
6
6
  import {
7
7
  buildDimensionalAxis,
8
8
  resolveTooltipOptions
9
- } from "../chunk-AL3OTBTT.js";
9
+ } from "../chunk-THDIQMFN.js";
10
10
  import {
11
11
  getChartContainerProps
12
- } from "../chunk-P3MVYSHX.js";
12
+ } from "../chunk-37QVUJXM.js";
13
13
  import {
14
14
  ChartRenderer,
15
15
  buildBaseChartOptions,
16
16
  useSeedsChartSetup
17
- } from "../chunk-CYCKJ5ML.js";
17
+ } from "../chunk-YCYACOQU.js";
18
18
  import {
19
19
  TIME_SERIES_CHART_HEIGHT
20
- } from "../chunk-332X77M5.js";
20
+ } from "../chunk-JNQC3ZRQ.js";
21
21
 
22
22
  // src/charts/bar/BarChart.tsx
23
23
  import { memo } from "react";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/charts/bar/BarChart.tsx","../../../src/charts/bar/adapter.ts","../../../src/charts/constants.ts"],"sourcesContent":["import { memo } from \"react\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildBarChartOptions } from \"./adapter\";\nimport type { BarChartProps } from \"./types\";\nimport { BAR_CHART_DEFAULT_SERIES_LIMIT } from \"../constants\";\n\nexport const BarChart = memo(function BarChart(props: BarChartProps) {\n // The shared hook caps the series to the limit (and warns once per render\n // when the default is exceeded without an explicit override) so the adapter\n // and renderer below all consume the capped data.\n const seriesLimit = props.seriesLimit ?? BAR_CHART_DEFAULT_SERIES_LIMIT;\n const { colors, series } = useSeedsChartSetup({\n series: props.series,\n seriesLimit,\n isSeriesLimitOverridden: props.seriesLimit !== undefined,\n hideSeriesLimitWarning: props.hideSeriesLimitWarning,\n componentName: \"BarChart\",\n });\n\n const { options, annotationLookup, tooltipOptions } = buildBarChartOptions(\n props,\n props.direction ?? \"vertical\",\n series\n );\n const hasOnClick = Boolean(props.onClick);\n\n // Plain <div> consuming the shared chart-styles.css contract via\n // getChartContainerProps. Colors are the RAW per-series colors (undefined when\n // unset, so only explicit overrides inline --highcharts-color-N), NOT the\n // palette-resolved `colors` passed to ChartRenderer. Neither stylesheet is\n // self-imported (consumers import both).\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-time-series\", \"seeds-chart-bar\"],\n colors: series.map((s) => s.color),\n hasOnClick,\n className: props.className,\n });\n\n return (\n <div {...containerProps}>\n <ChartRenderer\n options={options}\n series={series}\n colors={colors}\n tooltip={props.tooltip}\n annotationLookup={annotationLookup}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n tooltipOptions={tooltipOptions}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.yAxis?.format}\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import { buildAnnotationConfig } from \"../shared/annotations\";\nimport type { ChartAnnotationLookup } from \"../shared/annotations\";\nimport type {\n ChartTooltipProps,\n SeedsChartColumnPlotOptions,\n SeedsChartOptions,\n} from \"../shared/chartBase\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport { TIME_SERIES_CHART_HEIGHT } from \"../../constants/chartOptions\";\nimport {\n buildDimensionalAxis,\n resolveTooltipOptions,\n} from \"../shared/axisOptions\";\nimport {\n defaultValueAxisLabelFormatter,\n makeValueAxisLabelFormatter,\n} from \"../shared/valueAxisLabelFormatter\";\nimport type { BarChartDirection, BarChartProps } from \"./types\";\n\n// Maps the public `direction` to the Highcharts series/chart type. Highcharts\n// `bar` is a horizontally-oriented `column`: it performs the visual rotation\n// while keeping axis roles (xAxis = category, yAxis = value), so the rest of the\n// adapter is direction-agnostic.\nfunction highchartsType(direction: BarChartDirection): \"column\" | \"bar\" {\n return direction === \"horizontal\" ? \"bar\" : \"column\";\n}\n\nexport function buildBarChartOptions(\n props: BarChartProps,\n direction: BarChartDirection,\n // The (already-capped) series to render. Defaults to `props.series` so the\n // ~40 existing call sites keep working; the component passes the capped\n // series from `useSeedsChartSetup` explicitly.\n series: BarChartProps[\"series\"] = props.series\n): {\n options: SeedsChartOptions;\n annotationLookup: ChartAnnotationLookup | undefined;\n /** Resolved datetime-derived tooltip options (timezone / timeFormat / textLocale); all undefined on category axes. */\n tooltipOptions: Pick<\n ChartTooltipProps,\n \"timezone\" | \"timeFormat\" | \"textLocale\"\n >;\n} {\n const chartType = highchartsType(direction);\n const isDatetime = props.xAxis.type === \"datetime\";\n // Gate the `onMouseEnter`/`onMouseLeave` `series` field on the *rendered*\n // (already-capped) series count, not `props.series` — if `seriesLimit` caps a\n // multi-series input down to one rendered series the chart is effectively\n // single-series, and `series` must be absent per the \"present only for\n // multi-series bar\" contract.\n const isMultiSeries = series.length > 1;\n const tooltipOptions = resolveTooltipOptions(props);\n const { annotations, lookup: annotationLookup } = buildAnnotationConfig(\n props.annotations\n );\n // `column` (vertical) and `bar` (horizontal) take the same option shape, so a\n // single config is assigned under the active direction's key. Typed\n // explicitly so the `point.events` handlers below keep their `this`/`event`\n // contextual types (a computed `[chartType]` key would otherwise erase them).\n const barTypeConfig: SeedsChartColumnPlotOptions = {\n // \"grouped\" maps to omitting `stacking` — Highcharts renders multi-series\n // columns side-by-side when no stacking is set.\n ...(props.stacking === \"grouped\"\n ? {}\n : { stacking: props.stacking ?? \"normal\" }),\n // Horizontal bars are height-constrained (fixed chart height ÷ categories),\n // so the same padding fractions that work for columns produce hairline bars.\n pointPadding: direction === \"horizontal\" ? 0.05 : 0.25,\n groupPadding: direction === \"horizontal\" ? 0.1 : 0.25,\n // Fixed bar width on datetime axes. Sparse time-series otherwise size\n // columns from the (large) gap between points and balloon; a fixed\n // pointWidth: 20 gives a consistent time-series treatment. Dense datetime\n // data may instead want a maxPointWidth cap — revisit when Line/Area land.\n ...(isDatetime ? { pointWidth: 20 } : {}),\n borderRadius: 4,\n borderWidth: 0,\n // Pairs with the `:hover` dimming rule in `styles.ts`: while the cursor\n // is over the chart, all bars dim; these handlers restore opacity for\n // every bar at the hovered x (so stacked/grouped bars highlight together\n // rather than just the single hovered bar).\n point: {\n events: {\n click: props.onClick\n ? (event) => props.onClick!({ position: event.point.x })\n : undefined,\n mouseOver: function () {\n const x = this.x;\n props.onMouseEnter?.({\n position: x,\n // Omit the key entirely (not `series: undefined`) for single-series\n // so consumers testing `\"series\" in payload` see the contract.\n ...(isMultiSeries\n ? {\n series: { name: this.series.name, index: this.series.index },\n }\n : {}),\n });\n this.series.chart.series.forEach((s) => {\n if (s.type !== chartType) return;\n s.data.forEach((point) => {\n if (point.x !== x) return;\n point.graphic?.element?.classList.add(\"bar-point-hover\");\n });\n });\n },\n mouseOut: function () {\n props.onMouseLeave?.({\n position: this.x,\n ...(isMultiSeries\n ? {\n series: { name: this.series.name, index: this.series.index },\n }\n : {}),\n });\n this.series.chart.series.forEach((s) => {\n if (s.type !== chartType) return;\n s.data.forEach((point) => {\n point.graphic?.element?.classList.remove(\"bar-point-hover\");\n });\n });\n },\n },\n },\n };\n const base = buildBaseChartOptions({\n type: chartType,\n description: props.description,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipOptions.timezone,\n });\n\n const options: SeedsChartOptions = {\n ...base,\n // Default height baseline (overridable via `props.height`) so consumers\n // who don't configure sizing keep the design-reviewed default.\n chart: {\n ...base.chart,\n // Re-assert the definite `type` so spreading the optionally-typed\n // `base.chart` doesn't widen the required `type` field to optional.\n type: chartType,\n height: props.height ?? TIME_SERIES_CHART_HEIGHT,\n // Tight time-series spacing (from constants/chartOptions.ts) so the plot\n // area fills the 275px container; without it Highcharts' larger default\n // spacing ([10, 10, 15, 10]) shrinks the plot area.\n spacing: [5, 1, 0, 2],\n },\n xAxis: buildDimensionalAxis(props.xAxis, tooltipOptions.timezone ?? \"UTC\"),\n yAxis: {\n min: props.yAxis?.min,\n max: props.yAxis?.max,\n gridLineWidth: props.yAxis?.showGridLines === false ? 0 : 1,\n // A dedicated plotLine at 0, styled distinctly from regular gridlines\n // (see chartStyles.ts).\n plotLines: [{ value: 0, className: \"y-axis-zero-line\", zIndex: 3 }],\n title: { text: props.yAxis?.title ?? \"\" },\n labels: {\n // `showLabels` toggles tick-label visibility; defaults to shown.\n enabled: props.yAxis?.showLabels !== false,\n // A declarative `format` drives ticks through the shared valueFormatter;\n // absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).\n formatter: props.yAxis?.format\n ? makeValueAxisLabelFormatter(props.yAxis.format)\n : defaultValueAxisLabelFormatter,\n },\n },\n plotOptions: {\n series: { animation: false },\n [chartType]: barTypeConfig,\n },\n series: series.map((s) => ({\n type: chartType,\n name: s.name,\n data: [...s.data],\n color: s.color,\n })),\n ...(annotations ? { annotations } : {}),\n };\n\n return { options, annotationLookup, tooltipOptions };\n}\n","export const BAR_CHART_DEFAULT_SERIES_LIMIT = 10;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;;;ACuBrB,SAAS,eAAe,WAAgD;AACtE,SAAO,cAAc,eAAe,QAAQ;AAC9C;AAEO,SAAS,qBACd,OACA,WAIA,SAAkC,M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A,MACnB,SAAS,MAAM;AAAA;AAAA,EACjB,GACF;AAEJ,CAAC;","names":["BarChart"]}
1
+ {"version":3,"sources":["../../../src/charts/bar/BarChart.tsx","../../../src/charts/bar/adapter.ts","../../../src/charts/constants.ts"],"sourcesContent":["import { memo } from \"react\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildBarChartOptions } from \"./adapter\";\nimport type { TypeBarChartProps } from \"./types\";\nimport { BAR_CHART_DEFAULT_SERIES_LIMIT } from \"../constants\";\n\nexport const BarChart = memo(function BarChart(props: TypeBarChartProps) {\n // The shared hook caps the series to the limit (and warns once per render\n // when the default is exceeded without an explicit override) so the adapter\n // and renderer below all consume the capped data.\n const seriesLimit = props.seriesLimit ?? BAR_CHART_DEFAULT_SERIES_LIMIT;\n const { colors, series } = useSeedsChartSetup({\n series: props.series,\n seriesLimit,\n isSeriesLimitOverridden: props.seriesLimit !== undefined,\n hideSeriesLimitWarning: props.hideSeriesLimitWarning,\n componentName: \"BarChart\",\n });\n\n const { options, annotationLookup, tooltipOptions } = buildBarChartOptions(\n props,\n props.direction ?? \"vertical\",\n series\n );\n const hasOnClick = Boolean(props.onClick);\n\n // Plain <div> consuming the shared chart-styles.css contract via\n // getChartContainerProps. Colors are the RAW per-series colors (undefined when\n // unset, so only explicit overrides inline --highcharts-color-N), NOT the\n // palette-resolved `colors` passed to ChartRenderer. Neither stylesheet is\n // self-imported (consumers import both).\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-time-series\", \"seeds-chart-bar\"],\n colors: series.map((s) => s.color),\n hasOnClick,\n className: props.className,\n });\n\n return (\n <div {...containerProps}>\n <ChartRenderer\n options={options}\n series={series}\n colors={colors}\n tooltip={props.tooltip}\n annotationLookup={annotationLookup}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n tooltipOptions={tooltipOptions}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.yAxis?.format}\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import { buildAnnotationConfig } from \"../shared/annotations\";\nimport type { TypeChartAnnotationLookup } from \"../shared/annotations\";\nimport type {\n TypeSeedsChartColumnPlotOptions,\n TypeSeedsChartOptions,\n} from \"../shared/chartBase\";\nimport type { TypeChartTooltipRenderProps } from \"../shared/chartTooltip\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport { TIME_SERIES_CHART_HEIGHT } from \"../../constants/chartOptions\";\nimport {\n buildDimensionalAxis,\n resolveTooltipOptions,\n} from \"../shared/axisOptions\";\nimport {\n defaultValueAxisLabelFormatter,\n makeValueAxisLabelFormatter,\n} from \"../shared/valueAxisLabelFormatter\";\nimport type { TypeBarChartDirection, TypeBarChartProps } from \"./types\";\n\n// Maps the public `direction` to the Highcharts series/chart type. Highcharts\n// `bar` is a horizontally-oriented `column`: it performs the visual rotation\n// while keeping axis roles (xAxis = category, yAxis = value), so the rest of the\n// adapter is direction-agnostic.\nfunction highchartsType(direction: TypeBarChartDirection): \"column\" | \"bar\" {\n return direction === \"horizontal\" ? \"bar\" : \"column\";\n}\n\nexport function buildBarChartOptions(\n props: TypeBarChartProps,\n direction: TypeBarChartDirection,\n // The (already-capped) series to render. Defaults to `props.series` so the\n // ~40 existing call sites keep working; the component passes the capped\n // series from `useSeedsChartSetup` explicitly.\n series: TypeBarChartProps[\"series\"] = props.series\n): {\n options: TypeSeedsChartOptions;\n annotationLookup: TypeChartAnnotationLookup | undefined;\n /** Resolved datetime-derived tooltip options (timezone / timeFormat / textLocale); all undefined on category axes. */\n tooltipOptions: Pick<\n TypeChartTooltipRenderProps,\n \"timezone\" | \"timeFormat\" | \"textLocale\"\n >;\n} {\n const chartType = highchartsType(direction);\n const isDatetime = props.xAxis.type === \"datetime\";\n // Gate the `onMouseEnter`/`onMouseLeave` `series` field on the *rendered*\n // (already-capped) series count, not `props.series` — if `seriesLimit` caps a\n // multi-series input down to one rendered series the chart is effectively\n // single-series, and `series` must be absent per the \"present only for\n // multi-series bar\" contract.\n const isMultiSeries = series.length > 1;\n const tooltipOptions = resolveTooltipOptions(props);\n const { annotations, lookup: annotationLookup } = buildAnnotationConfig(\n props.annotations\n );\n // `column` (vertical) and `bar` (horizontal) take the same option shape, so a\n // single config is assigned under the active direction's key. Typed\n // explicitly so the `point.events` handlers below keep their `this`/`event`\n // contextual types (a computed `[chartType]` key would otherwise erase them).\n const barTypeConfig: TypeSeedsChartColumnPlotOptions = {\n // \"grouped\" maps to omitting `stacking` — Highcharts renders multi-series\n // columns side-by-side when no stacking is set.\n ...(props.stacking === \"grouped\"\n ? {}\n : { stacking: props.stacking ?? \"normal\" }),\n // Horizontal bars are height-constrained (fixed chart height ÷ categories),\n // so the same padding fractions that work for columns produce hairline bars.\n pointPadding: direction === \"horizontal\" ? 0.05 : 0.25,\n groupPadding: direction === \"horizontal\" ? 0.1 : 0.25,\n // Fixed bar width on datetime axes. Sparse time-series otherwise size\n // columns from the (large) gap between points and balloon; a fixed\n // pointWidth: 20 gives a consistent time-series treatment. Dense datetime\n // data may instead want a maxPointWidth cap — revisit when Line/Area land.\n ...(isDatetime ? { pointWidth: 20 } : {}),\n borderRadius: 4,\n borderWidth: 0,\n // Pairs with the `:hover` dimming rule in `styles.ts`: while the cursor\n // is over the chart, all bars dim; these handlers restore opacity for\n // every bar at the hovered x (so stacked/grouped bars highlight together\n // rather than just the single hovered bar).\n point: {\n events: {\n click: props.onClick\n ? (event) => props.onClick!({ position: event.point.x })\n : undefined,\n mouseOver: function () {\n const x = this.x;\n props.onMouseEnter?.({\n position: x,\n // Omit the key entirely (not `series: undefined`) for single-series\n // so consumers testing `\"series\" in payload` see the contract.\n ...(isMultiSeries\n ? {\n series: { name: this.series.name, index: this.series.index },\n }\n : {}),\n });\n this.series.chart.series.forEach((s) => {\n if (s.type !== chartType) return;\n s.data.forEach((point) => {\n if (point.x !== x) return;\n point.graphic?.element?.classList.add(\"bar-point-hover\");\n });\n });\n },\n mouseOut: function () {\n props.onMouseLeave?.({\n position: this.x,\n ...(isMultiSeries\n ? {\n series: { name: this.series.name, index: this.series.index },\n }\n : {}),\n });\n this.series.chart.series.forEach((s) => {\n if (s.type !== chartType) return;\n s.data.forEach((point) => {\n point.graphic?.element?.classList.remove(\"bar-point-hover\");\n });\n });\n },\n },\n },\n };\n const base = buildBaseChartOptions({\n type: chartType,\n description: props.description,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipOptions.timezone,\n });\n\n const options: TypeSeedsChartOptions = {\n ...base,\n // Default height baseline (overridable via `props.height`) so consumers\n // who don't configure sizing keep the design-reviewed default.\n chart: {\n ...base.chart,\n // Re-assert the definite `type` so spreading the optionally-typed\n // `base.chart` doesn't widen the required `type` field to optional.\n type: chartType,\n height: props.height ?? TIME_SERIES_CHART_HEIGHT,\n // Tight time-series spacing (from constants/chartOptions.ts) so the plot\n // area fills the 275px container; without it Highcharts' larger default\n // spacing ([10, 10, 15, 10]) shrinks the plot area.\n spacing: [5, 1, 0, 2],\n },\n xAxis: buildDimensionalAxis(props.xAxis, tooltipOptions.timezone ?? \"UTC\"),\n yAxis: {\n min: props.yAxis?.min,\n max: props.yAxis?.max,\n gridLineWidth: props.yAxis?.showGridLines === false ? 0 : 1,\n // A dedicated plotLine at 0, styled distinctly from regular gridlines\n // (see chartStyles.ts).\n plotLines: [{ value: 0, className: \"y-axis-zero-line\", zIndex: 3 }],\n title: { text: props.yAxis?.title ?? \"\" },\n labels: {\n // `showLabels` toggles tick-label visibility; defaults to shown.\n enabled: props.yAxis?.showLabels !== false,\n // A declarative `format` drives ticks through the shared valueFormatter;\n // absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).\n formatter: props.yAxis?.format\n ? makeValueAxisLabelFormatter(props.yAxis.format)\n : defaultValueAxisLabelFormatter,\n },\n },\n plotOptions: {\n series: { animation: false },\n [chartType]: barTypeConfig,\n },\n series: series.map((s) => ({\n type: chartType,\n name: s.name,\n data: [...s.data],\n color: s.color,\n })),\n ...(annotations ? { annotations } : {}),\n };\n\n return { options, annotationLookup, tooltipOptions };\n}\n","export const BAR_CHART_DEFAULT_SERIES_LIMIT = 10;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;;;ACuBrB,SAAS,eAAe,WAAoD;AAC1E,SAAO,cAAc,eAAe,QAAQ;AAC9C;AAEO,SAAS,qBACd,OACA,WAIA,SAAsC,MAAM,QAS5C;AACA,QAAM,YAAY,eAAe,SAAS;AAC1C,QAAM,aAAa,MAAM,MAAM,SAAS;AAMxC,QAAM,gBAAgB,OAAO,SAAS;AACtC,QAAM,iBAAiB,sBAAsB,KAAK;AAClD,QAAM,EAAE,aAAa,QAAQ,iBAAiB,IAAI;AAAA,IAChD,MAAM;AAAA,EACR;AAKA,QAAM,gBAAiD;AAAA;AAAA;AAAA,IAGrD,GAAI,MAAM,aAAa,YACnB,CAAC,IACD,EAAE,UAAU,MAAM,YAAY,SAAS;AAAA;AAAA;AAAA,IAG3C,cAAc,cAAc,eAAe,OAAO;AAAA,IAClD,cAAc,cAAc,eAAe,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjD,GAAI,aAAa,EAAE,YAAY,GAAG,IAAI,CAAC;AAAA,IACvC,cAAc;AAAA,IACd,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,IAKb,OAAO;AAAA,MACL,QAAQ;AAAA,QACN,OAAO,MAAM,UACT,CAAC,UAAU,MAAM,QAAS,EAAE,UAAU,MAAM,MAAM,EAAE,CAAC,IACrD;AAAA,QACJ,WAAW,WAAY;AACrB,gBAAM,IAAI,KAAK;AACf,gBAAM,eAAe;AAAA,YACnB,UAAU;AAAA;AAAA;AAAA,YAGV,GAAI,gBACA;AAAA,cACE,QAAQ,EAAE,MAAM,KAAK,OAAO,MAAM,OAAO,KAAK,OAAO,MAAM;AAAA,YAC7D,IACA,CAAC;AAAA,UACP,CAAC;AACD,eAAK,OAAO,MAAM,OAAO,QA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WAAW,MAAM;AAAA,EACnB,CAAC;AAED,SACE,oBAAC,SAAK,GAAG,gBACP;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,MAAM;AAAA,MACf;AAAA,MACA;AAAA,MACA,mBAAmB,MAAM;AAAA,MACzB;AAAA,MACA,oBAAoB,MAAM;AAAA,MAC1B,aAAa,MAAM,OAAO;AAAA,MAC1B,aAAa,MAAM;AAAA,MACnB,SAAS,MAAM;AAAA;AAAA,EACjB,GACF;AAEJ,CAAC;","names":["BarChart"]}
@@ -1,17 +1,18 @@
1
1
  import {
2
2
  getChartContainerProps
3
- } from "../chunk-P3MVYSHX.js";
3
+ } from "../chunk-37QVUJXM.js";
4
4
  import {
5
5
  ChartRenderer,
6
6
  buildBaseChartOptions,
7
+ deriveClickCoords,
7
8
  useSeedsChartSetup
8
- } from "../chunk-CYCKJ5ML.js";
9
+ } from "../chunk-YCYACOQU.js";
9
10
  import {
10
11
  BUBBLE_CHART_DEFAULT_MAX_SIZE,
11
12
  BUBBLE_CHART_DEFAULT_PADDING,
12
13
  BUBBLE_CHART_HEIGHT,
13
14
  defaultBubbleChartWidth
14
- } from "../chunk-332X77M5.js";
15
+ } from "../chunk-JNQC3ZRQ.js";
15
16
 
16
17
  // src/charts/bubble/BubbleChart.tsx
17
18
  import { memo, useMemo } from "react";
@@ -86,18 +87,15 @@ function transformBubbleDataToSeries(data) {
86
87
  }));
87
88
  }
88
89
  function transformBubbleClickData(event) {
89
- const base = {
90
+ return {
90
91
  name: event.point.name,
92
+ // Optional on the event type only to keep it comparable with Highcharts'
93
+ // `Point` (see `TypeSeedsChartBubbleClickEvent`); always set at runtime.
91
94
  value: event.point.value,
92
95
  seriesIndex: event.point.series.index,
93
- pointIndex: event.point.index
96
+ pointIndex: event.point.index,
97
+ ...deriveClickCoords(event)
94
98
  };
95
- const isClickEvent = event.type === "click";
96
- if (!isClickEvent && event.target) {
97
- const rect = event.target.getBoundingClientRect();
98
- return { ...base, pageX: rect.x, pageY: rect.y };
99
- }
100
- return { ...base, pageX: event.pageX ?? 0, pageY: event.pageY ?? 0 };
101
99
  }
102
100
  function mapBubbleTooltipRow(data) {
103
101
  const row = data[0];
@@ -139,7 +137,7 @@ function buildBubbleChartOptions(props) {
139
137
  },
140
138
  dataLabels: {
141
139
  enabled: true,
142
- // See chartBase.tsx's SeedsChartPackedBubblePlotOptions.dataLabels —
140
+ // See chartBase.tsx's TypeSeedsChartPackedBubblePlotOptions.dataLabels —
143
141
  // the label formatter returns HTML (icon + wrapped text); preserved
144
142
  // for functional parity (known useHTML gap, mirrors bar's axis
145
143
  // labels).
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/charts/bubble/BubbleChart.tsx","../../../src/charts/bubble/iconMarkup.ts","../../../src/charts/bubble/adapter.ts"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport {\n ChartRenderer,\n useSeedsChartSetup,\n type ChartTooltipProps,\n} from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildBubbleChartOptions, mapBubbleTooltipRow } from \"./adapter\";\nimport type { BubbleChartProps } from \"./types\";\n\n/**\n * BubbleChart renders a Highcharts packedbubble (clustered, axis-less) chart\n * from a list of categories, each with its own nested inner bubbles.\n *\n * Like DonutChart, it carries no `styled-components`: the wrapper is a plain\n * `<div>` and the Highcharts styling ships as static CSS. Consumers import\n * both `@sproutsocial/seeds-react-data-viz/chart-styles.css` and\n * `.../bubble.css` once (the component never self-imports its CSS).\n */\nexport const BubbleChart = memo(function BubbleChart(props: BubbleChartProps) {\n const { colors } = useSeedsChartSetup({\n series: props.data.map((d) => ({ color: d.color })),\n });\n\n const options = useMemo(() => buildBubbleChartOptions(props), [props]);\n const hasOnClick = Boolean(props.onClick);\n const hasOnPlotBackgroundClick = Boolean(props.onPlotBackgroundClick);\n\n // RAW per-category colors only — an unset category falls through to\n // chart-styles.css's --highcharts-color-N default, matching the bar\n // convention (bubble's outer categories are separate series, like bar's,\n // not donut's single-series-many-points model).\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-bubble\"],\n colors: props.data.map((d) => d.color),\n hasOnClick,\n className: props.className,\n });\n\n // `ChartRenderer` expects `(ChartTooltipProps) => ReactNode`; the consumer's\n // function expects the narrower `BubbleChartTooltipProps` (required\n // seriesIndex/pointIndex). Wrap rather than cast the function type so the\n // intent is explicit; `mapBubbleTooltipRow` applies the remount-desync null\n // guard.\n const tooltip = props.tooltip\n ? (args: ChartTooltipProps) => {\n const row = mapBubbleTooltipRow(args.data);\n if (!row) return null;\n return props.tooltip!({ ...args, data: [row] });\n }\n : undefined;\n\n return (\n <div\n {...containerProps}\n {...(hasOnPlotBackgroundClick\n ? { \"data-has-on-plot-background-click\": \"\" }\n : {})}\n onClick={props.onPlotBackgroundClick}\n >\n <ChartRenderer\n // Highcharts <12.2.0 can't re-run the packedbubble split layout when\n // `splitSeries` toggles (highcharts/highcharts#21972, fixed by #22186\n // in 12.2.0), so we force a full remount via `key`. REMOVE this `key`\n // once seeds is on Highcharts >=12.2.0.\n // Unrelated, but a watch-item for that same upgrade: the #21972 fix\n // (#22186) introduced a still-open regression, #24134, where 2+\n // packedbubble charts that are BOTH in split mode at the same time on\n // one page share a global `allParentNodes` array, causing one chart's\n // bubbles to drift outside its plot area. A single bubble chart (or\n // several where at most one is split) is unaffected — only\n // simultaneous multi-chart split mode triggers it. Doesn't affect this\n // usage today (Smart Categories renders one bubble chart at a time),\n // but if a future surface ever renders 2+ split bubble charts at\n // once post-upgrade, apply the maintainers' workaround (reset\n // `allParentNodes` on chart `init`) until Highcharts ships a fix.\n key={`Bubble-Chart-${props.splitSeries ? \"SplitSeries\" : \"\"}`}\n options={options}\n series={props.data.map((d, i) => ({\n name: d.name,\n color: d.color ?? colors[i],\n }))}\n colors={colors}\n tooltip={tooltip}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.format}\n hideLegend\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","/**\n * TEMPORARY — remove when CE-202 lands (this file and its import in\n * `adapter.ts`).\n *\n * Raw inline-SVG markup for the bubble chart's data-label icons, duplicated\n * verbatim from web-app-core v1's `smartCategoryToSVGMap`\n * (`SmartCategoriesBubbleChart.tsx`), re-keyed from entity type to the Seeds\n * icon name the chart's `icon` prop actually receives (the Listening consumer\n * maps entity type -> icon name via `EntityTypeIconMap`). Copying v1's exact\n * glyphs is what guarantees pixel parity with the live chart.\n *\n * WHY inline SVG rather than the Seeds sprite `<use xlink:href=\"#seeds-svgs_...\">`:\n * Highcharts renders `useHTML` data labels outside the light-DOM tree the\n * sprite sheet is injected into, so cross-tree `<use>` resolution fails. This\n * is the same wall v1 hit, which is why it hand-copied raw path data instead\n * of referencing the sprite. The general fix — a lightweight per-icon markup\n * export from seeds-icons that avoids pulling the whole ~300KB+/category\n * sprite bundle into every `seeds-react-data-viz` consumer — is tracked by\n * CE-202; when it lands, resolve icons through that and delete this file.\n *\n * Fills are `currentColor` so each glyph inherits the data-label text color.\n * Each SVG keeps its native `width`/`height` for v1-identical inline sizing.\n * An icon outside this map degrades to the no-icon (name-only) label rather\n * than rendering nothing.\n */\nexport const BUBBLE_ICON_MARKUP: Record<string, string> = {\n \"user-outline\": `<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5.72756 6C7.38441 6 8.72756 4.65685 8.72756 3C8.72756 1.34315 7.38441 0 5.72756 0C4.07071 0 2.72756 1.34315 2.72756 3C2.72756 4.65685 4.07071 6 5.72756 6Z\" fill=\"currentColor\"/>\n<path d=\"M5.72756 12C8.50201 12 10.1833 10.1963 11.0339 8.89858C11.4669 8.23803 11.0644 7.41859 10.2861 7.28445C8.63561 7 7.15327 7 5.72756 7C4.30185 7 2.81951 7 1.16899 7.28445C0.390671 7.41859 -0.0117778 8.23803 0.421187 8.89858C1.2718 10.1963 2.95311 12 5.72756 12Z\" fill=\"currentColor\"/>\n</svg>`,\n \"location-pin-outline\": `<svg width=\"10\" height=\"12\" viewBox=\"0 0 10 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M4.99992 12C6.33325 12 9.66659 7.244 9.66659 4.66667C9.66659 2.08934 7.57725 0 4.99992 0C2.42259 0 0.333252 2.08934 0.333252 4.66667C0.333252 7.244 3.66659 12 4.99992 12ZM4.99992 4.66667C5.36811 4.66667 5.66659 4.36819 5.66659 4C5.66659 3.63181 5.36811 3.33333 4.99992 3.33333C4.63173 3.33333 4.33325 3.63181 4.33325 4C4.33325 4.36819 4.63173 4.66667 4.99992 4.66667Z\" fill=\"currentColor\"/>\n</svg>`,\n \"cart-outline\": `<svg width=\"11\" height=\"12\" viewBox=\"0 0 11 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M0.666748 1.83333H1.76749C1.93793 1.83333 2.08092 1.96192 2.09895 2.1314L2.75892 8.33515C1.9651 8.37397 1.33341 9.02988 1.33341 9.83333C1.33341 10.6618 2.00499 11.3333 2.83341 11.3333C3.66184 11.3333 4.33341 10.6618 4.33341 9.83333C4.33341 9.777 4.33031 9.72139 4.32426 9.66667H7.34257C7.33652 9.72139 7.33341 9.777 7.33341 9.83333C7.33341 10.6618 8.00499 11.3333 8.83341 11.3333C9.66184 11.3333 10.3334 10.6618 10.3334 9.83333C10.3334 9.00491 9.66184 8.33333 8.83341 8.33333H4.09959L3.92228 6.66667H9.18028C9.65696 6.66667 10.0674 6.33021 10.1609 5.86278L10.9203 2.06537C10.9616 1.85911 10.8038 1.66667 10.5935 1.66667H3.35763C3.14364 0.98448 2.50729 0.5 1.76749 0.5H0.666748V1.83333Z\" fill=\"currentColor\"/>\n</svg>`,\n \"briefcase-outline\": `<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M3.5 1.83333V2H1C0.447715 2 0 2.44772 0 3V10.3333C0 10.8856 0.447715 11.3333 1 11.3333H11C11.5523 11.3333 12 10.8856 12 10.3333V3C12 2.44772 11.5523 2 11 2H8.5V1.83333C8.5 0.820811 7.67919 0 6.66667 0H5.33333C4.32081 0 3.5 0.820811 3.5 1.83333ZM5.33333 1C4.8731 1 4.5 1.3731 4.5 1.83333V2H7.5V1.83333C7.5 1.3731 7.1269 1 6.66667 1H5.33333ZM6.66667 5.33333C6.66667 5.70152 6.36819 6 6 6C5.63181 6 5.33333 5.70152 5.33333 5.33333C5.33333 4.96514 5.63181 4.66667 6 4.66667C6.36819 4.66667 6.66667 4.96514 6.66667 5.33333ZM10.6667 6.88767V5.74479C9.44176 6.48334 7.81474 6.95116 6 6.95116C4.18526 6.95116 2.55823 6.48334 1.33333 5.74479V6.88767C2.64682 7.55696 4.25842 7.95116 6 7.95116C7.74158 7.95116 9.35318 7.55696 10.6667 6.88767Z\" fill=\"currentColor\"/>\n</svg>`,\n \"laptop-mobile-outline\": `<svg width=\"13\" height=\"10\" viewBox=\"0 0 13 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M2.84994 0.333313C2.29765 0.333313 1.84993 0.781028 1.84993 1.33331V7.33331H0.516602C0.516602 7.8856 0.964317 8.33331 1.5166 8.33331H6.84994V3.33331C6.84994 2.22874 7.74537 1.33331 8.84994 1.33331H11.1833C11.1833 0.781028 10.7356 0.333313 10.1833 0.333313H2.84994Z\" fill=\"currentColor\"/>\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M7.84994 3.33331C7.84994 2.78103 8.29765 2.33331 8.84994 2.33331H11.5166C12.0689 2.33331 12.5166 2.78103 12.5166 3.33331V8.66665C12.5166 9.21893 12.0689 9.66665 11.5166 9.66665H8.84994C8.29765 9.66665 7.84994 9.21893 7.84994 8.66665V3.33331ZM10.6833 8.16665C10.6833 8.44279 10.4594 8.66665 10.1833 8.66665C9.90713 8.66665 9.68327 8.44279 9.68327 8.16665C9.68327 7.8905 9.90713 7.66665 10.1833 7.66665C10.4594 7.66665 10.6833 7.8905 10.6833 8.16665Z\" fill=\"currentColor\"/>\n</svg>`,\n \"calendar-day-outline\": `<svg width=\"11\" height=\"12\" viewBox=\"0 0 11 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M3.3632 1.33333H7.69653V0H8.69653V1.33333H9.8632C10.4155 1.33333 10.8632 1.78105 10.8632 2.33333V10.3333C10.8632 10.8856 10.4155 11.3333 9.8632 11.3333H1.19653C0.644248 11.3333 0.196533 10.8856 0.196533 10.3333V2.33333C0.196533 1.78105 0.644248 1.33333 1.19653 1.33333H2.3632V0H3.3632V1.33333ZM1.52987 2.66667V4H9.52987V2.66667H1.52987ZM3.8632 5.33333H1.8632V7.33333H3.8632V5.33333Z\" fill=\"currentColor\"/>\n</svg>`,\n \"chart-pie-outline\": `<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M10.9888 9.33342C11.6481 8.34673 12 7.18669 12 6H6V0C4.81331 0 3.65328 0.351894 2.66658 1.01118C1.67989 1.67047 0.910851 2.60754 0.456725 3.7039C0.00259971 4.80026 -0.11622 6.00666 0.115291 7.17054C0.346802 8.33443 0.918247 9.40353 1.75736 10.2426C2.59648 11.0818 3.66557 11.6532 4.82946 11.8847C5.99335 12.1162 7.19975 11.9974 8.2961 11.5433C9.39246 11.0892 10.3295 10.3201 10.9888 9.33342ZM7.33334 4.66672L11.8513 4.66656C11.3422 2.42346 9.57645 0.657717 7.33334 0.148727V4.66672Z\" fill=\"currentColor\"/>\n</svg>`,\n \"paper-outline\": `<svg width=\"10\" height=\"12\" viewBox=\"0 0 10 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M1.06836 12C0.516075 12 0.0683594 11.5523 0.0683594 11V1C0.0683594 0.447715 0.516075 0 1.06836 0H3.73503C4.28731 0 4.73503 0.447715 4.73503 1V2.83333C4.73503 4.02995 5.70508 5 6.90169 5H8.40169C8.95398 5 9.40169 5.44772 9.40169 6V11C9.40169 11.5523 8.95398 12 8.40169 12H1.06836Z\" fill=\"currentColor\"/>\n<path d=\"M5.73503 2.49999V0.107381C7.61938 0.518781 9.07818 2.06865 9.35443 3.99999H7.23503C6.4066 3.99999 5.73503 3.32841 5.73503 2.49999Z\" fill=\"currentColor\"/>\n</svg>`,\n};\n","import type { TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport { BUBBLE_ICON_MARKUP } from \"./iconMarkup\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport type {\n ChartTooltipDataRow,\n SeedsChartBubbleClickEvent,\n SeedsChartBubbleDataLabelFormatterContext,\n SeedsChartOptions,\n SeedsChartPackedBubbleSeriesOptions,\n} from \"../shared/chartBase\";\nimport {\n BUBBLE_CHART_DEFAULT_MAX_SIZE,\n BUBBLE_CHART_DEFAULT_PADDING,\n BUBBLE_CHART_HEIGHT,\n} from \"../../constants/chartOptions\";\nimport type {\n BubbleCategoryDataPoint,\n BubbleChartClickData,\n BubbleChartProps,\n BubbleChartTooltipRow,\n} from \"./types\";\n\nfunction defaultPointDescriptionFormatter(point: {\n name: string;\n value: number;\n}): string {\n return `${point.name}: ${point.value}. Press Enter or Space to activate.`;\n}\n\n/**\n * A bare icon name (no `-outline`/`-solid` suffix) resolves to its default\n * variant, matching `seeds-react-icon`'s own `resolveIconName` (`outline` at\n * this label's rendered size — mirrors non-mini `<Icon>` sizing, since\n * `BUBBLE_ICON_MARKUP` only stocks the outline variant).\n */\nfunction resolveIconName(name: TypeIconName): string {\n return name.endsWith(\"-outline\") || name.endsWith(\"-solid\")\n ? name\n : `${name}-outline`;\n}\n\n// Icon markup lives in ./iconMarkup (a verbatim, temporary duplicate of v1's\n// raw-SVG map — see that file's header and CE-202). Kept out of this adapter so\n// the eventual general fix is a one-file deletion, not a surgical edit here.\nfunction buildIconMarkup(icon: TypeIconName): string | undefined {\n return BUBBLE_ICON_MARKUP[resolveIconName(icon)];\n}\n\nfunction escapeHtml(value: string): string {\n return value\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\");\n}\n\n// v1's radius thresholds (`MINIMUM_BUBBLE_RADIUS_FOR_CATEGORY_TEXT` /\n// `MINIMUM_BUBBLE_RADIUS_FOR_DATALABEL_TEXT`), generalized per SPEC decision\n// 9a: the rule is icon-presence-driven, not view-mode-driven. v1 conflated the\n// two because overview-mode categories were the only points it ever assigned\n// an icon to — incidental, not load-bearing.\nconst ICON_LABEL_TEXT_MIN_RADIUS = 40;\nconst NO_ICON_LABEL_MIN_RADIUS = 25;\n\n/**\n * Assembles a packedbubble data label as an HTML string (`useHTML: true`,\n * required — see `charts/README.md`'s known gap, mirrored from v1). Icon\n * present → icon always renders, name conditional on radius; no icon → hidden\n * below a radius floor, else the name clipped/wrapped to the bubble's\n * diameter. Mirrors v1's `dataLabelFormatter` exactly: a plain `<div>` with the\n * inline icon to the left of the name (v1 does nothing more — it relies on the\n * browser-default inline `<svg>`; see bubble.css for the Tailwind-Preflight\n * override that keeps that default intact here). An `icon` outside\n * `BUBBLE_ICON_MARKUP`'s current coverage falls through to the no-icon branch\n * (name only) rather than rendering an empty/broken icon.\n */\nfunction buildBubbleDataLabel(\n point: { name: string; icon?: TypeIconName },\n radius: number\n): string {\n const name = escapeHtml(point.name);\n const iconMarkup = point.icon ? buildIconMarkup(point.icon) : undefined;\n if (iconMarkup) {\n const showName = radius > ICON_LABEL_TEXT_MIN_RADIUS;\n return `<div>${iconMarkup}${showName ? ` <span>${name}</span>` : \"\"}</div>`;\n }\n if (radius < NO_ICON_LABEL_MIN_RADIUS) return \"\";\n const diameter = radius * 2;\n return `<div style=\"max-width: ${diameter}px; max-height: ${diameter}px; overflow: hidden; text-overflow: ellipsis; white-space: wrap;\" title=\"${name}\">${name}</div>`;\n}\n\nexport function transformBubbleDataToSeries(\n data: Array<BubbleCategoryDataPoint>\n): Array<SeedsChartPackedBubbleSeriesOptions> {\n return data.map((category, index) => ({\n type: \"packedbubble\",\n name: category.name,\n data: category.innerBubbles.map((bubble) => ({\n name: bubble.name,\n value: bubble.value,\n })),\n color: category.color,\n colorIndex: index,\n }));\n}\n\n/**\n * Keyboard activation has no `stopPropagation` and its `type` isn't `\"click\"`;\n * derive `pageX`/`pageY` from the target's bounding rect for keyboard, from\n * the raw event for a mouse click. Mirrors v1's `transformBubbleChartClickData`.\n */\nexport function transformBubbleClickData(\n event: SeedsChartBubbleClickEvent\n): BubbleChartClickData {\n const base = {\n name: event.point.name,\n value: event.point.value,\n seriesIndex: event.point.series.index,\n pointIndex: event.point.index,\n };\n const isClickEvent = event.type === \"click\";\n if (!isClickEvent && event.target) {\n const rect = (event.target as HTMLElement).getBoundingClientRect();\n return { ...base, pageX: rect.x, pageY: rect.y };\n }\n return { ...base, pageX: event.pageX ?? 0, pageY: event.pageY ?? 0 };\n}\n\n/**\n * During the split<->unsplit remount transition the tooltip context is\n * briefly missing data (name/seriesIndex undefined) — bail rather than render\n * a broken tooltip. Mirrors v1.\n */\nexport function mapBubbleTooltipRow(\n data: ChartTooltipDataRow[]\n): BubbleChartTooltipRow | null {\n const row = data[0] as BubbleChartTooltipRow | undefined;\n if (row?.name == null || row?.seriesIndex == null) return null;\n return row;\n}\n\nexport function buildBubbleChartOptions(\n props: BubbleChartProps\n): SeedsChartOptions {\n const hasOnClick = Boolean(props.onClick);\n const base = buildBaseChartOptions({\n type: \"packedbubble\",\n description: props.accessibility.description,\n svgContainerLabel: props.accessibility.svgContainerLabel,\n ...(hasOnClick\n ? {\n point: {\n descriptionFormatter:\n props.accessibility.point?.descriptionFormatter ??\n defaultPointDescriptionFormatter,\n },\n }\n : {}),\n });\n\n return {\n ...base,\n chart: {\n ...base.chart,\n type: \"packedbubble\",\n height: props.height ?? BUBBLE_CHART_HEIGHT,\n },\n plotOptions: {\n packedbubble: {\n minSize: \"30%\",\n maxSize: props.maxBubbleSize ?? BUBBLE_CHART_DEFAULT_MAX_SIZE,\n draggable: false,\n states: { hover: { enabled: false } },\n layoutAlgorithm: {\n gravitationalConstant: 0.05,\n seriesInteraction: true,\n parentNodeLimit: true,\n enableSimulation: false,\n bubblePadding: props.bubblePadding ?? BUBBLE_CHART_DEFAULT_PADDING,\n splitSeries: props.splitSeries ?? false,\n },\n dataLabels: {\n enabled: true,\n // See chartBase.tsx's SeedsChartPackedBubblePlotOptions.dataLabels —\n // the label formatter returns HTML (icon + wrapped text); preserved\n // for functional parity (known useHTML gap, mirrors bar's axis\n // labels).\n useHTML: true,\n formatter(this: SeedsChartBubbleDataLabelFormatterContext) {\n const inner =\n props.data[this.point.series.index]?.innerBubbles[\n this.point.index\n ];\n return buildBubbleDataLabel(\n { name: this.point.name, icon: inner?.icon },\n this.radius\n );\n },\n },\n accessibility: {\n enabled: true,\n keyboardNavigation: { enabled: true },\n point: { valueDescriptionFormat: \"{point.name}: {point.value}\" },\n },\n point: {\n events: {\n click: hasOnClick\n ? (event: SeedsChartBubbleClickEvent) => {\n event.stopPropagation?.();\n // Keyboard events have no `target` when not a genuine click.\n if (event.type !== \"click\" && !event.target) return;\n props.onClick!(transformBubbleClickData(event));\n }\n : undefined,\n mouseOver: props.onMouseEnter\n ? function (this: { name: string }) {\n props.onMouseEnter!({ position: this.name });\n }\n : undefined,\n mouseOut: props.onMouseLeave\n ? function (this: { name: string }) {\n props.onMouseLeave!({ position: this.name });\n }\n : undefined,\n },\n },\n },\n },\n series: transformBubbleDataToSeries(props.data),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,eAAe;;;ACyBvB,IAAM,qBAA6C;AAAA,EACxD,g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,MAe7D;AAAA;AAAA,EACF;AAEJ,CAAC;","names":["BubbleChart"]}
1
+ {"version":3,"sources":["../../../src/charts/bubble/BubbleChart.tsx","../../../src/charts/bubble/iconMarkup.ts","../../../src/charts/bubble/adapter.ts"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { ChartRenderer, useSeedsChartSetup } from \"../shared/chartBase\";\nimport type { TypeChartTooltipRenderProps } from \"../shared/chartTooltip\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildBubbleChartOptions, mapBubbleTooltipRow } from \"./adapter\";\nimport type { TypeBubbleChartProps } from \"./types\";\n\n/**\n * BubbleChart renders a Highcharts packedbubble (clustered, axis-less) chart\n * from a list of categories, each with its own nested inner bubbles.\n *\n * Like DonutChart, it carries no `styled-components`: the wrapper is a plain\n * `<div>` and the Highcharts styling ships as static CSS. Consumers import\n * both `@sproutsocial/seeds-react-data-viz/chart-styles.css` and\n * `.../bubble.css` once (the component never self-imports its CSS).\n */\nexport const BubbleChart = memo(function BubbleChart(\n props: TypeBubbleChartProps\n) {\n const { colors } = useSeedsChartSetup({\n series: props.data.map((d) => ({ color: d.color })),\n });\n\n const options = useMemo(() => buildBubbleChartOptions(props), [props]);\n const hasOnClick = Boolean(props.onClick);\n const hasOnPlotBackgroundClick = Boolean(props.onPlotBackgroundClick);\n\n // RAW per-category colors only — an unset category falls through to\n // chart-styles.css's --highcharts-color-N default, matching the bar\n // convention (bubble's outer categories are separate series, like bar's,\n // not donut's single-series-many-points model).\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-bubble\"],\n colors: props.data.map((d) => d.color),\n hasOnClick,\n className: props.className,\n });\n\n // `ChartRenderer` expects `(TypeChartTooltipRenderProps) => ReactNode`; the consumer's\n // function expects the narrower `TypeBubbleChartTooltipProps` (required\n // seriesIndex/pointIndex). Wrap rather than cast the function type so the\n // intent is explicit; `mapBubbleTooltipRow` applies the remount-desync null\n // guard.\n const tooltip = props.tooltip\n ? (args: TypeChartTooltipRenderProps) => {\n const row = mapBubbleTooltipRow(args.data);\n if (!row) return null;\n return props.tooltip!({ ...args, data: [row] });\n }\n : undefined;\n\n return (\n <div\n {...containerProps}\n {...(hasOnPlotBackgroundClick\n ? { \"data-has-on-plot-background-click\": \"\" }\n : {})}\n onClick={props.onPlotBackgroundClick}\n >\n <ChartRenderer\n // Highcharts <12.2.0 can't re-run the packedbubble split layout when\n // `splitSeries` toggles (highcharts/highcharts#21972, fixed by #22186\n // in 12.2.0), so we force a full remount via `key`. REMOVE this `key`\n // once seeds is on Highcharts >=12.2.0.\n // Unrelated, but a watch-item for that same upgrade: the #21972 fix\n // (#22186) introduced a still-open regression, #24134, where 2+\n // packedbubble charts that are BOTH in split mode at the same time on\n // one page share a global `allParentNodes` array, causing one chart's\n // bubbles to drift outside its plot area. A single bubble chart (or\n // several where at most one is split) is unaffected — only\n // simultaneous multi-chart split mode triggers it. Doesn't affect this\n // usage today (Smart Categories renders one bubble chart at a time),\n // but if a future surface ever renders 2+ split bubble charts at\n // once post-upgrade, apply the maintainers' workaround (reset\n // `allParentNodes` on chart `init`) until Highcharts ships a fix.\n key={`Bubble-Chart-${props.splitSeries ? \"SplitSeries\" : \"\"}`}\n options={options}\n series={props.data.map((d, i) => ({\n name: d.name,\n color: d.color ?? colors[i],\n }))}\n colors={colors}\n tooltip={tooltip}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.format}\n hideLegend\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","/**\n * TEMPORARY — remove when CE-202 lands (this file and its import in\n * `adapter.ts`).\n *\n * Raw inline-SVG markup for the bubble chart's data-label icons, duplicated\n * verbatim from web-app-core v1's `smartCategoryToSVGMap`\n * (`SmartCategoriesBubbleChart.tsx`), re-keyed from entity type to the Seeds\n * icon name the chart's `icon` prop actually receives (the Listening consumer\n * maps entity type -> icon name via `EntityTypeIconMap`). Copying v1's exact\n * glyphs is what guarantees pixel parity with the live chart.\n *\n * WHY inline SVG rather than the Seeds sprite `<use xlink:href=\"#seeds-svgs_...\">`:\n * Highcharts renders `useHTML` data labels outside the light-DOM tree the\n * sprite sheet is injected into, so cross-tree `<use>` resolution fails. This\n * is the same wall v1 hit, which is why it hand-copied raw path data instead\n * of referencing the sprite. The general fix — a lightweight per-icon markup\n * export from seeds-icons that avoids pulling the whole ~300KB+/category\n * sprite bundle into every `seeds-react-data-viz` consumer — is tracked by\n * CE-202; when it lands, resolve icons through that and delete this file.\n *\n * Fills are `currentColor` so each glyph inherits the data-label text color.\n * Each SVG keeps its native `width`/`height` for v1-identical inline sizing.\n * An icon outside this map degrades to the no-icon (name-only) label rather\n * than rendering nothing.\n */\nexport const BUBBLE_ICON_MARKUP: Record<string, string> = {\n \"user-outline\": `<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M5.72756 6C7.38441 6 8.72756 4.65685 8.72756 3C8.72756 1.34315 7.38441 0 5.72756 0C4.07071 0 2.72756 1.34315 2.72756 3C2.72756 4.65685 4.07071 6 5.72756 6Z\" fill=\"currentColor\"/>\n<path d=\"M5.72756 12C8.50201 12 10.1833 10.1963 11.0339 8.89858C11.4669 8.23803 11.0644 7.41859 10.2861 7.28445C8.63561 7 7.15327 7 5.72756 7C4.30185 7 2.81951 7 1.16899 7.28445C0.390671 7.41859 -0.0117778 8.23803 0.421187 8.89858C1.2718 10.1963 2.95311 12 5.72756 12Z\" fill=\"currentColor\"/>\n</svg>`,\n \"location-pin-outline\": `<svg width=\"10\" height=\"12\" viewBox=\"0 0 10 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M4.99992 12C6.33325 12 9.66659 7.244 9.66659 4.66667C9.66659 2.08934 7.57725 0 4.99992 0C2.42259 0 0.333252 2.08934 0.333252 4.66667C0.333252 7.244 3.66659 12 4.99992 12ZM4.99992 4.66667C5.36811 4.66667 5.66659 4.36819 5.66659 4C5.66659 3.63181 5.36811 3.33333 4.99992 3.33333C4.63173 3.33333 4.33325 3.63181 4.33325 4C4.33325 4.36819 4.63173 4.66667 4.99992 4.66667Z\" fill=\"currentColor\"/>\n</svg>`,\n \"cart-outline\": `<svg width=\"11\" height=\"12\" viewBox=\"0 0 11 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M0.666748 1.83333H1.76749C1.93793 1.83333 2.08092 1.96192 2.09895 2.1314L2.75892 8.33515C1.9651 8.37397 1.33341 9.02988 1.33341 9.83333C1.33341 10.6618 2.00499 11.3333 2.83341 11.3333C3.66184 11.3333 4.33341 10.6618 4.33341 9.83333C4.33341 9.777 4.33031 9.72139 4.32426 9.66667H7.34257C7.33652 9.72139 7.33341 9.777 7.33341 9.83333C7.33341 10.6618 8.00499 11.3333 8.83341 11.3333C9.66184 11.3333 10.3334 10.6618 10.3334 9.83333C10.3334 9.00491 9.66184 8.33333 8.83341 8.33333H4.09959L3.92228 6.66667H9.18028C9.65696 6.66667 10.0674 6.33021 10.1609 5.86278L10.9203 2.06537C10.9616 1.85911 10.8038 1.66667 10.5935 1.66667H3.35763C3.14364 0.98448 2.50729 0.5 1.76749 0.5H0.666748V1.83333Z\" fill=\"currentColor\"/>\n</svg>`,\n \"briefcase-outline\": `<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M3.5 1.83333V2H1C0.447715 2 0 2.44772 0 3V10.3333C0 10.8856 0.447715 11.3333 1 11.3333H11C11.5523 11.3333 12 10.8856 12 10.3333V3C12 2.44772 11.5523 2 11 2H8.5V1.83333C8.5 0.820811 7.67919 0 6.66667 0H5.33333C4.32081 0 3.5 0.820811 3.5 1.83333ZM5.33333 1C4.8731 1 4.5 1.3731 4.5 1.83333V2H7.5V1.83333C7.5 1.3731 7.1269 1 6.66667 1H5.33333ZM6.66667 5.33333C6.66667 5.70152 6.36819 6 6 6C5.63181 6 5.33333 5.70152 5.33333 5.33333C5.33333 4.96514 5.63181 4.66667 6 4.66667C6.36819 4.66667 6.66667 4.96514 6.66667 5.33333ZM10.6667 6.88767V5.74479C9.44176 6.48334 7.81474 6.95116 6 6.95116C4.18526 6.95116 2.55823 6.48334 1.33333 5.74479V6.88767C2.64682 7.55696 4.25842 7.95116 6 7.95116C7.74158 7.95116 9.35318 7.55696 10.6667 6.88767Z\" fill=\"currentColor\"/>\n</svg>`,\n \"laptop-mobile-outline\": `<svg width=\"13\" height=\"10\" viewBox=\"0 0 13 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M2.84994 0.333313C2.29765 0.333313 1.84993 0.781028 1.84993 1.33331V7.33331H0.516602C0.516602 7.8856 0.964317 8.33331 1.5166 8.33331H6.84994V3.33331C6.84994 2.22874 7.74537 1.33331 8.84994 1.33331H11.1833C11.1833 0.781028 10.7356 0.333313 10.1833 0.333313H2.84994Z\" fill=\"currentColor\"/>\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M7.84994 3.33331C7.84994 2.78103 8.29765 2.33331 8.84994 2.33331H11.5166C12.0689 2.33331 12.5166 2.78103 12.5166 3.33331V8.66665C12.5166 9.21893 12.0689 9.66665 11.5166 9.66665H8.84994C8.29765 9.66665 7.84994 9.21893 7.84994 8.66665V3.33331ZM10.6833 8.16665C10.6833 8.44279 10.4594 8.66665 10.1833 8.66665C9.90713 8.66665 9.68327 8.44279 9.68327 8.16665C9.68327 7.8905 9.90713 7.66665 10.1833 7.66665C10.4594 7.66665 10.6833 7.8905 10.6833 8.16665Z\" fill=\"currentColor\"/>\n</svg>`,\n \"calendar-day-outline\": `<svg width=\"11\" height=\"12\" viewBox=\"0 0 11 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M3.3632 1.33333H7.69653V0H8.69653V1.33333H9.8632C10.4155 1.33333 10.8632 1.78105 10.8632 2.33333V10.3333C10.8632 10.8856 10.4155 11.3333 9.8632 11.3333H1.19653C0.644248 11.3333 0.196533 10.8856 0.196533 10.3333V2.33333C0.196533 1.78105 0.644248 1.33333 1.19653 1.33333H2.3632V0H3.3632V1.33333ZM1.52987 2.66667V4H9.52987V2.66667H1.52987ZM3.8632 5.33333H1.8632V7.33333H3.8632V5.33333Z\" fill=\"currentColor\"/>\n</svg>`,\n \"chart-pie-outline\": `<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path style=\"fill-rule: evenodd; clip-rule: evenodd;\" d=\"M10.9888 9.33342C11.6481 8.34673 12 7.18669 12 6H6V0C4.81331 0 3.65328 0.351894 2.66658 1.01118C1.67989 1.67047 0.910851 2.60754 0.456725 3.7039C0.00259971 4.80026 -0.11622 6.00666 0.115291 7.17054C0.346802 8.33443 0.918247 9.40353 1.75736 10.2426C2.59648 11.0818 3.66557 11.6532 4.82946 11.8847C5.99335 12.1162 7.19975 11.9974 8.2961 11.5433C9.39246 11.0892 10.3295 10.3201 10.9888 9.33342ZM7.33334 4.66672L11.8513 4.66656C11.3422 2.42346 9.57645 0.657717 7.33334 0.148727V4.66672Z\" fill=\"currentColor\"/>\n</svg>`,\n \"paper-outline\": `<svg width=\"10\" height=\"12\" viewBox=\"0 0 10 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M1.06836 12C0.516075 12 0.0683594 11.5523 0.0683594 11V1C0.0683594 0.447715 0.516075 0 1.06836 0H3.73503C4.28731 0 4.73503 0.447715 4.73503 1V2.83333C4.73503 4.02995 5.70508 5 6.90169 5H8.40169C8.95398 5 9.40169 5.44772 9.40169 6V11C9.40169 11.5523 8.95398 12 8.40169 12H1.06836Z\" fill=\"currentColor\"/>\n<path d=\"M5.73503 2.49999V0.107381C7.61938 0.518781 9.07818 2.06865 9.35443 3.99999H7.23503C6.4066 3.99999 5.73503 3.32841 5.73503 2.49999Z\" fill=\"currentColor\"/>\n</svg>`,\n};\n","import type { TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport { BUBBLE_ICON_MARKUP } from \"./iconMarkup\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport { deriveClickCoords } from \"../shared/pointerClick\";\nimport type {\n TypeSeedsChartBubbleDataLabelFormatterContext,\n TypeSeedsChartOptions,\n TypeSeedsChartPackedBubbleSeriesOptions,\n} from \"../shared/chartBase\";\nimport type { TypeChartTooltipDataRow } from \"../shared/chartTooltip\";\nimport {\n BUBBLE_CHART_DEFAULT_MAX_SIZE,\n BUBBLE_CHART_DEFAULT_PADDING,\n BUBBLE_CHART_HEIGHT,\n} from \"../../constants/chartOptions\";\nimport type {\n TypeBubbleCategoryDataPoint,\n TypeBubbleChartClickData,\n TypeBubbleChartProps,\n TypeBubbleChartTooltipRow,\n TypeSeedsChartBubbleClickEvent,\n} from \"./types\";\n\nfunction defaultPointDescriptionFormatter(point: {\n name: string;\n value: number;\n}): string {\n return `${point.name}: ${point.value}. Press Enter or Space to activate.`;\n}\n\n/**\n * A bare icon name (no `-outline`/`-solid` suffix) resolves to its default\n * variant, matching `seeds-react-icon`'s own `resolveIconName` (`outline` at\n * this label's rendered size — mirrors non-mini `<Icon>` sizing, since\n * `BUBBLE_ICON_MARKUP` only stocks the outline variant).\n */\nfunction resolveIconName(name: TypeIconName): string {\n return name.endsWith(\"-outline\") || name.endsWith(\"-solid\")\n ? name\n : `${name}-outline`;\n}\n\n// Icon markup lives in ./iconMarkup (a verbatim, temporary duplicate of v1's\n// raw-SVG map — see that file's header and CE-202). Kept out of this adapter so\n// the eventual general fix is a one-file deletion, not a surgical edit here.\nfunction buildIconMarkup(icon: TypeIconName): string | undefined {\n return BUBBLE_ICON_MARKUP[resolveIconName(icon)];\n}\n\nfunction escapeHtml(value: string): string {\n return value\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\");\n}\n\n// v1's radius thresholds (`MINIMUM_BUBBLE_RADIUS_FOR_CATEGORY_TEXT` /\n// `MINIMUM_BUBBLE_RADIUS_FOR_DATALABEL_TEXT`), generalized per SPEC decision\n// 9a: the rule is icon-presence-driven, not view-mode-driven. v1 conflated the\n// two because overview-mode categories were the only points it ever assigned\n// an icon to — incidental, not load-bearing.\nconst ICON_LABEL_TEXT_MIN_RADIUS = 40;\nconst NO_ICON_LABEL_MIN_RADIUS = 25;\n\n/**\n * Assembles a packedbubble data label as an HTML string (`useHTML: true`,\n * required — see `charts/README.md`'s known gap, mirrored from v1). Icon\n * present → icon always renders, name conditional on radius; no icon → hidden\n * below a radius floor, else the name clipped/wrapped to the bubble's\n * diameter. Mirrors v1's `dataLabelFormatter` exactly: a plain `<div>` with the\n * inline icon to the left of the name (v1 does nothing more — it relies on the\n * browser-default inline `<svg>`; see bubble.css for the Tailwind-Preflight\n * override that keeps that default intact here). An `icon` outside\n * `BUBBLE_ICON_MARKUP`'s current coverage falls through to the no-icon branch\n * (name only) rather than rendering an empty/broken icon.\n */\nfunction buildBubbleDataLabel(\n point: { name: string; icon?: TypeIconName },\n radius: number\n): string {\n const name = escapeHtml(point.name);\n const iconMarkup = point.icon ? buildIconMarkup(point.icon) : undefined;\n if (iconMarkup) {\n const showName = radius > ICON_LABEL_TEXT_MIN_RADIUS;\n return `<div>${iconMarkup}${showName ? ` <span>${name}</span>` : \"\"}</div>`;\n }\n if (radius < NO_ICON_LABEL_MIN_RADIUS) return \"\";\n const diameter = radius * 2;\n return `<div style=\"max-width: ${diameter}px; max-height: ${diameter}px; overflow: hidden; text-overflow: ellipsis; white-space: wrap;\" title=\"${name}\">${name}</div>`;\n}\n\nexport function transformBubbleDataToSeries(\n data: TypeBubbleCategoryDataPoint[]\n): TypeSeedsChartPackedBubbleSeriesOptions[] {\n return data.map((category, index) => ({\n type: \"packedbubble\",\n name: category.name,\n data: category.innerBubbles.map((bubble) => ({\n name: bubble.name,\n value: bubble.value,\n })),\n color: category.color,\n colorIndex: index,\n }));\n}\n\n/**\n * Keyboard activation has no `stopPropagation` and its `type` isn't `\"click\"`;\n * derive `pageX`/`pageY` from the target's bounding rect for keyboard, from\n * the raw event for a mouse click. Mirrors v1's `transformBubbleChartClickData`.\n */\nexport function transformBubbleClickData(\n event: TypeSeedsChartBubbleClickEvent\n): TypeBubbleChartClickData {\n return {\n name: event.point.name,\n // Optional on the event type only to keep it comparable with Highcharts'\n // `Point` (see `TypeSeedsChartBubbleClickEvent`); always set at runtime.\n value: event.point.value!,\n seriesIndex: event.point.series.index,\n pointIndex: event.point.index,\n ...deriveClickCoords(event),\n };\n}\n\n/**\n * During the split<->unsplit remount transition the tooltip context is\n * briefly missing data (name/seriesIndex undefined) — bail rather than render\n * a broken tooltip. Mirrors v1.\n */\nexport function mapBubbleTooltipRow(\n data: TypeChartTooltipDataRow[]\n): TypeBubbleChartTooltipRow | null {\n const row = data[0] as TypeBubbleChartTooltipRow | undefined;\n if (row?.name == null || row?.seriesIndex == null) return null;\n return row;\n}\n\nexport function buildBubbleChartOptions(\n props: TypeBubbleChartProps\n): TypeSeedsChartOptions {\n const hasOnClick = Boolean(props.onClick);\n const base = buildBaseChartOptions({\n type: \"packedbubble\",\n description: props.accessibility.description,\n svgContainerLabel: props.accessibility.svgContainerLabel,\n ...(hasOnClick\n ? {\n point: {\n descriptionFormatter:\n props.accessibility.point?.descriptionFormatter ??\n defaultPointDescriptionFormatter,\n },\n }\n : {}),\n });\n\n return {\n ...base,\n chart: {\n ...base.chart,\n type: \"packedbubble\",\n height: props.height ?? BUBBLE_CHART_HEIGHT,\n },\n plotOptions: {\n packedbubble: {\n minSize: \"30%\",\n maxSize: props.maxBubbleSize ?? BUBBLE_CHART_DEFAULT_MAX_SIZE,\n draggable: false,\n states: { hover: { enabled: false } },\n layoutAlgorithm: {\n gravitationalConstant: 0.05,\n seriesInteraction: true,\n parentNodeLimit: true,\n enableSimulation: false,\n bubblePadding: props.bubblePadding ?? BUBBLE_CHART_DEFAULT_PADDING,\n splitSeries: props.splitSeries ?? false,\n },\n dataLabels: {\n enabled: true,\n // See chartBase.tsx's TypeSeedsChartPackedBubblePlotOptions.dataLabels —\n // the label formatter returns HTML (icon + wrapped text); preserved\n // for functional parity (known useHTML gap, mirrors bar's axis\n // labels).\n useHTML: true,\n formatter(this: TypeSeedsChartBubbleDataLabelFormatterContext) {\n const inner =\n props.data[this.point.series.index]?.innerBubbles[\n this.point.index\n ];\n return buildBubbleDataLabel(\n { name: this.point.name, icon: inner?.icon },\n this.radius\n );\n },\n },\n accessibility: {\n enabled: true,\n keyboardNavigation: { enabled: true },\n point: { valueDescriptionFormat: \"{point.name}: {point.value}\" },\n },\n point: {\n events: {\n click: hasOnClick\n ? (event: TypeSeedsChartBubbleClickEvent) => {\n event.stopPropagation?.();\n // Keyboard events have no `target` when not a genuine click.\n if (event.type !== \"click\" && !event.target) return;\n props.onClick!(transformBubbleClickData(event));\n }\n : undefined,\n mouseOver: props.onMouseEnter\n ? function (this: { name: string }) {\n props.onMouseEnter!({ position: this.name });\n }\n : undefined,\n mouseOut: props.onMouseLeave\n ? function (this: { name: string }) {\n props.onMouseLeave!({ position: this.name });\n }\n : undefined,\n },\n },\n },\n },\n series: transformBubbleDataToSeries(props.data),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,eAAe;;;ACyBvB,IAAM,qBAA6C;AAAA,EACxD,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAIhB,wBAAwB;AAAA;AAAA;AAAA,EAGxB,gBAAgB;AAAA;AAAA;AAAA,EAGhB,qBAAqB;AAAA;AAAA;AAAA,EAGrB,yBAAyB;AAAA;AAAA;AAAA;AAAA,EAIzB,wBAAwB;AAAA;AAAA;AAAA,EAGxB,qBAAqB;AAAA;AAAA;AAAA,EAGrB,iBAAiB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CAAC;AAOD,QAAM,UAAU,MAAM,UAClB,CAAC,SAAsC;AACrC,UAAM,MAAM,oBAAoB,KAAK,IAAI;AACzC,QAAI,CAAC,IAAK,QAAO;AACjB,WAAO,MAAM,QAAS,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;AAAA,EAChD,IACA;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAI,2BACD,EAAE,qCAAqC,GAAG,IAC1C,CAAC;AAAA,MACL,SAAS,MAAM;AAAA,MAEf;AAAA,QAAC;AAAA;AAAA,UAiBC;AAAA,UACA,QAAQ,MAAM,KAAK,IAAI,CAAC,GAAG,OAAO;AAAA,YAChC,MAAM,EAAE;AAAA,YACR,OAAO,EAAE,SAAS,OAAO,CAAC;AAAA,UAC5B,EAAE;AAAA,UACF;AAAA,UACA;AAAA,UACA;AAAA,UACA,mBAAmB,MAAM;AAAA,UACzB,oBAAoB,MAAM;AAAA,UAC1B,aAAa,MAAM;AAAA,UACnB,YAAU;AAAA,UACV,aAAa,MAAM;AAAA,UACnB,SAAS,MAAM;AAAA;AAAA,QAdV,gBAAgB,MAAM,cAAc,gBAAgB,EAAE;AAAA,MAe7D;AAAA;AAAA,EACF;AAEJ,CAAC;","names":["BubbleChart"]}
@@ -19,4 +19,4 @@ function getChartContainerProps(args) {
19
19
  export {
20
20
  getChartContainerProps
21
21
  };
22
- //# sourceMappingURL=chunk-P3MVYSHX.js.map
22
+ //# sourceMappingURL=chunk-37QVUJXM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/charts/shared/chartContainer.ts"],"sourcesContent":["import type { CSSProperties } from \"react\";\nimport type { TypeChartStyleColor, TypeChartStylePattern } from \"../../types\";\n\n/**\n * The container contract for v2 charts using the static chart-styles.css.\n *\n * This is the analog of Sparkline's inline --seeds-sparkline-color: it turns the\n * dynamic pieces the styled-components blocks in src/styles/chartStyles.ts used\n * to interpolate at runtime ($hasOnClick, $patterns, per-series color overrides)\n * into the class names, CSS custom properties, and data-attributes that\n * chart-styles.css reads. The three per-chart subtasks (CE-170 bar,\n * CE-165 line-area, CE-166 donut) derive their container props from this one\n * source so the class/variable/attribute names stay in sync with the stylesheet.\n *\n * Theme tokens are NOT resolved here: chart-styles.css references the DS's\n * already-emitted global CSS variables (var(--color-*), var(--font-*)) directly,\n * so light/dark follows the theme stylesheet with zero inline JS. Likewise the\n * default data-viz palette falls through to var(--color-dataviz-list-N) in the\n * stylesheet — only an explicit consumer-provided per-series color is inlined\n * here as --highcharts-color-N. Callers therefore pass the RAW per-series colors\n * (series.map(s => s.color), undefined when unset), not the palette-resolved\n * array from useSeedsChartSetup.\n *\n * This function owns only the genuinely-shared container mechanism. It does NOT\n * know about individual chart families: each family (CE-170 bar, CE-165\n * line-area, CE-166 donut) passes its own `familyClasses` chain, so a new family\n * never has to edit this file. Those chains mix a shared cross-family layer that\n * lives in chart-styles.css (e.g. .seeds-chart-time-series, used by both bar and\n * line-area) with truly per-family selectors each family ships in its own .css\n * (e.g. .seeds-chart-bar hover-dimming).\n */\nexport type TypeChartContainerProps = Readonly<{\n className: string;\n style: CSSProperties;\n \"data-has-on-click\"?: string;\n \"data-dashed-series\"?: string;\n}>;\n\n/**\n * Build the props for a v2 chart container consuming chart-styles.css.\n *\n * @param familyClasses the family class chain the caller owns, prepended by the\n * shared `seeds-chart` base — e.g. `[\"seeds-chart-time-series\", \"seeds-chart-line\"]`.\n * The shared function does not know families in advance; each family supplies\n * its own chain. Selectors for a shared cross-family class live in\n * chart-styles.css (e.g. seeds-chart-time-series); truly per-family selectors\n * live in that family's own .css (e.g. seeds-chart-bar).\n * @param colors the RAW per-series colors (series.map(s => s.color)); undefined\n * entries are left to fall through to the CSS var default and only explicit\n * overrides are inlined as --highcharts-color-N.\n * @returns the className chain, the inline CSS custom properties (explicit\n * per-series color overrides only), and the data-attributes gating the\n * $hasOnClick and $patterns rules.\n */\nexport function getChartContainerProps(\n args: Readonly<{\n familyClasses: readonly string[];\n colors: readonly (TypeChartStyleColor | undefined)[];\n patterns?: readonly TypeChartStylePattern[];\n hasOnClick?: boolean;\n /** Consumer Tailwind passthrough, appended to the class chain. */\n className?: string;\n }>\n): TypeChartContainerProps {\n const { familyClasses, colors, patterns = [], hasOnClick, className } = args;\n\n // Per-series colors: inline --highcharts-color-N ONLY for an explicit\n // consumer-provided override. A default (undefined) series falls through to\n // var(--highcharts-color-N, var(--color-dataviz-list-N)) in chart-styles.css,\n // so the default data-viz rotation is resolved by the DS theme stylesheet\n // (light/dark aware) rather than baked into an inline literal here.\n const style: Record<string, string> = {};\n colors.forEach((color, index) => {\n if (color) {\n style[`--highcharts-color-${index}`] = color;\n }\n });\n\n // $patterns -> space-separated dashed indices, matched by [data-dashed-series~=\"N\"].\n const dashedSeries = patterns\n .map((pattern, index) => (pattern === \"dashed\" ? index : -1))\n .filter((index) => index >= 0)\n .join(\" \");\n\n return {\n className: [\"seeds-chart\", ...familyClasses, className]\n .filter(Boolean)\n .join(\" \"),\n style: style as CSSProperties,\n ...(hasOnClick ? { \"data-has-on-click\": \"\" } : {}),\n ...(dashedSeries ? { \"data-dashed-series\": dashedSeries } : {}),\n };\n}\n"],"mappings":";AAsDO,SAAS,uBACd,MAQyB;AACzB,QAAM,EAAE,eAAe,QAAQ,WAAW,CAAC,GAAG,YAAY,UAAU,IAAI;AAOxE,QAAM,QAAgC,CAAC;AACvC,SAAO,QAAQ,CAAC,OAAO,UAAU;AAC/B,QAAI,OAAO;AACT,YAAM,sBAAsB,KAAK,EAAE,IAAI;AAAA,IACzC;AAAA,EACF,CAAC;AAGD,QAAM,eAAe,SAClB,IAAI,CAAC,SAAS,UAAW,YAAY,WAAW,QAAQ,EAAG,EAC3D,OAAO,CAAC,UAAU,SAAS,CAAC,EAC5B,KAAK,GAAG;AAEX,SAAO;AAAA,IACL,WAAW,CAAC,eAAe,GAAG,eAAe,SAAS,EACnD,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,IACX;AAAA,IACA,GAAI,aAAa,EAAE,qBAAqB,GAAG,IAAI,CAAC;AAAA,IAChD,GAAI,eAAe,EAAE,sBAAsB,aAAa,IAAI,CAAC;AAAA,EAC/D;AACF;","names":[]}
@@ -260,11 +260,11 @@ var transformTimeSeriesTooltipData = ({
260
260
  context,
261
261
  data
262
262
  }) => {
263
- return (context.series.chart.series || []).map((series, index) => {
263
+ return (context.series?.chart?.series || []).map((series, index) => {
264
264
  const pointIndex = context.point.index;
265
265
  const y = series?.points?.[pointIndex]?.y;
266
266
  return {
267
- color: data[index]?.styles?.color || theme3.colors.DATAVIZ_COLORS_LIST[index],
267
+ color: data[index]?.styles?.color || theme3.colors.DATAVIZ_COLORS_LIST[index] || "",
268
268
  ...data[index]?.icon ? { icon: data[index]?.icon } : {},
269
269
  name: series.name,
270
270
  value: typeof y === "number" ? y : null
@@ -646,4 +646,4 @@ export {
646
646
  areaChartStyles,
647
647
  donutChartStyles
648
648
  };
649
- //# sourceMappingURL=chunk-332X77M5.js.map
649
+ //# sourceMappingURL=chunk-JNQC3ZRQ.js.map