@sproutsocial/seeds-react-data-viz 0.26.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-RHGKZW6Y.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,EAAU,UAAU,CAAA;AAAA,EACjC;AACA,EAAA,GAAA,CAAI,MAAA,CAAO,OAAA,IAAW,CAAA,EAAG;AACvB,IAAA,OAAO,EAAE,WAAA,EAAa,KAAA,CAAA,EAAW,MAAA,EAAQ,KAAA,EAAU,CAAA;AAAA,EACrD;AACA,EAAA,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,WAAA,EAAa,CAAC,EAAE,MA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AAA;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-RHGKZW6Y.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"]}
1
+ {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-PIZ4MT2B.js","../src/charts/shared/annotations.ts","../src/charts/shared/valueAxisLabelFormatter.ts"],"names":[],"mappings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A;AACnC,EAAA,MAAM,SAAA,EACJ,cAAA,GAAiB,aAAA,CAAc,OAAA,EAAS,EAAA,EACpC,aAAA,CAAc,aAAA,CAAc,OAAA,EAAS,CAAC,EAAA,EACtC,KAAA,CAAA;AACN,EAAA,OAAO,OAAO,SAAA,IAAa,SAAA,GAAY,SAAA,EAAW,KAAA,EAAO,IAAA,EAAO,IAAA;AAClE;AAWO,SAAS,8BAAA,CAAA,EAEN;AACR,EAAA,MAAM,YAAA,EAAc,MAAA,CAAO,IAAA,CAAK,KAAK,CAAA;AAErC,EAAA,GAAA,CAAI,YAAA,IAAgB,CAAA,EAAG;AACrB,IAAA,OAAO,8CAAA,EAAgB,MAAA,EAAQ,YAAA,EAAc,MAAA,EAAQ,EAAE,CAAC,CAAA;AAAA,EAC1D;AAEA,EAAA,MAAM,WAAA,EAAa,yBAAA,CAA0B,IAAI,CAAA;AAEjD,EAAA,OAAO,8CAAA;AAAc,IACnB,UAAA;AAAA,IACA,MAAA,EAAQ,SAAA;AAAA,IACR,MAAA,EAAQ,YAAA;AAAA,IACR,MAAA,EAAQ;AAAA,EACV,CAAC,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-PIZ4MT2B.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"]}
@@ -5,7 +5,7 @@ var _chunk6EIJCJCNjs = require('../chunk-6EIJCJCN.js');
5
5
 
6
6
 
7
7
 
8
- var _chunkPOMPBGZRjs = require('../chunk-POMPBGZR.js');
8
+ var _chunkNU2RCATKjs = require('../chunk-NU2RCATK.js');
9
9
 
10
10
 
11
11
  var _chunkLWDHU4QKjs = require('../chunk-LWDHU4QK.js');
@@ -15,7 +15,7 @@ var _react = require('react');
15
15
 
16
16
  // src/charts/donut/adapter.ts
17
17
  function buildDonutOptions(props, colors) {
18
- const base = _chunkPOMPBGZRjs.buildBaseChartOptions.call(void 0, {
18
+ const base = _chunkNU2RCATKjs.buildBaseChartOptions.call(void 0, {
19
19
  type: "pie",
20
20
  description: props.description
21
21
  });
@@ -74,7 +74,7 @@ function buildDonutOptions(props, colors) {
74
74
  // src/charts/donut/DonutChart.tsx
75
75
  var _jsxruntime = require('react/jsx-runtime');
76
76
  var DonutChart = _react.memo.call(void 0, function DonutChart2(props) {
77
- const { colors } = _chunkPOMPBGZRjs.useSeedsChartSetup.call(void 0, {
77
+ const { colors } = _chunkNU2RCATKjs.useSeedsChartSetup.call(void 0, {
78
78
  series: props.data.map((d) => ({ color: d.color }))
79
79
  });
80
80
  const options = _react.useMemo.call(void 0,
@@ -90,7 +90,7 @@ var DonutChart = _react.memo.call(void 0, function DonutChart2(props) {
90
90
  });
91
91
  const tooltip = props.tooltip ? (args) => props.tooltip(args) : void 0;
92
92
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ...containerProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
93
- _chunkPOMPBGZRjs.ChartRenderer,
93
+ _chunkNU2RCATKjs.ChartRenderer,
94
94
  {
95
95
  options,
96
96
  series: props.data.map((d, i) => ({
@@ -2,11 +2,11 @@ import {
2
2
  buildAnnotationConfig,
3
3
  defaultValueAxisLabelFormatter,
4
4
  makeValueAxisLabelFormatter
5
- } from "../chunk-SM2B52UR.js";
5
+ } from "../chunk-GHP4TT7H.js";
6
6
  import {
7
7
  buildDimensionalAxis,
8
8
  resolveTooltipOptions
9
- } from "../chunk-QBFXLKBO.js";
9
+ } from "../chunk-OZ7SPMTQ.js";
10
10
  import {
11
11
  getChartContainerProps
12
12
  } from "../chunk-P3MVYSHX.js";
@@ -14,7 +14,7 @@ import {
14
14
  ChartRenderer,
15
15
  buildBaseChartOptions,
16
16
  useSeedsChartSetup
17
- } from "../chunk-4IWPHCZ4.js";
17
+ } from "../chunk-XEFCGFCF.js";
18
18
  import {
19
19
  TIME_SERIES_CHART_HEIGHT
20
20
  } from "../chunk-VCTZWYEM.js";
@@ -5,7 +5,7 @@ import {
5
5
  ChartRenderer,
6
6
  buildBaseChartOptions,
7
7
  useSeedsChartSetup
8
- } from "../chunk-4IWPHCZ4.js";
8
+ } from "../chunk-XEFCGFCF.js";
9
9
  import {
10
10
  BUBBLE_CHART_DEFAULT_MAX_SIZE,
11
11
  BUBBLE_CHART_DEFAULT_PADDING,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  valueFormatter
3
- } from "./chunk-4IWPHCZ4.js";
3
+ } from "./chunk-XEFCGFCF.js";
4
4
 
5
5
  // src/charts/shared/annotations.ts
6
6
  function buildAnnotationConfig(annotations) {
@@ -65,4 +65,4 @@ export {
65
65
  defaultValueAxisLabelFormatter,
66
66
  makeValueAxisLabelFormatter
67
67
  };
68
- //# sourceMappingURL=chunk-SM2B52UR.js.map
68
+ //# sourceMappingURL=chunk-GHP4TT7H.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  datetimeFormatter
3
- } from "./chunk-4IWPHCZ4.js";
3
+ } from "./chunk-XEFCGFCF.js";
4
4
 
5
5
  // src/charts/shared/axisOptions.ts
6
6
  function makeDatetimeAxisLabelFormatter(timezone, timeFormat) {
@@ -53,4 +53,4 @@ export {
53
53
  buildDimensionalAxis,
54
54
  resolveTooltipOptions
55
55
  };
56
- //# sourceMappingURL=chunk-QBFXLKBO.js.map
56
+ //# sourceMappingURL=chunk-OZ7SPMTQ.js.map
@@ -157,7 +157,7 @@ function allocateWordsAcrossGroups(data, maxWordCount) {
157
157
  }
158
158
  return result.sort((a, b) => b.weight - a.weight);
159
159
  }
160
- function transformWordCloudDataToPoints(data, groups, opacityRange, maxWordCount = WORD_CLOUD_MAXIMUM_WORD_COUNT) {
160
+ function transformWordCloudDataToPoints(data, groups, opacityRange, maxWordCount = WORD_CLOUD_MAXIMUM_WORD_COUNT, minFontSize = WORD_CLOUD_MIN_FONT_SIZE, maxFontSize = WORD_CLOUD_MAXIMUM_MAX_FONT_SIZE) {
161
161
  const hasGroups = Boolean(groups && groups.length > 0);
162
162
  const capped = hasGroups ? allocateWordsAcrossGroups(data, maxWordCount) : [...data].sort((a, b) => b.weight - a.weight).slice(0, maxWordCount);
163
163
  const compressedWeights = capped.map((point) => compressWeight(point.weight));
@@ -165,13 +165,15 @@ function transformWordCloudDataToPoints(data, groups, opacityRange, maxWordCount
165
165
  const max = Math.max(...compressedWeights);
166
166
  return capped.map((point, i) => {
167
167
  const colorIndex = resolveGroupColorIndex(point.groupId, groups);
168
- const weight = compressedWeights[i];
168
+ const compressed = compressedWeights[i];
169
+ const t = normalizeWeight(compressed, min, max);
170
+ const weight = minFontSize + t * (maxFontSize - minFontSize);
169
171
  return {
170
172
  name: point.name,
171
173
  weight,
172
174
  colorIndex,
173
175
  opacity: resolvePointOpacity({
174
- weight,
176
+ weight: compressed,
175
177
  min,
176
178
  max,
177
179
  hasGroups,
@@ -199,11 +201,15 @@ function transformWordCloudClickData(event) {
199
201
  }
200
202
  function buildWordCloudOptions(props, containerWidth, hasActiveNames = false) {
201
203
  const opacityRange = props.opacityRange ?? DEFAULT_OPACITY_RANGE;
204
+ const minFontSize = props.minFontSize ?? WORD_CLOUD_MIN_FONT_SIZE;
205
+ const maxFontSize = props.maxFontSize ?? deriveMaxFontSize(containerWidth ?? 0);
202
206
  const points = transformWordCloudDataToPoints(
203
207
  props.data,
204
208
  props.groups,
205
209
  opacityRange,
206
- deriveMaxWordCount(containerWidth ?? 0)
210
+ deriveMaxWordCount(containerWidth ?? 0),
211
+ minFontSize,
212
+ maxFontSize
207
213
  );
208
214
  const base = buildBaseChartOptions({
209
215
  type: "wordcloud",
@@ -245,20 +251,23 @@ function buildWordCloudOptions(props, containerWidth, hasActiveNames = false) {
245
251
  // emphasis — otherwise Highcharts' own hover pass fights the
246
252
  // consumer's `data-active-word-indices` dimming (wordcloud.css).
247
253
  inactiveOtherPoints: !hasActiveNames,
248
- minFontSize: props.minFontSize ?? WORD_CLOUD_MIN_FONT_SIZE,
249
- // An explicit prop wins; otherwise derived from the measured
250
- // container width (`WordCloud.tsx`'s `useMeasure` call). Must stay a
251
- // number — see `WORD_CLOUD_MAXIMUM_MAX_FONT_SIZE`'s doc comment for
252
- // why `undefined` breaks sizing.
253
- maxFontSize: props.maxFontSize ?? deriveMaxFontSize(containerWidth ?? 0),
254
+ // Resolved above and shared with the transform's font-size mapping.
255
+ // Must stay a number see `WORD_CLOUD_MAXIMUM_MAX_FONT_SIZE`'s doc
256
+ // comment for why `undefined` breaks sizing.
257
+ minFontSize,
258
+ maxFontSize,
254
259
  // Pinned horizontal — Highcharts' default tilts words vertical
255
260
  // (`{from: 0, to: 90}`).
256
261
  rotation: { from: 0, to: 0, orientations: 1 },
257
- // `seedsAspectArchimedean` (a pure function above, registered onto
258
- // Highcharts in chartBase.tsx) — Highcharts' own `archimedean` traces
259
- // a true circle with no aspect term, so it can't grow into a wide
260
- // container.
261
- spiral: "seedsAspectArchimedean",
262
+ // Highcharts' built-in rectangular spiral. It factors the field's
263
+ // aspect ratio in natively (it's built on squareSpiral over the field
264
+ // dimensions), so it fills a wide container and packs denser than the
265
+ // circular `archimedean`. Chosen over the custom `seedsAspectArchimedean`
266
+ // after a visual comparison once the font-size hierarchy fix made word
267
+ // sizes vary enough for the circular spiral's gaps to show. The custom
268
+ // spiral stays registered in chartBase.tsx for now; drop it if
269
+ // rectangular holds up in-app.
270
+ spiral: "rectangular",
262
271
  // `seedsWordPadding` (a pure function above, registered onto
263
272
  // Highcharts in chartBase.tsx) approximates word spacing, which
264
273
  // Highcharts' wordcloud module has no native option for; it reads
@@ -1171,4 +1180,4 @@ export {
1171
1180
  useSeedsChartSetup,
1172
1181
  ChartRenderer
1173
1182
  };
1174
- //# sourceMappingURL=chunk-4IWPHCZ4.js.map
1183
+ //# sourceMappingURL=chunk-XEFCGFCF.js.map