@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.
- package/dist/{annotations-CjFoRPXf.d.mts → annotations-YfJndb5S.d.mts} +2 -2
- package/dist/{annotations-CjFoRPXf.d.ts → annotations-YfJndb5S.d.ts} +2 -2
- package/dist/{axis-DVx6Mn1k.d.mts → axis-Byl9vNMR.d.mts} +9 -9
- package/dist/{axis-DQXvjzBs.d.ts → axis-Cn8NAgwb.d.ts} +9 -9
- package/dist/bar/index.d.mts +25 -47
- package/dist/bar/index.d.ts +25 -47
- package/dist/bar/index.js +14 -14
- package/dist/bar/index.js.map +1 -1
- package/dist/bubble/index.d.mts +29 -40
- package/dist/bubble/index.d.ts +29 -40
- package/dist/bubble/index.js +18 -20
- package/dist/bubble/index.js.map +1 -1
- package/dist/{chartExport-CKYpuhik.d.mts → chartExport-B0imEQ8Y.d.mts} +4 -4
- package/dist/{chartExport-CKYpuhik.d.ts → chartExport-B0imEQ8Y.d.ts} +4 -4
- package/dist/{chartBase-Cd405GIA.d.mts → chartProps-BgGx1GTo.d.mts} +67 -23
- package/dist/{chartBase-BYipK7MZ.d.ts → chartProps-C2Lxty-_.d.ts} +67 -23
- package/dist/{chunk-WMKO3RGT.js → chunk-2S7XMWJ4.js} +3 -3
- package/dist/chunk-2S7XMWJ4.js.map +1 -0
- package/dist/{chunk-6EIJCJCN.js → chunk-I72SSPMX.js} +1 -1
- package/dist/chunk-I72SSPMX.js.map +1 -0
- package/dist/{chunk-CV45MD47.js → chunk-RDS2VCPO.js} +3 -3
- package/dist/chunk-RDS2VCPO.js.map +1 -0
- package/dist/{chunk-5TWNMPQU.js → chunk-V5EXL244.js} +73 -63
- package/dist/chunk-V5EXL244.js.map +1 -0
- package/dist/{chunk-34OKRQET.js → chunk-XH7ZKGHD.js} +5 -5
- package/dist/{chunk-34OKRQET.js.map → chunk-XH7ZKGHD.js.map} +1 -1
- package/dist/donut/index.d.mts +21 -36
- package/dist/donut/index.d.ts +21 -36
- package/dist/donut/index.js +8 -8
- package/dist/donut/index.js.map +1 -1
- package/dist/esm/bar/index.js +5 -5
- package/dist/esm/bar/index.js.map +1 -1
- package/dist/esm/bubble/index.js +10 -12
- package/dist/esm/bubble/index.js.map +1 -1
- package/dist/esm/{chunk-P3MVYSHX.js → chunk-37QVUJXM.js} +1 -1
- package/dist/esm/chunk-37QVUJXM.js.map +1 -0
- package/dist/esm/{chunk-332X77M5.js → chunk-JNQC3ZRQ.js} +3 -3
- package/dist/esm/chunk-JNQC3ZRQ.js.map +1 -0
- package/dist/esm/{chunk-MVNO5UV6.js → chunk-NBMVFYDJ.js} +2 -2
- package/dist/esm/chunk-NBMVFYDJ.js.map +1 -0
- package/dist/esm/{chunk-AL3OTBTT.js → chunk-THDIQMFN.js} +2 -2
- package/dist/esm/chunk-THDIQMFN.js.map +1 -0
- package/dist/esm/{chunk-CYCKJ5ML.js → chunk-YCYACOQU.js} +34 -24
- package/dist/esm/chunk-YCYACOQU.js.map +1 -0
- package/dist/esm/donut/index.js +3 -3
- package/dist/esm/donut/index.js.map +1 -1
- package/dist/esm/export/index.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/line-area/index.js +5 -5
- package/dist/esm/line-area/index.js.map +1 -1
- package/dist/esm/sparkline/index.js +3 -3
- package/dist/esm/sparkline/index.js.map +1 -1
- package/dist/esm/wordcloud/index.js +4 -3
- package/dist/esm/wordcloud/index.js.map +1 -1
- package/dist/export/index.d.mts +5 -5
- package/dist/export/index.d.ts +5 -5
- package/dist/export/index.js.map +1 -1
- package/dist/index.js +92 -92
- package/dist/index.js.map +1 -1
- package/dist/{interactions-pEXA1XxF.d.ts → interactions-D2a4O6iM.d.mts} +8 -8
- package/dist/{interactions-pEXA1XxF.d.mts → interactions-D2a4O6iM.d.ts} +8 -8
- package/dist/line-area/index.d.mts +22 -48
- package/dist/line-area/index.d.ts +22 -48
- package/dist/line-area/index.js +14 -14
- package/dist/line-area/index.js.map +1 -1
- package/dist/pointerClick-4LUDwS3L.d.mts +15 -0
- package/dist/pointerClick-4LUDwS3L.d.ts +15 -0
- package/dist/sparkline/index.d.mts +24 -33
- package/dist/sparkline/index.d.ts +24 -33
- package/dist/sparkline/index.js +7 -7
- package/dist/sparkline/index.js.map +1 -1
- package/dist/wordcloud/index.d.mts +22 -20
- package/dist/wordcloud/index.d.ts +22 -20
- package/dist/wordcloud/index.js +11 -10
- package/dist/wordcloud/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-5TWNMPQU.js.map +0 -1
- package/dist/chunk-6EIJCJCN.js.map +0 -1
- package/dist/chunk-CV45MD47.js.map +0 -1
- package/dist/chunk-WMKO3RGT.js.map +0 -1
- package/dist/esm/chunk-332X77M5.js.map +0 -1
- package/dist/esm/chunk-AL3OTBTT.js.map +0 -1
- package/dist/esm/chunk-CYCKJ5ML.js.map +0 -1
- package/dist/esm/chunk-MVNO5UV6.js.map +0 -1
- package/dist/esm/chunk-P3MVYSHX.js.map +0 -1
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { a as CategoryAxis, D as DatetimeAxis } from '../axis-DVx6Mn1k.mjs';
|
|
2
|
+
import { T as TypeChartBaseProps, b as TypeChartTooltipDisplayProps } from '../chartProps-BgGx1GTo.mjs';
|
|
3
|
+
import { T as TypeChartDataPoint, d as TypeDimensionalAxis } from '../axis-Byl9vNMR.mjs';
|
|
4
|
+
export { a as TypeCategoryAxis, b as TypeDatetimeAxis } from '../axis-Byl9vNMR.mjs';
|
|
5
|
+
export { T as TypeChartExportHandle } from '../chartExport-B0imEQ8Y.mjs';
|
|
7
6
|
import '@sproutsocial/seeds-react-icon';
|
|
8
7
|
import '../types-DxrhdAdn.mjs';
|
|
9
8
|
import 'highcharts';
|
|
@@ -12,54 +11,46 @@ import 'highcharts';
|
|
|
12
11
|
* Trend direction derived from a series (first vs. last finite value): rising →
|
|
13
12
|
* `"positive"`, falling → `"negative"`, flat → `"neutral"`.
|
|
14
13
|
*/
|
|
15
|
-
type
|
|
14
|
+
type TypeTrend = "positive" | "negative" | "neutral";
|
|
16
15
|
|
|
17
16
|
/** A single sparkline value, or a `[timestamp, value]` / `{ x, y }` point on a datetime axis. */
|
|
18
|
-
type
|
|
17
|
+
type TypeSparklineDataPoint = TypeChartDataPoint;
|
|
19
18
|
/** Visual encoding of the sparkline. `"line"` draws a stroke; `"bar"` draws columns. */
|
|
20
|
-
type
|
|
19
|
+
type TypeSparklineVariant = "line" | "bar";
|
|
21
20
|
/**
|
|
22
21
|
* Trend direction, derived from the data (first vs. last finite value). Drives
|
|
23
22
|
* the single color the whole sparkline renders in.
|
|
24
23
|
*/
|
|
25
|
-
type
|
|
26
|
-
type
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
type TypeSparklineTrend = TypeTrend;
|
|
25
|
+
type TypeSparklineXAxis = TypeDimensionalAxis;
|
|
26
|
+
/**
|
|
27
|
+
* Takes the core and tooltip tiers only — no `height` (this family is
|
|
28
|
+
* fixed-size, sized via `className`) and no `tooltipClickLabel` (it has no
|
|
29
|
+
* `onClick`, so the footer would never render). See `shared/chartProps.ts`.
|
|
30
|
+
*/
|
|
31
|
+
interface TypeSparklineChartProps extends TypeChartBaseProps, TypeChartTooltipDisplayProps {
|
|
30
32
|
/** `"line"` (stroke) or `"bar"` (columns). */
|
|
31
|
-
variant:
|
|
33
|
+
variant: TypeSparklineVariant;
|
|
32
34
|
/**
|
|
33
35
|
* The single data series. Bare numbers render on an index/category axis;
|
|
34
36
|
* `[timestamp, value]` tuples (or `{ x, y }`) render on a datetime axis when
|
|
35
37
|
* `xAxis.type` is `"datetime"`.
|
|
36
38
|
*/
|
|
37
|
-
data:
|
|
39
|
+
data: TypeSparklineDataPoint[];
|
|
38
40
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
+
* Same type as the core tier's `className`, restated because this family
|
|
42
|
+
* gives it a specific job: Tailwind utilities applied to the wrapper are the
|
|
43
|
+
* intended way to size the sparkline (e.g. `"h-6 w-32"`), standing in for the
|
|
44
|
+
* `height` prop it opts out of. Defaults come from `sparkline.css`.
|
|
41
45
|
*/
|
|
42
46
|
className?: string;
|
|
43
47
|
/**
|
|
44
48
|
* Optional axis config. Omit for the default hidden index axis; pass a
|
|
45
49
|
* datetime axis to place `[timestamp, value]` points in time.
|
|
46
50
|
*/
|
|
47
|
-
xAxis?:
|
|
51
|
+
xAxis?: TypeSparklineXAxis;
|
|
48
52
|
/** IANA timezone for datetime-axis tooltips. Default `"UTC"`. Ignored for category axes. */
|
|
49
53
|
timezone?: string;
|
|
50
|
-
/** Override for the default hover tooltip content. */
|
|
51
|
-
tooltip?: (args: ChartTooltipProps) => ReactNode;
|
|
52
|
-
/** Override for the value shown when a data point is null. Defaults to an em-dash. */
|
|
53
|
-
invalidNumberLabel?: ReactNode;
|
|
54
|
-
/**
|
|
55
|
-
* Chart title included in the exported image (PNG/SVG/PDF) only — it does
|
|
56
|
-
* *not* render on screen. The on-screen title is a React sibling outside the
|
|
57
|
-
* chart SVG and can't be captured on export, so `exportTitle` is baked into
|
|
58
|
-
* the export clone as a themed native Highcharts title. Omit for no title.
|
|
59
|
-
*/
|
|
60
|
-
exportTitle?: string;
|
|
61
|
-
/** Fired once per chart instance with a handle for PNG/SVG/PDF/CSV downloads. Re-fires only on remount. */
|
|
62
|
-
onReady?: (handle: ChartExportHandle) => void;
|
|
63
54
|
}
|
|
64
55
|
|
|
65
56
|
/**
|
|
@@ -75,6 +66,6 @@ interface SparklineChartProps {
|
|
|
75
66
|
* `--seeds-sparkline-color` CSS variable, so light/dark works without depending
|
|
76
67
|
* on the theme's CSS-variable stylesheet.
|
|
77
68
|
*/
|
|
78
|
-
declare const SparklineChart: react.NamedExoticComponent<
|
|
69
|
+
declare const SparklineChart: react.NamedExoticComponent<TypeSparklineChartProps>;
|
|
79
70
|
|
|
80
|
-
export {
|
|
71
|
+
export { SparklineChart, type TypeSparklineChartProps, type TypeSparklineDataPoint, type TypeSparklineTrend, type TypeSparklineVariant, type TypeSparklineXAxis };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { a as CategoryAxis, D as DatetimeAxis } from '../axis-DQXvjzBs.js';
|
|
2
|
+
import { T as TypeChartBaseProps, b as TypeChartTooltipDisplayProps } from '../chartProps-C2Lxty-_.js';
|
|
3
|
+
import { T as TypeChartDataPoint, d as TypeDimensionalAxis } from '../axis-Cn8NAgwb.js';
|
|
4
|
+
export { a as TypeCategoryAxis, b as TypeDatetimeAxis } from '../axis-Cn8NAgwb.js';
|
|
5
|
+
export { T as TypeChartExportHandle } from '../chartExport-B0imEQ8Y.js';
|
|
7
6
|
import '@sproutsocial/seeds-react-icon';
|
|
8
7
|
import '../types-DxrhdAdn.js';
|
|
9
8
|
import 'highcharts';
|
|
@@ -12,54 +11,46 @@ import 'highcharts';
|
|
|
12
11
|
* Trend direction derived from a series (first vs. last finite value): rising →
|
|
13
12
|
* `"positive"`, falling → `"negative"`, flat → `"neutral"`.
|
|
14
13
|
*/
|
|
15
|
-
type
|
|
14
|
+
type TypeTrend = "positive" | "negative" | "neutral";
|
|
16
15
|
|
|
17
16
|
/** A single sparkline value, or a `[timestamp, value]` / `{ x, y }` point on a datetime axis. */
|
|
18
|
-
type
|
|
17
|
+
type TypeSparklineDataPoint = TypeChartDataPoint;
|
|
19
18
|
/** Visual encoding of the sparkline. `"line"` draws a stroke; `"bar"` draws columns. */
|
|
20
|
-
type
|
|
19
|
+
type TypeSparklineVariant = "line" | "bar";
|
|
21
20
|
/**
|
|
22
21
|
* Trend direction, derived from the data (first vs. last finite value). Drives
|
|
23
22
|
* the single color the whole sparkline renders in.
|
|
24
23
|
*/
|
|
25
|
-
type
|
|
26
|
-
type
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
type TypeSparklineTrend = TypeTrend;
|
|
25
|
+
type TypeSparklineXAxis = TypeDimensionalAxis;
|
|
26
|
+
/**
|
|
27
|
+
* Takes the core and tooltip tiers only — no `height` (this family is
|
|
28
|
+
* fixed-size, sized via `className`) and no `tooltipClickLabel` (it has no
|
|
29
|
+
* `onClick`, so the footer would never render). See `shared/chartProps.ts`.
|
|
30
|
+
*/
|
|
31
|
+
interface TypeSparklineChartProps extends TypeChartBaseProps, TypeChartTooltipDisplayProps {
|
|
30
32
|
/** `"line"` (stroke) or `"bar"` (columns). */
|
|
31
|
-
variant:
|
|
33
|
+
variant: TypeSparklineVariant;
|
|
32
34
|
/**
|
|
33
35
|
* The single data series. Bare numbers render on an index/category axis;
|
|
34
36
|
* `[timestamp, value]` tuples (or `{ x, y }`) render on a datetime axis when
|
|
35
37
|
* `xAxis.type` is `"datetime"`.
|
|
36
38
|
*/
|
|
37
|
-
data:
|
|
39
|
+
data: TypeSparklineDataPoint[];
|
|
38
40
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
+
* Same type as the core tier's `className`, restated because this family
|
|
42
|
+
* gives it a specific job: Tailwind utilities applied to the wrapper are the
|
|
43
|
+
* intended way to size the sparkline (e.g. `"h-6 w-32"`), standing in for the
|
|
44
|
+
* `height` prop it opts out of. Defaults come from `sparkline.css`.
|
|
41
45
|
*/
|
|
42
46
|
className?: string;
|
|
43
47
|
/**
|
|
44
48
|
* Optional axis config. Omit for the default hidden index axis; pass a
|
|
45
49
|
* datetime axis to place `[timestamp, value]` points in time.
|
|
46
50
|
*/
|
|
47
|
-
xAxis?:
|
|
51
|
+
xAxis?: TypeSparklineXAxis;
|
|
48
52
|
/** IANA timezone for datetime-axis tooltips. Default `"UTC"`. Ignored for category axes. */
|
|
49
53
|
timezone?: string;
|
|
50
|
-
/** Override for the default hover tooltip content. */
|
|
51
|
-
tooltip?: (args: ChartTooltipProps) => ReactNode;
|
|
52
|
-
/** Override for the value shown when a data point is null. Defaults to an em-dash. */
|
|
53
|
-
invalidNumberLabel?: ReactNode;
|
|
54
|
-
/**
|
|
55
|
-
* Chart title included in the exported image (PNG/SVG/PDF) only — it does
|
|
56
|
-
* *not* render on screen. The on-screen title is a React sibling outside the
|
|
57
|
-
* chart SVG and can't be captured on export, so `exportTitle` is baked into
|
|
58
|
-
* the export clone as a themed native Highcharts title. Omit for no title.
|
|
59
|
-
*/
|
|
60
|
-
exportTitle?: string;
|
|
61
|
-
/** Fired once per chart instance with a handle for PNG/SVG/PDF/CSV downloads. Re-fires only on remount. */
|
|
62
|
-
onReady?: (handle: ChartExportHandle) => void;
|
|
63
54
|
}
|
|
64
55
|
|
|
65
56
|
/**
|
|
@@ -75,6 +66,6 @@ interface SparklineChartProps {
|
|
|
75
66
|
* `--seeds-sparkline-color` CSS variable, so light/dark works without depending
|
|
76
67
|
* on the theme's CSS-variable stylesheet.
|
|
77
68
|
*/
|
|
78
|
-
declare const SparklineChart: react.NamedExoticComponent<
|
|
69
|
+
declare const SparklineChart: react.NamedExoticComponent<TypeSparklineChartProps>;
|
|
79
70
|
|
|
80
|
-
export {
|
|
71
|
+
export { SparklineChart, type TypeSparklineChartProps, type TypeSparklineDataPoint, type TypeSparklineTrend, type TypeSparklineVariant, type TypeSparklineXAxis };
|
package/dist/sparkline/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkRDS2VCPOjs = require('../chunk-RDS2VCPO.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../chunk-
|
|
8
|
+
var _chunkV5EXL244js = require('../chunk-V5EXL244.js');
|
|
9
|
+
require('../chunk-XH7ZKGHD.js');
|
|
10
10
|
|
|
11
11
|
// src/charts/sparkline/SparklineChart.tsx
|
|
12
12
|
var _react = require('react');
|
|
@@ -19,12 +19,12 @@ function highchartsType(variant) {
|
|
|
19
19
|
var SPARKLINE_SERIES_NAME = "sparkline";
|
|
20
20
|
function buildSparklineChartOptions(props) {
|
|
21
21
|
const type = highchartsType(props.variant);
|
|
22
|
-
const tooltipOptions =
|
|
22
|
+
const tooltipOptions = _chunkRDS2VCPOjs.resolveTooltipOptions.call(void 0, props);
|
|
23
23
|
const xAxis = props.xAxis ? {
|
|
24
|
-
...
|
|
24
|
+
..._chunkRDS2VCPOjs.buildDimensionalAxis.call(void 0, props.xAxis, _nullishCoalesce(tooltipOptions.timezone, () => ( "UTC"))),
|
|
25
25
|
visible: false
|
|
26
26
|
} : { type: "linear", visible: false };
|
|
27
|
-
const base =
|
|
27
|
+
const base = _chunkV5EXL244js.buildBaseChartOptions.call(void 0, {
|
|
28
28
|
type,
|
|
29
29
|
description: props.description,
|
|
30
30
|
timezone: tooltipOptions.timezone
|
|
@@ -101,7 +101,7 @@ var SparklineChart = _react.memo.call(void 0, function SparklineChart2(props) {
|
|
|
101
101
|
className,
|
|
102
102
|
style: { "--seeds-sparkline-color": trendColor },
|
|
103
103
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
104
|
-
|
|
104
|
+
_chunkV5EXL244js.ChartRenderer,
|
|
105
105
|
{
|
|
106
106
|
options,
|
|
107
107
|
series: [{ name: SPARKLINE_SERIES_NAME, color: trendColor }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/sparkline/index.js","../../src/charts/sparkline/SparklineChart.tsx","../../src/charts/sparkline/adapter.ts","../../src/charts/shared/trend.ts"],"names":["SparklineChart"],"mappings":"AAAA;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AAC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AAO,OAAO,UAAA;AACzB,EAAA,OAAO,SAAA;AACT;AAQO,SAAS,iBAAA,CAAkB,KAAA,EAAkB,KAAA,EAAsB;AACxE,EAAA,MAAM,WAAA,EAAa,KAAA,CAAM,MAAA,CAAO,SAAA,CAAU,MAAA,CAAO,UAAA;AACjD,EAAA,GAAA,CAAI,MAAA,IAAU,UAAA,EAAY,OAAO,UAAA,CAAW,KAAA;AAC5C,EAAA,GAAA,CAAI,MAAA,IAAU,UAAA,EAAY,OAAO,UAAA,CAAW,GAAA;AAC5C,EAAA,OAAO,UAAA,CAAW,OAAA;AACpB;AH+BA;AACA;ACnCM,+CAAA;AA7BC,IAAM,eAAA,EAAiB,yBAAA,SAAcA,eAAAA,CAC1C,KAAA,EACA;AAOA,EAAA,MAAM,MAAA,EAAQ,wCAAA,CAAS;AAEvB,EAAA,MAAM,MAAA,EAAQ,YAAA,CAAa,KAAA,CAAM,IAAI,CAAA;AACrC,EAAA,MAAM,WAAA,EAAa,iBAAA,CAAkB,KAAA,EAAO,KAAK,CAAA;AAEjD,EAAA,MAAM,EAAE,OAAA,EAAS,eAAe,EAAA,EAAI,0BAAA,CAA2B,KAAK,CAAA;AAEpE,EAAA,MAAM,UAAA,EAAY;AAAA,IAChB,iBAAA;AAAA,IACA,CAAA,gBAAA,EAAmB,KAAA,CAAM,OAAO,CAAA,CAAA;AAC1B,IAAA;AAGG,EAAA;AAGT,EAAA;AAAC,IAAA;AAAA,IAAA;AACC,MAAA;AACS,MAAA;AAET,MAAA;AAAC,QAAA;AAAA,QAAA;AACC,UAAA;AACiB,UAAA;AACE,UAAA;AACJ,UAAA;AACf,UAAA;AAC0B,UAAA;AAChB,UAAA;AACS,UAAA;AACJ,UAAA;AAAA,QAAA;AACjB,MAAA;AAAA,IAAA;AACF,EAAA;AAEH;ADwDoC;AACA;AACA","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/sparkline/index.js","sourcesContent":[null,"import { memo, type CSSProperties } from \"react\";\nimport { useTheme } from \"styled-components\";\nimport type { TypeTheme } from \"@sproutsocial/seeds-react-theme\";\nimport { ChartRenderer } from \"../shared/chartBase\";\nimport { buildSparklineChartOptions, SPARKLINE_SERIES_NAME } from \"./adapter\";\nimport { computeTrend, resolveTrendColor } from \"./trend\";\nimport type { SparklineChartProps } from \"./types\";\n\n/**\n * SparklineChart — a compact, axis-less inline micro-chart in a `\"line\"` or\n * `\"bar\"` variant. The whole sparkline is colored by trend (auto-computed from\n * the data): green when rising, red when falling, neutral-gray when flat.\n *\n * Unlike the other v2 chart families this one carries no `styled-components`:\n * the wrapper is a plain `<div>` that accepts `className` (Tailwind sizing), and\n * the Highcharts styling lives in `sparkline.css`. Consumers must import\n * `@sproutsocial/seeds-react-data-viz/sparkline.css` once. The single trend\n * color is resolved from the JS theme and passed down as the\n * `--seeds-sparkline-color` CSS variable, so light/dark works without depending\n * on the theme's CSS-variable stylesheet.\n */\nexport const SparklineChart = memo(function SparklineChart(\n props: SparklineChartProps\n) {\n // The active theme resolves the single trend color. We read it directly rather\n // than via useSeedsChartSetup — the sparkline has no categorical palette or\n // series-limit concerns, so the hook's series machinery (and its dummy series\n // input) would be dead weight. ChartRenderer below is itself a styled-\n // component, so this adds no new dependency; the \"no styled-components\" trait\n // of this family is about the wrapper being a plain <div> + static CSS.\n const theme = useTheme() as TypeTheme;\n\n const trend = computeTrend(props.data);\n const trendColor = resolveTrendColor(theme, trend);\n\n const { options, tooltipOptions } = buildSparklineChartOptions(props);\n\n const className = [\n \"seeds-sparkline\",\n `seeds-sparkline-${props.variant}`,\n props.className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n className={className}\n style={{ \"--seeds-sparkline-color\": trendColor } as CSSProperties}\n >\n <ChartRenderer\n options={options}\n series={[{ name: SPARKLINE_SERIES_NAME, color: trendColor }]}\n colors={[trendColor]}\n tooltip={props.tooltip}\n tooltipOptions={tooltipOptions}\n invalidNumberLabel={props.invalidNumberLabel}\n hideLegend\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import type {\n ChartTooltipProps,\n SeedsChartOptions,\n SeedsChartType,\n} from \"../shared/chartBase\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport {\n buildDimensionalAxis,\n resolveTooltipOptions,\n} from \"../shared/axisOptions\";\nimport type { SparklineChartProps, SparklineVariant } from \"./types\";\n\n// A sparkline line is a `line`; a sparkline bar is a `column` (vertical bars).\nfunction highchartsType(variant: SparklineVariant): SeedsChartType {\n return variant === \"bar\" ? \"column\" : \"line\";\n}\n\nconst SPARKLINE_SERIES_NAME = \"sparkline\";\n\nexport function buildSparklineChartOptions(props: SparklineChartProps): {\n options: SeedsChartOptions;\n /** Resolved datetime-derived tooltip options (timezone / timeFormat / textLocale); all undefined without a datetime axis. */\n tooltipOptions: Pick<\n ChartTooltipProps,\n \"timezone\" | \"timeFormat\" | \"textLocale\"\n >;\n} {\n const type = highchartsType(props.variant);\n // `resolveTooltipOptions` handles the optional `xAxis` internally (all-undefined\n // when absent), so the sparkline passes its props straight in like the other\n // families.\n const tooltipOptions = resolveTooltipOptions(props);\n\n // A configured axis is placed but hidden (labels/line/ticks off). Without one\n // we fall back to a hidden linear index axis.\n const xAxis = props.xAxis\n ? {\n ...buildDimensionalAxis(props.xAxis, tooltipOptions.timezone ?? \"UTC\"),\n visible: false,\n }\n : { type: \"linear\" as const, visible: false };\n\n const base = buildBaseChartOptions({\n type,\n description: props.description,\n timezone: tooltipOptions.timezone,\n });\n\n const options: SeedsChartOptions = {\n ...base,\n // Zero the outer spacing so the plot fills the (consumer-sized) wrapper.\n chart: { type, styledMode: true, animation: false, spacing: [0, 0, 0, 0] },\n xAxis,\n yAxis: { visible: false },\n plotOptions: {\n series: {\n animation: false,\n // Decorative micro-chart: no per-point markers on the line.\n marker: { enabled: false },\n },\n // Tight padding so bars read as a compact cluster.\n column: {\n pointPadding: 0.05,\n groupPadding: 0.05,\n borderWidth: 0,\n borderRadius: 3,\n },\n },\n series: [\n {\n type,\n name: SPARKLINE_SERIES_NAME,\n data: [...props.data],\n },\n ],\n };\n\n return { options, tooltipOptions };\n}\n\nexport { SPARKLINE_SERIES_NAME };\n","import type { TypeTheme } from \"@sproutsocial/seeds-react-theme\";\nimport type { ChartDataPoint } from \"./axis\";\n\n// Family-agnostic trend helpers, shared across chart families. First used by the\n// sparkline (colored entirely by its trend direction); reusable by any chart\n// that wants a sentiment/directional color from a single series (e.g. a\n// sentiment chart).\n\n/**\n * Trend direction derived from a series (first vs. last finite value): rising →\n * `\"positive\"`, falling → `\"negative\"`, flat → `\"neutral\"`.\n */\nexport type Trend = \"positive\" | \"negative\" | \"neutral\";\n\n/** Extract the numeric y-value from a bare number, tuple, or `{ x, y }` point. */\nfunction yValue(point: ChartDataPoint): number | null {\n if (point == null) return null;\n if (typeof point === \"number\") return point;\n if (Array.isArray(point)) return point[1];\n return point.y;\n}\n\n/**\n * Derive the trend from the series by comparing the first finite value to the\n * last finite value: rising → `\"positive\"`, falling → `\"negative\"`, equal (or\n * fewer than two finite values) → `\"neutral\"`.\n */\nexport function computeTrend(data: ReadonlyArray<ChartDataPoint>): Trend {\n const finite = data\n .map(yValue)\n .filter((v): v is number => v != null && Number.isFinite(v));\n\n if (finite.length < 2) return \"neutral\";\n\n const first = finite[0]!;\n const last = finite[finite.length - 1]!;\n\n if (last > first) return \"positive\";\n if (last < first) return \"negative\";\n return \"neutral\";\n}\n\n/**\n * Resolve the trend to a Seeds decorative highlight/accent color: positive →\n * vibrant green (green-500), negative → vibrant red (red-600), neutral → middle\n * gray (neutral-600). These highlight tones are theme-stable — the same value in\n * light and dark — and are designed to read as accents on either surface.\n */\nexport function resolveTrendColor(theme: TypeTheme, trend: Trend): string {\n const decorative = theme.colors.container.border.decorative;\n if (trend === \"positive\") return decorative.green;\n if (trend === \"negative\") return decorative.red;\n return decorative.neutral;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/sparkline/index.js","../../src/charts/sparkline/SparklineChart.tsx","../../src/charts/sparkline/adapter.ts","../../src/charts/shared/trend.ts"],"names":["SparklineChart"],"mappings":"AAAA;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACVA,8BAAyC;AACzC,qDAAyB;ADYzB;AACA;AEDA,SAAS,cAAA,CAAe,OAAA,EAAmD;AACzE,EAAA,OAAO,QAAA,IAAY,MAAA,EAAQ,SAAA,EAAW,MAAA;AACxC;AAEA,IAAM,sBAAA,EAAwB,WAAA;AAEvB,SAAS,0BAAA,CAA2B,KAAA,EAOzC;AACA,EAAA,MAAM,KAAA,EAAO,cAAA,CAAe,KAAA,CAAM,OAAO,CAAA;AAIzC,EAAA,MAAM,eAAA,EAAiB,oDAAA,KAA2B,CAAA;AAIlD,EAAA,MAAM,MAAA,EAAQ,KAAA,CAAM,MAAA,EAChB;AAAA,IACE,GAAG,mDAAA,KAAqB,CAAM,KAAA,mBAAO,cAAA,CAAe,QAAA,UAAY,OAAK,CAAA;AAAA,IACrE,OAAA,EAAS;AAAA,EACX,EAAA,EACA,EAAE,IAAA,EAAM,QAAA,EAAmB,OAAA,EAAS,MAAM,CAAA;AAE9C,EAAA,MAAM,KAAA,EAAO,oDAAA;AAAsB,IACjC,IAAA;AAAA,IACA,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,IACnB,QAAA,EAAU,cAAA,CAAe;AAAA,EAC3B,CAAC,CAAA;AAED,EAAA,MAAM,QAAA,EAAiC;AAAA,IACrC,GAAG,IAAA;AAAA;AAAA,IAEH,KAAA,EAAO,EAAE,IAAA,EAAM,UAAA,EAAY,IAAA,EAAM,SAAA,EAAW,KAAA,EAAO,OAAA,EAAS,CAAC,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAC,EAAE,CAAA;AAAA,IACzE,KAAA;AAAA,IACA,KAAA,EAAO,EAAE,OAAA,EAAS,MAAM,CAAA;AAA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AACjB,MAAA;AAAA,IAAA;AACF,EAAA;AAEH;ADwDoC;AACA;AACA","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/sparkline/index.js","sourcesContent":[null,"import { memo, type CSSProperties } from \"react\";\nimport { useTheme } from \"styled-components\";\nimport type { TypeTheme } from \"@sproutsocial/seeds-react-theme\";\nimport { ChartRenderer } from \"../shared/chartBase\";\nimport { buildSparklineChartOptions, SPARKLINE_SERIES_NAME } from \"./adapter\";\nimport { computeTrend, resolveTrendColor } from \"./trend\";\nimport type { TypeSparklineChartProps } from \"./types\";\n\n/**\n * SparklineChart — a compact, axis-less inline micro-chart in a `\"line\"` or\n * `\"bar\"` variant. The whole sparkline is colored by trend (auto-computed from\n * the data): green when rising, red when falling, neutral-gray when flat.\n *\n * Unlike the other v2 chart families this one carries no `styled-components`:\n * the wrapper is a plain `<div>` that accepts `className` (Tailwind sizing), and\n * the Highcharts styling lives in `sparkline.css`. Consumers must import\n * `@sproutsocial/seeds-react-data-viz/sparkline.css` once. The single trend\n * color is resolved from the JS theme and passed down as the\n * `--seeds-sparkline-color` CSS variable, so light/dark works without depending\n * on the theme's CSS-variable stylesheet.\n */\nexport const SparklineChart = memo(function SparklineChart(\n props: TypeSparklineChartProps\n) {\n // The active theme resolves the single trend color. We read it directly rather\n // than via useSeedsChartSetup — the sparkline has no categorical palette or\n // series-limit concerns, so the hook's series machinery (and its dummy series\n // input) would be dead weight. ChartRenderer below is itself a styled-\n // component, so this adds no new dependency; the \"no styled-components\" trait\n // of this family is about the wrapper being a plain <div> + static CSS.\n const theme = useTheme() as TypeTheme;\n\n const trend = computeTrend(props.data);\n const trendColor = resolveTrendColor(theme, trend);\n\n const { options, tooltipOptions } = buildSparklineChartOptions(props);\n\n const className = [\n \"seeds-sparkline\",\n `seeds-sparkline-${props.variant}`,\n props.className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n className={className}\n style={{ \"--seeds-sparkline-color\": trendColor } as CSSProperties}\n >\n <ChartRenderer\n options={options}\n series={[{ name: SPARKLINE_SERIES_NAME, color: trendColor }]}\n colors={[trendColor]}\n tooltip={props.tooltip}\n tooltipOptions={tooltipOptions}\n invalidNumberLabel={props.invalidNumberLabel}\n hideLegend\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import type {\n TypeSeedsChartOptions,\n TypeSeedsChartType,\n} from \"../shared/chartBase\";\nimport type { TypeChartTooltipRenderProps } from \"../shared/chartTooltip\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport {\n buildDimensionalAxis,\n resolveTooltipOptions,\n} from \"../shared/axisOptions\";\nimport type { TypeSparklineChartProps, TypeSparklineVariant } from \"./types\";\n\n// A sparkline line is a `line`; a sparkline bar is a `column` (vertical bars).\nfunction highchartsType(variant: TypeSparklineVariant): TypeSeedsChartType {\n return variant === \"bar\" ? \"column\" : \"line\";\n}\n\nconst SPARKLINE_SERIES_NAME = \"sparkline\";\n\nexport function buildSparklineChartOptions(props: TypeSparklineChartProps): {\n options: TypeSeedsChartOptions;\n /** Resolved datetime-derived tooltip options (timezone / timeFormat / textLocale); all undefined without a datetime axis. */\n tooltipOptions: Pick<\n TypeChartTooltipRenderProps,\n \"timezone\" | \"timeFormat\" | \"textLocale\"\n >;\n} {\n const type = highchartsType(props.variant);\n // `resolveTooltipOptions` handles the optional `xAxis` internally (all-undefined\n // when absent), so the sparkline passes its props straight in like the other\n // families.\n const tooltipOptions = resolveTooltipOptions(props);\n\n // A configured axis is placed but hidden (labels/line/ticks off). Without one\n // we fall back to a hidden linear index axis.\n const xAxis = props.xAxis\n ? {\n ...buildDimensionalAxis(props.xAxis, tooltipOptions.timezone ?? \"UTC\"),\n visible: false,\n }\n : { type: \"linear\" as const, visible: false };\n\n const base = buildBaseChartOptions({\n type,\n description: props.description,\n timezone: tooltipOptions.timezone,\n });\n\n const options: TypeSeedsChartOptions = {\n ...base,\n // Zero the outer spacing so the plot fills the (consumer-sized) wrapper.\n chart: { type, styledMode: true, animation: false, spacing: [0, 0, 0, 0] },\n xAxis,\n yAxis: { visible: false },\n plotOptions: {\n series: {\n animation: false,\n // Decorative micro-chart: no per-point markers on the line.\n marker: { enabled: false },\n },\n // Tight padding so bars read as a compact cluster.\n column: {\n pointPadding: 0.05,\n groupPadding: 0.05,\n borderWidth: 0,\n borderRadius: 3,\n },\n },\n series: [\n {\n type,\n name: SPARKLINE_SERIES_NAME,\n data: [...props.data],\n },\n ],\n };\n\n return { options, tooltipOptions };\n}\n\nexport { SPARKLINE_SERIES_NAME };\n","import type { TypeTheme } from \"@sproutsocial/seeds-react-theme\";\nimport type { TypeChartDataPoint } from \"./axis\";\n\n// Family-agnostic trend helpers, shared across chart families. First used by the\n// sparkline (colored entirely by its trend direction); reusable by any chart\n// that wants a sentiment/directional color from a single series (e.g. a\n// sentiment chart).\n\n/**\n * Trend direction derived from a series (first vs. last finite value): rising →\n * `\"positive\"`, falling → `\"negative\"`, flat → `\"neutral\"`.\n */\nexport type TypeTrend = \"positive\" | \"negative\" | \"neutral\";\n\n/** Extract the numeric y-value from a bare number, tuple, or `{ x, y }` point. */\nfunction yValue(point: TypeChartDataPoint): number | null {\n if (point == null) return null;\n if (typeof point === \"number\") return point;\n if (Array.isArray(point)) return point[1];\n return point.y;\n}\n\n/**\n * Derive the trend from the series by comparing the first finite value to the\n * last finite value: rising → `\"positive\"`, falling → `\"negative\"`, equal (or\n * fewer than two finite values) → `\"neutral\"`.\n */\nexport function computeTrend(data: readonly TypeChartDataPoint[]): TypeTrend {\n const finite = data\n .map(yValue)\n .filter((v): v is number => v != null && Number.isFinite(v));\n\n if (finite.length < 2) return \"neutral\";\n\n const first = finite[0]!;\n const last = finite[finite.length - 1]!;\n\n if (last > first) return \"positive\";\n if (last < first) return \"negative\";\n return \"neutral\";\n}\n\n/**\n * Resolve the trend to a Seeds decorative highlight/accent color: positive →\n * vibrant green (green-500), negative → vibrant red (red-600), neutral → middle\n * gray (neutral-600). These highlight tones are theme-stable — the same value in\n * light and dark — and are designed to read as accents on either surface.\n */\nexport function resolveTrendColor(theme: TypeTheme, trend: TypeTrend): string {\n const decorative = theme.colors.container.border.decorative;\n if (trend === \"positive\") return decorative.green;\n if (trend === \"negative\") return decorative.red;\n return decorative.neutral;\n}\n"]}
|
|
@@ -1,38 +1,45 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { T as TypeChartBaseProps, a as TypeChartSizingProps } from '../chartProps-BgGx1GTo.mjs';
|
|
3
|
+
import { T as TypeChartPointerClickData } from '../pointerClick-4LUDwS3L.mjs';
|
|
4
|
+
export { T as TypeChartExportHandle } from '../chartExport-B0imEQ8Y.mjs';
|
|
5
|
+
import '@sproutsocial/seeds-react-icon';
|
|
6
|
+
import '../types-DxrhdAdn.mjs';
|
|
7
|
+
import 'highcharts';
|
|
3
8
|
|
|
4
9
|
/** A single word in the cloud. `weight` drives both font size and (absent `groups`) opacity. */
|
|
5
|
-
interface
|
|
10
|
+
interface TypeWordCloudDataPoint {
|
|
6
11
|
/** The word as rendered. */
|
|
7
12
|
name: string;
|
|
8
13
|
/** Relative size driver; larger renders bigger. */
|
|
9
14
|
weight: number;
|
|
10
|
-
/** Links this word to a
|
|
15
|
+
/** Links this word to a TypeWordCloudGroup for coloring and dimming. */
|
|
11
16
|
groupId?: string;
|
|
12
17
|
}
|
|
13
18
|
/** A competitive/category grouping. Presence of `groups` switches the cloud into competitive mode. */
|
|
14
|
-
interface
|
|
19
|
+
interface TypeWordCloudGroup {
|
|
15
20
|
id: string;
|
|
16
21
|
name: string;
|
|
17
22
|
/** Overrides this group's palette slot. Tenant-specific competitor colors go here. */
|
|
18
23
|
color?: string;
|
|
19
24
|
}
|
|
20
|
-
interface
|
|
25
|
+
interface TypeWordCloudClickData extends TypeChartPointerClickData {
|
|
21
26
|
name: string;
|
|
27
|
+
/** The clicked word's original input weight, not the font-size target. */
|
|
22
28
|
weight: number;
|
|
23
29
|
groupId?: string;
|
|
24
|
-
pointIndex: number;
|
|
25
|
-
pageX: number;
|
|
26
|
-
pageY: number;
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Takes the core and sizing tiers only — no tooltip tier, since this family
|
|
33
|
+
* disables Highcharts' tooltip subsystem entirely (see `shared/chartProps.ts`).
|
|
34
|
+
*/
|
|
35
|
+
interface TypeWordCloudProps extends TypeChartBaseProps, TypeChartSizingProps {
|
|
36
|
+
data: TypeWordCloudDataPoint[];
|
|
30
37
|
/** Competitive mode. Omit for a single-color cloud. */
|
|
31
|
-
groups?:
|
|
38
|
+
groups?: TypeWordCloudGroup[];
|
|
32
39
|
/** Dims every word outside this group. Null or undefined means no dimming. */
|
|
33
40
|
activeGroupId?: string | null;
|
|
34
41
|
/** Raises every word whose name is in this set to full opacity and dims the rest — the consumer decides what belongs in the set (e.g. every word matching the hovered term's text). Null or undefined means no emphasis. */
|
|
35
|
-
activeNames?:
|
|
42
|
+
activeNames?: readonly string[] | null;
|
|
36
43
|
minFontSize?: number;
|
|
37
44
|
maxFontSize?: number;
|
|
38
45
|
/** [min, max] weight-driven opacity ramp. Defaults to [0.6, 1]; pass [1, 1] to disable. */
|
|
@@ -41,17 +48,12 @@ interface WordCloudProps {
|
|
|
41
48
|
wordPadding?: number;
|
|
42
49
|
/** Skips internal container measurement — pass the container's known pixel width directly. Useful in tests (no `ResizeObserver` mocking needed) and anywhere the width is already known. */
|
|
43
50
|
width?: number;
|
|
44
|
-
|
|
45
|
-
/** Accessibility description (Highcharts `accessibility.description`) — required, matching every sibling v2 family. */
|
|
46
|
-
description: string;
|
|
47
|
-
className?: string;
|
|
48
|
-
onClick?: (data: WordCloudClickData) => void;
|
|
51
|
+
onClick?: (data: TypeWordCloudClickData) => void;
|
|
49
52
|
/** Fires on pointer enter with the hovered word's name (and `groupId`, if grouped); `null` on pointer leave. */
|
|
50
53
|
onWordHover?: (data: {
|
|
51
54
|
name: string;
|
|
52
55
|
groupId?: string;
|
|
53
56
|
} | null) => void;
|
|
54
|
-
onReady?: (handle: ChartExportHandle) => void;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/**
|
|
@@ -64,6 +66,6 @@ interface WordCloudProps {
|
|
|
64
66
|
* import both `@sproutsocial/seeds-react-data-viz/chart-styles.css` and
|
|
65
67
|
* `.../wordcloud.css` once (the component never self-imports its CSS).
|
|
66
68
|
*/
|
|
67
|
-
declare const WordCloud: react.NamedExoticComponent<
|
|
69
|
+
declare const WordCloud: react.NamedExoticComponent<TypeWordCloudProps>;
|
|
68
70
|
|
|
69
|
-
export {
|
|
71
|
+
export { type TypeWordCloudClickData, type TypeWordCloudDataPoint, type TypeWordCloudGroup, type TypeWordCloudProps, WordCloud };
|
|
@@ -1,38 +1,45 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { T as TypeChartBaseProps, a as TypeChartSizingProps } from '../chartProps-C2Lxty-_.js';
|
|
3
|
+
import { T as TypeChartPointerClickData } from '../pointerClick-4LUDwS3L.js';
|
|
4
|
+
export { T as TypeChartExportHandle } from '../chartExport-B0imEQ8Y.js';
|
|
5
|
+
import '@sproutsocial/seeds-react-icon';
|
|
6
|
+
import '../types-DxrhdAdn.js';
|
|
7
|
+
import 'highcharts';
|
|
3
8
|
|
|
4
9
|
/** A single word in the cloud. `weight` drives both font size and (absent `groups`) opacity. */
|
|
5
|
-
interface
|
|
10
|
+
interface TypeWordCloudDataPoint {
|
|
6
11
|
/** The word as rendered. */
|
|
7
12
|
name: string;
|
|
8
13
|
/** Relative size driver; larger renders bigger. */
|
|
9
14
|
weight: number;
|
|
10
|
-
/** Links this word to a
|
|
15
|
+
/** Links this word to a TypeWordCloudGroup for coloring and dimming. */
|
|
11
16
|
groupId?: string;
|
|
12
17
|
}
|
|
13
18
|
/** A competitive/category grouping. Presence of `groups` switches the cloud into competitive mode. */
|
|
14
|
-
interface
|
|
19
|
+
interface TypeWordCloudGroup {
|
|
15
20
|
id: string;
|
|
16
21
|
name: string;
|
|
17
22
|
/** Overrides this group's palette slot. Tenant-specific competitor colors go here. */
|
|
18
23
|
color?: string;
|
|
19
24
|
}
|
|
20
|
-
interface
|
|
25
|
+
interface TypeWordCloudClickData extends TypeChartPointerClickData {
|
|
21
26
|
name: string;
|
|
27
|
+
/** The clicked word's original input weight, not the font-size target. */
|
|
22
28
|
weight: number;
|
|
23
29
|
groupId?: string;
|
|
24
|
-
pointIndex: number;
|
|
25
|
-
pageX: number;
|
|
26
|
-
pageY: number;
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Takes the core and sizing tiers only — no tooltip tier, since this family
|
|
33
|
+
* disables Highcharts' tooltip subsystem entirely (see `shared/chartProps.ts`).
|
|
34
|
+
*/
|
|
35
|
+
interface TypeWordCloudProps extends TypeChartBaseProps, TypeChartSizingProps {
|
|
36
|
+
data: TypeWordCloudDataPoint[];
|
|
30
37
|
/** Competitive mode. Omit for a single-color cloud. */
|
|
31
|
-
groups?:
|
|
38
|
+
groups?: TypeWordCloudGroup[];
|
|
32
39
|
/** Dims every word outside this group. Null or undefined means no dimming. */
|
|
33
40
|
activeGroupId?: string | null;
|
|
34
41
|
/** Raises every word whose name is in this set to full opacity and dims the rest — the consumer decides what belongs in the set (e.g. every word matching the hovered term's text). Null or undefined means no emphasis. */
|
|
35
|
-
activeNames?:
|
|
42
|
+
activeNames?: readonly string[] | null;
|
|
36
43
|
minFontSize?: number;
|
|
37
44
|
maxFontSize?: number;
|
|
38
45
|
/** [min, max] weight-driven opacity ramp. Defaults to [0.6, 1]; pass [1, 1] to disable. */
|
|
@@ -41,17 +48,12 @@ interface WordCloudProps {
|
|
|
41
48
|
wordPadding?: number;
|
|
42
49
|
/** Skips internal container measurement — pass the container's known pixel width directly. Useful in tests (no `ResizeObserver` mocking needed) and anywhere the width is already known. */
|
|
43
50
|
width?: number;
|
|
44
|
-
|
|
45
|
-
/** Accessibility description (Highcharts `accessibility.description`) — required, matching every sibling v2 family. */
|
|
46
|
-
description: string;
|
|
47
|
-
className?: string;
|
|
48
|
-
onClick?: (data: WordCloudClickData) => void;
|
|
51
|
+
onClick?: (data: TypeWordCloudClickData) => void;
|
|
49
52
|
/** Fires on pointer enter with the hovered word's name (and `groupId`, if grouped); `null` on pointer leave. */
|
|
50
53
|
onWordHover?: (data: {
|
|
51
54
|
name: string;
|
|
52
55
|
groupId?: string;
|
|
53
56
|
} | null) => void;
|
|
54
|
-
onReady?: (handle: ChartExportHandle) => void;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/**
|
|
@@ -64,6 +66,6 @@ interface WordCloudProps {
|
|
|
64
66
|
* import both `@sproutsocial/seeds-react-data-viz/chart-styles.css` and
|
|
65
67
|
* `.../wordcloud.css` once (the component never self-imports its CSS).
|
|
66
68
|
*/
|
|
67
|
-
declare const WordCloud: react.NamedExoticComponent<
|
|
69
|
+
declare const WordCloud: react.NamedExoticComponent<TypeWordCloudProps>;
|
|
68
70
|
|
|
69
|
-
export {
|
|
71
|
+
export { type TypeWordCloudClickData, type TypeWordCloudDataPoint, type TypeWordCloudGroup, type TypeWordCloudProps, WordCloud };
|
package/dist/wordcloud/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkI72SSPMXjs = require('../chunk-I72SSPMX.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,8 +8,8 @@ var _chunk6EIJCJCNjs = require('../chunk-6EIJCJCN.js');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('../chunk-
|
|
11
|
+
var _chunkV5EXL244js = require('../chunk-V5EXL244.js');
|
|
12
|
+
require('../chunk-XH7ZKGHD.js');
|
|
13
13
|
|
|
14
14
|
// src/charts/wordcloud/WordCloud.tsx
|
|
15
15
|
var _react = require('react');
|
|
@@ -27,18 +27,18 @@ function resolveActiveWordIndices(activeNames, points) {
|
|
|
27
27
|
return indices.length ? indices : void 0;
|
|
28
28
|
}
|
|
29
29
|
var WordCloud = _react.memo.call(void 0, function WordCloud2(props) {
|
|
30
|
-
const { colors } =
|
|
30
|
+
const { colors } = _chunkV5EXL244js.useSeedsChartSetup.call(void 0, {
|
|
31
31
|
series: _optionalChain([props, 'access', _4 => _4.groups, 'optionalAccess', _5 => _5.length]) ? props.groups.map((group) => ({ color: group.color })) : [{ color: void 0 }]
|
|
32
32
|
});
|
|
33
33
|
const containerRef = _react.useRef.call(void 0, null);
|
|
34
34
|
const { width: measuredWidth } = _seedsreacthooks.useMeasure.call(void 0, containerRef, true);
|
|
35
35
|
const width = _nullishCoalesce(props.width, () => ( measuredWidth));
|
|
36
|
-
const derivedMaxFontSize =
|
|
37
|
-
const derivedMaxWordCount =
|
|
38
|
-
const derivedWordPadding =
|
|
36
|
+
const derivedMaxFontSize = _chunkV5EXL244js.deriveMaxFontSize.call(void 0, width);
|
|
37
|
+
const derivedMaxWordCount = _chunkV5EXL244js.deriveMaxWordCount.call(void 0, width);
|
|
38
|
+
const derivedWordPadding = _chunkV5EXL244js.deriveWordPadding.call(void 0, width);
|
|
39
39
|
const hasActiveNames = props.activeNames !== void 0;
|
|
40
40
|
const options = _react.useMemo.call(void 0,
|
|
41
|
-
() =>
|
|
41
|
+
() => _chunkV5EXL244js.buildWordCloudOptions.call(void 0, props, width, hasActiveNames),
|
|
42
42
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- `width` excluded (see above); the rest is only what `buildWordCloudOptions` reads, not `props` wholesale, so an activeGroupId/activeNames/className/onReady change doesn't rebuild this.
|
|
43
43
|
[
|
|
44
44
|
props.data,
|
|
@@ -66,7 +66,7 @@ var WordCloud = _react.memo.call(void 0, function WordCloud2(props) {
|
|
|
66
66
|
props.activeNames,
|
|
67
67
|
renderedPoints
|
|
68
68
|
);
|
|
69
|
-
const containerProps =
|
|
69
|
+
const containerProps = _chunkI72SSPMXjs.getChartContainerProps.call(void 0, {
|
|
70
70
|
familyClasses: ["seeds-chart-wordcloud"],
|
|
71
71
|
// RAW per-group colors only — an unset group falls through to
|
|
72
72
|
// chart-styles.css's --highcharts-color-N default, matching the
|
|
@@ -92,12 +92,13 @@ var WordCloud = _react.memo.call(void 0, function WordCloud2(props) {
|
|
|
92
92
|
// paint: `chart.hasRendered` never gets set by a wrong-then-corrected
|
|
93
93
|
// double render.
|
|
94
94
|
children: width > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
95
|
-
|
|
95
|
+
_chunkV5EXL244js.ChartRenderer,
|
|
96
96
|
{
|
|
97
97
|
options,
|
|
98
98
|
series: _optionalChain([options, 'access', _12 => _12.series, 'optionalAccess', _13 => _13.length]) ? [{ name: "Word Cloud" }] : [],
|
|
99
99
|
colors,
|
|
100
100
|
hideLegend: true,
|
|
101
|
+
exportTitle: props.exportTitle,
|
|
101
102
|
onReady: props.onReady
|
|
102
103
|
}
|
|
103
104
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/wordcloud/index.js","../../src/charts/wordcloud/WordCloud.tsx"],"names":["WordCloud"],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACA;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F,8BAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/wordcloud/index.js","sourcesContent":[null,"import { memo, useMemo, useRef } from \"react\";\nimport { useMeasure } from \"@sproutsocial/seeds-react-hooks\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport {\n buildWordCloudOptions,\n deriveMaxFontSize,\n deriveMaxWordCount,\n deriveWordPadding,\n} from \"./adapter\";\nimport type {\n SeedsChartWordCloudSeriesOptions,\n WordCloudGroup,\n WordCloudProps,\n} from \"./types\";\n\n/**\n * Resolves `activeGroupId` to its index in `groups` for the container's\n * `data-active-group-index` attribute (layer 2 CSS dimming, wordcloud.css).\n * An unresolvable id (unknown, or no `groups`) is treated the same as\n * null/undefined — no dimming — rather than falling back to group 0, which\n * would incorrectly mark group 0 as \"active\" and dim everything else.\n */\nfunction resolveActiveGroupIndex(\n activeGroupId: string | null | undefined,\n groups: ReadonlyArray<WordCloudGroup> | undefined\n): number | undefined {\n if (activeGroupId == null || !groups?.length) return undefined;\n const index = groups.findIndex((group) => group.id === activeGroupId);\n return index === -1 ? undefined : index;\n}\n\n/**\n * Resolves `activeNames` to the rendered indices of matching points, for the\n * container's `data-active-word-indices` attribute. Reads `points` off the\n * already-built options (not a fresh transform) so indices match what's\n * actually on screen, including `allocateWordsAcrossGroups`'s reordering.\n * Names are unbounded, unlike `activeGroupId`'s small `groups` list, so this\n * keys off each point's bounded position instead — see wordcloud.css's\n * `--index-N` rules (bounded by `WORD_CLOUD_MAXIMUM_WORD_COUNT`).\n */\nfunction resolveActiveWordIndices(\n activeNames: ReadonlyArray<string> | null | undefined,\n points: ReadonlyArray<{ name: string }> | undefined\n): ReadonlyArray<number> | undefined {\n if (!activeNames?.length || !points?.length) return undefined;\n const activeSet = new Set(activeNames);\n const indices = points\n .map((point, i) => (activeSet.has(point.name) ? i : -1))\n .filter((i) => i !== -1);\n return indices.length ? indices : undefined;\n}\n\n/**\n * WordCloud renders a Highcharts wordcloud chart from a flat list of weighted\n * words, optionally grouped (competitive coloring + externally-driven dimming\n * via `activeGroupId` or `activeNames`).\n *\n * Like BubbleChart/DonutChart, it carries no `styled-components`: the wrapper\n * is a plain `<div>` and the Highcharts styling ships as static CSS. Consumers\n * import both `@sproutsocial/seeds-react-data-viz/chart-styles.css` and\n * `.../wordcloud.css` once (the component never self-imports its CSS).\n */\nexport const WordCloud = memo(function WordCloud(props: WordCloudProps) {\n // One \"series\" input per group (or a single default entry when ungrouped),\n // matching bubble/donut's convention: colorIndex slots map 1:1 to entries\n // here, so the resolved `colors` array sizes and resolves correctly for\n // both the live chart and the styledMode:false export clone.\n const { colors } = useSeedsChartSetup({\n series: props.groups?.length\n ? props.groups.map((group) => ({ color: group.color }))\n : [{ color: undefined }],\n });\n\n const containerRef = useRef<HTMLDivElement>(null);\n // `synchronous: true` reads the container's bounds before first paint\n // instead of waiting on ResizeObserver's own (always-async) first\n // callback — otherwise every derive* below sees a false `width: 0` on\n // mount and renders the widest-case guess before snapping to the real\n // layout a tick later (the flash this family shipped with through Slice\n // 8). An explicit `props.width` skips measurement entirely.\n const { width: measuredWidth } = useMeasure(containerRef, true);\n const width = props.width ?? measuredWidth;\n // These derived values, not raw `width`, drive the memo dependency below.\n // Each is a step function of width (`deriveMaxFontSize`/`deriveMaxWordCount`/\n // `deriveWordPadding` in adapter.ts), so a resize tick that lands in the\n // same bucket for all three — most of them, during a drag-resize — leaves\n // the dependency array unchanged and the options object keeps its identity\n // instead of forcing Highcharts to re-lay out the cloud on every\n // ResizeObserver callback.\n const derivedMaxFontSize = deriveMaxFontSize(width);\n const derivedMaxWordCount = deriveMaxWordCount(width);\n const derivedWordPadding = deriveWordPadding(width);\n // Whether `activeNames` is supplied at all, not its current null/array\n // value — see `buildWordCloudOptions`'s `hasActiveNames` doc comment.\n // Stable across hover transitions, so it's safe in the memo deps below.\n const hasActiveNames = props.activeNames !== undefined;\n const options = useMemo(\n () => buildWordCloudOptions(props, width, hasActiveNames),\n // eslint-disable-next-line react-hooks/exhaustive-deps -- `width` excluded (see above); the rest is only what `buildWordCloudOptions` reads, not `props` wholesale, so an activeGroupId/activeNames/className/onReady change doesn't rebuild this.\n [\n props.data,\n props.groups,\n props.opacityRange,\n props.description,\n props.height,\n props.minFontSize,\n props.maxFontSize,\n props.wordPadding,\n props.onClick,\n props.onWordHover,\n hasActiveNames,\n derivedMaxFontSize,\n derivedMaxWordCount,\n derivedWordPadding,\n ]\n );\n const activeGroupIndex = resolveActiveGroupIndex(\n props.activeGroupId,\n props.groups\n );\n const renderedPoints = (\n options.series?.[0] as SeedsChartWordCloudSeriesOptions | undefined\n )?.data;\n const activeWordIndices = resolveActiveWordIndices(\n props.activeNames,\n renderedPoints\n );\n\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-wordcloud\"],\n // RAW per-group colors only — an unset group falls through to\n // chart-styles.css's --highcharts-color-N default, matching the\n // bubble/bar convention. Only an explicit consumer override is inlined.\n colors: props.groups?.map((group) => group.color) ?? [],\n hasOnClick: Boolean(props.onClick),\n className: props.className,\n });\n\n return (\n <div\n ref={containerRef}\n {...containerProps}\n {...(activeGroupIndex !== undefined\n ? { \"data-active-group-index\": activeGroupIndex }\n : {})}\n {...(activeWordIndices !== undefined\n ? { \"data-active-word-indices\": activeWordIndices.join(\" \") }\n : {})}\n >\n {\n // Gate the chart's one-and-only real mount on a genuinely measured\n // width. This container `<div>` still always renders (measuring it\n // is what produces `measuredWidth` in the first place) — but a\n // `width` of 0 means \"no room to lay out yet,\" not \"assume the\n // widest case,\" so nothing else renders until it's positive. This\n // is also what makes Highcharts' native center-burst entrance\n // animation (plotOptions.wordcloud.animation, above) fire on first\n // paint: `chart.hasRendered` never gets set by a wrong-then-corrected\n // double render.\n width > 0 && (\n <ChartRenderer\n options={options}\n // A single Highcharts series (all words), so a single entry here —\n // its only job is satisfying ChartRenderer's non-empty-series check,\n // since hideLegend suppresses the legend this would otherwise feed.\n series={options.series?.length ? [{ name: \"Word Cloud\" }] : []}\n colors={colors}\n hideLegend\n onReady={props.onReady}\n />\n )\n }\n </div>\n );\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/wordcloud/index.js","../../src/charts/wordcloud/WordCloud.tsx"],"names":["WordCloud"],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACbA,8BAAsC;AACtC,kEAA2B;AAgKjB,+CAAA;AA1IV,SAAS,uBAAA,CACP,aAAA,EACA,MAAA,EACoB;AACpB,EAAA,GAAA,CAAI,cAAA,GAAiB,KAAA,GAAQ,iBAAC,MAAA,2BAAQ,QAAA,EAAQ,OAAO,KAAA,CAAA;AACrD,EAAA,MAAM,MAAA,EAAQ,MAAA,CAAO,SAAA,CAAU,CAAC,KAAA,EAAA,GAAU,KAAA,CAAM,GAAA,IAAO,aAAa,CAAA;AACpE,EAAA,OAAO,MAAA,IAAU,CAAA,EAAA,EAAK,KAAA,EAAA,EAAY,KAAA;AACpC;AAWA,SAAS,wBAAA,CACP,WAAA,EACA,MAAA,EAC+B;AAC/B,EAAA,GAAA,CAAI,iBAAC,WAAA,6BAAa,SAAA,GAAU,iBAAC,MAAA,6BAAQ,QAAA,EAAQ,OAAO,KAAA,CAAA;AACpD,EAAA,MAAM,UAAA,EAAY,IAAI,GAAA,CAAI,WAAW,CAAA;AACrC,EAAA,MAAM,QAAA,EAAU,MAAA,CACb,GAAA,CAAI,CAAC,KAAA,EAAO,CAAA,EAAA,GAAO,SAAA,CAAU,GAAA,CAAI,KAAA,CAAM,IAAI,EAAA,EAAI,EAAA,EAAI,CAAA,CAAG,CAAA,CACtD,MAAA,CAAO,CAAC,CAAA,EAAA,GAAM,EAAA,IAAM,CAAA,CAAE,CAAA;AACzB,EAAA,OAAO,OAAA,CAAQ,OAAA,EAAS,QAAA,E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AAA;AAAA,QAAA;AAAA,UACC,OAAA;AAAA,UAIA,MAAA,kBAAQ,OAAA,uBAAQ,MAAA,+BAAQ,SAAA,EAAS,CAAC,EAAE,IAAA,EAAM,aAAa,CAAC,EAAA,EAAI,CAAC,CAAA;AAAA,UAC7D,MAAA;AAAA,UACA,UAAA,EAAU,IAAA;AAAA,UACV,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,UACnB,OAAA,EAAS,KAAA,CAAM;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EAGN,CAAA;AAEJ,CAAC,CAAA;ADrED;AACE;AACF,8BAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/wordcloud/index.js","sourcesContent":[null,"import { memo, useMemo, useRef } from \"react\";\nimport { useMeasure } from \"@sproutsocial/seeds-react-hooks\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport {\n buildWordCloudOptions,\n deriveMaxFontSize,\n deriveMaxWordCount,\n deriveWordPadding,\n} from \"./adapter\";\nimport type {\n TypeSeedsChartWordCloudSeriesOptions,\n TypeWordCloudGroup,\n TypeWordCloudProps,\n} from \"./types\";\n\n/**\n * Resolves `activeGroupId` to its index in `groups` for the container's\n * `data-active-group-index` attribute (layer 2 CSS dimming, wordcloud.css).\n * An unresolvable id (unknown, or no `groups`) is treated the same as\n * null/undefined — no dimming — rather than falling back to group 0, which\n * would incorrectly mark group 0 as \"active\" and dim everything else.\n */\nfunction resolveActiveGroupIndex(\n activeGroupId: string | null | undefined,\n groups: readonly TypeWordCloudGroup[] | undefined\n): number | undefined {\n if (activeGroupId == null || !groups?.length) return undefined;\n const index = groups.findIndex((group) => group.id === activeGroupId);\n return index === -1 ? undefined : index;\n}\n\n/**\n * Resolves `activeNames` to the rendered indices of matching points, for the\n * container's `data-active-word-indices` attribute. Reads `points` off the\n * already-built options (not a fresh transform) so indices match what's\n * actually on screen, including `allocateWordsAcrossGroups`'s reordering.\n * Names are unbounded, unlike `activeGroupId`'s small `groups` list, so this\n * keys off each point's bounded position instead — see wordcloud.css's\n * `--index-N` rules (bounded by `WORD_CLOUD_MAXIMUM_WORD_COUNT`).\n */\nfunction resolveActiveWordIndices(\n activeNames: readonly string[] | null | undefined,\n points: readonly { name: string }[] | undefined\n): readonly number[] | undefined {\n if (!activeNames?.length || !points?.length) return undefined;\n const activeSet = new Set(activeNames);\n const indices = points\n .map((point, i) => (activeSet.has(point.name) ? i : -1))\n .filter((i) => i !== -1);\n return indices.length ? indices : undefined;\n}\n\n/**\n * WordCloud renders a Highcharts wordcloud chart from a flat list of weighted\n * words, optionally grouped (competitive coloring + externally-driven dimming\n * via `activeGroupId` or `activeNames`).\n *\n * Like BubbleChart/DonutChart, it carries no `styled-components`: the wrapper\n * is a plain `<div>` and the Highcharts styling ships as static CSS. Consumers\n * import both `@sproutsocial/seeds-react-data-viz/chart-styles.css` and\n * `.../wordcloud.css` once (the component never self-imports its CSS).\n */\nexport const WordCloud = memo(function WordCloud(props: TypeWordCloudProps) {\n // One \"series\" input per group (or a single default entry when ungrouped),\n // matching bubble/donut's convention: colorIndex slots map 1:1 to entries\n // here, so the resolved `colors` array sizes and resolves correctly for\n // both the live chart and the styledMode:false export clone.\n const { colors } = useSeedsChartSetup({\n series: props.groups?.length\n ? props.groups.map((group) => ({ color: group.color }))\n : [{ color: undefined }],\n });\n\n const containerRef = useRef<HTMLDivElement>(null);\n // `synchronous: true` reads the container's bounds before first paint\n // instead of waiting on ResizeObserver's own (always-async) first\n // callback — otherwise every derive* below sees a false `width: 0` on\n // mount and renders the widest-case guess before snapping to the real\n // layout a tick later (the flash this family shipped with through Slice\n // 8). An explicit `props.width` skips measurement entirely.\n const { width: measuredWidth } = useMeasure(containerRef, true);\n const width = props.width ?? measuredWidth;\n // These derived values, not raw `width`, drive the memo dependency below.\n // Each is a step function of width (`deriveMaxFontSize`/`deriveMaxWordCount`/\n // `deriveWordPadding` in adapter.ts), so a resize tick that lands in the\n // same bucket for all three — most of them, during a drag-resize — leaves\n // the dependency array unchanged and the options object keeps its identity\n // instead of forcing Highcharts to re-lay out the cloud on every\n // ResizeObserver callback.\n const derivedMaxFontSize = deriveMaxFontSize(width);\n const derivedMaxWordCount = deriveMaxWordCount(width);\n const derivedWordPadding = deriveWordPadding(width);\n // Whether `activeNames` is supplied at all, not its current null/array\n // value — see `buildWordCloudOptions`'s `hasActiveNames` doc comment.\n // Stable across hover transitions, so it's safe in the memo deps below.\n const hasActiveNames = props.activeNames !== undefined;\n const options = useMemo(\n () => buildWordCloudOptions(props, width, hasActiveNames),\n // eslint-disable-next-line react-hooks/exhaustive-deps -- `width` excluded (see above); the rest is only what `buildWordCloudOptions` reads, not `props` wholesale, so an activeGroupId/activeNames/className/onReady change doesn't rebuild this.\n [\n props.data,\n props.groups,\n props.opacityRange,\n props.description,\n props.height,\n props.minFontSize,\n props.maxFontSize,\n props.wordPadding,\n props.onClick,\n props.onWordHover,\n hasActiveNames,\n derivedMaxFontSize,\n derivedMaxWordCount,\n derivedWordPadding,\n ]\n );\n const activeGroupIndex = resolveActiveGroupIndex(\n props.activeGroupId,\n props.groups\n );\n const renderedPoints = (\n options.series?.[0] as TypeSeedsChartWordCloudSeriesOptions | undefined\n )?.data;\n const activeWordIndices = resolveActiveWordIndices(\n props.activeNames,\n renderedPoints\n );\n\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-wordcloud\"],\n // RAW per-group colors only — an unset group falls through to\n // chart-styles.css's --highcharts-color-N default, matching the\n // bubble/bar convention. Only an explicit consumer override is inlined.\n colors: props.groups?.map((group) => group.color) ?? [],\n hasOnClick: Boolean(props.onClick),\n className: props.className,\n });\n\n return (\n <div\n ref={containerRef}\n {...containerProps}\n {...(activeGroupIndex !== undefined\n ? { \"data-active-group-index\": activeGroupIndex }\n : {})}\n {...(activeWordIndices !== undefined\n ? { \"data-active-word-indices\": activeWordIndices.join(\" \") }\n : {})}\n >\n {\n // Gate the chart's one-and-only real mount on a genuinely measured\n // width. This container `<div>` still always renders (measuring it\n // is what produces `measuredWidth` in the first place) — but a\n // `width` of 0 means \"no room to lay out yet,\" not \"assume the\n // widest case,\" so nothing else renders until it's positive. This\n // is also what makes Highcharts' native center-burst entrance\n // animation (plotOptions.wordcloud.animation, above) fire on first\n // paint: `chart.hasRendered` never gets set by a wrong-then-corrected\n // double render.\n width > 0 && (\n <ChartRenderer\n options={options}\n // A single Highcharts series (all words), so a single entry here —\n // its only job is satisfying ChartRenderer's non-empty-series check,\n // since hideLegend suppresses the legend this would otherwise feed.\n series={options.series?.length ? [{ name: \"Word Cloud\" }] : []}\n colors={colors}\n hideLegend\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n )\n }\n </div>\n );\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/seeds-react-data-viz",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Seeds React Data Viz Components",
|
|
5
5
|
"author": "Sprout Social, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@sproutsocial/seeds-react-duration": "^1.0.36",
|
|
83
83
|
"@sproutsocial/seeds-react-hooks": "^3.3.2",
|
|
84
84
|
"@sproutsocial/seeds-react-icon": "^2.5.2",
|
|
85
|
-
"@sproutsocial/seeds-react-menu": "^1.18.
|
|
85
|
+
"@sproutsocial/seeds-react-menu": "^1.18.1",
|
|
86
86
|
"@sproutsocial/seeds-react-numeral": "^1.0.60",
|
|
87
87
|
"@sproutsocial/seeds-react-partner-logo": "^1.7.24",
|
|
88
88
|
"@sproutsocial/seeds-react-system-props": "^3.2.1",
|