@sproutsocial/seeds-react-data-viz 0.26.1 → 0.27.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/{axis-BWvZqdQr.d.ts → axis-DQXvjzBs.d.ts} +1 -1
- package/dist/{axis-3XKa6pW7.d.mts → axis-DVx6Mn1k.d.mts} +1 -1
- package/dist/bar/index.d.mts +2 -2
- package/dist/bar/index.d.ts +2 -2
- package/dist/bar/index.js +12 -12
- package/dist/bubble/index.d.mts +1 -1
- package/dist/bubble/index.d.ts +1 -1
- package/dist/bubble/index.js +9 -9
- package/dist/chart-styles.css +41 -0
- package/dist/{chartBase-BM97OBBE.d.ts → chartBase-BYipK7MZ.d.ts} +5 -1
- package/dist/{chartBase-D6WI2icR.d.mts → chartBase-Cd405GIA.d.mts} +5 -1
- package/dist/charts.css +41 -0
- package/dist/{chunk-LWDHU4QK.js → chunk-34OKRQET.js} +8 -49
- package/dist/chunk-34OKRQET.js.map +1 -0
- package/dist/{chunk-NU2RCATK.js → chunk-5TWNMPQU.js} +94 -31
- package/dist/chunk-5TWNMPQU.js.map +1 -0
- package/dist/{chunk-BRIU5SPJ.js → chunk-CV45MD47.js} +3 -3
- package/dist/{chunk-BRIU5SPJ.js.map → chunk-CV45MD47.js.map} +1 -1
- package/dist/{chunk-PIZ4MT2B.js → chunk-WMKO3RGT.js} +3 -3
- package/dist/{chunk-PIZ4MT2B.js.map → chunk-WMKO3RGT.js.map} +1 -1
- package/dist/donut/index.d.mts +1 -1
- package/dist/donut/index.d.ts +1 -1
- package/dist/donut/index.js +6 -6
- package/dist/esm/bar/index.js +4 -4
- package/dist/esm/bubble/index.js +2 -2
- package/dist/esm/{chunk-VCTZWYEM.js → chunk-332X77M5.js} +11 -52
- package/dist/esm/chunk-332X77M5.js.map +1 -0
- package/dist/esm/{chunk-OZ7SPMTQ.js → chunk-AL3OTBTT.js} +2 -2
- package/dist/esm/{chunk-XEFCGFCF.js → chunk-CYCKJ5ML.js} +81 -18
- package/dist/esm/chunk-CYCKJ5ML.js.map +1 -0
- package/dist/esm/{chunk-GHP4TT7H.js → chunk-MVNO5UV6.js} +2 -2
- package/dist/esm/donut/index.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/line-area/index.js +4 -4
- package/dist/esm/sparkline/index.js +3 -3
- package/dist/esm/wordcloud/index.js +2 -2
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +53 -53
- package/dist/line-area/index.d.mts +2 -2
- package/dist/line-area/index.d.ts +2 -2
- package/dist/line-area/index.js +12 -12
- package/dist/sparkline/index.d.mts +3 -3
- package/dist/sparkline/index.d.ts +3 -3
- package/dist/sparkline/index.js +7 -7
- package/dist/wordcloud/index.js +8 -8
- package/package.json +1 -1
- package/dist/chunk-LWDHU4QK.js.map +0 -1
- package/dist/chunk-NU2RCATK.js.map +0 -1
- package/dist/esm/chunk-VCTZWYEM.js.map +0 -1
- package/dist/esm/chunk-XEFCGFCF.js.map +0 -1
- /package/dist/esm/{chunk-OZ7SPMTQ.js.map → chunk-AL3OTBTT.js.map} +0 -0
- /package/dist/esm/{chunk-GHP4TT7H.js.map → chunk-MVNO5UV6.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-CV45MD47.js","../src/charts/shared/axisOptions.ts"],"names":[],"mappings":"AAAA;AACE;AACF,sDAA4B;AAC5B;AACA;ACqBA,SAAS,8BAAA,CACP,QAAA,EACA,UAAA,EACA;AACA,EAAA,OAAO,QAAA,CAAA,EAAwD;AAC7D,IAAA,MAAM,EAAE,OAAA,EAAS,UAAU,EAAA,EAAI,gDAAA;AAAkB,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;AAqBgB;AAGC,EAAA;AACH,EAAA;AACH,IAAA;AACK,MAAA;AACE,MAAA;AACA,MAAA;AACd,IAAA;AACF,EAAA;AACO,EAAA;AACK,IAAA;AACQ,IAAA;AACN,IAAA;AACd,EAAA;AACF;ADhEwB;AACA;AACA;AACA;AACA","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-CV45MD47.js","sourcesContent":[null,"// 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 ChartTooltipProps,\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\n/**\n * The slice of a family's public props the tooltip defaults derive from. Every\n * X/Y family satisfies this structurally, so a family passes its props straight\n * in. Growing the inputs means widening this type, not changing call sites.\n */\nexport type ChartTooltipOptionsInput = Readonly<{\n xAxis?: DimensionalAxis;\n timezone?: string;\n}>;\n\n/**\n * The tooltip's datetime-derived options as one object, so the resolver output\n * and the `ChartTooltipProps` payload can't drift. `timezone` gets the `?? \"UTC\"`\n * default via `resolveTooltipTimezone`; `timeFormat` is read straight off a\n * datetime axis; `textLocale` has no input source in this signature today\n * (CE-35) and resolves to `undefined` — wiring it to `valueFormat.textLocale` is\n * out of scope. Both sides are derived types: widen the input, add the field to\n * `ChartTooltipProps` and this `Pick`, and the compiler keeps them aligned.\n */\nexport function resolveTooltipOptions(\n input: ChartTooltipOptionsInput\n): Pick<ChartTooltipProps, \"timezone\" | \"timeFormat\" | \"textLocale\"> {\n const { xAxis, timezone } = input;\n if (!xAxis) {\n return {\n timezone: undefined,\n timeFormat: undefined,\n textLocale: undefined,\n };\n }\n return {\n timezone: resolveTooltipTimezone(xAxis, timezone),\n timeFormat: xAxis.type === \"datetime\" ? xAxis.timeFormat : undefined,\n textLocale: undefined,\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk5TWNMPQUjs = require('./chunk-5TWNMPQU.js');
|
|
4
4
|
|
|
5
5
|
// src/charts/shared/annotations.ts
|
|
6
6
|
function buildAnnotationConfig(annotations) {
|
|
@@ -56,7 +56,7 @@ function makeValueAxisLabelFormatter(format) {
|
|
|
56
56
|
return function() {
|
|
57
57
|
const numberValue = Number(this.value);
|
|
58
58
|
const abbreviate = format.abbreviate === false ? false : deriveAbbreviateFromTicks(this);
|
|
59
|
-
return
|
|
59
|
+
return _chunk5TWNMPQUjs.valueFormatter.call(void 0, { ...format, value: numberValue, abbreviate });
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -65,4 +65,4 @@ function makeValueAxisLabelFormatter(format) {
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
exports.buildAnnotationConfig = buildAnnotationConfig; exports.defaultValueAxisLabelFormatter = defaultValueAxisLabelFormatter; exports.makeValueAxisLabelFormatter = makeValueAxisLabelFormatter;
|
|
68
|
-
//# sourceMappingURL=chunk-
|
|
68
|
+
//# sourceMappingURL=chunk-WMKO3RGT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-WMKO3RGT.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,G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,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-WMKO3RGT.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"]}
|
package/dist/donut/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { V as ValueFormat, C as ChartTooltipProps, a as ChartTooltipDataRow } from '../chartBase-
|
|
3
|
+
import { V as ValueFormat, C as ChartTooltipProps, a as ChartTooltipDataRow } from '../chartBase-Cd405GIA.mjs';
|
|
4
4
|
import { C as ChartColorableEntity, a as ChartIconableEntity, b as ChartClickHandler, c as ChartHoverHandler } from '../interactions-pEXA1XxF.mjs';
|
|
5
5
|
import { C as ChartExportHandle } from '../chartExport-CKYpuhik.mjs';
|
|
6
6
|
import '@sproutsocial/seeds-react-icon';
|
package/dist/donut/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { V as ValueFormat, C as ChartTooltipProps, a as ChartTooltipDataRow } from '../chartBase-
|
|
3
|
+
import { V as ValueFormat, C as ChartTooltipProps, a as ChartTooltipDataRow } from '../chartBase-BYipK7MZ.js';
|
|
4
4
|
import { C as ChartColorableEntity, a as ChartIconableEntity, b as ChartClickHandler, c as ChartHoverHandler } from '../interactions-pEXA1XxF.js';
|
|
5
5
|
import { C as ChartExportHandle } from '../chartExport-CKYpuhik.js';
|
|
6
6
|
import '@sproutsocial/seeds-react-icon';
|
package/dist/donut/index.js
CHANGED
|
@@ -5,17 +5,17 @@ var _chunk6EIJCJCNjs = require('../chunk-6EIJCJCN.js');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk5TWNMPQUjs = require('../chunk-5TWNMPQU.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk34OKRQETjs = require('../chunk-34OKRQET.js');
|
|
12
12
|
|
|
13
13
|
// src/charts/donut/DonutChart.tsx
|
|
14
14
|
var _react = require('react');
|
|
15
15
|
|
|
16
16
|
// src/charts/donut/adapter.ts
|
|
17
17
|
function buildDonutOptions(props, colors) {
|
|
18
|
-
const base =
|
|
18
|
+
const base = _chunk5TWNMPQUjs.buildBaseChartOptions.call(void 0, {
|
|
19
19
|
type: "pie",
|
|
20
20
|
description: props.description
|
|
21
21
|
});
|
|
@@ -28,7 +28,7 @@ function buildDonutOptions(props, colors) {
|
|
|
28
28
|
// Height only — width is left fluid so the chart fills its container and
|
|
29
29
|
// the pie auto-centers. The container bounds the width (see styles.ts) so
|
|
30
30
|
// the legend below wraps to the donut and centers with it.
|
|
31
|
-
height: _nullishCoalesce(props.height, () => (
|
|
31
|
+
height: _nullishCoalesce(props.height, () => ( _chunk34OKRQETjs.DONUT_CHART_HEIGHT)),
|
|
32
32
|
// Drop Highcharts' default spacing so the donut uses the full height.
|
|
33
33
|
spacing: [0, 0, 0, 0]
|
|
34
34
|
},
|
|
@@ -74,7 +74,7 @@ function buildDonutOptions(props, colors) {
|
|
|
74
74
|
// src/charts/donut/DonutChart.tsx
|
|
75
75
|
var _jsxruntime = require('react/jsx-runtime');
|
|
76
76
|
var DonutChart = _react.memo.call(void 0, function DonutChart2(props) {
|
|
77
|
-
const { colors } =
|
|
77
|
+
const { colors } = _chunk5TWNMPQUjs.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
|
-
|
|
93
|
+
_chunk5TWNMPQUjs.ChartRenderer,
|
|
94
94
|
{
|
|
95
95
|
options,
|
|
96
96
|
series: props.data.map((d, i) => ({
|
package/dist/esm/bar/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
buildAnnotationConfig,
|
|
3
3
|
defaultValueAxisLabelFormatter,
|
|
4
4
|
makeValueAxisLabelFormatter
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-MVNO5UV6.js";
|
|
6
6
|
import {
|
|
7
7
|
buildDimensionalAxis,
|
|
8
8
|
resolveTooltipOptions
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-AL3OTBTT.js";
|
|
10
10
|
import {
|
|
11
11
|
getChartContainerProps
|
|
12
12
|
} from "../chunk-P3MVYSHX.js";
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
ChartRenderer,
|
|
15
15
|
buildBaseChartOptions,
|
|
16
16
|
useSeedsChartSetup
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-CYCKJ5ML.js";
|
|
18
18
|
import {
|
|
19
19
|
TIME_SERIES_CHART_HEIGHT
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-332X77M5.js";
|
|
21
21
|
|
|
22
22
|
// src/charts/bar/BarChart.tsx
|
|
23
23
|
import { memo } from "react";
|
package/dist/esm/bubble/index.js
CHANGED
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
ChartRenderer,
|
|
6
6
|
buildBaseChartOptions,
|
|
7
7
|
useSeedsChartSetup
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-CYCKJ5ML.js";
|
|
9
9
|
import {
|
|
10
10
|
BUBBLE_CHART_DEFAULT_MAX_SIZE,
|
|
11
11
|
BUBBLE_CHART_DEFAULT_PADDING,
|
|
12
12
|
BUBBLE_CHART_HEIGHT,
|
|
13
13
|
defaultBubbleChartWidth
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-332X77M5.js";
|
|
15
15
|
|
|
16
16
|
// src/charts/bubble/BubbleChart.tsx
|
|
17
17
|
import { memo, useMemo } from "react";
|
|
@@ -99,72 +99,28 @@ var ChartLegend = memo2(function ChartLegend2({
|
|
|
99
99
|
|
|
100
100
|
// src/components/ChartTooltip/ChartTooltip.tsx
|
|
101
101
|
import { memo as memo3 } from "react";
|
|
102
|
-
import styled2 from "styled-components";
|
|
103
|
-
import { Box as Box4 } from "@sproutsocial/seeds-react-box";
|
|
104
102
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
105
|
-
var StyledBox2 = styled2(Box4)`
|
|
106
|
-
.Icon,
|
|
107
|
-
.logo {
|
|
108
|
-
stroke: none;
|
|
109
|
-
}
|
|
110
|
-
`;
|
|
111
103
|
var ChartTooltip = memo3(function ChartTooltip2({
|
|
112
104
|
children
|
|
113
105
|
}) {
|
|
114
|
-
return /* @__PURE__ */ jsx5(
|
|
115
|
-
StyledBox2,
|
|
116
|
-
{
|
|
117
|
-
bg: "container.background.base",
|
|
118
|
-
boxShadow: "medium",
|
|
119
|
-
border: 500,
|
|
120
|
-
borderColor: "container.border.base",
|
|
121
|
-
borderRadius: 500,
|
|
122
|
-
p: 400,
|
|
123
|
-
minWidth: 285,
|
|
124
|
-
children: /* @__PURE__ */ jsx5(Box4, { display: "flex", flexDirection: "column", gap: 350, children })
|
|
125
|
-
}
|
|
126
|
-
);
|
|
106
|
+
return /* @__PURE__ */ jsx5("div", { className: "seeds-chart-tooltip", children });
|
|
127
107
|
});
|
|
128
108
|
|
|
129
109
|
// src/components/ChartTooltip/components/ChartTooltipFooter.tsx
|
|
130
110
|
import { memo as memo4 } from "react";
|
|
131
|
-
import { Box as Box5 } from "@sproutsocial/seeds-react-box";
|
|
132
111
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
133
112
|
var ChartTooltipFooter = memo4(
|
|
134
113
|
function ChartTooltipFooter2({ children }) {
|
|
135
|
-
return /* @__PURE__ */ jsx6(
|
|
136
|
-
Box5,
|
|
137
|
-
{
|
|
138
|
-
borderTop: 500,
|
|
139
|
-
borderColor: "container.border.base",
|
|
140
|
-
mx: -400,
|
|
141
|
-
mb: -200,
|
|
142
|
-
px: 400,
|
|
143
|
-
pt: 350,
|
|
144
|
-
children
|
|
145
|
-
}
|
|
146
|
-
);
|
|
114
|
+
return /* @__PURE__ */ jsx6("div", { className: "seeds-chart-tooltip-footer", children });
|
|
147
115
|
}
|
|
148
116
|
);
|
|
149
117
|
|
|
150
118
|
// src/components/ChartTooltip/components/ChartTooltipHeader.tsx
|
|
151
119
|
import { memo as memo5 } from "react";
|
|
152
|
-
import { Box as Box6 } from "@sproutsocial/seeds-react-box";
|
|
153
120
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
154
121
|
var ChartTooltipHeader = memo5(
|
|
155
122
|
function ChartTooltipHeader2({ children }) {
|
|
156
|
-
return /* @__PURE__ */ jsx7(
|
|
157
|
-
Box6,
|
|
158
|
-
{
|
|
159
|
-
borderBottom: 500,
|
|
160
|
-
borderColor: "container.border.base",
|
|
161
|
-
mx: -400,
|
|
162
|
-
mt: -200,
|
|
163
|
-
px: 400,
|
|
164
|
-
pb: 350,
|
|
165
|
-
children
|
|
166
|
-
}
|
|
167
|
-
);
|
|
123
|
+
return /* @__PURE__ */ jsx7("div", { className: "seeds-chart-tooltip-header", children });
|
|
168
124
|
}
|
|
169
125
|
);
|
|
170
126
|
|
|
@@ -213,11 +169,11 @@ var ChartTooltipPortal = memo6(
|
|
|
213
169
|
|
|
214
170
|
// src/components/ChartTable/ChartTable.tsx
|
|
215
171
|
import { memo as memo7 } from "react";
|
|
216
|
-
import
|
|
172
|
+
import styled2 from "styled-components";
|
|
217
173
|
import { Text as Text2 } from "@sproutsocial/seeds-react-text";
|
|
218
174
|
import { Table as SeedsTable } from "@sproutsocial/seeds-react-table";
|
|
219
175
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
220
|
-
var StyledSeedsTable =
|
|
176
|
+
var StyledSeedsTable = styled2(SeedsTable)`
|
|
221
177
|
tbody tr:last-child {
|
|
222
178
|
border-bottom: none;
|
|
223
179
|
}
|
|
@@ -236,7 +192,7 @@ var StyledSeedsTable = styled3(SeedsTable)`
|
|
|
236
192
|
padding-right: 0;
|
|
237
193
|
}
|
|
238
194
|
`;
|
|
239
|
-
var StyledSeedsTableRow =
|
|
195
|
+
var StyledSeedsTableRow = styled2(SeedsTable.TableRow)`
|
|
240
196
|
${({ $isAppendedRow, theme: theme5 }) => $isAppendedRow ? `border-top: 2px solid ${theme5.colors.container.border.base}` : ""}
|
|
241
197
|
`;
|
|
242
198
|
var ChartTable = memo7(function ChartTable2({
|
|
@@ -254,7 +210,7 @@ var ChartTable = memo7(function ChartTable2({
|
|
|
254
210
|
{
|
|
255
211
|
$isAppendedRow: isAppendedRow,
|
|
256
212
|
children: cells.map(
|
|
257
|
-
({ content, align = "left", colSpan = 1 }, cellIndex) => {
|
|
213
|
+
({ content, align = "left", colSpan = 1, pl, pr, style }, cellIndex) => {
|
|
258
214
|
const uniqueIdentifier = `chart-tooltip-table-cell-${cellIndex}`;
|
|
259
215
|
return /* @__PURE__ */ jsx8(
|
|
260
216
|
SeedsTable.Cell,
|
|
@@ -264,6 +220,9 @@ var ChartTable = memo7(function ChartTable2({
|
|
|
264
220
|
align,
|
|
265
221
|
colSpan,
|
|
266
222
|
py: 200,
|
|
223
|
+
pl,
|
|
224
|
+
pr,
|
|
225
|
+
style,
|
|
267
226
|
children: /* @__PURE__ */ jsx8(Text2.SmallBodyCopy, { as: "div", children: content })
|
|
268
227
|
},
|
|
269
228
|
uniqueIdentifier
|
|
@@ -687,4 +646,4 @@ export {
|
|
|
687
646
|
areaChartStyles,
|
|
688
647
|
donutChartStyles
|
|
689
648
|
};
|
|
690
|
-
//# sourceMappingURL=chunk-
|
|
649
|
+
//# sourceMappingURL=chunk-332X77M5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/ColorBox/ColorBox.tsx","../../../seeds-react-theme-provider/src/index.tsx","../../src/components/ChartLegend/components/ChartLegendLabel.tsx","../../src/components/ChartLegend/ChartLegend.tsx","../../src/components/ChartTooltip/ChartTooltip.tsx","../../src/components/ChartTooltip/components/ChartTooltipFooter.tsx","../../src/components/ChartTooltip/components/ChartTooltipHeader.tsx","../../src/components/ChartTooltip/components/ChartTooltipPortal.tsx","../../src/components/ChartTable/ChartTable.tsx","../../src/components/ChartTooltip/components/ChartTooltipTable.tsx","../../src/components/ChartTooltip/components/ChartTooltipTitle.tsx","../../src/helpers/transformTimeSeriesTooltipData.ts","../../src/constants/chartOptions.ts","../../src/styles/chartStyles.ts"],"sourcesContent":["import { css, type CSSProp } from \"styled-components\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport ThemeProvider from \"@sproutsocial/seeds-react-theme-provider\";\nimport { type TypeSproutTheme } from \"@sproutsocial/seeds-react-theme\";\n\nexport type TypeColorBoxProps = TypeBoxProps;\n\n/**\n * ColorBox extends Box to apply basic styles.\n */\nexport const ColorBox = ({\n display = \"inline-block\",\n height = \"16px\",\n width = \"16px\",\n minWidth = width,\n borderRadius = \"400\",\n ...props\n}: TypeColorBoxProps) => {\n return (\n <Box\n {...props}\n display={display}\n height={height}\n width={width}\n minWidth={minWidth}\n borderRadius={borderRadius}\n css={\n css`\n cursor: ${(\n props: typeof ThemeProvider & {\n onClick: ((e: React.MouseEvent<HTMLElement>) => void) | void;\n }\n ) => (props?.onClick ? \"pointer\" : \"default\")};\n ` as CSSProp<TypeSproutTheme>\n }\n />\n );\n};\n","import * as React from \"react\";\nimport { ThemeProvider as BaseThemeProvider } from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport type {\n TypeSproutTheme,\n TypeTheme,\n} from \"@sproutsocial/seeds-react-theme\";\n\n// We can append additional themes types here\ntype TypeAllThemes = TypeTheme | TypeSproutTheme;\n\ntype TypeProps = {\n readonly theme?: TypeAllThemes;\n readonly children?: React.ReactNode;\n};\n\nconst ThemeProvider = (props: TypeProps) => (\n <BaseThemeProvider {...props} theme={props.theme || theme}>\n {props.children}\n </BaseThemeProvider>\n);\n\nexport default ThemeProvider;\n","import styled from \"styled-components\";\nimport { memo } from \"react\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\nimport type { TypeLegendLabel } from \"../ChartLegend\";\n\nimport { ColorBox } from \"../../ColorBox\";\n\nconst StyledBox = styled(Box)<TypeBoxProps>`\n list-style: none;\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n`;\n\nexport type TypeChartLegendLabelProps = Readonly<{\n children: TypeLegendLabel[\"content\"];\n color: TypeLegendLabel[\"color\"];\n // optional\n containerBoxProps?: TypeBoxProps;\n}>;\n\nexport const ChartLegendLabel = memo<TypeChartLegendLabelProps>(\n function ChartLegendLabel({\n children,\n color = \"#CCC\",\n containerBoxProps = {},\n }: TypeChartLegendLabelProps) {\n return (\n <StyledBox {...containerBoxProps}>\n <ColorBox bg={color} />\n <Text as=\"div\" fontSize={200} color=\"text.subtext\">\n {children}\n </Text>\n </StyledBox>\n );\n }\n);\n","import { memo } from \"react\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\n\nimport { ChartLegendLabel } from \"./components/ChartLegendLabel\";\n\nexport type TypeLegendLabel = Readonly<{\n content: React.ReactNode;\n color?: string;\n}>;\n\nexport type TypeChartLegendProps = Readonly<{\n legendLabels: ReadonlyArray<TypeLegendLabel>;\n // optional\n containerBoxProps?: TypeBoxProps;\n stacked?: boolean;\n}>;\n\nexport const ChartLegend = memo<TypeChartLegendProps>(function ChartLegend({\n legendLabels,\n containerBoxProps = {},\n stacked = false,\n}: TypeChartLegendProps) {\n return (\n <Box\n as=\"ul\"\n aria-hidden=\"true\"\n display=\"flex\"\n justifyContent=\"center\"\n flexDirection={stacked ? \"column\" : \"row\"}\n flexWrap=\"wrap\"\n columnGap={450}\n rowGap={200}\n m={0}\n p={0}\n {...containerBoxProps}\n >\n {legendLabels.map(({ color, content }, index) => (\n <ChartLegendLabel\n key={`chart-legend-label-${index}`}\n color={color || theme.colors.DATAVIZ_COLORS_LIST[index]}\n containerBoxProps={{ as: \"li\" }}\n >\n {content}\n </ChartLegendLabel>\n ))}\n </Box>\n );\n});\n","import { memo } from \"react\";\n\n// Chart Tooltip\ntype TypeChartTooltipProps = Readonly<{\n children: React.ReactNode;\n}>;\n\n// Consumes the .seeds-chart-tooltip class from chart-styles.css (the shared\n// foundation every v2 chart already imports): the padded/bordered/shadowed\n// container plus the flex-column gap between rows.\nexport const ChartTooltip = memo<TypeChartTooltipProps>(function ChartTooltip({\n children,\n}: TypeChartTooltipProps) {\n return <div className=\"seeds-chart-tooltip\">{children}</div>;\n});\n","import { memo } from \"react\";\n\ntype TypeChartTooltipFooterProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipFooter = memo<TypeChartTooltipFooterProps>(\n function ChartTooltipFooter({ children }: TypeChartTooltipFooterProps) {\n return <div className=\"seeds-chart-tooltip-footer\">{children}</div>;\n }\n);\n","import { memo } from \"react\";\n\ntype TypeChartTooltipHeaderProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipHeader = memo<TypeChartTooltipHeaderProps>(\n function ChartTooltipHeader({ children }: TypeChartTooltipHeaderProps) {\n return <div className=\"seeds-chart-tooltip-header\">{children}</div>;\n }\n);\n","import { memo, useState, useRef, useEffect, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type {\n Tooltip,\n Chart,\n TooltipFormatterContextObject,\n TooltipFormatterCallbackFunction,\n} from \"highcharts\";\n\ninterface ExtendedHighchartsTooltip extends Tooltip {\n label: {\n box: { attr({ height, width }: { height: number; width: number }): void };\n text: { element: HTMLElement };\n };\n}\n\nexport const generateChartTooltipPortalId = (chartId: number) =>\n `highcharts-custom-tooltip-${chartId}`;\n\ntype ChartTooltipPortalProps = Readonly<{\n chart: Chart;\n renderContent: (_context: TooltipFormatterContextObject) => ReactNode;\n}>;\n\nexport const ChartTooltipPortal = memo<ChartTooltipPortalProps>(\n function ChartTooltipPortal({\n chart,\n renderContent,\n }: ChartTooltipPortalProps) {\n const isInitialized = useRef<boolean>(false);\n const [node, setNode] = useState<HTMLElement | null>(null);\n const [context, setContext] =\n useState<TooltipFormatterContextObject | null>(null);\n\n useEffect(() => {\n const formatter: TooltipFormatterCallbackFunction = function () {\n // Ensures that tooltip DOM container is rendered before React portal is created.\n if (!isInitialized.current) {\n isInitialized.current = true;\n chart.tooltip.refresh.apply(chart.tooltip, [this.point]);\n chart.tooltip.hide(0);\n }\n\n setContext(this);\n\n return `<div id=\"${generateChartTooltipPortalId(\n chart.index\n )}\" role='tooltip'></div>`;\n };\n\n chart.update({ tooltip: { formatter } });\n }, [chart]);\n\n useEffect(() => {\n // In some cases tooltip is not available on the chart yet\n if (context?.series?.chart?.tooltip) {\n const tooltip = context.series.chart\n .tooltip as ExtendedHighchartsTooltip;\n const textElement = tooltip.label.text.element;\n\n tooltip.label.box.attr({\n height: textElement.offsetHeight,\n width: textElement.offsetWidth,\n });\n\n setNode(\n document.getElementById(generateChartTooltipPortalId(chart.index))\n );\n }\n }, [context, chart.index]);\n\n return node && context ? createPortal(renderContent(context), node) : null;\n }\n);\n","import { memo } from \"react\";\nimport styled from \"styled-components\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\nimport { Table as SeedsTable } from \"@sproutsocial/seeds-react-table\";\n\nconst StyledSeedsTable = styled<typeof SeedsTable>(SeedsTable)`\n tbody tr:last-child {\n border-bottom: none;\n }\n tr:last-child td,\n tr:last-child th {\n padding-bottom: 0;\n }\n tr:first-child td,\n tr:first-child th {\n padding-top: 0;\n }\n tr th {\n padding-left: 0;\n }\n tr td:last-child {\n padding-right: 0;\n }\n`;\n\nconst StyledSeedsTableRow = styled(SeedsTable.TableRow)<{\n $isAppendedRow?: boolean;\n}>`\n ${({ $isAppendedRow, theme }) =>\n $isAppendedRow\n ? `border-top: 2px solid ${theme.colors.container.border.base}`\n : \"\"}\n`;\n\nexport type TypeChartTableProps = Readonly<{\n rows: ReadonlyArray<{\n cells: ReadonlyArray<{\n content: React.ReactNode;\n align?: React.ComponentProps<typeof SeedsTable.Cell>[\"align\"];\n colSpan?: React.ComponentProps<typeof SeedsTable.Cell>[\"colSpan\"];\n pl?: React.ComponentProps<typeof SeedsTable.Cell>[\"pl\"];\n pr?: React.ComponentProps<typeof SeedsTable.Cell>[\"pr\"];\n style?: React.ComponentProps<typeof SeedsTable.Cell>[\"style\"];\n }>;\n isAppendedRow?: boolean;\n }>;\n}>;\n\nexport const ChartTable = memo<TypeChartTableProps>(function ChartTable({\n rows,\n}: TypeChartTableProps) {\n if (!rows || rows.length === 0) {\n return null;\n }\n\n return (\n <StyledSeedsTable>\n <SeedsTable.TableBody>\n {rows.map(({ cells, isAppendedRow }, rowIndex) => {\n if (!cells || cells.length === 0) {\n return null;\n }\n\n return (\n <StyledSeedsTableRow\n key={`chart-tooltip-table-row-${rowIndex}`}\n $isAppendedRow={isAppendedRow}\n >\n {cells.map(\n (\n { content, align = \"left\", colSpan = 1, pl, pr, style },\n cellIndex\n ) => {\n const uniqueIdentifier = `chart-tooltip-table-cell-${cellIndex}`;\n return (\n <SeedsTable.Cell\n key={uniqueIdentifier}\n id={uniqueIdentifier}\n scope={cellIndex === 0 ? \"row\" : undefined}\n align={align}\n colSpan={colSpan}\n py={200}\n pl={pl}\n pr={pr}\n style={style}\n >\n <Text.SmallBodyCopy as=\"div\">\n {content}\n </Text.SmallBodyCopy>\n </SeedsTable.Cell>\n );\n }\n )}\n </StyledSeedsTableRow>\n );\n })}\n </SeedsTable.TableBody>\n </StyledSeedsTable>\n );\n});\n","import { memo } from \"react\";\n\nimport { ChartTable, type TypeChartTableProps } from \"../../ChartTable\";\n\nexport type TypeChartTooltipTableProps = {\n rows: TypeChartTableProps[\"rows\"];\n};\n\nexport const ChartTooltipTable = memo<TypeChartTooltipTableProps>(\n function ChartTooltipTable({ rows }: TypeChartTooltipTableProps) {\n return <ChartTable rows={rows} />;\n }\n);\n","import { memo } from \"react\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\ntype TypeChartTooltipTitleProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipTitle = memo<TypeChartTooltipTitleProps>(\n function ChartTooltipTitle({ children }: TypeChartTooltipTitleProps) {\n return <Text.SmallSubHeadline as=\"p\">{children}</Text.SmallSubHeadline>;\n }\n);\n","import type { TooltipFormatterContextObject } from \"highcharts\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\n\nimport type { TypeAreaChartProps } from \"../components/AreaChart\";\nimport type { TypeLineChartProps } from \"../components/LineChart\";\nimport type { TypeChartTooltipProps } from \"../types\";\n\ntype TypeTransformTimeSeriesTooltipDataProps = Readonly<{\n context: TooltipFormatterContextObject;\n data: TypeAreaChartProps[\"data\"] | TypeLineChartProps[\"data\"];\n}>;\ntype TypeTransformTimeSeriesTooltipDataReturn = TypeChartTooltipProps[\"data\"];\n\nexport const transformTimeSeriesTooltipData = ({\n context,\n data,\n}: TypeTransformTimeSeriesTooltipDataProps): TypeTransformTimeSeriesTooltipDataReturn => {\n // @ts-expect-error - Highcharts tooltip context series typing does not expose chart.series here\n return (context.series.chart.series || []).map((series, index) => {\n const pointIndex = context.point.index;\n const y = series?.points?.[pointIndex]?.y;\n\n return {\n color:\n data[index]?.styles?.color || theme.colors.DATAVIZ_COLORS_LIST[index],\n ...(data[index]?.icon ? { icon: data[index]?.icon } : {}),\n name: series.name,\n value: typeof y === \"number\" ? y : null,\n };\n });\n};\n","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\n// options that should apply to BubbleChart (v2 packedbubble)\nexport const BUBBLE_CHART_HEIGHT = 600;\n// Preserved verbatim from v1 (consumed by web-app-core's `Overlays.tsx` as a\n// Box width) — re-exported from `/bubble` for the future consumer-migration\n// ticket. Not wired into the v2 chart's own options: packedbubble is\n// fluid-width like every other v2 family, matching the container's own\n// responsive sizing rather than v1's fixed `chart.width`.\nexport const defaultBubbleChartWidth = 600;\nexport const BUBBLE_CHART_DEFAULT_PADDING = 16;\nexport const BUBBLE_CHART_DEFAULT_MAX_SIZE = \"100%\";\n\n// options that should apply to WordCloud\n/** Also sets the cloud's aspect ratio — a wider/shorter box biases the silhouette wide, a narrower/taller one biases it tall. */\nexport const WORD_CLOUD_CHART_HEIGHT = 400;\n","import { css, createGlobalStyle } from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport {\n type TypeChartStyleColor,\n type TypeChartStyleHasOnClick,\n type TypeChartStylePattern,\n} from \"../types\";\nimport \"highcharts/css/highcharts.css\";\n\nexport const GlobalChartStyleOverrides = createGlobalStyle`\n // USAGE NOTE:\n // Put general styles in baseChartStyles instead when possible to avoid excessive global styling.\n // This global component is only for styles that can't override highcharts defaults when scoped.\n\n .highcharts-tooltip-container {\n z-index: 7 !important;\n }\n .highcharts-tooltip-box {\n fill: transparent !important;\n }\n`;\n\n// options that should apply to all charts\nexport const baseChartStyles = css<\n Readonly<{ $colors: ReadonlyArray<TypeChartStyleColor> }>\n>`\n --highcharts-background-color: ${({ theme }) =>\n theme.colors.container.background.base};\n\n // set color variables and map to each series\n ${({ $colors }) =>\n $colors\n .map((color, index) => {\n const chartColor = color || theme.colors.DATAVIZ_COLORS_LIST[index];\n return `\n\t\t\t\t// map colors to custom assigned colors or fallback to default data viz color rotation\n\t\t\t\t--highcharts-color-${index}: ${chartColor};\n\n\t\t\t\t// highcharts already accounts for 10 series, but if we have more, we need to add them\n\t\t\t\t.highcharts-color-${index} {\n\t\t\t\t\tcolor: var(--highcharts-color-${index});\n\t\t\t\t\tstroke: var(--highcharts-color-${index});\n\t\t\t\t\tfill: var(--highcharts-color-${index});\n\t\t\t\t}`;\n })\n .join(\"\\n\")}\n\n // set overall chart background color\n .highcharts-background {\n fill: ${({ theme }) => theme.colors.container.background.base};\n }\n\n g.highcharts-annotation-label {\n display: none;\n }\n\n div.highcharts-annotation-label {\n top: 0 !important;\n transform: translateX(-50%); // centers the label on the targeted axis point\n pointer-events: none; // prevents tooltip hover from being interrupted by this element since it renders after on the dom\n }\n`;\n\n// options that should apply to time series charts\nexport const timeSeriesChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${baseChartStyles}\n\n // vertical crosshair styles\n\t.highcharts-crosshair {\n stroke: ${({ theme }) => theme.colors.container.border.decorative.neutral};\n stroke-width: 1;\n }\n\n // axis and gridline styles\n .highcharts-grid-line {\n stroke: ${({ theme }) => theme.colors.container.border.base};\n }\n\n .highcharts-axis-line {\n stroke: ${({ theme }) => theme.colors.container.border.base};\n }\n\n .highcharts-tick {\n stroke: none;\n }\n .highcharts-xaxis-labels,\n .highcharts-yaxis-labels {\n // v1 HTML labels (useHTML: true). v2 SVG label styles live in\n // charts/shared/styles.ts (axisLabelV2Styles) — don't add v2 rules here.\n > span {\n font-family: ${({ theme }) => theme.fontFamily};\n ${({ theme }) => theme.typography[100]};\n font-weight: ${({ theme }) => theme.fontWeights.normal};\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n }\n .highcharts-xaxis-labels {\n // v1 HTML stacked labels (useHTML: true). v2 SVG stacked-label styles live\n // in charts/shared/styles.ts (axisLabelV2Styles).\n > span {\n display: flex;\n flex-direction: column;\n align-items: center;\n > span:nth-of-type(2) {\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n }\n\n // we don't want to drop the opacity when another item is hovered\n .highcharts-series-inactive {\n opacity: 1;\n }\n\n // apply cursor pointer when click functionality is turned on\n ${({ $hasOnClick }) =>\n $hasOnClick &&\n `\n \t\t\t.highcharts-series,\n \t\t\t.highcharts-point {\n \t\t\t\tcursor: pointer;\n \t\t\t}\n \t\t\t.highcharts-plot-background,\n \t\t\t.highcharts-crosshair,\n \t\t\t.highcharts-grid-line {\n \t\t\t\tfill: transparent;\n \t\t\t\tcursor: pointer;\n \t\t}`}\n\n path.highcharts-plot-line.y-axis-zero-line {\n stroke: ${({ theme }) => theme.colors.container.border.decorative.neutral};\n }\n`;\n\n// options that should apply to line charts\nexport const lineChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $patterns: ReadonlyArray<TypeChartStylePattern>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${timeSeriesChartStyles}\n\n // set the line stroke\n\t.highcharts-graph {\n stroke-width: 3;\n }\n\n // dashed line styles\n ${({ $patterns }) =>\n $patterns.map((pattern, index) => {\n return pattern === \"dashed\"\n ? `\n \t\t\t\t\t// highcharts already accounts for 10 series, but if we have more, we need to add them\n \t\t\t\t\t.highcharts-series-${index} {\n \t\t\t\t\t\tstroke-dasharray: 2, 8;\n \t\t\t\t\t}`\n : \"\";\n })}\n`;\n\n// options that should apply to area charts\nexport const areaChartStyles = css`\n ${timeSeriesChartStyles}\n\n // don't need to show a stroke for the line part of each area\n\t.highcharts-graph {\n stroke-width: 0;\n }\n\n // fill areas to full opacity\n .highcharts-area {\n fill-opacity: 1;\n }\n`;\n\n// options that should apply to donut charts\nexport const donutChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${baseChartStyles}\n\n // remove 250ms fade in/out when hovering over different donut chart slices\n\t.highcharts-point {\n transition: opacity 0s;\n }\n\n // remove stroke on donut slices\n .highcharts-pie-series .highcharts-point {\n stroke: none;\n }\n\n // don't reduce opacity when hovering\n .highcharts-point-hover {\n fill-opacity: none;\n }\n\n // apply cursor pointer when click functionality is turned on\n ${({ $hasOnClick }) =>\n $hasOnClick &&\n `\n \t\t\t.highcharts-series,\n \t\t\t.highcharts-point {\n \t\t\t\tcursor: pointer;\n \t\t\t}\n \t\t\t.highcharts-plot-background,\n \t\t\t.highcharts-crosshair,\n \t\t\t.highcharts-grid-line {\n \t\t\t\tfill: transparent;\n \t\t\t\tcursor: pointer;\n \t\t}`}\n`;\n"],"mappings":";AAAA,SAAS,WAAyB;AAClC,SAAS,WAA8B;;;ACDvC,OAAuB;AACvB,SAAS,iBAAiB,yBAAyB;AACnD,SAAS,aAAa;AAepB,SAAA,WAAA;;;ADdF,OAAqC;AAgBjC,gBAAAA,YAAA;AATG,IAAM,WAAW,CAAC;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UAAU,OAAO,WAAW,OAAO;AAAA;AAAA;AAKtE,IAAM,kBAAkBD;AAAA,IAO3B,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQrB,CAAC,EAAE,UAAU,MACb,UAAU,IAAI,CAAC,SAAS,UAAU;AAChC,SAAO,YAAY,WACf;AAAA;AAAA,2BAEiB,KAAK;AAAA;AAAA,WAGtB;AACN,CAAC,CAAC;AAAA;AAIC,IAAM,kBAAkBA;AAAA,IAC3B,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAclB,IAAM,mBAAmBA;AAAA,IAM5B,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAkBf,CAAC,EAAE,YAAY,MACf,eACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAUC;AAAA;","names":["jsx","props","Box","jsx","Box","theme","ChartLegendLabel","memo","Box","theme","jsx","memo","ChartLegend","Box","theme","memo","jsx","ChartTooltip","memo","jsx","ChartTooltipFooter","memo","jsx","ChartTooltipHeader","memo","ChartTooltipPortal","memo","styled","Text","jsx","theme","ChartTable","memo","jsx","memo","ChartTooltipTable","memo","Text","jsx","ChartTooltipTitle","theme","css","theme","css","theme"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
datetimeFormatter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CYCKJ5ML.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-
|
|
56
|
+
//# sourceMappingURL=chunk-AL3OTBTT.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
GlobalChartStyleOverrides,
|
|
11
11
|
WORD_CLOUD_CHART_HEIGHT,
|
|
12
12
|
transformTimeSeriesTooltipData
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-332X77M5.js";
|
|
14
14
|
|
|
15
15
|
// src/charts/shared/baseChartOptions.ts
|
|
16
16
|
function buildBaseChartOptions({
|
|
@@ -268,6 +268,9 @@ function buildWordCloudOptions(props, containerWidth, hasActiveNames = false) {
|
|
|
268
268
|
// spiral stays registered in chartBase.tsx for now; drop it if
|
|
269
269
|
// rectangular holds up in-app.
|
|
270
270
|
spiral: "rectangular",
|
|
271
|
+
// Highcharts' wordcloud module defaults `style.fontWeight` to `"900"`
|
|
272
|
+
// (heavy bold) — overridden to normal weight.
|
|
273
|
+
style: { fontWeight: "normal" },
|
|
271
274
|
// `seedsWordPadding` (a pure function above, registered onto
|
|
272
275
|
// Highcharts in chartBase.tsx) approximates word spacing, which
|
|
273
276
|
// Highcharts' wordcloud module has no native option for; it reads
|
|
@@ -695,18 +698,42 @@ function DefaultChartTooltip({
|
|
|
695
698
|
hideTitle,
|
|
696
699
|
hideTotal = false
|
|
697
700
|
}) {
|
|
701
|
+
const usePercentColumn = data.filter((d) => d.percent != null && !isNaN(d.percent)).length > 1;
|
|
698
702
|
const rows = data.map((d) => {
|
|
699
703
|
const formattedValue = d.value == null ? invalidNumberLabel ?? "\u2014" : valueFormatter({ ...valueFormat, value: d.value, abbreviate: false });
|
|
700
704
|
const nameCell = {
|
|
701
705
|
content: /* @__PURE__ */ jsx3(ChartLegendLabel, { color: d.color, children: /* @__PURE__ */ jsx3(ChartLabelWithIcon, { icon: d.icon, children: /* @__PURE__ */ jsx3(Text, { "aria-label": `${d.name}: `, children: d.name }) }) })
|
|
702
706
|
};
|
|
707
|
+
const percent = d.percent;
|
|
708
|
+
if (usePercentColumn) {
|
|
709
|
+
return {
|
|
710
|
+
cells: [
|
|
711
|
+
nameCell,
|
|
712
|
+
{
|
|
713
|
+
content: percent != null && !isNaN(percent) ? /* @__PURE__ */ jsxs3(Text, { children: [
|
|
714
|
+
Math.round(percent),
|
|
715
|
+
"%"
|
|
716
|
+
] }) : null,
|
|
717
|
+
align: "right",
|
|
718
|
+
pr: 350,
|
|
719
|
+
style: { width: "1%", whiteSpace: "nowrap" }
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
content: /* @__PURE__ */ jsx3(Text, { children: formattedValue }),
|
|
723
|
+
align: "right",
|
|
724
|
+
pl: 0,
|
|
725
|
+
style: { width: "1%", whiteSpace: "nowrap" }
|
|
726
|
+
}
|
|
727
|
+
]
|
|
728
|
+
};
|
|
729
|
+
}
|
|
703
730
|
return {
|
|
704
731
|
cells: [
|
|
705
732
|
nameCell,
|
|
706
733
|
{
|
|
707
|
-
content:
|
|
734
|
+
content: percent != null && !isNaN(percent) ? /* @__PURE__ */ jsxs3(Box2, { display: "inline-flex", alignItems: "center", gap: 350, children: [
|
|
708
735
|
/* @__PURE__ */ jsxs3(Text, { children: [
|
|
709
|
-
Math.round(
|
|
736
|
+
Math.round(percent),
|
|
710
737
|
"%"
|
|
711
738
|
] }),
|
|
712
739
|
/* @__PURE__ */ jsx3(Text, { fontWeight: "semibold", children: formattedValue })
|
|
@@ -723,6 +750,10 @@ function DefaultChartTooltip({
|
|
|
723
750
|
isAppendedRow: true,
|
|
724
751
|
cells: [
|
|
725
752
|
{
|
|
753
|
+
// In column mode the Total has no percent, so span the label
|
|
754
|
+
// across the name + percent columns; the value then lands in
|
|
755
|
+
// the value column (col 3) without an empty <td>.
|
|
756
|
+
colSpan: usePercentColumn ? 2 : 1,
|
|
726
757
|
content: /* @__PURE__ */ jsx3(Text, { fontWeight: "semibold", "aria-label": "Total: ", children: "Total" })
|
|
727
758
|
},
|
|
728
759
|
{
|
|
@@ -732,7 +763,20 @@ function DefaultChartTooltip({
|
|
|
732
763
|
value: total,
|
|
733
764
|
abbreviate: false
|
|
734
765
|
}) }),
|
|
735
|
-
align: "right"
|
|
766
|
+
align: "right",
|
|
767
|
+
// Only collapse to content width in percent-column mode, matching
|
|
768
|
+
// the per-series value cells above (which are gated the same way).
|
|
769
|
+
// In non-percent multi-series mode the Total stays a plain
|
|
770
|
+
// right-aligned cell so regular stacking is untouched (ticket
|
|
771
|
+
// scope) and the Total matches the series value cells stacked
|
|
772
|
+
// above it.
|
|
773
|
+
...usePercentColumn ? {
|
|
774
|
+
pl: 0,
|
|
775
|
+
style: {
|
|
776
|
+
width: "1%",
|
|
777
|
+
whiteSpace: "nowrap"
|
|
778
|
+
}
|
|
779
|
+
} : {}
|
|
736
780
|
}
|
|
737
781
|
]
|
|
738
782
|
}
|
|
@@ -780,6 +824,15 @@ var SeriesLegend = memo3(function SeriesLegend2({
|
|
|
780
824
|
return /* @__PURE__ */ jsx4(ChartLegend, { legendLabels: labels });
|
|
781
825
|
});
|
|
782
826
|
|
|
827
|
+
// src/charts/shared/stacking.ts
|
|
828
|
+
function isChartPercentStacked(options) {
|
|
829
|
+
const plotOptions = options.plotOptions;
|
|
830
|
+
if (!plotOptions) return false;
|
|
831
|
+
return Object.values(plotOptions).some(
|
|
832
|
+
(slot) => slot != null && typeof slot === "object" && slot.stacking === "percent"
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
|
|
783
836
|
// src/charts/shared/chartExport.ts
|
|
784
837
|
function defaultFilename(type, now) {
|
|
785
838
|
const iso = now.toISOString();
|
|
@@ -1117,19 +1170,29 @@ function ChartRenderer({
|
|
|
1117
1170
|
] : (
|
|
1118
1171
|
// Drop v1's `readonly` wrapper (v2 is mutable); icon is forwarded
|
|
1119
1172
|
// from `series[]` by index below since the helper doesn't carry it.
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1173
|
+
(() => {
|
|
1174
|
+
const showPercent = isChartPercentStacked(options) && series.length > 1;
|
|
1175
|
+
const pctCtx = context;
|
|
1176
|
+
const pointIndex = pctCtx.point.index;
|
|
1177
|
+
const chartSeries = pctCtx.series.chart.series;
|
|
1178
|
+
return transformTimeSeriesTooltipData({
|
|
1179
|
+
context,
|
|
1180
|
+
data: series.map((s, i) => ({
|
|
1181
|
+
name: s.name,
|
|
1182
|
+
points: [],
|
|
1183
|
+
styles: { color: s.color ?? colors[i] ?? "" }
|
|
1184
|
+
}))
|
|
1185
|
+
}).map((row, i) => {
|
|
1186
|
+
const percentage = chartSeries[i]?.points?.[pointIndex]?.percentage;
|
|
1187
|
+
return {
|
|
1188
|
+
color: row.color,
|
|
1189
|
+
name: row.name,
|
|
1190
|
+
value: row.value,
|
|
1191
|
+
icon: series[i]?.icon,
|
|
1192
|
+
...showPercent && typeof percentage === "number" && !isNaN(percentage) ? { percent: percentage } : {}
|
|
1193
|
+
};
|
|
1194
|
+
});
|
|
1195
|
+
})()
|
|
1133
1196
|
);
|
|
1134
1197
|
const position = isPie || isPackedBubble ? ctx.key ?? ctx.point.name : context.x;
|
|
1135
1198
|
const tickPositions = ctx.points?.[0]?.series?.xAxis?.tickPositions;
|
|
@@ -1180,4 +1243,4 @@ export {
|
|
|
1180
1243
|
useSeedsChartSetup,
|
|
1181
1244
|
ChartRenderer
|
|
1182
1245
|
};
|
|
1183
|
-
//# sourceMappingURL=chunk-
|
|
1246
|
+
//# sourceMappingURL=chunk-CYCKJ5ML.js.map
|