@sproutsocial/seeds-react-data-viz 0.16.1 → 0.17.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 (56) hide show
  1. package/dist/annotations-CjFoRPXf.d.mts +20 -0
  2. package/dist/annotations-CjFoRPXf.d.ts +20 -0
  3. package/dist/axis-WOeYkTO1.d.mts +44 -0
  4. package/dist/axis-WOeYkTO1.d.ts +44 -0
  5. package/dist/bar/index.d.mts +3 -1
  6. package/dist/bar/index.d.ts +3 -1
  7. package/dist/bar/index.js +12 -8
  8. package/dist/bar/index.js.map +1 -1
  9. package/dist/{axis-BVPkC6iF.d.ts → chartBase-C-l7yYGx.d.ts} +5 -59
  10. package/dist/{axis-BjucJt39.d.mts → chartBase-Cn_5CUJi.d.mts} +5 -59
  11. package/dist/{chunk-EJYDQYLE.js → chunk-2K7PFHIM.js} +92 -245
  12. package/dist/chunk-2K7PFHIM.js.map +1 -0
  13. package/dist/chunk-6D7P3IOT.js +150 -0
  14. package/dist/chunk-6D7P3IOT.js.map +1 -0
  15. package/dist/chunk-CYQXUAJC.js +169 -0
  16. package/dist/chunk-CYQXUAJC.js.map +1 -0
  17. package/dist/chunk-VVGBJOFH.js +68 -0
  18. package/dist/chunk-VVGBJOFH.js.map +1 -0
  19. package/dist/donut/index.d.mts +48 -0
  20. package/dist/donut/index.d.ts +48 -0
  21. package/dist/donut/index.js +125 -0
  22. package/dist/donut/index.js.map +1 -0
  23. package/dist/esm/bar/index.js +10 -6
  24. package/dist/esm/bar/index.js.map +1 -1
  25. package/dist/esm/chunk-AUJ3EWRH.js +68 -0
  26. package/dist/esm/chunk-AUJ3EWRH.js.map +1 -0
  27. package/dist/esm/{chunk-DKTW56NJ.js → chunk-LPQXJJNT.js} +93 -246
  28. package/dist/esm/chunk-LPQXJJNT.js.map +1 -0
  29. package/dist/esm/chunk-NAKJY5PA.js +150 -0
  30. package/dist/esm/chunk-NAKJY5PA.js.map +1 -0
  31. package/dist/esm/chunk-XMYGML25.js +169 -0
  32. package/dist/esm/chunk-XMYGML25.js.map +1 -0
  33. package/dist/esm/donut/index.js +125 -0
  34. package/dist/esm/donut/index.js.map +1 -0
  35. package/dist/esm/index.js +13 -157
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist/esm/line-area/index.js +11 -6
  38. package/dist/esm/line-area/index.js.map +1 -1
  39. package/dist/esm/sparkline/index.js +123 -0
  40. package/dist/esm/sparkline/index.js.map +1 -0
  41. package/dist/index.d.mts +3 -0
  42. package/dist/index.d.ts +3 -0
  43. package/dist/index.js +55 -199
  44. package/dist/index.js.map +1 -1
  45. package/dist/line-area/index.d.mts +6 -3
  46. package/dist/line-area/index.d.ts +6 -3
  47. package/dist/line-area/index.js +13 -8
  48. package/dist/line-area/index.js.map +1 -1
  49. package/dist/sparkline/index.d.mts +75 -0
  50. package/dist/sparkline/index.d.ts +75 -0
  51. package/dist/sparkline/index.js +123 -0
  52. package/dist/sparkline/index.js.map +1 -0
  53. package/dist/sparkline.css +76 -0
  54. package/package.json +13 -2
  55. package/dist/chunk-EJYDQYLE.js.map +0 -1
  56. package/dist/esm/chunk-DKTW56NJ.js.map +0 -1
@@ -0,0 +1,150 @@
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; }// src/charts/shared/formatters/datetimeFormatter.ts
2
+ var DAY_MS = 864e5;
3
+ var WEEK_MS = 6048e5;
4
+ var MIN_MONTH_MS = 24192e5;
5
+ var MIN_YEAR_MS = 31536e6;
6
+ var getDatePartsInTimezone = (date, timezone) => {
7
+ const formatter = new Intl.DateTimeFormat("en-US", {
8
+ year: "numeric",
9
+ month: "numeric",
10
+ day: "numeric",
11
+ timeZone: timezone
12
+ });
13
+ const parts = formatter.formatToParts(date);
14
+ return {
15
+ day: parseInt(_nullishCoalesce(_optionalChain([parts, 'access', _ => _.find, 'call', _2 => _2((p) => p.type === "day"), 'optionalAccess', _3 => _3.value]), () => ( "0")), 10),
16
+ month: parseInt(_nullishCoalesce(_optionalChain([parts, 'access', _4 => _4.find, 'call', _5 => _5((p) => p.type === "month"), 'optionalAccess', _6 => _6.value]), () => ( "0")), 10),
17
+ year: parseInt(_nullishCoalesce(_optionalChain([parts, 'access', _7 => _7.find, 'call', _8 => _8((p) => p.type === "year"), 'optionalAccess', _9 => _9.value]), () => ( "0")), 10)
18
+ };
19
+ };
20
+ var deriveGranularity = (tickPositions) => {
21
+ if (tickPositions.length < 2) {
22
+ return "day";
23
+ }
24
+ const deltas = [];
25
+ for (let i = 1; i < tickPositions.length; i++) {
26
+ const curr = tickPositions[i];
27
+ const prev = tickPositions[i - 1];
28
+ if (curr === void 0 || prev === void 0) {
29
+ continue;
30
+ }
31
+ deltas.push(Math.abs(curr - prev));
32
+ }
33
+ deltas.sort((a, b) => a - b);
34
+ const mid = Math.floor(deltas.length / 2);
35
+ const upper = deltas[mid];
36
+ const lower = deltas[mid - 1];
37
+ const median = deltas.length % 2 === 0 && lower !== void 0 ? (lower + upper) / 2 : upper;
38
+ if (median < DAY_MS) {
39
+ return "hour";
40
+ }
41
+ if (median < WEEK_MS) {
42
+ return "day";
43
+ }
44
+ if (median < MIN_MONTH_MS) {
45
+ return "week";
46
+ }
47
+ if (median < MIN_YEAR_MS) {
48
+ return "month";
49
+ }
50
+ return "year";
51
+ };
52
+ function datetimeFormatter({
53
+ value,
54
+ tickPositions = [],
55
+ // optional
56
+ timezone = "UTC",
57
+ timeFormat = "12",
58
+ textLocale = "en-US"
59
+ }) {
60
+ if (typeof value === "string" || !Number.isFinite(value)) {
61
+ return { primary: String(value) };
62
+ }
63
+ const granularity = deriveGranularity(tickPositions);
64
+ const tickIndex = tickPositions.indexOf(value);
65
+ const isFirst = tickIndex === 0;
66
+ const previousValue = tickPositions[tickIndex - 1];
67
+ const valueDate = new Date(value);
68
+ const valueParts = getDatePartsInTimezone(valueDate, timezone);
69
+ const previousValueDate = previousValue ? new Date(previousValue) : void 0;
70
+ const previousValueParts = previousValueDate ? getDatePartsInTimezone(previousValueDate, timezone) : void 0;
71
+ let firstPartOptions = {};
72
+ let secondPartOptions = {};
73
+ switch (granularity) {
74
+ case "hour":
75
+ firstPartOptions = timeFormat === "24" ? { hour: "numeric", minute: "numeric", hour12: false } : { hour: "numeric" };
76
+ if (isFirst || valueParts.day !== _optionalChain([previousValueParts, 'optionalAccess', _10 => _10.day])) {
77
+ secondPartOptions = { day: "numeric", month: "short" };
78
+ }
79
+ break;
80
+ case "day":
81
+ case "week":
82
+ firstPartOptions = { day: "numeric" };
83
+ if (isFirst || valueParts.month !== _optionalChain([previousValueParts, 'optionalAccess', _11 => _11.month])) {
84
+ secondPartOptions = { month: "short" };
85
+ }
86
+ break;
87
+ case "month":
88
+ firstPartOptions = { month: "short" };
89
+ if (isFirst || valueParts.year !== _optionalChain([previousValueParts, 'optionalAccess', _12 => _12.year])) {
90
+ secondPartOptions = { year: "numeric" };
91
+ }
92
+ break;
93
+ case "year":
94
+ firstPartOptions = { year: "numeric" };
95
+ break;
96
+ default:
97
+ firstPartOptions = {};
98
+ break;
99
+ }
100
+ const primary = new Intl.DateTimeFormat(textLocale, {
101
+ ...firstPartOptions,
102
+ timeZone: timezone
103
+ }).format(valueDate);
104
+ if (Object.keys(secondPartOptions).length > 0) {
105
+ const secondary = new Intl.DateTimeFormat(textLocale, {
106
+ ...secondPartOptions,
107
+ timeZone: timezone
108
+ }).format(valueDate);
109
+ return { primary, secondary };
110
+ }
111
+ return { primary };
112
+ }
113
+
114
+ // src/charts/shared/axisOptions.ts
115
+ function makeDatetimeAxisLabelFormatter(timezone, timeFormat) {
116
+ return function() {
117
+ const { primary, secondary } = datetimeFormatter({
118
+ value: this.value,
119
+ tickPositions: _nullishCoalesce(this.axis.tickPositions, () => ( [])),
120
+ timezone,
121
+ timeFormat
122
+ });
123
+ return secondary ? `${primary}<br/><span class="hc-axis-label-secondary">${secondary}</span>` : primary;
124
+ };
125
+ }
126
+ function buildDimensionalAxis(axis, timezone) {
127
+ if (axis.type === "datetime") {
128
+ return {
129
+ type: "datetime",
130
+ crosshair: axis.crosshair,
131
+ labels: {
132
+ formatter: makeDatetimeAxisLabelFormatter(timezone, axis.timeFormat)
133
+ }
134
+ };
135
+ }
136
+ return {
137
+ type: "category",
138
+ categories: [...axis.categories],
139
+ crosshair: axis.crosshair
140
+ };
141
+ }
142
+ function resolveTooltipTimezone(axis, timezone) {
143
+ return axis.type === "datetime" ? _nullishCoalesce(timezone, () => ( "UTC")) : void 0;
144
+ }
145
+
146
+
147
+
148
+
149
+ exports.buildDimensionalAxis = buildDimensionalAxis; exports.resolveTooltipTimezone = resolveTooltipTimezone;
150
+ //# sourceMappingURL=chunk-6D7P3IOT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-6D7P3IOT.js","../src/charts/shared/formatters/datetimeFormatter.ts","../src/charts/shared/axisOptions.ts"],"names":[],"mappings":"AAAA;AC2CA,IAAM,OAAA,EAAS,KAAA;AACf,IAAM,QAAA,EAAU,MAAA;AAQhB,IAAM,aAAA,EAAe,OAAA;AACrB,IAAM,YAAA,EAAc,OAAA;AAQpB,IAAM,uBAAA,EAAyB,CAAC,IAAA,EAAY,QAAA,EAAA,GAAqB;AAC/D,EAAA,MAAM,UAAA,EAAY,IAAI,IAAA,CAAK,cAAA,CAAe,OAAA,EAAS;AAAA,IACjD,IAAA,EAAM,SAAA;AAAA,IACN,KAAA,EAAO,SAAA;AAAA,I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A,EACA;AACA,EAAA,OAAO,QAAA,CAAA,EAAwD;AAC7D,IAAA,MAAM,EAAE,OAAA,EAAS,UAAU,EAAA,EAAI,iBAAA,CAAkB;AAAA,MAC/C,KAAA,EAAO,IAAA,CAAK,KAAA;AAAA,MACZ,aAAA,mBAAe,IAAA,CAAK,IAAA,CAAK,aAAA,UAAiB,CAAC,GAAA;AAAA,MAC3C,QAAA;AAAA,MACA;AAAA,IACF,CAAC,CAAA;AACD,IAAA,OAAO,UAAA,EACH,CAAA,EAAA;AAEN,EAAA;AACF;AAOgB;AAII,EAAA;AACT,IAAA;AACC,MAAA;AACU,MAAA;AACR,MAAA;AACK,QAAA;AACb,MAAA;AACF,IAAA;AACF,EAAA;AACO,EAAA;AACC,IAAA;AACU,IAAA;AACA,IAAA;AAClB,EAAA;AACF;AAOgB;AAIO,EAAA;AACvB;AFoEwB;AACA;AACA;AACA;AACA","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-6D7P3IOT.js","sourcesContent":[null,"/**\n * Pure, Highcharts-free datetime axis label formatter for v2 chart families.\n *\n * Ports v1's `helpers/xAxisLabelFormatter` into a rendering-agnostic shape: it\n * returns a `{ primary, secondary? }` object instead of an HTML string, leaving\n * SVG rendering to the caller. The timezone- and DST-correct boundary detection\n * (calendar parts read in the target timezone) and the per-granularity\n * `Intl.DateTimeFormat` option sets are a near-verbatim port of v1.\n *\n * The one net-new piece versus v1 is granularity derivation: v1 receives\n * `unitName` from Highcharts, but `charts/` may not depend on Highcharts types\n * (see `charts/README.md` invariants), so granularity is derived from the\n * spacing of `tickPositions`.\n */\n\n// Local types — defined here rather than imported from the Highcharts package\n// or v1's src/types.ts, to keep charts/ self-contained per the README invariant.\nexport type DatetimeTimeFormat = \"12\" | \"24\";\n\nexport type DatetimeLabel = Readonly<{\n primary: string;\n /** Omitted (undefined) when the tick is not on a unit boundary. */\n secondary?: string;\n}>;\n\ntype DatetimeGranularity = \"hour\" | \"day\" | \"week\" | \"month\" | \"year\";\n\ntype DatetimeFormatterInput = Readonly<{\n /** ms-epoch tick value, or a categorical string passed through verbatim. */\n value: number | string;\n /** Full tick array — used for boundary lookup and granularity derivation. */\n tickPositions: readonly number[];\n // optional\n /** IANA timezone. Defaults to \"UTC\". */\n timezone?: string;\n /** \"12\" | \"24\" hour clock for the hour granularity. Defaults to \"12\". */\n timeFormat?: DatetimeTimeFormat;\n /** Locale for Intl formatting. Defaults to \"en-US\". */\n textLocale?: Intl.LocalesArgument;\n}>;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars -- kept alongside DAY_MS/WEEK_MS for upcoming duration formatting; stable numeric constant unlikely to drift\nconst HOUR_MS = 3_600_000;\nconst DAY_MS = 86_400_000;\nconst WEEK_MS = 604_800_000;\n// Granularity cutoffs use the *minimum* month/year length, not the average, so\n// calendar-aligned axes classify correctly: a real Highcharts month-unit axis\n// sits 28–31d apart and a year-unit axis 365–366d apart. Comparing the median\n// tick delta against the *average* month (30.44d) / year (365.25d) length\n// misclassified a 28-day February month gap as \"week\" and a 365-day non-leap\n// year as \"month\". Bias to the minimum so the shortest real span still reads as\n// \"month\" / \"year\".\nconst MIN_MONTH_MS = 2_419_200_000; // 28 days (shortest month, non-leap Feb)\nconst MIN_YEAR_MS = 31_536_000_000; // 365 days (shortest, non-leap year)\n\n/**\n * Reads the calendar day/month/year of a date *in the target timezone* via\n * `Intl.DateTimeFormat(...).formatToParts`. This is what makes boundary\n * detection timezone- and DST-correct (a 25-hour \"fall back\" day still rolls\n * the day over on the correct local-midnight tick). Ported verbatim from v1.\n */\nconst getDatePartsInTimezone = (date: Date, timezone: string) => {\n const formatter = new Intl.DateTimeFormat(\"en-US\", {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n timeZone: timezone,\n });\n const parts = formatter.formatToParts(date);\n return {\n day: parseInt(parts.find((p) => p.type === \"day\")?.value ?? \"0\", 10),\n month: parseInt(parts.find((p) => p.type === \"month\")?.value ?? \"0\", 10),\n year: parseInt(parts.find((p) => p.type === \"year\")?.value ?? \"0\", 10),\n };\n};\n\n/**\n * Derives the axis granularity from the median delta between consecutive\n * `tickPositions`. Median (not mean) so an irregular first/last gap does not\n * skew the result. With fewer than two ticks there is no spacing to measure, so\n * we default to \"day\".\n *\n * Note: \"day\" and \"week\" produce identical output (same primary/secondary\n * option sets), so the day/week threshold is cosmetic and never changes a label.\n * The week↔month and month↔year cutoffs do change output, so they compare\n * against the *minimum* month/year length (not the average); see MIN_MONTH_MS /\n * MIN_YEAR_MS for why calendar-aligned axes would otherwise be misclassified.\n */\nconst deriveGranularity = (\n tickPositions: readonly number[]\n): DatetimeGranularity => {\n if (tickPositions.length < 2) {\n return \"day\";\n }\n\n const deltas: number[] = [];\n for (let i = 1; i < tickPositions.length; i++) {\n const curr = tickPositions[i];\n const prev = tickPositions[i - 1];\n // Both reads are in range by the loop bounds (1 <= i < length); the guard\n // only satisfies noUncheckedIndexedAccess and is unreachable at runtime.\n if (curr === undefined || prev === undefined) {\n continue;\n }\n deltas.push(Math.abs(curr - prev));\n }\n deltas.sort((a, b) => a - b);\n\n const mid = Math.floor(deltas.length / 2);\n // `length >= 2` is guaranteed by the early return above, so `deltas` has at\n // least one element and `deltas[mid]` is always defined; `deltas[mid - 1]` is\n // only read on the even-length branch, where it is guaranteed in range too.\n const upper = deltas[mid]!;\n const lower = deltas[mid - 1];\n const median =\n deltas.length % 2 === 0 && lower !== undefined\n ? (lower + upper) / 2\n : upper;\n\n if (median < DAY_MS) {\n return \"hour\";\n }\n if (median < WEEK_MS) {\n return \"day\";\n }\n if (median < MIN_MONTH_MS) {\n return \"week\";\n }\n if (median < MIN_YEAR_MS) {\n return \"month\";\n }\n return \"year\";\n};\n\n/**\n * Derives a datetime tick's two-line stacked label as a rendering-agnostic\n * `{ primary, secondary? }` object. `secondary` is emitted only on a unit\n * boundary (the first tick, or when the relevant calendar part changes versus\n * the previous tick), matching v1's two-line semantics.\n *\n * Categorical (string) values and non-finite numbers are passed through as\n * `{ primary: String(value) }` with no secondary, so callers always get a\n * stable, markup-free string rather than \"Invalid Date\".\n */\nexport function datetimeFormatter({\n value,\n tickPositions = [],\n // optional\n timezone = \"UTC\",\n timeFormat = \"12\",\n textLocale = \"en-US\",\n}: DatetimeFormatterInput): DatetimeLabel {\n // Categorical (string) data, and non-finite timestamps, pass through.\n if (typeof value === \"string\" || !Number.isFinite(value)) {\n return { primary: String(value) };\n }\n\n const granularity = deriveGranularity(tickPositions);\n\n const tickIndex = tickPositions.indexOf(value);\n const isFirst = tickIndex === 0;\n const previousValue = tickPositions[tickIndex - 1];\n\n const valueDate = new Date(value);\n const valueParts = getDatePartsInTimezone(valueDate, timezone);\n const previousValueDate = previousValue ? new Date(previousValue) : undefined;\n const previousValueParts = previousValueDate\n ? getDatePartsInTimezone(previousValueDate, timezone)\n : undefined;\n\n let firstPartOptions: Intl.DateTimeFormatOptions = {};\n let secondPartOptions: Intl.DateTimeFormatOptions = {};\n\n switch (granularity) {\n case \"hour\":\n firstPartOptions =\n timeFormat === \"24\"\n ? { hour: \"numeric\", minute: \"numeric\", hour12: false }\n : { hour: \"numeric\" };\n if (isFirst || valueParts.day !== previousValueParts?.day) {\n secondPartOptions = { day: \"numeric\", month: \"short\" };\n }\n break;\n case \"day\":\n case \"week\":\n firstPartOptions = { day: \"numeric\" };\n if (isFirst || valueParts.month !== previousValueParts?.month) {\n secondPartOptions = { month: \"short\" };\n }\n break;\n case \"month\":\n firstPartOptions = { month: \"short\" };\n if (isFirst || valueParts.year !== previousValueParts?.year) {\n secondPartOptions = { year: \"numeric\" };\n }\n break;\n case \"year\":\n firstPartOptions = { year: \"numeric\" };\n break;\n default:\n firstPartOptions = {};\n break;\n }\n\n const primary = new Intl.DateTimeFormat(textLocale, {\n ...firstPartOptions,\n timeZone: timezone,\n }).format(valueDate);\n\n if (Object.keys(secondPartOptions).length > 0) {\n const secondary = new Intl.DateTimeFormat(textLocale, {\n ...secondPartOptions,\n timeZone: timezone,\n }).format(valueDate);\n return { primary, secondary };\n }\n\n return { primary };\n}\n","// Shared adapter helpers for the X/Y chart families (bar, line-area, …). Each\n// family's adapter still owns its `chart.type`, `plotOptions`, `series`, and\n// value (y) axis; these utilities cover the dimensional-axis + timezone wiring\n// that is identical across families, so it lives in one place.\n//\n// Deliberately granular (one concern per function) rather than a single base-\n// options builder, so a non-X/Y family like donut can reuse the subset that\n// applies to it. The broader shared-shell + value-axis sharing is left to the\n// X/Y pattern-sharing spike — the value axis in particular diverges per family\n// today (e.g. bar's declarative `format` from CE-41), so it stays per-family.\n\nimport type { DimensionalAxis } from \"./axis\";\nimport type {\n SeedsAxisLabelFormatterContext,\n SeedsChartXAxisOptions,\n} from \"./chartBase\";\nimport { datetimeFormatter } from \"./formatters/datetimeFormatter\";\nimport type { DatetimeTimeFormat } from \"./formatters/datetimeFormatter\";\n\n// Datetime tick labels: a granularity-aware, timezone/DST-correct two-line\n// stacked label via the shared `datetimeFormatter`, rendered as SVG. `<br/>` is a\n// line break in Highcharts' SVG text (styledMode, useHTML: false); the secondary\n// token is wrapped in a <span> — rendered as a <tspan> — styled by the\n// `.highcharts-xaxis-labels` rule in `styles/chartStyles.ts`.\nfunction makeDatetimeAxisLabelFormatter(\n timezone: string,\n timeFormat: DatetimeTimeFormat | undefined\n) {\n return function (this: SeedsAxisLabelFormatterContext): string {\n const { primary, secondary } = datetimeFormatter({\n value: this.value,\n tickPositions: this.axis.tickPositions ?? [],\n timezone,\n timeFormat,\n });\n return secondary\n ? `${primary}<br/><span class=\"hc-axis-label-secondary\">${secondary}</span>`\n : primary;\n };\n}\n\n/**\n * Builds the dimensional (x) axis options shared by the X/Y chart families.\n * Category axes pass their labels through; datetime axes get the granularity-\n * aware two-line label formatter. `timezone` is only consulted for datetime.\n */\nexport function buildDimensionalAxis(\n axis: DimensionalAxis,\n timezone: string\n): SeedsChartXAxisOptions {\n if (axis.type === \"datetime\") {\n return {\n type: \"datetime\",\n crosshair: axis.crosshair,\n labels: {\n formatter: makeDatetimeAxisLabelFormatter(timezone, axis.timeFormat),\n },\n };\n }\n return {\n type: \"category\",\n categories: [...axis.categories],\n crosshair: axis.crosshair,\n };\n}\n\n/**\n * The timezone shared by datetime-axis ticks (`time.timezone`) and the tooltip\n * date formatter, so they can never disagree about the day. Defaults to `\"UTC\"`\n * on a datetime axis; `undefined` on a category axis (timezone is meaningless).\n */\nexport function resolveTooltipTimezone(\n axis: DimensionalAxis,\n timezone?: string\n): string | undefined {\n return axis.type === \"datetime\" ? timezone ?? \"UTC\" : undefined;\n}\n"]}
@@ -0,0 +1,169 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/constants/chartOptions.ts
2
+ var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash);
3
+ var baseChartOptions = {
4
+ chart: {
5
+ animation: false,
6
+ styledMode: true
7
+ },
8
+ credits: {
9
+ enabled: false
10
+ },
11
+ exporting: {
12
+ enabled: false,
13
+ fallbackToExportServer: false
14
+ },
15
+ legend: {
16
+ enabled: false
17
+ },
18
+ title: {
19
+ text: void 0
20
+ },
21
+ tooltip: {
22
+ hideDelay: 0,
23
+ outside: true,
24
+ padding: 0,
25
+ shape: "rect",
26
+ shared: true,
27
+ useHTML: true
28
+ }
29
+ };
30
+ var TIME_SERIES_CHART_HEIGHT = 275;
31
+ var timeSeriesChartOptions = _lodash2.default.merge({}, baseChartOptions, {
32
+ annotations: [
33
+ {
34
+ draggable: "",
35
+ labelOptions: {
36
+ useHTML: true,
37
+ padding: 0
38
+ // removes "left" property padding created by highcharts so that label is centered
39
+ }
40
+ }
41
+ ],
42
+ chart: {
43
+ // events.click is set at the component level because of the optional onClick prop
44
+ height: TIME_SERIES_CHART_HEIGHT,
45
+ spacing: [5, 1, 0, 2]
46
+ },
47
+ plotOptions: {
48
+ series: {
49
+ animation: false,
50
+ clip: false,
51
+ marker: {
52
+ enabled: false,
53
+ states: {
54
+ hover: {
55
+ enabled: false
56
+ }
57
+ }
58
+ }
59
+ }
60
+ },
61
+ xAxis: {
62
+ crosshair: {
63
+ zIndex: 3
64
+ },
65
+ minPadding: 0,
66
+ // must be handled dynamically instead of css
67
+ maxPadding: 0,
68
+ // must be handled dynamically instead of css
69
+ type: "datetime",
70
+ labels: {
71
+ useHTML: true
72
+ // formatter is set at the component level because of the required text locale prop
73
+ }
74
+ },
75
+ yAxis: {
76
+ labels: {
77
+ useHTML: true
78
+ // formatter is set at the component level because of the optional yAxisLabelFormatter prop
79
+ },
80
+ softMax: 0,
81
+ softMin: 0,
82
+ title: {
83
+ text: void 0
84
+ },
85
+ plotLines: [
86
+ /* Adds a custom plotLine at y=0 to represent the chart baseline.
87
+ This approach allows full control over the line's appearance (e.g., color, z-index),
88
+ unlike relying on the default xAxis line, which always renders at the bottom of the chart
89
+ even when y=0 appears elsewhere (e.g., with negative values).
90
+ */
91
+ {
92
+ className: "y-axis-zero-line",
93
+ value: 0,
94
+ zIndex: 3
95
+ // ensures the line appears over the default y=0 line, which we can't seleect as specifically
96
+ }
97
+ ]
98
+ }
99
+ });
100
+ var lineChartOptions = _lodash2.default.merge({}, timeSeriesChartOptions, {
101
+ // plotOptions.spline.events.click is set at the component level because of the optional onClick prop
102
+ });
103
+ var areaChartOptions = _lodash2.default.merge({}, timeSeriesChartOptions, {
104
+ plotOptions: {
105
+ areaspline: {
106
+ // events.click is set at the component level because of the optional onClick prop
107
+ stacking: "normal"
108
+ }
109
+ }
110
+ });
111
+ var columnChartOptions = _lodash2.default.merge({}, timeSeriesChartOptions, {
112
+ plotOptions: {
113
+ column: {
114
+ stacking: "normal",
115
+ pointPadding: 0.25,
116
+ groupPadding: 0.25,
117
+ borderRadius: 4
118
+ }
119
+ },
120
+ xAxis: {
121
+ crosshair: false
122
+ },
123
+ yAxis: {
124
+ plotLines: [
125
+ {
126
+ // For stacked column charts with visible borders (e.g., white for contrast),
127
+ // we raise the zIndex of the y=0 plotLine to ensure it remains visible
128
+ // and isn't visually covered by overlapping column borders.
129
+ zIndex: 5
130
+ }
131
+ ]
132
+ }
133
+ });
134
+ var VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT = 10;
135
+ var DONUT_CHART_HALO_SIZE = 10;
136
+ var DONUT_CHART_HEIGHT = 250 + DONUT_CHART_HALO_SIZE * 2;
137
+ var DONUT_CHART_WIDTH = DONUT_CHART_HEIGHT;
138
+ var donutChartOptions = _lodash2.default.merge({}, baseChartOptions, {
139
+ chart: {
140
+ height: DONUT_CHART_HEIGHT,
141
+ spacing: [0, 0, 0, 0]
142
+ },
143
+ plotOptions: {
144
+ pie: {
145
+ animation: false,
146
+ borderRadius: 0,
147
+ // must be handled here instead of css because of path rendering
148
+ dataLabels: {
149
+ enabled: false
150
+ },
151
+ innerSize: "50%"
152
+ }
153
+ }
154
+ });
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ exports.baseChartOptions = baseChartOptions; exports.TIME_SERIES_CHART_HEIGHT = TIME_SERIES_CHART_HEIGHT; exports.timeSeriesChartOptions = timeSeriesChartOptions; exports.lineChartOptions = lineChartOptions; exports.areaChartOptions = areaChartOptions; exports.columnChartOptions = columnChartOptions; exports.VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT = VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT; exports.DONUT_CHART_HALO_SIZE = DONUT_CHART_HALO_SIZE; exports.DONUT_CHART_HEIGHT = DONUT_CHART_HEIGHT; exports.DONUT_CHART_WIDTH = DONUT_CHART_WIDTH; exports.donutChartOptions = donutChartOptions;
169
+ //# sourceMappingURL=chunk-CYQXUAJC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-CYQXUAJC.js","../src/constants/chartOptions.ts"],"names":[],"mappings":"AAAA;ACCA,gFAAc;AAKP,IAAM,iBAAA,EAA4B;AAAA,EACvC,KAAA,EAAO;AAAA,IAC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,QAAA;AAAA,MACV,YAAA,EAAc,IAAA;AAAA,MACd,YAAA,EAAc,IAAA;AAAA,MACd,YAAA,EAAc;AAAA,IAChB;AAAA,EACF,CAAA;AAAA,EACA,KAAA,EAAO;AAAA,IACL,SAAA,EAAW;AAAA,EACb,CAAA;AAAA,EACA,KAAA,EAAO;AAAA,IACL,SAAA,EAAW;AAAA,MACT;AAAA;AAAA;AAAA;AAAA,QAIE,MAAA,EAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF;AACF,CAAC,CAAA;AAOM,IAAM,wCAAA,EAA0C,EAAA;AAGhD,IAAM,sBAAA,EAAwB,EAAA;AAC9B,IAAM,mBAAA,EAAqB,IAAA,EAAM,sBAAA,EAAwB,CAAA;AACzD,IAAM,kBAAA,EAAoB,kBAAA;AAC1B,IAAM,kBAAA,EAA6B,gBAAA,CAAE,KAAA,CAAM,CAAC,CAAA,EAAG,gBAAA,EAAkB;AAAA,EACtE,KAAA,EAAO;AAAA,IACL,MAAA,EAAQ,kBAAA;AAAA,IACR,OAAA,EAAS,CAAC,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAC;AAAA,EACtB,CAAA;AAAA,EACA,WAAA,EAAa;AAAA,IACX,GAAA,EAAK;AAAA,MACH,SAAA,EAAW,KAAA;AAAA,MACX,YAAA,EAAc,CAAA;AAAA;AAAA,MACd,UAAA,EAAY;AAAA,QACV,OAAA,EAAS;AAAA,MACX,CAAA;AAAA,MACA,SAAA,EAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC,CAAA;ADbD;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,8kBAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-CYQXUAJC.js","sourcesContent":[null,"import type { Options } from \"highcharts\";\nimport _ from \"lodash\";\n\n// options that should apply to all charts\n// this is being exported because it's needed for the listening bubble chart component.\n// when that components gets moved into the data-viz package, we can remove the export here\nexport const baseChartOptions: Options = {\n chart: {\n animation: false,\n styledMode: true,\n },\n credits: {\n enabled: false,\n },\n exporting: {\n enabled: false,\n fallbackToExportServer: false,\n },\n legend: {\n enabled: false,\n },\n title: {\n text: undefined,\n },\n tooltip: {\n hideDelay: 0,\n outside: true,\n padding: 0,\n shape: \"rect\",\n shared: true,\n useHTML: true,\n },\n};\n\n// options that should apply to time series charts\nexport const TIME_SERIES_CHART_HEIGHT = 275;\nexport const timeSeriesChartOptions: Options = _.merge({}, baseChartOptions, {\n annotations: [\n {\n draggable: \"\",\n labelOptions: {\n useHTML: true,\n padding: 0, // removes \"left\" property padding created by highcharts so that label is centered\n },\n },\n ],\n chart: {\n // events.click is set at the component level because of the optional onClick prop\n height: TIME_SERIES_CHART_HEIGHT,\n spacing: [5, 1, 0, 2],\n },\n plotOptions: {\n series: {\n animation: false,\n clip: false,\n marker: {\n enabled: false,\n states: {\n hover: {\n enabled: false,\n },\n },\n },\n },\n },\n xAxis: {\n crosshair: {\n zIndex: 3,\n },\n minPadding: 0, // must be handled dynamically instead of css\n maxPadding: 0, // must be handled dynamically instead of css\n type: \"datetime\",\n labels: {\n useHTML: true,\n // formatter is set at the component level because of the required text locale prop\n },\n },\n yAxis: {\n labels: {\n useHTML: true,\n // formatter is set at the component level because of the optional yAxisLabelFormatter prop\n },\n softMax: 0,\n softMin: 0,\n title: {\n text: undefined,\n },\n plotLines: [\n /* Adds a custom plotLine at y=0 to represent the chart baseline.\n This approach allows full control over the line's appearance (e.g., color, z-index),\n unlike relying on the default xAxis line, which always renders at the bottom of the chart\n even when y=0 appears elsewhere (e.g., with negative values).\n */\n {\n className: \"y-axis-zero-line\",\n value: 0,\n zIndex: 3, // ensures the line appears over the default y=0 line, which we can't seleect as specifically\n },\n ],\n },\n});\n\n// options that should apply to LineChart\nexport const lineChartOptions: Options = _.merge({}, timeSeriesChartOptions, {\n // plotOptions.spline.events.click is set at the component level because of the optional onClick prop\n});\n\n// options that should apply to AreaChart\nexport const areaChartOptions: Options = _.merge({}, timeSeriesChartOptions, {\n plotOptions: {\n areaspline: {\n // events.click is set at the component level because of the optional onClick prop\n stacking: \"normal\",\n },\n },\n});\n\nexport const columnChartOptions: Options = _.merge({}, timeSeriesChartOptions, {\n plotOptions: {\n column: {\n stacking: \"normal\",\n pointPadding: 0.25,\n groupPadding: 0.25,\n borderRadius: 4,\n },\n },\n xAxis: {\n crosshair: false,\n },\n yAxis: {\n plotLines: [\n {\n // For stacked column charts with visible borders (e.g., white for contrast),\n // we raise the zIndex of the y=0 plotLine to ensure it remains visible\n // and isn't visually covered by overlapping column borders.\n zIndex: 5,\n },\n ],\n },\n});\n\n/**\n * The default series limit for VerticalBarChart.\n * This limit is recommended to maintain chart readability and accessibility.\n * @see {VerticalBarChart}\n */\nexport const VERTICAL_BAR_CHART_DEFAULT_SERIES_LIMIT = 10;\n\n// options that should apply to DonutChart\nexport const DONUT_CHART_HALO_SIZE = 10; // 10 is the default from highcharts\nexport const DONUT_CHART_HEIGHT = 250 + DONUT_CHART_HALO_SIZE * 2;\nexport const DONUT_CHART_WIDTH = DONUT_CHART_HEIGHT;\nexport const donutChartOptions: Options = _.merge({}, baseChartOptions, {\n chart: {\n height: DONUT_CHART_HEIGHT,\n spacing: [0, 0, 0, 0],\n },\n plotOptions: {\n pie: {\n animation: false,\n borderRadius: 0, // must be handled here instead of css because of path rendering\n dataLabels: {\n enabled: false,\n },\n innerSize: \"50%\",\n },\n },\n});\n"]}
@@ -0,0 +1,68 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
+
3
+ var _chunk2K7PFHIMjs = require('./chunk-2K7PFHIM.js');
4
+
5
+ // src/charts/shared/annotations.ts
6
+ function buildAnnotationConfig(annotations) {
7
+ if (!_optionalChain([annotations, 'optionalAccess', _ => _.length])) {
8
+ return { annotations: void 0, lookup: void 0 };
9
+ }
10
+ const labels = [];
11
+ const lookup = /* @__PURE__ */ new Map();
12
+ for (const annotation of annotations) {
13
+ const { position } = annotation;
14
+ labels.push({
15
+ // Highcharts anchor — always uses `x` regardless of chart orientation.
16
+ point: { x: position, y: 0, xAxis: 0, yAxis: 0 },
17
+ // Space (not empty) — Highcharts reverts to its built-in label text on empty string.
18
+ text: " "
19
+ });
20
+ lookup.set(position, annotation);
21
+ }
22
+ if (labels.length === 0) {
23
+ return { annotations: void 0, lookup: void 0 };
24
+ }
25
+ return {
26
+ // `useHTML: true` makes Highcharts attach an HTML `graphic.div` to each
27
+ // label, which the marker portal needs as its render target. `padding: 0`
28
+ // removes Highcharts' default left padding so markers stay centered.
29
+ annotations: [{ labels, labelOptions: { useHTML: true, padding: 0 } }],
30
+ lookup
31
+ };
32
+ }
33
+
34
+ // src/charts/shared/valueAxisLabelFormatter.ts
35
+ var _seedsreactnumeral = require('@sproutsocial/seeds-react-numeral');
36
+ var FIXED_LOCALE = "en-US";
37
+ function deriveAbbreviateFromTicks(context) {
38
+ const tickPositions = context.axis.tickPositions;
39
+ const maxValue = tickPositions && tickPositions.length > 0 ? tickPositions[tickPositions.length - 1] : void 0;
40
+ return typeof maxValue === "number" && maxValue > 9999 ? 1e3 : true;
41
+ }
42
+ function defaultValueAxisLabelFormatter() {
43
+ const numberValue = Number(this.value);
44
+ if (numberValue === 0) {
45
+ return _seedsreactnumeral.formatNumeral.call(void 0, { locale: FIXED_LOCALE, number: 0 });
46
+ }
47
+ const abbreviate = deriveAbbreviateFromTicks(this);
48
+ return _seedsreactnumeral.formatNumeral.call(void 0, {
49
+ abbreviate,
50
+ format: "decimal",
51
+ locale: FIXED_LOCALE,
52
+ number: numberValue
53
+ });
54
+ }
55
+ function makeValueAxisLabelFormatter(format) {
56
+ return function() {
57
+ const numberValue = Number(this.value);
58
+ const abbreviate = format.abbreviate === false ? false : deriveAbbreviateFromTicks(this);
59
+ return _chunk2K7PFHIMjs.valueFormatter.call(void 0, { ...format, value: numberValue, abbreviate });
60
+ };
61
+ }
62
+
63
+
64
+
65
+
66
+
67
+ exports.buildAnnotationConfig = buildAnnotationConfig; exports.defaultValueAxisLabelFormatter = defaultValueAxisLabelFormatter; exports.makeValueAxisLabelFormatter = makeValueAxisLabelFormatter;
68
+ //# sourceMappingURL=chunk-VVGBJOFH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-VVGBJOFH.js","../src/charts/shared/annotations.ts","../src/charts/shared/valueAxisLabelFormatter.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACA;ACkCO,SAAS,qBAAA,CACd,WAAA,EAIA;AACA,EAAA,GAAA,CAAI,iBAAC,WAAA,2BAAa,QAAA,EAAQ;AACxB,IAAA,OAAO,EAAE,WAAA,EAAa,KAAA,CAAA,EAAW,MAAA,EAAQ,KAAA,EAAU,CAAA;AAAA,EACrD;AACA,EAAA,MAAM,OAAA,EAGA,CAAC,CAAA;AACP,EAAA,MAAM,OAAA,kBAAgC,IAAI,GAAA,CAAI,CAAA;AAC9C,EAAA,IAAA,CAAA,MAAW,WAAA,GAAc,WAAA,EAAa;AACpC,IAAA,MAAM,EAAE,SAAS,EAAA,EAAI,UAAA;AACrB,IAAA,MAAA,CAAO,IAAA,CAAK;AAAA;AAAA,MAEV,KAAA,EAAO,EAAE,CAAA,EAAG,QAAA,EAAU,CAAA,EAAG,CAAA,EAAG,KAAA,EAAO,CAAA,EAAG,KAAA,EAAO,EAAE,CAAA;AAAA;AAAA,MAE/C,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAID,IAAA,MAAA,CAAO,GAAA,CAAI,QAAA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,CAAA;AACH;AAYO,SAAS,2BAAA,CAA4B,MAAA,EAAqB;AAC/D,EAAA,OAAO,QAAA,CAAA,EAAwD;AAC7D,IAAA,MAAM,YAAA,EAAc,MAAA,CAAO,IAAA,CAAK,KAAK,CAAA;AAMrC,IAAA,MAAM,WAAA,EACJ,MAAA,CAAO,WAAA,IAAe,MAAA,EAAQ,MAAA,EAAQ,yBAAA,CAA0B,IAAI,CAAA;AAEtE,IAAA,OAAO,6CAAA,EAAiB,GAAG,MAAA,EAAQ,KAAA,EAAO,WAAA,EAAa,WAAW,CAAC,CAAA;AAAA,EACrE,CAAA;AACF;AFvBA;AACA;AACE;AACA;AACA;AACF,kMAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-VVGBJOFH.js","sourcesContent":[null,"// Shared annotation plumbing across v2 chart families. Currently consumed by\n// BarChart; v2 Line/Area will share the same `annotations` shape and reuse\n// `buildAnnotationConfig` directly. Annotation data is purely numeric —\n// the module has no knowledge of `categories`; resolving a numeric position to\n// a display name is the tooltip's job (see chartBase `renderContent`).\n\nimport type { TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport type { SeedsChartAnnotationsOptions } from \"./chartBase\";\n\n/**\n * Annotations keyed by the numeric Highcharts index. Both consumers resolve\n * numerically: the marker portal reads `label.point.x` and the tooltip reads\n * `context.point.x` (numeric on both category and datetime axes).\n */\nexport type ChartAnnotationLookup = Map<number, ChartAnnotation>;\n\n/**\n * Declarative annotation shape — the DS renders the marker and tooltip header\n * internally; consumers don't supply render functions. See CE-7.\n */\nexport interface ChartAnnotation {\n /** Numeric x-axis coordinate — a category index (category axes) or the raw coordinate (datetime/linear axes). */\n position: number;\n /** Icon shown above the chart at `position` and inline with `title` in the tooltip header. */\n icon?: TypeIconName;\n /** Color applied to the marker's vertical line. */\n color?: string;\n /** Tooltip header line 1. */\n title?: string;\n /** Tooltip header line 2. */\n description?: string;\n}\n\n/**\n * Build the Highcharts `annotations` config and a parallel lookup keyed by the\n * numeric `position`. Both consumers (chart adapter for Highcharts, ChartRenderer\n * for the portal + tooltip) read from the same numeric lookup to stay aligned.\n */\nexport function buildAnnotationConfig(\n annotations: ChartAnnotation[] | undefined\n): {\n annotations: SeedsChartAnnotationsOptions[] | undefined;\n lookup: ChartAnnotationLookup | undefined;\n} {\n if (!annotations?.length) {\n return { annotations: undefined, lookup: undefined };\n }\n const labels: {\n point: { x: number; y: number; xAxis: 0; yAxis: 0 };\n text: string;\n }[] = [];\n const lookup: ChartAnnotationLookup = new Map();\n for (const annotation of annotations) {\n const { position } = annotation;\n labels.push({\n // Highcharts anchor — always uses `x` regardless of chart orientation.\n point: { x: position, y: 0, xAxis: 0, yAxis: 0 },\n // Space (not empty) — Highcharts reverts to its built-in label text on empty string.\n text: \" \",\n });\n // Keyed by the numeric position only. The marker portal reads\n // `label.point.x` and the tooltip reads `context.point.x` — both numeric on\n // every axis type, so no category-name keying is needed.\n lookup.set(position, annotation);\n }\n if (labels.length === 0) {\n return { annotations: undefined, lookup: undefined };\n }\n return {\n // `useHTML: true` makes Highcharts attach an HTML `graphic.div` to each\n // label, which the marker portal needs as its render target. `padding: 0`\n // removes Highcharts' default left padding so markers stay centered.\n annotations: [{ labels, labelOptions: { useHTML: true, padding: 0 } }],\n lookup,\n };\n}\n","import { formatNumeral } from \"@sproutsocial/seeds-react-numeral\";\n\nimport type { SeedsAxisLabelFormatterContext } from \"./chartBase\";\nimport { valueFormatter, type ValueFormat } from \"./formatters/valueFormatter\";\n\n/**\n * Fixed internal locale for the default value-axis formatter. Pins the en-US\n * compact symbols (2K / 1.2M / 1.2B) so output is deterministic regardless of\n * the environment's locale resolution.\n * TODO: consumer-facing locale and an override surface may be added later.\n */\nconst FIXED_LOCALE = \"en-US\";\n\n/**\n * Derive formatNumeral's `abbreviate` threshold from the axis tick scan.\n *\n * formatNumeral abbreviates above 10,000 by default; passing a numeric\n * `abbreviate` lowers that threshold to that value. When the top tick exceeds\n * 9,999 we lower it to 1,000 so the whole axis reads \"2K 4K 6K 8K 10K\" rather\n * than a mixed \"2,000 4,000 6,000 8,000 10K\". Otherwise `true` keeps the default\n * 10,000 threshold. Centralizes the 9,999 rule for both formatters below.\n */\nfunction deriveAbbreviateFromTicks(\n context: SeedsAxisLabelFormatterContext\n): boolean | number {\n const tickPositions = context.axis.tickPositions;\n const maxValue =\n tickPositions && tickPositions.length > 0\n ? tickPositions[tickPositions.length - 1]\n : undefined;\n return typeof maxValue === \"number\" && maxValue > 9999 ? 1000 : true;\n}\n\n/**\n * Internal, zero-config default value-axis label formatter for v2 chart\n * families. Abbreviates value-axis ticks (1.20K / 1.20M / 1.20B); decimal mode\n * only. Zero renders \"0\". Decimal compact precision is fixed at two fraction\n * digits, so abbreviated ticks always carry two decimals.\n *\n * Wired as a Highcharts `yAxis.labels.formatter`, invoked `this`-bound with the\n * Seeds-local context.\n */\nexport function defaultValueAxisLabelFormatter(\n this: SeedsAxisLabelFormatterContext\n): string {\n const numberValue = Number(this.value);\n\n if (numberValue === 0) {\n return formatNumeral({ locale: FIXED_LOCALE, number: 0 });\n }\n\n const abbreviate = deriveAbbreviateFromTicks(this);\n\n return formatNumeral({\n abbreviate,\n format: \"decimal\",\n locale: FIXED_LOCALE,\n number: numberValue,\n });\n}\n\n/**\n * Build a `format`-driven value-axis label formatter that runs a declarative\n * {@link ValueFormat} through the shared {@link valueFormatter}. Reuses the same\n * `tickPositions` scan as {@link defaultValueAxisLabelFormatter} so the\n * axis-wide \"smart 1k/10k\" abbreviation is preserved for decimal/currency ticks.\n *\n * Wired as a Highcharts `yAxis.labels.formatter`; invoked `this`-bound with the\n * Seeds-local context. The returned formatter never carries chart-engine types,\n * keeping the engine boundary intact.\n */\nexport function makeValueAxisLabelFormatter(format: ValueFormat) {\n return function (this: SeedsAxisLabelFormatterContext): string {\n const numberValue = Number(this.value);\n\n // Honor an explicit `abbreviate: false` opt-out; otherwise derive the\n // threshold from the same tick scan as the default formatter (abbreviation\n // only affects decimal/currency — percent and duration ignore it inside\n // valueFormatter).\n const abbreviate =\n format.abbreviate === false ? false : deriveAbbreviateFromTicks(this);\n\n return valueFormatter({ ...format, value: numberValue, abbreviate });\n };\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
4
+ import { V as ValueFormat, C as ChartTooltipProps, a as ChartTooltipDataRow } from '../chartBase-Cn_5CUJi.mjs';
5
+ import { C as ChartExportHandle } from '../chartExport-CKYpuhik.mjs';
6
+ import '../types-DxrhdAdn.mjs';
7
+ import 'highcharts';
8
+
9
+ interface DonutDataPoint {
10
+ name: string;
11
+ value: number | null;
12
+ color?: string;
13
+ /** Seeds icon or partner-logo name rendered in the legend chip. */
14
+ icon?: TypeIconName;
15
+ }
16
+ /** A donut tooltip row — always carries `percent` (Highcharts computes it for pie series). */
17
+ interface DonutChartTooltipRow extends ChartTooltipDataRow {
18
+ percent: number;
19
+ }
20
+ /** Tooltip render-prop signature for DonutChart. `data` rows always include `percent`. */
21
+ interface DonutChartTooltipProps extends Omit<ChartTooltipProps, "data"> {
22
+ data: DonutChartTooltipRow[];
23
+ }
24
+ interface DonutChartProps {
25
+ /** Wired into Highcharts' `accessibility.description`. */
26
+ description: string;
27
+ data: Array<DonutDataPoint>;
28
+ /** Applied to the outermost container element for layout/spacing overrides. */
29
+ className?: string;
30
+ /** Replaces v1's `numberFormat`, `currency`, `numberLocale`, `textLocale`. */
31
+ format?: ValueFormat;
32
+ /** Override for the default tooltip content. Receives `DonutChartTooltipProps` including `percent` per row. */
33
+ tooltip?: (args: DonutChartTooltipProps) => ReactNode;
34
+ /** Footer content shown in the default tooltip when `onClick` is set. */
35
+ tooltipClickLabel?: ReactNode;
36
+ /** Override for the value shown when a data point is `null`. Defaults to an em-dash. */
37
+ invalidNumberLabel?: ReactNode;
38
+ /** Click handler invoked with the `name` of the clicked slice. */
39
+ onClick?: ({ position }: {
40
+ position: string;
41
+ }) => void;
42
+ /** Fired once per chart instance with a handle for PNG/SVG/PDF/CSV exports. */
43
+ onReady?: (handle: ChartExportHandle) => void;
44
+ }
45
+
46
+ declare const DonutChart: react.NamedExoticComponent<DonutChartProps>;
47
+
48
+ export { ChartExportHandle, DonutChart, type DonutChartProps, type DonutChartTooltipProps, type DonutChartTooltipRow, type DonutDataPoint, ValueFormat };
@@ -0,0 +1,48 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
4
+ import { V as ValueFormat, C as ChartTooltipProps, a as ChartTooltipDataRow } from '../chartBase-C-l7yYGx.js';
5
+ import { C as ChartExportHandle } from '../chartExport-CKYpuhik.js';
6
+ import '../types-DxrhdAdn.js';
7
+ import 'highcharts';
8
+
9
+ interface DonutDataPoint {
10
+ name: string;
11
+ value: number | null;
12
+ color?: string;
13
+ /** Seeds icon or partner-logo name rendered in the legend chip. */
14
+ icon?: TypeIconName;
15
+ }
16
+ /** A donut tooltip row — always carries `percent` (Highcharts computes it for pie series). */
17
+ interface DonutChartTooltipRow extends ChartTooltipDataRow {
18
+ percent: number;
19
+ }
20
+ /** Tooltip render-prop signature for DonutChart. `data` rows always include `percent`. */
21
+ interface DonutChartTooltipProps extends Omit<ChartTooltipProps, "data"> {
22
+ data: DonutChartTooltipRow[];
23
+ }
24
+ interface DonutChartProps {
25
+ /** Wired into Highcharts' `accessibility.description`. */
26
+ description: string;
27
+ data: Array<DonutDataPoint>;
28
+ /** Applied to the outermost container element for layout/spacing overrides. */
29
+ className?: string;
30
+ /** Replaces v1's `numberFormat`, `currency`, `numberLocale`, `textLocale`. */
31
+ format?: ValueFormat;
32
+ /** Override for the default tooltip content. Receives `DonutChartTooltipProps` including `percent` per row. */
33
+ tooltip?: (args: DonutChartTooltipProps) => ReactNode;
34
+ /** Footer content shown in the default tooltip when `onClick` is set. */
35
+ tooltipClickLabel?: ReactNode;
36
+ /** Override for the value shown when a data point is `null`. Defaults to an em-dash. */
37
+ invalidNumberLabel?: ReactNode;
38
+ /** Click handler invoked with the `name` of the clicked slice. */
39
+ onClick?: ({ position }: {
40
+ position: string;
41
+ }) => void;
42
+ /** Fired once per chart instance with a handle for PNG/SVG/PDF/CSV exports. */
43
+ onReady?: (handle: ChartExportHandle) => void;
44
+ }
45
+
46
+ declare const DonutChart: react.NamedExoticComponent<DonutChartProps>;
47
+
48
+ export { ChartExportHandle, DonutChart, type DonutChartProps, type DonutChartTooltipProps, type DonutChartTooltipRow, type DonutDataPoint, ValueFormat };