@sproutsocial/seeds-react-data-viz 0.21.3 → 0.22.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.
- package/dist/bar/index.d.mts +5 -9
- package/dist/bar/index.d.ts +5 -9
- package/dist/bar/index.js +12 -12
- package/dist/bar/index.js.map +1 -1
- package/dist/bubble/index.d.mts +102 -0
- package/dist/bubble/index.d.ts +102 -0
- package/dist/bubble/index.js +235 -0
- package/dist/bubble/index.js.map +1 -0
- package/dist/bubble.css +104 -0
- package/dist/{chartBase-Cn_5CUJi.d.mts → chartBase-BClSc5EN.d.mts} +4 -0
- package/dist/{chartBase-C-l7yYGx.d.ts → chartBase-CycEw2vy.d.ts} +4 -0
- package/dist/chartOptions-DHzoGRdG.d.mts +24 -0
- package/dist/chartOptions-DHzoGRdG.d.ts +24 -0
- package/dist/charts.css +105 -0
- package/dist/{chunk-46L4YBLC.js → chunk-2H2Z7PKZ.js} +1 -14
- package/dist/chunk-2H2Z7PKZ.js.map +1 -0
- package/dist/{chunk-CYQXUAJC.js → chunk-33Y5FZTT.js} +10 -2
- package/dist/chunk-33Y5FZTT.js.map +1 -0
- package/dist/{chunk-27M4FDNK.js → chunk-GWP3PWIG.js} +84 -27
- package/dist/chunk-GWP3PWIG.js.map +1 -0
- package/dist/{chunk-XYE6O77Z.js → chunk-KMJD7BW3.js} +3 -3
- package/dist/{chunk-XYE6O77Z.js.map → chunk-KMJD7BW3.js.map} +1 -1
- package/dist/donut/index.d.mts +4 -8
- package/dist/donut/index.d.ts +4 -8
- package/dist/donut/index.js +7 -7
- package/dist/esm/bar/index.js +8 -8
- package/dist/esm/bubble/index.js +235 -0
- package/dist/esm/bubble/index.js.map +1 -0
- package/dist/esm/{chunk-QSSYSKRP.js → chunk-JGM4M7QV.js} +70 -13
- package/dist/esm/chunk-JGM4M7QV.js.map +1 -0
- package/dist/esm/{chunk-KMFRRUTY.js → chunk-KQKAVIYW.js} +2 -2
- package/dist/esm/{chunk-XEKQTAUH.js → chunk-NZX3WPXT.js} +9 -22
- package/dist/esm/chunk-NZX3WPXT.js.map +1 -0
- package/dist/esm/{chunk-XMYGML25.js → chunk-XRZJACCB.js} +10 -2
- package/dist/esm/{chunk-XMYGML25.js.map → chunk-XRZJACCB.js.map} +1 -1
- package/dist/esm/donut/index.js +3 -3
- package/dist/esm/index.js +10 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/line-area/index.js +8 -8
- package/dist/esm/sparkline/index.js +2 -2
- package/dist/index.d.mts +3 -19
- package/dist/index.d.ts +3 -19
- package/dist/index.js +66 -58
- package/dist/index.js.map +1 -1
- package/dist/{interactions-DoWoL7bu.d.mts → interactions-pEXA1XxF.d.mts} +16 -1
- package/dist/{interactions-DoWoL7bu.d.ts → interactions-pEXA1XxF.d.ts} +16 -1
- package/dist/line-area/index.d.mts +4 -8
- package/dist/line-area/index.d.ts +4 -8
- package/dist/line-area/index.js +12 -12
- package/dist/line-area/index.js.map +1 -1
- package/dist/sparkline/index.d.mts +1 -1
- package/dist/sparkline/index.d.ts +1 -1
- package/dist/sparkline/index.js +4 -4
- package/package.json +18 -12
- package/dist/chunk-27M4FDNK.js.map +0 -1
- package/dist/chunk-46L4YBLC.js.map +0 -1
- package/dist/chunk-CYQXUAJC.js.map +0 -1
- package/dist/esm/chunk-QSSYSKRP.js.map +0 -1
- package/dist/esm/chunk-XEKQTAUH.js.map +0 -1
- /package/dist/esm/{chunk-KMFRRUTY.js.map → chunk-KQKAVIYW.js.map} +0 -0
package/dist/bar/index.d.mts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { TypeIconName } from '@sproutsocial/seeds-react-icon';
|
|
4
3
|
import { C as ChartAnnotation } from '../annotations-CjFoRPXf.mjs';
|
|
5
|
-
import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-
|
|
4
|
+
import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-BClSc5EN.mjs';
|
|
5
|
+
import { C as ChartColorableEntity, a as ChartIconableEntity, b as ChartClickHandler, c as ChartHoverHandler } from '../interactions-pEXA1XxF.mjs';
|
|
6
|
+
export { d as ChartHoverSeries } from '../interactions-pEXA1XxF.mjs';
|
|
6
7
|
import { C as ChartExportHandle } from '../chartExport-CKYpuhik.mjs';
|
|
7
|
-
import { C as ChartClickHandler, a as ChartHoverHandler } from '../interactions-DoWoL7bu.mjs';
|
|
8
|
-
export { b as ChartHoverSeries } from '../interactions-DoWoL7bu.mjs';
|
|
9
8
|
import { C as ChartDataPoint, a as CategoryAxis, D as DatetimeAxis, b as DatetimePoint } from '../axis-WOeYkTO1.mjs';
|
|
9
|
+
import '@sproutsocial/seeds-react-icon';
|
|
10
10
|
import '../types-DxrhdAdn.mjs';
|
|
11
11
|
import 'highcharts';
|
|
12
12
|
|
|
13
13
|
type BarDatetimePoint = DatetimePoint;
|
|
14
14
|
type BarDataPoint = ChartDataPoint;
|
|
15
|
-
interface BarSeries {
|
|
16
|
-
name: string;
|
|
15
|
+
interface BarSeries extends ChartColorableEntity, ChartIconableEntity {
|
|
17
16
|
/** Y-values for each category, or `[timestamp, value]` / `{ x, y }` points on a datetime axis. */
|
|
18
17
|
data: Array<BarDataPoint>;
|
|
19
|
-
color?: string;
|
|
20
|
-
/** Seeds icon or partner-logo name rendered before the series name in the legend. */
|
|
21
|
-
icon?: TypeIconName;
|
|
22
18
|
}
|
|
23
19
|
type BarXAxis = CategoryAxis | DatetimeAxis;
|
|
24
20
|
interface BarYAxis {
|
package/dist/bar/index.d.ts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { TypeIconName } from '@sproutsocial/seeds-react-icon';
|
|
4
3
|
import { C as ChartAnnotation } from '../annotations-CjFoRPXf.js';
|
|
5
|
-
import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-
|
|
4
|
+
import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-CycEw2vy.js';
|
|
5
|
+
import { C as ChartColorableEntity, a as ChartIconableEntity, b as ChartClickHandler, c as ChartHoverHandler } from '../interactions-pEXA1XxF.js';
|
|
6
|
+
export { d as ChartHoverSeries } from '../interactions-pEXA1XxF.js';
|
|
6
7
|
import { C as ChartExportHandle } from '../chartExport-CKYpuhik.js';
|
|
7
|
-
import { C as ChartClickHandler, a as ChartHoverHandler } from '../interactions-DoWoL7bu.js';
|
|
8
|
-
export { b as ChartHoverSeries } from '../interactions-DoWoL7bu.js';
|
|
9
8
|
import { C as ChartDataPoint, a as CategoryAxis, D as DatetimeAxis, b as DatetimePoint } from '../axis-WOeYkTO1.js';
|
|
9
|
+
import '@sproutsocial/seeds-react-icon';
|
|
10
10
|
import '../types-DxrhdAdn.js';
|
|
11
11
|
import 'highcharts';
|
|
12
12
|
|
|
13
13
|
type BarDatetimePoint = DatetimePoint;
|
|
14
14
|
type BarDataPoint = ChartDataPoint;
|
|
15
|
-
interface BarSeries {
|
|
16
|
-
name: string;
|
|
15
|
+
interface BarSeries extends ChartColorableEntity, ChartIconableEntity {
|
|
17
16
|
/** Y-values for each category, or `[timestamp, value]` / `{ x, y }` points on a datetime axis. */
|
|
18
17
|
data: Array<BarDataPoint>;
|
|
19
|
-
color?: string;
|
|
20
|
-
/** Seeds icon or partner-logo name rendered before the series name in the legend. */
|
|
21
|
-
icon?: TypeIconName;
|
|
22
18
|
}
|
|
23
19
|
type BarXAxis = CategoryAxis | DatetimeAxis;
|
|
24
20
|
interface BarYAxis {
|
package/dist/bar/index.js
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkKMJD7BW3js = require('../chunk-KMJD7BW3.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _chunk6EIJCJCNjs = require('../chunk-6EIJCJCN.js');
|
|
9
8
|
|
|
9
|
+
var _chunk6D7P3IOTjs = require('../chunk-6D7P3IOT.js');
|
|
10
10
|
|
|
11
|
-
var _chunkCYQXUAJCjs = require('../chunk-CYQXUAJC.js');
|
|
12
11
|
|
|
12
|
+
var _chunk6EIJCJCNjs = require('../chunk-6EIJCJCN.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunk33Y5FZTTjs = require('../chunk-33Y5FZTT.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
21
|
-
require('../chunk-
|
|
20
|
+
var _chunkGWP3PWIGjs = require('../chunk-GWP3PWIG.js');
|
|
21
|
+
require('../chunk-2H2Z7PKZ.js');
|
|
22
22
|
|
|
23
23
|
// src/charts/bar/BarChart.tsx
|
|
24
24
|
var _react = require('react');
|
|
@@ -32,7 +32,7 @@ function buildBarChartOptions(props, direction, series = props.series) {
|
|
|
32
32
|
const isDatetime = props.xAxis.type === "datetime";
|
|
33
33
|
const isMultiSeries = series.length > 1;
|
|
34
34
|
const tooltipTimezone = _chunk6D7P3IOTjs.resolveTooltipTimezone.call(void 0, props.xAxis, props.timezone);
|
|
35
|
-
const { annotations, lookup: annotationLookup } =
|
|
35
|
+
const { annotations, lookup: annotationLookup } = _chunkKMJD7BW3js.buildAnnotationConfig.call(void 0,
|
|
36
36
|
props.annotations
|
|
37
37
|
);
|
|
38
38
|
const barTypeConfig = {
|
|
@@ -92,7 +92,7 @@ function buildBarChartOptions(props, direction, series = props.series) {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
const base =
|
|
95
|
+
const base = _chunkGWP3PWIGjs.buildBaseChartOptions.call(void 0, {
|
|
96
96
|
type: chartType,
|
|
97
97
|
description: props.description,
|
|
98
98
|
valueSuffix: props.valueSuffix,
|
|
@@ -108,7 +108,7 @@ function buildBarChartOptions(props, direction, series = props.series) {
|
|
|
108
108
|
// Re-assert the definite `type` so spreading the optionally-typed
|
|
109
109
|
// `base.chart` doesn't widen the required `type` field to optional.
|
|
110
110
|
type: chartType,
|
|
111
|
-
height: _nullishCoalesce(props.height, () => (
|
|
111
|
+
height: _nullishCoalesce(props.height, () => ( _chunk33Y5FZTTjs.TIME_SERIES_CHART_HEIGHT)),
|
|
112
112
|
// Tight time-series spacing (from constants/chartOptions.ts) so the plot
|
|
113
113
|
// area fills the 275px container; without it Highcharts' larger default
|
|
114
114
|
// spacing ([10, 10, 15, 10]) shrinks the plot area.
|
|
@@ -128,7 +128,7 @@ function buildBarChartOptions(props, direction, series = props.series) {
|
|
|
128
128
|
enabled: _optionalChain([props, 'access', _23 => _23.yAxis, 'optionalAccess', _24 => _24.showLabels]) !== false,
|
|
129
129
|
// A declarative `format` drives ticks through the shared valueFormatter;
|
|
130
130
|
// absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).
|
|
131
|
-
formatter: _optionalChain([props, 'access', _25 => _25.yAxis, 'optionalAccess', _26 => _26.format]) ?
|
|
131
|
+
formatter: _optionalChain([props, 'access', _25 => _25.yAxis, 'optionalAccess', _26 => _26.format]) ? _chunkKMJD7BW3js.makeValueAxisLabelFormatter.call(void 0, props.yAxis.format) : _chunkKMJD7BW3js.defaultValueAxisLabelFormatter
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
plotOptions: {
|
|
@@ -153,7 +153,7 @@ var BAR_CHART_DEFAULT_SERIES_LIMIT = 10;
|
|
|
153
153
|
var _jsxruntime = require('react/jsx-runtime');
|
|
154
154
|
var BarChart = _react.memo.call(void 0, function BarChart2(props) {
|
|
155
155
|
const seriesLimit = _nullishCoalesce(props.seriesLimit, () => ( BAR_CHART_DEFAULT_SERIES_LIMIT));
|
|
156
|
-
const { colors, series } =
|
|
156
|
+
const { colors, series } = _chunkGWP3PWIGjs.useSeedsChartSetup.call(void 0, {
|
|
157
157
|
series: props.series,
|
|
158
158
|
seriesLimit,
|
|
159
159
|
isSeriesLimitOverridden: props.seriesLimit !== void 0,
|
|
@@ -173,7 +173,7 @@ var BarChart = _react.memo.call(void 0, function BarChart2(props) {
|
|
|
173
173
|
className: props.className
|
|
174
174
|
});
|
|
175
175
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ...containerProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
176
|
-
|
|
176
|
+
_chunkGWP3PWIGjs.ChartRenderer,
|
|
177
177
|
{
|
|
178
178
|
options,
|
|
179
179
|
series,
|
package/dist/bar/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/bar/index.js","../../src/charts/bar/BarChart.tsx","../../src/charts/bar/adapter.ts","../../src/charts/constants.ts"],"names":["BarChart"],"mappings":"AAAA;AACE;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACtBA,8BAAqB;ADwBrB;AACA;AEHA,SAAS,cAAA,CAAe,SAAA,EAAgD;AACtE,EAAA,OAAO,UAAA,IAAc,aAAA,EAAe,MAAA,EAAQ,QAAA;AAC9C;AAEO,SAAS,oBAAA,CACd,KAAA,EACA,SAAA,EAIA,OAAA,EAAkC,KAAA,CAAM,MAAA,EAMxC;AACA,EAAA,MAAM,UAAA,EAAY,cAAA,CAAe,SAAS,CAAA;AAC1C,EAAA,MAAM,WAAA,EAAa,KAAA,CAAM,KAAA,CAAM,KAAA,IAAS,UAAA;AAMxC,EAAA,MAAM,cAAA,EAAgB,MAAA,CAAO,OAAA,EAAS,CAAA;AACtC,EAAA,MAAM,gBAAA,EAAkB,qDAAA,KAAuB,CAAM,KAAA,EAAO,KAAA,CAAM,QAAQ,CAAA;AAC1E,EAAA,MAAM,EAAE,WAAA,EAAa,MAAA,EAAQ,iBAAi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AA,UAAa,YAAA;AAAA,IACnB;AAAA,EACF,CAAA;AACA,EAAA,MAAM,WAAA,EAAa,OAAA,CAAQ,KAAA,CAAM,OAAO,CAAA;AAOxC,EAAA,MAAM,eAAA,EAAiB,qDAAA;AAAuB,IAC5C,aAAA,EAAe,CAAC,yBAAA,EAA2B,iBAAiB,CAAA;AAAA,IAC5D,MAAA,EAAQ,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,EAAA,GAAM,CAAA,CAAE,KAAK,CAAA;AAAA,IACjC,UAAA;AAAA,IACA,SAAA,EAAW,KAAA,CAAM;AAAA,EACnB,CAAC,CAAA;AAED,EAAA,uBACE,6BAAA,KAAC,EAAA,EAAK,GAAG,cAAA,EACP,QAAA,kBAAA,6BAAA;AAAA,IAAC,8BAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA,EAAS,KAAA,CAAM,OAAA;AAAA,MACf,gBAAA;AAAA,MACA,UAAA;AAAA,MACA,iBAAA,EAAmB,KAAA,CAAM,iBAAA;AAAA,MACzB,QAAA,EAAU,eAAA;AAAA,MACV,kBAAA,EAAoB,KAAA,CAAM,kBAAA;AAAA,MAC1B,WAAA,kBAAa,KAAA,uBAAM,KAAA,+BAAO,QAAA;AAAA,MAC1B,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,MACnB,OAAA,EAAS,KAAA,CAAM;AAAA,IAAA;AAAA,EACjB,EAAA,CACF,CAAA;AAEJ,CAAC,CAAA;ADuID;AACE;AACF,4BAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/bar/index.js","sourcesContent":[null,"import { memo } from \"react\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildBarChartOptions } from \"./adapter\";\nimport type { BarChartProps } from \"./types\";\nimport { BAR_CHART_DEFAULT_SERIES_LIMIT } from \"../constants\";\n\nexport const BarChart = memo(function BarChart(props: BarChartProps) {\n // The shared hook caps the series to the limit (and warns once per render\n // when the default is exceeded without an explicit override) so the adapter\n // and renderer below all consume the capped data.\n const seriesLimit = props.seriesLimit ?? BAR_CHART_DEFAULT_SERIES_LIMIT;\n const { colors, series } = useSeedsChartSetup({\n series: props.series,\n seriesLimit,\n isSeriesLimitOverridden: props.seriesLimit !== undefined,\n hideSeriesLimitWarning: props.hideSeriesLimitWarning,\n componentName: \"BarChart\",\n });\n\n const { options, annotationLookup, tooltipTimezone } = buildBarChartOptions(\n props,\n props.direction ?? \"vertical\",\n series\n );\n const hasOnClick = Boolean(props.onClick);\n\n // Plain <div> consuming the shared chart-styles.css contract via\n // getChartContainerProps. Colors are the RAW per-series colors (undefined when\n // unset, so only explicit overrides inline --highcharts-color-N), NOT the\n // palette-resolved `colors` passed to ChartRenderer. Neither stylesheet is\n // self-imported (consumers import both).\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-time-series\", \"seeds-chart-bar\"],\n colors: series.map((s) => s.color),\n hasOnClick,\n className: props.className,\n });\n\n return (\n <div {...containerProps}>\n <ChartRenderer\n options={options}\n series={series}\n colors={colors}\n tooltip={props.tooltip}\n annotationLookup={annotationLookup}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n timezone={tooltipTimezone}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.yAxis?.format}\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import { buildAnnotationConfig } from \"../shared/annotations\";\nimport type { ChartAnnotationLookup } from \"../shared/annotations\";\nimport type {\n SeedsChartColumnPlotOptions,\n SeedsChartOptions,\n} from \"../shared/chartBase\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport { TIME_SERIES_CHART_HEIGHT } from \"../../constants/chartOptions\";\nimport {\n buildDimensionalAxis,\n resolveTooltipTimezone,\n} from \"../shared/axisOptions\";\nimport {\n defaultValueAxisLabelFormatter,\n makeValueAxisLabelFormatter,\n} from \"../shared/valueAxisLabelFormatter\";\nimport type { BarChartDirection, BarChartProps } from \"./types\";\n\n// Maps the public `direction` to the Highcharts series/chart type. Highcharts\n// `bar` is a horizontally-oriented `column`: it performs the visual rotation\n// while keeping axis roles (xAxis = category, yAxis = value), so the rest of the\n// adapter is direction-agnostic.\nfunction highchartsType(direction: BarChartDirection): \"column\" | \"bar\" {\n return direction === \"horizontal\" ? \"bar\" : \"column\";\n}\n\nexport function buildBarChartOptions(\n props: BarChartProps,\n direction: BarChartDirection,\n // The (already-capped) series to render. Defaults to `props.series` so the\n // ~40 existing call sites keep working; the component passes the capped\n // series from `useSeedsChartSetup` explicitly.\n series: BarChartProps[\"series\"] = props.series\n): {\n options: SeedsChartOptions;\n annotationLookup: ChartAnnotationLookup | undefined;\n /** Resolved timezone for the tooltip date formatter; undefined on category axes. */\n tooltipTimezone: string | undefined;\n} {\n const chartType = highchartsType(direction);\n const isDatetime = props.xAxis.type === \"datetime\";\n // Gate the `onMouseEnter`/`onMouseLeave` `series` field on the *rendered*\n // (already-capped) series count, not `props.series` — if `seriesLimit` caps a\n // multi-series input down to one rendered series the chart is effectively\n // single-series, and `series` must be absent per the \"present only for\n // multi-series bar\" contract.\n const isMultiSeries = series.length > 1;\n const tooltipTimezone = resolveTooltipTimezone(props.xAxis, props.timezone);\n const { annotations, lookup: annotationLookup } = buildAnnotationConfig(\n props.annotations\n );\n // `column` (vertical) and `bar` (horizontal) take the same option shape, so a\n // single config is assigned under the active direction's key. Typed\n // explicitly so the `point.events` handlers below keep their `this`/`event`\n // contextual types (a computed `[chartType]` key would otherwise erase them).\n const barTypeConfig: SeedsChartColumnPlotOptions = {\n // \"grouped\" maps to omitting `stacking` — Highcharts renders multi-series\n // columns side-by-side when no stacking is set.\n ...(props.stacking === \"grouped\"\n ? {}\n : { stacking: props.stacking ?? \"normal\" }),\n // Horizontal bars are height-constrained (fixed chart height ÷ categories),\n // so the same padding fractions that work for columns produce hairline bars.\n pointPadding: direction === \"horizontal\" ? 0.05 : 0.25,\n groupPadding: direction === \"horizontal\" ? 0.1 : 0.25,\n // Fixed bar width on datetime axes. Sparse time-series otherwise size\n // columns from the (large) gap between points and balloon; a fixed\n // pointWidth: 20 gives a consistent time-series treatment. Dense datetime\n // data may instead want a maxPointWidth cap — revisit when Line/Area land.\n ...(isDatetime ? { pointWidth: 20 } : {}),\n borderRadius: 4,\n borderWidth: 0,\n // Pairs with the `:hover` dimming rule in `styles.ts`: while the cursor\n // is over the chart, all bars dim; these handlers restore opacity for\n // every bar at the hovered x (so stacked/grouped bars highlight together\n // rather than just the single hovered bar).\n point: {\n events: {\n click: props.onClick\n ? (event) => props.onClick!({ position: event.point.x })\n : undefined,\n mouseOver: function () {\n const x = this.x;\n props.onMouseEnter?.({\n position: x,\n // Omit the key entirely (not `series: undefined`) for single-series\n // so consumers testing `\"series\" in payload` see the contract.\n ...(isMultiSeries\n ? {\n series: { name: this.series.name, index: this.series.index },\n }\n : {}),\n });\n this.series.chart.series.forEach((s) => {\n if (s.type !== chartType) return;\n s.data.forEach((point) => {\n if (point.x !== x) return;\n point.graphic?.element?.classList.add(\"bar-point-hover\");\n });\n });\n },\n mouseOut: function () {\n props.onMouseLeave?.({\n position: this.x,\n ...(isMultiSeries\n ? {\n series: { name: this.series.name, index: this.series.index },\n }\n : {}),\n });\n this.series.chart.series.forEach((s) => {\n if (s.type !== chartType) return;\n s.data.forEach((point) => {\n point.graphic?.element?.classList.remove(\"bar-point-hover\");\n });\n });\n },\n },\n },\n };\n const base = buildBaseChartOptions({\n type: chartType,\n description: props.description,\n valueSuffix: props.valueSuffix,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipTimezone,\n });\n\n const options: SeedsChartOptions = {\n ...base,\n // Default height baseline (overridable via `props.height`) so consumers\n // who don't configure sizing keep the design-reviewed default.\n chart: {\n ...base.chart,\n // Re-assert the definite `type` so spreading the optionally-typed\n // `base.chart` doesn't widen the required `type` field to optional.\n type: chartType,\n height: props.height ?? TIME_SERIES_CHART_HEIGHT,\n // Tight time-series spacing (from constants/chartOptions.ts) so the plot\n // area fills the 275px container; without it Highcharts' larger default\n // spacing ([10, 10, 15, 10]) shrinks the plot area.\n spacing: [5, 1, 0, 2],\n },\n xAxis: buildDimensionalAxis(props.xAxis, tooltipTimezone ?? \"UTC\"),\n yAxis: {\n min: props.yAxis?.min,\n max: props.yAxis?.max,\n gridLineWidth: props.yAxis?.showGridLines === false ? 0 : 1,\n // A dedicated plotLine at 0, styled distinctly from regular gridlines\n // (see chartStyles.ts).\n plotLines: [{ value: 0, className: \"y-axis-zero-line\", zIndex: 3 }],\n title: { text: props.yAxis?.title ?? \"\" },\n labels: {\n // `showLabels` toggles tick-label visibility; defaults to shown.\n enabled: props.yAxis?.showLabels !== false,\n // A declarative `format` drives ticks through the shared valueFormatter;\n // absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).\n formatter: props.yAxis?.format\n ? makeValueAxisLabelFormatter(props.yAxis.format)\n : defaultValueAxisLabelFormatter,\n },\n },\n plotOptions: {\n series: { animation: false },\n [chartType]: barTypeConfig,\n },\n series: series.map((s) => ({\n type: chartType,\n name: s.name,\n data: [...s.data],\n color: s.color,\n })),\n ...(annotations ? { annotations } : {}),\n };\n\n return { options, annotationLookup, tooltipTimezone };\n}\n","export const BAR_CHART_DEFAULT_SERIES_LIMIT = 10;\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/bar/index.js","../../src/charts/bar/BarChart.tsx","../../src/charts/bar/adapter.ts","../../src/charts/constants.ts"],"names":["BarChart"],"mappings":"AAAA;AACE;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACtBA,8BAAqB;ADwBrB;AACA;AEHA,SAA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A,EAAoB,KAAA,CAAM,kBAAA;AAAA,MAC1B,WAAA,kBAAa,KAAA,uBAAM,KAAA,+BAAO,QAAA;AAAA,MAC1B,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,MACnB,OAAA,EAAS,KAAA,CAAM;AAAA,IAAA;AAAA,EACjB,EAAA,CACF,CAAA;AAEJ,CAAC,CAAA;ADuID;AACE;AACF,4BAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/bar/index.js","sourcesContent":[null,"import { memo } from \"react\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildBarChartOptions } from \"./adapter\";\nimport type { BarChartProps } from \"./types\";\nimport { BAR_CHART_DEFAULT_SERIES_LIMIT } from \"../constants\";\n\nexport const BarChart = memo(function BarChart(props: BarChartProps) {\n // The shared hook caps the series to the limit (and warns once per render\n // when the default is exceeded without an explicit override) so the adapter\n // and renderer below all consume the capped data.\n const seriesLimit = props.seriesLimit ?? BAR_CHART_DEFAULT_SERIES_LIMIT;\n const { colors, series } = useSeedsChartSetup({\n series: props.series,\n seriesLimit,\n isSeriesLimitOverridden: props.seriesLimit !== undefined,\n hideSeriesLimitWarning: props.hideSeriesLimitWarning,\n componentName: \"BarChart\",\n });\n\n const { options, annotationLookup, tooltipTimezone } = buildBarChartOptions(\n props,\n props.direction ?? \"vertical\",\n series\n );\n const hasOnClick = Boolean(props.onClick);\n\n // Plain <div> consuming the shared chart-styles.css contract via\n // getChartContainerProps. Colors are the RAW per-series colors (undefined when\n // unset, so only explicit overrides inline --highcharts-color-N), NOT the\n // palette-resolved `colors` passed to ChartRenderer. Neither stylesheet is\n // self-imported (consumers import both).\n const containerProps = getChartContainerProps({\n familyClasses: [\"seeds-chart-time-series\", \"seeds-chart-bar\"],\n colors: series.map((s) => s.color),\n hasOnClick,\n className: props.className,\n });\n\n return (\n <div {...containerProps}>\n <ChartRenderer\n options={options}\n series={series}\n colors={colors}\n tooltip={props.tooltip}\n annotationLookup={annotationLookup}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n timezone={tooltipTimezone}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.yAxis?.format}\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import { buildAnnotationConfig } from \"../shared/annotations\";\nimport type { ChartAnnotationLookup } from \"../shared/annotations\";\nimport type {\n SeedsChartColumnPlotOptions,\n SeedsChartOptions,\n} from \"../shared/chartBase\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport { TIME_SERIES_CHART_HEIGHT } from \"../../constants/chartOptions\";\nimport {\n buildDimensionalAxis,\n resolveTooltipTimezone,\n} from \"../shared/axisOptions\";\nimport {\n defaultValueAxisLabelFormatter,\n makeValueAxisLabelFormatter,\n} from \"../shared/valueAxisLabelFormatter\";\nimport type { BarChartDirection, BarChartProps } from \"./types\";\n\n// Maps the public `direction` to the Highcharts series/chart type. Highcharts\n// `bar` is a horizontally-oriented `column`: it performs the visual rotation\n// while keeping axis roles (xAxis = category, yAxis = value), so the rest of the\n// adapter is direction-agnostic.\nfunction highchartsType(direction: BarChartDirection): \"column\" | \"bar\" {\n return direction === \"horizontal\" ? \"bar\" : \"column\";\n}\n\nexport function buildBarChartOptions(\n props: BarChartProps,\n direction: BarChartDirection,\n // The (already-capped) series to render. Defaults to `props.series` so the\n // ~40 existing call sites keep working; the component passes the capped\n // series from `useSeedsChartSetup` explicitly.\n series: BarChartProps[\"series\"] = props.series\n): {\n options: SeedsChartOptions;\n annotationLookup: ChartAnnotationLookup | undefined;\n /** Resolved timezone for the tooltip date formatter; undefined on category axes. */\n tooltipTimezone: string | undefined;\n} {\n const chartType = highchartsType(direction);\n const isDatetime = props.xAxis.type === \"datetime\";\n // Gate the `onMouseEnter`/`onMouseLeave` `series` field on the *rendered*\n // (already-capped) series count, not `props.series` — if `seriesLimit` caps a\n // multi-series input down to one rendered series the chart is effectively\n // single-series, and `series` must be absent per the \"present only for\n // multi-series bar\" contract.\n const isMultiSeries = series.length > 1;\n const tooltipTimezone = resolveTooltipTimezone(props.xAxis, props.timezone);\n const { annotations, lookup: annotationLookup } = buildAnnotationConfig(\n props.annotations\n );\n // `column` (vertical) and `bar` (horizontal) take the same option shape, so a\n // single config is assigned under the active direction's key. Typed\n // explicitly so the `point.events` handlers below keep their `this`/`event`\n // contextual types (a computed `[chartType]` key would otherwise erase them).\n const barTypeConfig: SeedsChartColumnPlotOptions = {\n // \"grouped\" maps to omitting `stacking` — Highcharts renders multi-series\n // columns side-by-side when no stacking is set.\n ...(props.stacking === \"grouped\"\n ? {}\n : { stacking: props.stacking ?? \"normal\" }),\n // Horizontal bars are height-constrained (fixed chart height ÷ categories),\n // so the same padding fractions that work for columns produce hairline bars.\n pointPadding: direction === \"horizontal\" ? 0.05 : 0.25,\n groupPadding: direction === \"horizontal\" ? 0.1 : 0.25,\n // Fixed bar width on datetime axes. Sparse time-series otherwise size\n // columns from the (large) gap between points and balloon; a fixed\n // pointWidth: 20 gives a consistent time-series treatment. Dense datetime\n // data may instead want a maxPointWidth cap — revisit when Line/Area land.\n ...(isDatetime ? { pointWidth: 20 } : {}),\n borderRadius: 4,\n borderWidth: 0,\n // Pairs with the `:hover` dimming rule in `styles.ts`: while the cursor\n // is over the chart, all bars dim; these handlers restore opacity for\n // every bar at the hovered x (so stacked/grouped bars highlight together\n // rather than just the single hovered bar).\n point: {\n events: {\n click: props.onClick\n ? (event) => props.onClick!({ position: event.point.x })\n : undefined,\n mouseOver: function () {\n const x = this.x;\n props.onMouseEnter?.({\n position: x,\n // Omit the key entirely (not `series: undefined`) for single-series\n // so consumers testing `\"series\" in payload` see the contract.\n ...(isMultiSeries\n ? {\n series: { name: this.series.name, index: this.series.index },\n }\n : {}),\n });\n this.series.chart.series.forEach((s) => {\n if (s.type !== chartType) return;\n s.data.forEach((point) => {\n if (point.x !== x) return;\n point.graphic?.element?.classList.add(\"bar-point-hover\");\n });\n });\n },\n mouseOut: function () {\n props.onMouseLeave?.({\n position: this.x,\n ...(isMultiSeries\n ? {\n series: { name: this.series.name, index: this.series.index },\n }\n : {}),\n });\n this.series.chart.series.forEach((s) => {\n if (s.type !== chartType) return;\n s.data.forEach((point) => {\n point.graphic?.element?.classList.remove(\"bar-point-hover\");\n });\n });\n },\n },\n },\n };\n const base = buildBaseChartOptions({\n type: chartType,\n description: props.description,\n valueSuffix: props.valueSuffix,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipTimezone,\n });\n\n const options: SeedsChartOptions = {\n ...base,\n // Default height baseline (overridable via `props.height`) so consumers\n // who don't configure sizing keep the design-reviewed default.\n chart: {\n ...base.chart,\n // Re-assert the definite `type` so spreading the optionally-typed\n // `base.chart` doesn't widen the required `type` field to optional.\n type: chartType,\n height: props.height ?? TIME_SERIES_CHART_HEIGHT,\n // Tight time-series spacing (from constants/chartOptions.ts) so the plot\n // area fills the 275px container; without it Highcharts' larger default\n // spacing ([10, 10, 15, 10]) shrinks the plot area.\n spacing: [5, 1, 0, 2],\n },\n xAxis: buildDimensionalAxis(props.xAxis, tooltipTimezone ?? \"UTC\"),\n yAxis: {\n min: props.yAxis?.min,\n max: props.yAxis?.max,\n gridLineWidth: props.yAxis?.showGridLines === false ? 0 : 1,\n // A dedicated plotLine at 0, styled distinctly from regular gridlines\n // (see chartStyles.ts).\n plotLines: [{ value: 0, className: \"y-axis-zero-line\", zIndex: 3 }],\n title: { text: props.yAxis?.title ?? \"\" },\n labels: {\n // `showLabels` toggles tick-label visibility; defaults to shown.\n enabled: props.yAxis?.showLabels !== false,\n // A declarative `format` drives ticks through the shared valueFormatter;\n // absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).\n formatter: props.yAxis?.format\n ? makeValueAxisLabelFormatter(props.yAxis.format)\n : defaultValueAxisLabelFormatter,\n },\n },\n plotOptions: {\n series: { animation: false },\n [chartType]: barTypeConfig,\n },\n series: series.map((s) => ({\n type: chartType,\n name: s.name,\n data: [...s.data],\n color: s.color,\n })),\n ...(annotations ? { annotations } : {}),\n };\n\n return { options, annotationLookup, tooltipTimezone };\n}\n","export const BAR_CHART_DEFAULT_SERIES_LIMIT = 10;\n"]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, MouseEventHandler } from 'react';
|
|
3
|
+
import { C as ChartTooltipProps, a as ChartTooltipDataRow, V as ValueFormat } from '../chartBase-BClSc5EN.mjs';
|
|
4
|
+
import { C as ChartExportHandle } from '../chartExport-CKYpuhik.mjs';
|
|
5
|
+
import { C as ChartColorableEntity, a as ChartIconableEntity, c as ChartHoverHandler } from '../interactions-pEXA1XxF.mjs';
|
|
6
|
+
export { h as defaultBubbleChartWidth } from '../chartOptions-DHzoGRdG.mjs';
|
|
7
|
+
import '@sproutsocial/seeds-react-icon';
|
|
8
|
+
import '../types-DxrhdAdn.mjs';
|
|
9
|
+
import 'highcharts';
|
|
10
|
+
|
|
11
|
+
/** A single inner bubble within a category. An `icon` renders inside the bubble's data label (see `BubbleChartProps.format` for value display, not label assembly). */
|
|
12
|
+
interface BubbleInnerDataPoint extends ChartIconableEntity {
|
|
13
|
+
value: number;
|
|
14
|
+
}
|
|
15
|
+
/** One outer category — its own packedbubble series, clustering its inner bubbles. */
|
|
16
|
+
interface BubbleCategoryDataPoint extends ChartColorableEntity, ChartIconableEntity {
|
|
17
|
+
innerBubbles: Array<BubbleInnerDataPoint>;
|
|
18
|
+
}
|
|
19
|
+
interface BubbleChartAccessibility {
|
|
20
|
+
/** The chart region's accessible name (Highcharts `svgContainerLabel`). */
|
|
21
|
+
svgContainerLabel?: string;
|
|
22
|
+
/** Long-form data summary (Highcharts `accessibility.description`). */
|
|
23
|
+
description: string;
|
|
24
|
+
point?: {
|
|
25
|
+
/**
|
|
26
|
+
* Per-point description for keyboard/proxy-button activation. Omitted →
|
|
27
|
+
* internal English default "{name}: {value}. Press Enter or Space to
|
|
28
|
+
* activate." Only wired to Highcharts when `onClick` is set.
|
|
29
|
+
*/
|
|
30
|
+
descriptionFormatter?: (point: {
|
|
31
|
+
name: string;
|
|
32
|
+
value: number;
|
|
33
|
+
}) => string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** A bubble tooltip row — always carries the outer/inner index pair so consumers can map back to their own category/entity data. */
|
|
37
|
+
interface BubbleChartTooltipRow extends ChartTooltipDataRow {
|
|
38
|
+
seriesIndex: number;
|
|
39
|
+
pointIndex: number;
|
|
40
|
+
}
|
|
41
|
+
/** Tooltip render-prop signature for BubbleChart. `data` is always a single-row array (one hovered bubble). */
|
|
42
|
+
interface BubbleChartTooltipProps extends Omit<ChartTooltipProps, "data"> {
|
|
43
|
+
data: BubbleChartTooltipRow[];
|
|
44
|
+
}
|
|
45
|
+
interface BubbleChartClickData {
|
|
46
|
+
name: string;
|
|
47
|
+
value: number;
|
|
48
|
+
seriesIndex: number;
|
|
49
|
+
pointIndex: number;
|
|
50
|
+
pageX: number;
|
|
51
|
+
pageY: number;
|
|
52
|
+
}
|
|
53
|
+
interface BubbleChartProps {
|
|
54
|
+
data: Array<BubbleCategoryDataPoint>;
|
|
55
|
+
accessibility: BubbleChartAccessibility;
|
|
56
|
+
/** Splits each category into its own packed cluster (drilldown). Defaults to `false` (overview: one bubble per category). */
|
|
57
|
+
splitSeries?: boolean;
|
|
58
|
+
/** Applied to the outermost container element for layout/spacing overrides. */
|
|
59
|
+
className?: string;
|
|
60
|
+
/** Chart height in pixels. Defaults to 600 (v1 parity). */
|
|
61
|
+
height?: number;
|
|
62
|
+
/** Override for the default tooltip content. Receives a single-row `data` array (the hovered bubble). */
|
|
63
|
+
tooltip?: (args: BubbleChartTooltipProps) => ReactNode;
|
|
64
|
+
/** Footer content shown in the default tooltip when `onClick` is set. */
|
|
65
|
+
tooltipClickLabel?: ReactNode;
|
|
66
|
+
/** Override for the value shown when a data point is `null`. Defaults to an em-dash. */
|
|
67
|
+
invalidNumberLabel?: ReactNode;
|
|
68
|
+
/** Controls number/currency/locale formatting for the default tooltip's value. */
|
|
69
|
+
format?: ValueFormat;
|
|
70
|
+
/** Space reserved between bubbles. Defaults to 16px (v1 parity). */
|
|
71
|
+
bubblePadding?: number;
|
|
72
|
+
/** Max bubble size, as a percent of the plot area (e.g. `"100%"`). Values over 100 clip. Defaults to `"100%"` (v1 parity). */
|
|
73
|
+
maxBubbleSize?: string | number;
|
|
74
|
+
/** Click handler for a bubble point. */
|
|
75
|
+
onClick?: (data: BubbleChartClickData) => void;
|
|
76
|
+
/** Click handler for the plot background (outside any bubble). */
|
|
77
|
+
onPlotBackgroundClick?: MouseEventHandler<HTMLDivElement>;
|
|
78
|
+
/** Fired when the pointer enters a bubble (also on keyboard focus), with the bubble `name` as `position`. */
|
|
79
|
+
onMouseEnter?: ChartHoverHandler<string>;
|
|
80
|
+
/** Fired when the pointer leaves a bubble (also on keyboard blur), with the bubble `name` as `position`. */
|
|
81
|
+
onMouseLeave?: ChartHoverHandler<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Chart title included in the exported image (PNG/SVG/PDF) only — it does
|
|
84
|
+
* *not* render on screen. Omit for no title.
|
|
85
|
+
*/
|
|
86
|
+
exportTitle?: string;
|
|
87
|
+
/** Fired once per chart instance with a handle for PNG/SVG/PDF/CSV exports. */
|
|
88
|
+
onReady?: (handle: ChartExportHandle) => void;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* BubbleChart renders a Highcharts packedbubble (clustered, axis-less) chart
|
|
93
|
+
* from a list of categories, each with its own nested inner bubbles.
|
|
94
|
+
*
|
|
95
|
+
* Like DonutChart, it carries no `styled-components`: the wrapper is a plain
|
|
96
|
+
* `<div>` and the Highcharts styling ships as static CSS. Consumers import
|
|
97
|
+
* both `@sproutsocial/seeds-react-data-viz/chart-styles.css` and
|
|
98
|
+
* `.../bubble.css` once (the component never self-imports its CSS).
|
|
99
|
+
*/
|
|
100
|
+
declare const BubbleChart: react.NamedExoticComponent<BubbleChartProps>;
|
|
101
|
+
|
|
102
|
+
export { type BubbleCategoryDataPoint, BubbleChart, type BubbleChartAccessibility, type BubbleChartClickData, type BubbleChartProps, type BubbleChartTooltipProps, type BubbleChartTooltipRow, type BubbleInnerDataPoint, ChartExportHandle, ChartHoverHandler, ValueFormat };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, MouseEventHandler } from 'react';
|
|
3
|
+
import { C as ChartTooltipProps, a as ChartTooltipDataRow, V as ValueFormat } from '../chartBase-CycEw2vy.js';
|
|
4
|
+
import { C as ChartExportHandle } from '../chartExport-CKYpuhik.js';
|
|
5
|
+
import { C as ChartColorableEntity, a as ChartIconableEntity, c as ChartHoverHandler } from '../interactions-pEXA1XxF.js';
|
|
6
|
+
export { h as defaultBubbleChartWidth } from '../chartOptions-DHzoGRdG.js';
|
|
7
|
+
import '@sproutsocial/seeds-react-icon';
|
|
8
|
+
import '../types-DxrhdAdn.js';
|
|
9
|
+
import 'highcharts';
|
|
10
|
+
|
|
11
|
+
/** A single inner bubble within a category. An `icon` renders inside the bubble's data label (see `BubbleChartProps.format` for value display, not label assembly). */
|
|
12
|
+
interface BubbleInnerDataPoint extends ChartIconableEntity {
|
|
13
|
+
value: number;
|
|
14
|
+
}
|
|
15
|
+
/** One outer category — its own packedbubble series, clustering its inner bubbles. */
|
|
16
|
+
interface BubbleCategoryDataPoint extends ChartColorableEntity, ChartIconableEntity {
|
|
17
|
+
innerBubbles: Array<BubbleInnerDataPoint>;
|
|
18
|
+
}
|
|
19
|
+
interface BubbleChartAccessibility {
|
|
20
|
+
/** The chart region's accessible name (Highcharts `svgContainerLabel`). */
|
|
21
|
+
svgContainerLabel?: string;
|
|
22
|
+
/** Long-form data summary (Highcharts `accessibility.description`). */
|
|
23
|
+
description: string;
|
|
24
|
+
point?: {
|
|
25
|
+
/**
|
|
26
|
+
* Per-point description for keyboard/proxy-button activation. Omitted →
|
|
27
|
+
* internal English default "{name}: {value}. Press Enter or Space to
|
|
28
|
+
* activate." Only wired to Highcharts when `onClick` is set.
|
|
29
|
+
*/
|
|
30
|
+
descriptionFormatter?: (point: {
|
|
31
|
+
name: string;
|
|
32
|
+
value: number;
|
|
33
|
+
}) => string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** A bubble tooltip row — always carries the outer/inner index pair so consumers can map back to their own category/entity data. */
|
|
37
|
+
interface BubbleChartTooltipRow extends ChartTooltipDataRow {
|
|
38
|
+
seriesIndex: number;
|
|
39
|
+
pointIndex: number;
|
|
40
|
+
}
|
|
41
|
+
/** Tooltip render-prop signature for BubbleChart. `data` is always a single-row array (one hovered bubble). */
|
|
42
|
+
interface BubbleChartTooltipProps extends Omit<ChartTooltipProps, "data"> {
|
|
43
|
+
data: BubbleChartTooltipRow[];
|
|
44
|
+
}
|
|
45
|
+
interface BubbleChartClickData {
|
|
46
|
+
name: string;
|
|
47
|
+
value: number;
|
|
48
|
+
seriesIndex: number;
|
|
49
|
+
pointIndex: number;
|
|
50
|
+
pageX: number;
|
|
51
|
+
pageY: number;
|
|
52
|
+
}
|
|
53
|
+
interface BubbleChartProps {
|
|
54
|
+
data: Array<BubbleCategoryDataPoint>;
|
|
55
|
+
accessibility: BubbleChartAccessibility;
|
|
56
|
+
/** Splits each category into its own packed cluster (drilldown). Defaults to `false` (overview: one bubble per category). */
|
|
57
|
+
splitSeries?: boolean;
|
|
58
|
+
/** Applied to the outermost container element for layout/spacing overrides. */
|
|
59
|
+
className?: string;
|
|
60
|
+
/** Chart height in pixels. Defaults to 600 (v1 parity). */
|
|
61
|
+
height?: number;
|
|
62
|
+
/** Override for the default tooltip content. Receives a single-row `data` array (the hovered bubble). */
|
|
63
|
+
tooltip?: (args: BubbleChartTooltipProps) => ReactNode;
|
|
64
|
+
/** Footer content shown in the default tooltip when `onClick` is set. */
|
|
65
|
+
tooltipClickLabel?: ReactNode;
|
|
66
|
+
/** Override for the value shown when a data point is `null`. Defaults to an em-dash. */
|
|
67
|
+
invalidNumberLabel?: ReactNode;
|
|
68
|
+
/** Controls number/currency/locale formatting for the default tooltip's value. */
|
|
69
|
+
format?: ValueFormat;
|
|
70
|
+
/** Space reserved between bubbles. Defaults to 16px (v1 parity). */
|
|
71
|
+
bubblePadding?: number;
|
|
72
|
+
/** Max bubble size, as a percent of the plot area (e.g. `"100%"`). Values over 100 clip. Defaults to `"100%"` (v1 parity). */
|
|
73
|
+
maxBubbleSize?: string | number;
|
|
74
|
+
/** Click handler for a bubble point. */
|
|
75
|
+
onClick?: (data: BubbleChartClickData) => void;
|
|
76
|
+
/** Click handler for the plot background (outside any bubble). */
|
|
77
|
+
onPlotBackgroundClick?: MouseEventHandler<HTMLDivElement>;
|
|
78
|
+
/** Fired when the pointer enters a bubble (also on keyboard focus), with the bubble `name` as `position`. */
|
|
79
|
+
onMouseEnter?: ChartHoverHandler<string>;
|
|
80
|
+
/** Fired when the pointer leaves a bubble (also on keyboard blur), with the bubble `name` as `position`. */
|
|
81
|
+
onMouseLeave?: ChartHoverHandler<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Chart title included in the exported image (PNG/SVG/PDF) only — it does
|
|
84
|
+
* *not* render on screen. Omit for no title.
|
|
85
|
+
*/
|
|
86
|
+
exportTitle?: string;
|
|
87
|
+
/** Fired once per chart instance with a handle for PNG/SVG/PDF/CSV exports. */
|
|
88
|
+
onReady?: (handle: ChartExportHandle) => void;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* BubbleChart renders a Highcharts packedbubble (clustered, axis-less) chart
|
|
93
|
+
* from a list of categories, each with its own nested inner bubbles.
|
|
94
|
+
*
|
|
95
|
+
* Like DonutChart, it carries no `styled-components`: the wrapper is a plain
|
|
96
|
+
* `<div>` and the Highcharts styling ships as static CSS. Consumers import
|
|
97
|
+
* both `@sproutsocial/seeds-react-data-viz/chart-styles.css` and
|
|
98
|
+
* `.../bubble.css` once (the component never self-imports its CSS).
|
|
99
|
+
*/
|
|
100
|
+
declare const BubbleChart: react.NamedExoticComponent<BubbleChartProps>;
|
|
101
|
+
|
|
102
|
+
export { type BubbleCategoryDataPoint, BubbleChart, type BubbleChartAccessibility, type BubbleChartClickData, type BubbleChartProps, type BubbleChartTooltipProps, type BubbleChartTooltipRow, type BubbleInnerDataPoint, ChartExportHandle, ChartHoverHandler, ValueFormat };
|