@sproutsocial/seeds-react-data-viz 0.18.0 → 0.20.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/bar/index.d.mts +20 -4
- package/dist/bar/index.d.ts +20 -4
- package/dist/bar/index.js +53 -85
- package/dist/bar/index.js.map +1 -1
- package/dist/bar.css +39 -0
- package/dist/chart-styles.css +295 -0
- package/dist/charts.css +583 -0
- package/dist/{chunk-XP7HNV23.js → chunk-27M4FDNK.js} +16 -17
- package/dist/chunk-27M4FDNK.js.map +1 -0
- package/dist/chunk-46L4YBLC.js +544 -0
- package/dist/chunk-46L4YBLC.js.map +1 -0
- package/dist/chunk-6EIJCJCN.js +22 -0
- package/dist/chunk-6EIJCJCN.js.map +1 -0
- package/dist/{chunk-GVAMWFB7.js → chunk-XYE6O77Z.js} +3 -3
- package/dist/{chunk-GVAMWFB7.js.map → chunk-XYE6O77Z.js.map} +1 -1
- package/dist/donut/index.d.mts +21 -4
- package/dist/donut/index.d.ts +21 -4
- package/dist/donut/index.js +39 -49
- package/dist/donut/index.js.map +1 -1
- package/dist/donut.css +45 -0
- package/dist/esm/bar/index.js +42 -74
- package/dist/esm/bar/index.js.map +1 -1
- package/dist/esm/{chunk-X2KAXY3P.js → chunk-KMFRRUTY.js} +2 -2
- package/dist/esm/chunk-P3MVYSHX.js +22 -0
- package/dist/esm/chunk-P3MVYSHX.js.map +1 -0
- package/dist/esm/{chunk-JLFXOEV2.js → chunk-QSSYSKRP.js} +3 -4
- package/dist/esm/chunk-QSSYSKRP.js.map +1 -0
- package/dist/esm/chunk-XEKQTAUH.js +544 -0
- package/dist/esm/chunk-XEKQTAUH.js.map +1 -0
- package/dist/esm/donut/index.js +38 -48
- package/dist/esm/donut/index.js.map +1 -1
- package/dist/esm/index.js +536 -134
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/line-area/index.js +30 -21
- package/dist/esm/line-area/index.js.map +1 -1
- package/dist/esm/sparkline/index.js +2 -2
- package/dist/index.js +497 -95
- package/dist/index.js.map +1 -1
- package/dist/interactions-DoWoL7bu.d.mts +29 -0
- package/dist/interactions-DoWoL7bu.d.ts +29 -0
- package/dist/line-area/index.d.mts +30 -4
- package/dist/line-area/index.d.ts +30 -4
- package/dist/line-area/index.js +35 -26
- package/dist/line-area/index.js.map +1 -1
- package/dist/line-area.css +112 -0
- package/dist/sparkline/index.js +4 -4
- package/package.json +16 -7
- package/dist/chunk-WEKDYQ4T.js +0 -968
- package/dist/chunk-WEKDYQ4T.js.map +0 -1
- package/dist/chunk-XP7HNV23.js.map +0 -1
- package/dist/esm/chunk-JLFXOEV2.js.map +0 -1
- package/dist/esm/chunk-Z4LOM4OZ.js +0 -968
- package/dist/esm/chunk-Z4LOM4OZ.js.map +0 -1
- /package/dist/esm/{chunk-X2KAXY3P.js.map → chunk-KMFRRUTY.js.map} +0 -0
package/dist/bar/index.d.mts
CHANGED
|
@@ -4,6 +4,8 @@ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
|
|
|
4
4
|
import { C as ChartAnnotation } from '../annotations-CjFoRPXf.mjs';
|
|
5
5
|
import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-Cn_5CUJi.mjs';
|
|
6
6
|
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';
|
|
7
9
|
import { C as ChartDataPoint, a as CategoryAxis, D as DatetimeAxis, b as DatetimePoint } from '../axis-WOeYkTO1.mjs';
|
|
8
10
|
import '../types-DxrhdAdn.mjs';
|
|
9
11
|
import 'highcharts';
|
|
@@ -35,6 +37,8 @@ interface BarChartProps {
|
|
|
35
37
|
/** Wired into Highcharts' `accessibility.description`. */
|
|
36
38
|
description: string;
|
|
37
39
|
series: Array<BarSeries>;
|
|
40
|
+
/** Tailwind / class passthrough appended to the container class chain. */
|
|
41
|
+
className?: string;
|
|
38
42
|
/** Orientation of the bars. `"vertical"` (default) renders columns; `"horizontal"` renders bars. */
|
|
39
43
|
direction?: BarChartDirection;
|
|
40
44
|
/** Maximum number of series to display. Series beyond the limit are dropped. Default `10`. */
|
|
@@ -54,9 +58,21 @@ interface BarChartProps {
|
|
|
54
58
|
/** Declarative annotations rendered at positions on the chart. */
|
|
55
59
|
annotations?: ChartAnnotation[];
|
|
56
60
|
/** Click handler invoked with the category name or timestamp of the clicked bar. */
|
|
57
|
-
onClick?:
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
onClick?: ChartClickHandler;
|
|
62
|
+
/**
|
|
63
|
+
* Fired when the pointer enters a bar (also on keyboard focus), with the
|
|
64
|
+
* category name or timestamp of the bar as `position`. For a multi-series bar
|
|
65
|
+
* chart the payload also carries `series: { name, index }` identifying the
|
|
66
|
+
* hovered series; it is omitted for single-series charts.
|
|
67
|
+
*/
|
|
68
|
+
onMouseEnter?: ChartHoverHandler;
|
|
69
|
+
/**
|
|
70
|
+
* Fired when the pointer leaves a bar (also on keyboard blur), with the
|
|
71
|
+
* category name or timestamp of the bar as `position`. For a multi-series bar
|
|
72
|
+
* chart the payload also carries `series: { name, index }` identifying the
|
|
73
|
+
* hovered series; it is omitted for single-series charts.
|
|
74
|
+
*/
|
|
75
|
+
onMouseLeave?: ChartHoverHandler;
|
|
60
76
|
/** Footer content shown in the default tooltip when `onClick` is set. */
|
|
61
77
|
tooltipClickLabel?: ReactNode;
|
|
62
78
|
/** Override for the value shown when a data point is null. Defaults to an em-dash. */
|
|
@@ -74,4 +90,4 @@ interface BarChartProps {
|
|
|
74
90
|
|
|
75
91
|
declare const BarChart: react.NamedExoticComponent<BarChartProps>;
|
|
76
92
|
|
|
77
|
-
export { BarChart, type BarChartDirection, type BarChartProps, type BarDataPoint, type BarDatetimePoint, type BarSeries, type BarXAxis, type BarYAxis, CategoryAxis, ChartExportHandle, DatetimeAxis, ValueFormat };
|
|
93
|
+
export { BarChart, type BarChartDirection, type BarChartProps, type BarDataPoint, type BarDatetimePoint, type BarSeries, type BarXAxis, type BarYAxis, CategoryAxis, ChartClickHandler, ChartExportHandle, ChartHoverHandler, DatetimeAxis, ValueFormat };
|
package/dist/bar/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
|
|
|
4
4
|
import { C as ChartAnnotation } from '../annotations-CjFoRPXf.js';
|
|
5
5
|
import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-C-l7yYGx.js';
|
|
6
6
|
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';
|
|
7
9
|
import { C as ChartDataPoint, a as CategoryAxis, D as DatetimeAxis, b as DatetimePoint } from '../axis-WOeYkTO1.js';
|
|
8
10
|
import '../types-DxrhdAdn.js';
|
|
9
11
|
import 'highcharts';
|
|
@@ -35,6 +37,8 @@ interface BarChartProps {
|
|
|
35
37
|
/** Wired into Highcharts' `accessibility.description`. */
|
|
36
38
|
description: string;
|
|
37
39
|
series: Array<BarSeries>;
|
|
40
|
+
/** Tailwind / class passthrough appended to the container class chain. */
|
|
41
|
+
className?: string;
|
|
38
42
|
/** Orientation of the bars. `"vertical"` (default) renders columns; `"horizontal"` renders bars. */
|
|
39
43
|
direction?: BarChartDirection;
|
|
40
44
|
/** Maximum number of series to display. Series beyond the limit are dropped. Default `10`. */
|
|
@@ -54,9 +58,21 @@ interface BarChartProps {
|
|
|
54
58
|
/** Declarative annotations rendered at positions on the chart. */
|
|
55
59
|
annotations?: ChartAnnotation[];
|
|
56
60
|
/** Click handler invoked with the category name or timestamp of the clicked bar. */
|
|
57
|
-
onClick?:
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
onClick?: ChartClickHandler;
|
|
62
|
+
/**
|
|
63
|
+
* Fired when the pointer enters a bar (also on keyboard focus), with the
|
|
64
|
+
* category name or timestamp of the bar as `position`. For a multi-series bar
|
|
65
|
+
* chart the payload also carries `series: { name, index }` identifying the
|
|
66
|
+
* hovered series; it is omitted for single-series charts.
|
|
67
|
+
*/
|
|
68
|
+
onMouseEnter?: ChartHoverHandler;
|
|
69
|
+
/**
|
|
70
|
+
* Fired when the pointer leaves a bar (also on keyboard blur), with the
|
|
71
|
+
* category name or timestamp of the bar as `position`. For a multi-series bar
|
|
72
|
+
* chart the payload also carries `series: { name, index }` identifying the
|
|
73
|
+
* hovered series; it is omitted for single-series charts.
|
|
74
|
+
*/
|
|
75
|
+
onMouseLeave?: ChartHoverHandler;
|
|
60
76
|
/** Footer content shown in the default tooltip when `onClick` is set. */
|
|
61
77
|
tooltipClickLabel?: ReactNode;
|
|
62
78
|
/** Override for the value shown when a data point is null. Defaults to an em-dash. */
|
|
@@ -74,4 +90,4 @@ interface BarChartProps {
|
|
|
74
90
|
|
|
75
91
|
declare const BarChart: react.NamedExoticComponent<BarChartProps>;
|
|
76
92
|
|
|
77
|
-
export { BarChart, type BarChartDirection, type BarChartProps, type BarDataPoint, type BarDatetimePoint, type BarSeries, type BarXAxis, type BarYAxis, CategoryAxis, ChartExportHandle, DatetimeAxis, ValueFormat };
|
|
93
|
+
export { BarChart, type BarChartDirection, type BarChartProps, type BarDataPoint, type BarDatetimePoint, type BarSeries, type BarXAxis, type BarYAxis, CategoryAxis, ChartClickHandler, ChartExportHandle, ChartHoverHandler, DatetimeAxis, ValueFormat };
|
package/dist/bar/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkXYE6O77Zjs = require('../chunk-XYE6O77Z.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
var _chunk6EIJCJCNjs = require('../chunk-6EIJCJCN.js');
|
|
8
9
|
|
|
9
|
-
var _chunk6D7P3IOTjs = require('../chunk-6D7P3IOT.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
var _chunk6D7P3IOTjs = require('../chunk-6D7P3IOT.js');
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
var _chunkXP7HNV23js = require('../chunk-XP7HNV23.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk27M4FDNKjs = require('../chunk-27M4FDNK.js');
|
|
18
|
+
require('../chunk-46L4YBLC.js');
|
|
18
19
|
|
|
19
20
|
// src/charts/bar/BarChart.tsx
|
|
20
21
|
var _react = require('react');
|
|
@@ -26,8 +27,9 @@ function highchartsType(direction) {
|
|
|
26
27
|
function buildBarChartOptions(props, direction, series = props.series) {
|
|
27
28
|
const chartType = highchartsType(direction);
|
|
28
29
|
const isDatetime = props.xAxis.type === "datetime";
|
|
30
|
+
const isMultiSeries = series.length > 1;
|
|
29
31
|
const tooltipTimezone = _chunk6D7P3IOTjs.resolveTooltipTimezone.call(void 0, props.xAxis, props.timezone);
|
|
30
|
-
const { annotations, lookup: annotationLookup } =
|
|
32
|
+
const { annotations, lookup: annotationLookup } = _chunkXYE6O77Zjs.buildAnnotationConfig.call(void 0,
|
|
31
33
|
props.annotations
|
|
32
34
|
);
|
|
33
35
|
const barTypeConfig = {
|
|
@@ -54,19 +56,33 @@ function buildBarChartOptions(props, direction, series = props.series) {
|
|
|
54
56
|
click: props.onClick ? (event) => props.onClick({ position: event.point.x }) : void 0,
|
|
55
57
|
mouseOver: function() {
|
|
56
58
|
const x = this.x;
|
|
59
|
+
_optionalChain([props, 'access', _ => _.onMouseEnter, 'optionalCall', _2 => _2({
|
|
60
|
+
position: x,
|
|
61
|
+
// Omit the key entirely (not `series: undefined`) for single-series
|
|
62
|
+
// so consumers testing `"series" in payload` see the contract.
|
|
63
|
+
...isMultiSeries ? {
|
|
64
|
+
series: { name: this.series.name, index: this.series.index }
|
|
65
|
+
} : {}
|
|
66
|
+
})]);
|
|
57
67
|
this.series.chart.series.forEach((s) => {
|
|
58
68
|
if (s.type !== chartType) return;
|
|
59
69
|
s.data.forEach((point) => {
|
|
60
70
|
if (point.x !== x) return;
|
|
61
|
-
_optionalChain([point, 'access',
|
|
71
|
+
_optionalChain([point, 'access', _3 => _3.graphic, 'optionalAccess', _4 => _4.element, 'optionalAccess', _5 => _5.classList, 'access', _6 => _6.add, 'call', _7 => _7("bar-point-hover")]);
|
|
62
72
|
});
|
|
63
73
|
});
|
|
64
74
|
},
|
|
65
75
|
mouseOut: function() {
|
|
76
|
+
_optionalChain([props, 'access', _8 => _8.onMouseLeave, 'optionalCall', _9 => _9({
|
|
77
|
+
position: this.x,
|
|
78
|
+
...isMultiSeries ? {
|
|
79
|
+
series: { name: this.series.name, index: this.series.index }
|
|
80
|
+
} : {}
|
|
81
|
+
})]);
|
|
66
82
|
this.series.chart.series.forEach((s) => {
|
|
67
83
|
if (s.type !== chartType) return;
|
|
68
84
|
s.data.forEach((point) => {
|
|
69
|
-
_optionalChain([point, 'access',
|
|
85
|
+
_optionalChain([point, 'access', _10 => _10.graphic, 'optionalAccess', _11 => _11.element, 'optionalAccess', _12 => _12.classList, 'access', _13 => _13.remove, 'call', _14 => _14("bar-point-hover")]);
|
|
70
86
|
});
|
|
71
87
|
});
|
|
72
88
|
}
|
|
@@ -74,7 +90,7 @@ function buildBarChartOptions(props, direction, series = props.series) {
|
|
|
74
90
|
}
|
|
75
91
|
};
|
|
76
92
|
const options = {
|
|
77
|
-
...
|
|
93
|
+
..._chunk27M4FDNKjs.buildBaseChartOptions.call(void 0, {
|
|
78
94
|
type: chartType,
|
|
79
95
|
description: props.description,
|
|
80
96
|
valueSuffix: props.valueSuffix,
|
|
@@ -83,19 +99,19 @@ function buildBarChartOptions(props, direction, series = props.series) {
|
|
|
83
99
|
}),
|
|
84
100
|
xAxis: _chunk6D7P3IOTjs.buildDimensionalAxis.call(void 0, props.xAxis, _nullishCoalesce(tooltipTimezone, () => ( "UTC"))),
|
|
85
101
|
yAxis: {
|
|
86
|
-
min: _optionalChain([props, 'access',
|
|
87
|
-
max: _optionalChain([props, 'access',
|
|
88
|
-
gridLineWidth: _optionalChain([props, 'access',
|
|
102
|
+
min: _optionalChain([props, 'access', _15 => _15.yAxis, 'optionalAccess', _16 => _16.min]),
|
|
103
|
+
max: _optionalChain([props, 'access', _17 => _17.yAxis, 'optionalAccess', _18 => _18.max]),
|
|
104
|
+
gridLineWidth: _optionalChain([props, 'access', _19 => _19.yAxis, 'optionalAccess', _20 => _20.showGridLines]) === false ? 0 : 1,
|
|
89
105
|
// A dedicated plotLine at 0, styled distinctly from regular gridlines
|
|
90
106
|
// (see chartStyles.ts).
|
|
91
107
|
plotLines: [{ value: 0, className: "y-axis-zero-line", zIndex: 3 }],
|
|
92
|
-
title: { text: _nullishCoalesce(_optionalChain([props, 'access',
|
|
108
|
+
title: { text: _nullishCoalesce(_optionalChain([props, 'access', _21 => _21.yAxis, 'optionalAccess', _22 => _22.title]), () => ( "")) },
|
|
93
109
|
labels: {
|
|
94
110
|
// `showLabels` toggles tick-label visibility; defaults to shown.
|
|
95
|
-
enabled: _optionalChain([props, 'access',
|
|
111
|
+
enabled: _optionalChain([props, 'access', _23 => _23.yAxis, 'optionalAccess', _24 => _24.showLabels]) !== false,
|
|
96
112
|
// A declarative `format` drives ticks through the shared valueFormatter;
|
|
97
113
|
// absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).
|
|
98
|
-
formatter: _optionalChain([props, 'access',
|
|
114
|
+
formatter: _optionalChain([props, 'access', _25 => _25.yAxis, 'optionalAccess', _26 => _26.format]) ? _chunkXYE6O77Zjs.makeValueAxisLabelFormatter.call(void 0, props.yAxis.format) : _chunkXYE6O77Zjs.defaultValueAxisLabelFormatter
|
|
99
115
|
}
|
|
100
116
|
},
|
|
101
117
|
plotOptions: {
|
|
@@ -113,52 +129,6 @@ function buildBarChartOptions(props, direction, series = props.series) {
|
|
|
113
129
|
return { options, annotationLookup, tooltipTimezone };
|
|
114
130
|
}
|
|
115
131
|
|
|
116
|
-
// src/charts/bar/styles.ts
|
|
117
|
-
var _styledcomponents = require('styled-components'); var _styledcomponents2 = _interopRequireDefault(_styledcomponents);
|
|
118
|
-
var _seedsreactbox = require('@sproutsocial/seeds-react-box');
|
|
119
|
-
|
|
120
|
-
// src/charts/shared/styles.ts
|
|
121
|
-
|
|
122
|
-
var axisLabelV2Styles = _styledcomponents.css`
|
|
123
|
-
.highcharts-xaxis-labels,
|
|
124
|
-
.highcharts-yaxis-labels {
|
|
125
|
-
// SVG labels (styledMode): fill is the SVG text colour; color has no effect.
|
|
126
|
-
text {
|
|
127
|
-
font-family: ${({ theme }) => theme.fontFamily};
|
|
128
|
-
${({ theme }) => theme.typography[100]};
|
|
129
|
-
font-weight: ${({ theme }) => theme.fontWeights.normal};
|
|
130
|
-
fill: ${({ theme }) => theme.colors.text.subtext};
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
// Two-line stacked datetime label: the boundary token is an
|
|
134
|
-
// hc-axis-label-secondary tspan on a second line, rendered semibold.
|
|
135
|
-
.highcharts-xaxis-labels text tspan.hc-axis-label-secondary {
|
|
136
|
-
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
137
|
-
}
|
|
138
|
-
`;
|
|
139
|
-
|
|
140
|
-
// src/charts/bar/styles.ts
|
|
141
|
-
var barFamilyStyles = _styledcomponents.css`
|
|
142
|
-
${_chunkWEKDYQ4Tjs.timeSeriesChartStyles}
|
|
143
|
-
|
|
144
|
-
/*
|
|
145
|
-
When the chart container is hovered, dim all bars. Then restore opacity for
|
|
146
|
-
the hovered bar(s) — flagged with the bar-point-hover class by the adapter —
|
|
147
|
-
so the non-hovered bars fade out.
|
|
148
|
-
*/
|
|
149
|
-
.highcharts-container:hover .highcharts-point {
|
|
150
|
-
fill-opacity: 0.3;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.highcharts-point.bar-point-hover {
|
|
154
|
-
fill-opacity: 1 !important;
|
|
155
|
-
}
|
|
156
|
-
`;
|
|
157
|
-
var BarStyledBox = _styledcomponents2.default.call(void 0, _seedsreactbox.Box)`
|
|
158
|
-
${barFamilyStyles}
|
|
159
|
-
${axisLabelV2Styles}
|
|
160
|
-
`;
|
|
161
|
-
|
|
162
132
|
// src/charts/constants.ts
|
|
163
133
|
var BAR_CHART_DEFAULT_SERIES_LIMIT = 10;
|
|
164
134
|
|
|
@@ -166,7 +136,7 @@ var BAR_CHART_DEFAULT_SERIES_LIMIT = 10;
|
|
|
166
136
|
var _jsxruntime = require('react/jsx-runtime');
|
|
167
137
|
var BarChart = _react.memo.call(void 0, function BarChart2(props) {
|
|
168
138
|
const seriesLimit = _nullishCoalesce(props.seriesLimit, () => ( BAR_CHART_DEFAULT_SERIES_LIMIT));
|
|
169
|
-
const { colors, series } =
|
|
139
|
+
const { colors, series } = _chunk27M4FDNKjs.useSeedsChartSetup.call(void 0, {
|
|
170
140
|
series: props.series,
|
|
171
141
|
seriesLimit,
|
|
172
142
|
isSeriesLimitOverridden: props.seriesLimit !== void 0,
|
|
@@ -179,31 +149,29 @@ var BarChart = _react.memo.call(void 0, function BarChart2(props) {
|
|
|
179
149
|
series
|
|
180
150
|
);
|
|
181
151
|
const hasOnClick = Boolean(props.onClick);
|
|
182
|
-
|
|
183
|
-
|
|
152
|
+
const containerProps = _chunk6EIJCJCNjs.getChartContainerProps.call(void 0, {
|
|
153
|
+
familyClasses: ["seeds-chart-time-series", "seeds-chart-bar"],
|
|
154
|
+
colors: series.map((s) => s.color),
|
|
155
|
+
hasOnClick,
|
|
156
|
+
className: props.className
|
|
157
|
+
});
|
|
158
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ...containerProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
159
|
+
_chunk27M4FDNKjs.ChartRenderer,
|
|
184
160
|
{
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
tooltipClickLabel: props.tooltipClickLabel,
|
|
198
|
-
timezone: tooltipTimezone,
|
|
199
|
-
invalidNumberLabel: props.invalidNumberLabel,
|
|
200
|
-
valueFormat: _optionalChain([props, 'access', _23 => _23.yAxis, 'optionalAccess', _24 => _24.format]),
|
|
201
|
-
exportTitle: props.exportTitle,
|
|
202
|
-
onReady: props.onReady
|
|
203
|
-
}
|
|
204
|
-
)
|
|
161
|
+
options,
|
|
162
|
+
series,
|
|
163
|
+
colors,
|
|
164
|
+
tooltip: props.tooltip,
|
|
165
|
+
annotationLookup,
|
|
166
|
+
hasOnClick,
|
|
167
|
+
tooltipClickLabel: props.tooltipClickLabel,
|
|
168
|
+
timezone: tooltipTimezone,
|
|
169
|
+
invalidNumberLabel: props.invalidNumberLabel,
|
|
170
|
+
valueFormat: _optionalChain([props, 'access', _27 => _27.yAxis, 'optionalAccess', _28 => _28.format]),
|
|
171
|
+
exportTitle: props.exportTitle,
|
|
172
|
+
onReady: props.onReady
|
|
205
173
|
}
|
|
206
|
-
);
|
|
174
|
+
) });
|
|
207
175
|
});
|
|
208
176
|
|
|
209
177
|
|
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/bar/styles.ts","../../src/charts/shared/styles.ts","../../src/charts/constants.ts"],"names":["css","BarChart"],"mappings":"AAAA;AACE;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACA;AClBA,8BAAqB;ADoBrB;AACA;AEAA,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;AACxC,EAAA,MAAM,gBAAA,EAAkB,qDAAA,KAAuB,CAAM,KAAA,EAAO,KAAA,CAAM,QAAQ,CAAA;AAC1E,EAAA,MAAM,EAAE,WAAA,EAAa,MAAA,EAAQ,iBAAiB,EAAA,EAAI,oDAAA;AAAA,IAChD,KAAA,CAAM;AAAA,EACR,CAAA;AAKA,EAAA,MAAM,cAAA,EAA6C;AAAA;AAAA;AAAA,IAGjD,GAAI,KAAA,CAAM,SAAA,IAAa,UAAA,EACnB,CAAC,EAAA,EACD,EAAE,QAAA,mBAAU,KAAA,CAAM,QAAA,UAAY,WAAS,CAAA;AAAA;AAAA;AAAA,IAG3C,YAAA,EAAc,UAAA,IAAc,aAAA,EAAe,KAAA,EAAO,IAAA;AAAA,IAClD,YAAA,EAAc,UAAA,IAAc,aAAA,EAAe,IAAA,EAAM,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IA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;AAAA,UACA,MAAA;AAAA,UACA,OAAA,EAAS,KAAA,CAAM,OAAA;AAAA,UACf,gBAAA;AAAA,UACA,UAAA;AAAA,UACA,iBAAA,EAAmB,KAAA,CAAM,iBAAA;AAAA,UACzB,QAAA,EAAU,eAAA;AAAA,UACV,kBAAA,EAAoB,KAAA,CAAM,kBAAA;AAAA,UAC1B,WAAA,kBAAa,KAAA,uBAAM,KAAA,+BAAO,QAAA;AAAA,UAC1B,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,UACnB,OAAA,EAAS,KAAA,CAAM;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ,CAAC,CAAA;AD8JD;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 { buildBarChartOptions } from \"./adapter\";\nimport { BarStyledBox } from \"./styles\";\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 return (\n <BarStyledBox\n $colors={colors}\n $hasOnClick={hasOnClick}\n bg=\"container.background.base\"\n >\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 </BarStyledBox>\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 {\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 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; this mirrors\n // v1's `pointWidth: 20` time-series treatment. Dense datetime data may\n // 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 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 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 options: SeedsChartOptions = {\n ...buildBaseChartOptions({\n type: chartType,\n description: props.description,\n valueSuffix: props.valueSuffix,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipTimezone,\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","import styled, { css } from \"styled-components\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { timeSeriesChartStyles } from \"../../styles/chartStyles\";\nimport { axisLabelV2Styles } from \"../shared/styles\";\nimport type {\n TypeChartStyleColor,\n TypeChartStyleHasOnClick,\n} from \"../../types\";\n\ntype StyleProps = Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $hasOnClick: TypeChartStyleHasOnClick;\n}>;\n\n// Direction-neutral styling shared by the v2 bar family (vertical + horizontal).\n// Consumes only the v1 `timeSeriesChartStyles` base and owns the hover-dimming\n// block itself, keyed on the neutral `.bar-point-hover` class the adapter emits\n// — so v2 no longer imports v1 *component* styles (see `shared/styles.ts`).\nexport const barFamilyStyles = css<StyleProps>`\n ${timeSeriesChartStyles}\n\n /*\n When the chart container is hovered, dim all bars. Then restore opacity for\n the hovered bar(s) — flagged with the bar-point-hover class by the adapter —\n so the non-hovered bars fade out.\n */\n .highcharts-container:hover .highcharts-point {\n fill-opacity: 0.3;\n }\n\n .highcharts-point.bar-point-hover {\n fill-opacity: 1 !important;\n }\n`;\n\nexport const BarStyledBox = styled(Box)<StyleProps>`\n ${barFamilyStyles}\n ${axisLabelV2Styles}\n`;\n","import { css } from \"styled-components\";\n\n/**\n * v2 chart axis-label styles. v2 charts render in `styledMode` with\n * `useHTML: false`, so axis labels are SVG `<text>` / `<tspan>` rather than the\n * HTML `<span>`s v1 uses; these mirror the v1 HTML label rules in\n * `styles/chartStyles.ts` for the SVG element type.\n *\n * Kept here, separate from v1's `timeSeriesChartStyles`: v2 may *consume* the v1\n * styles, but v2-specific rules must not accrete into the v1 files — that keeps\n * the eventual v1 → v2 port clean and avoids coupling. Compose this into each v2\n * chart family's styled wrapper.\n */\nexport const axisLabelV2Styles = css`\n .highcharts-xaxis-labels,\n .highcharts-yaxis-labels {\n // SVG labels (styledMode): fill is the SVG text colour; color has no effect.\n text {\n font-family: ${({ theme }) => theme.fontFamily};\n ${({ theme }) => theme.typography[100]};\n font-weight: ${({ theme }) => theme.fontWeights.normal};\n fill: ${({ theme }) => theme.colors.text.subtext};\n }\n }\n // Two-line stacked datetime label: the boundary token is an\n // hc-axis-label-secondary tspan on a second line, rendered semibold.\n .highcharts-xaxis-labels text tspan.hc-axis-label-secondary {\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\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;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACnBA,8BAAqB;ADqBrB;AACA;AEDA,SAAS,cAAA,CAAe,SAAA,EAAgD;AACtE,EAAA,OAAO,UAAA,IAAc,aAAA,EAAe,MAAA,EAAQ,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ED,EAAA,MAAM,EAAE,OAAA,EAAS,gBAAA,EAAkB,gBAAgB,EAAA,EAAI,oBAAA;AAAA,IACrD,KAAA;AAAA,qBACA,KAAA,CAAM,SAAA,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;ADsHD;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 {\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; this mirrors\n // v1's `pointWidth: 20` time-series treatment. Dense datetime data may\n // 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 options: SeedsChartOptions = {\n ...buildBaseChartOptions({\n type: chartType,\n description: props.description,\n valueSuffix: props.valueSuffix,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipTimezone,\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"]}
|
package/dist/bar.css
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seeds BarChart per-family styles.
|
|
3
|
+
*
|
|
4
|
+
* Consumers import this alongside the shared foundation stylesheet:
|
|
5
|
+
*
|
|
6
|
+
* import "@sproutsocial/seeds-react-data-viz/chart-styles.css";
|
|
7
|
+
* import "@sproutsocial/seeds-react-data-viz/bar.css";
|
|
8
|
+
*
|
|
9
|
+
* chart-styles.css owns the shared .seeds-chart layer (background,
|
|
10
|
+
* annotation-label rules, the per-series .highcharts-color-0..19 palette
|
|
11
|
+
* fallback, the [data-has-on-click] cursor rules, the global tooltip overrides,
|
|
12
|
+
* and the .seeds-chart-legend spacing) AND the shared cross-family
|
|
13
|
+
* .seeds-chart-time-series layer (crosshair, grid/axis lines, ticks, zero line,
|
|
14
|
+
* hover opacity guard, and the v2 SVG axis-label typography) that line-area also
|
|
15
|
+
* uses. This file owns ONLY the truly bar-specific .seeds-chart-bar block — it
|
|
16
|
+
* deliberately does not repeat anything chart-styles.css already ships.
|
|
17
|
+
*
|
|
18
|
+
* Static theme values reference the DS token CSS variables directly
|
|
19
|
+
* (var(--color-*)) — the same tokens every other Seeds component CSS uses,
|
|
20
|
+
* emitted by seeds-react-theme and provided at runtime by the theme provider —
|
|
21
|
+
* so light/dark follows automatically. Ported from the v1 bar hover-dimming
|
|
22
|
+
* block; v1 chartStyles.ts stays in place for the v1 wrappers.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/* =========================================================================
|
|
26
|
+
* bar family -> .seeds-chart-bar
|
|
27
|
+
*
|
|
28
|
+
* hover-dimming: when the chart container is hovered, dim all bars, then
|
|
29
|
+
* restore opacity for the hovered bar(s) — flagged with the bar-point-hover
|
|
30
|
+
* class by the adapter — so the non-hovered bars fade out.
|
|
31
|
+
* ========================================================================= */
|
|
32
|
+
|
|
33
|
+
.seeds-chart-bar .highcharts-container:hover .highcharts-point {
|
|
34
|
+
fill-opacity: 0.3;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.seeds-chart-bar .highcharts-point.bar-point-hover {
|
|
38
|
+
fill-opacity: 1 !important;
|
|
39
|
+
}
|