@automattic/charts 0.3.0 → 0.4.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/CHANGELOG.md +14 -0
- package/dist/cjs/components/bar-chart/index.js +2 -3
- package/dist/cjs/components/bar-chart/index.js.map +1 -1
- package/dist/cjs/components/bar-chart/style.css +94 -5
- package/dist/cjs/components/grid-control/index.js +2 -3
- package/dist/cjs/components/grid-control/index.js.map +1 -1
- package/dist/cjs/components/grid-control/style.css +94 -2
- package/dist/cjs/components/legend/index.js +2 -3
- package/dist/cjs/components/legend/index.js.map +1 -1
- package/dist/cjs/components/legend/style.css +94 -2
- package/dist/cjs/components/line-chart/index.js +2 -3
- package/dist/cjs/components/line-chart/index.js.map +1 -1
- package/dist/cjs/components/line-chart/style.css +94 -3
- package/dist/cjs/components/pie-chart/index.js +2 -3
- package/dist/cjs/components/pie-chart/index.js.map +1 -1
- package/dist/cjs/components/pie-chart/style.css +94 -4
- package/dist/cjs/components/pie-semi-circle-chart/index.js +2 -3
- package/dist/cjs/components/pie-semi-circle-chart/index.js.map +1 -1
- package/dist/cjs/components/pie-semi-circle-chart/style.css +94 -4
- package/dist/cjs/components/tooltip/index.js +2 -3
- package/dist/cjs/components/tooltip/index.js.map +1 -1
- package/dist/cjs/components/tooltip/style.css +94 -2
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/providers/theme/index.js +2 -3
- package/dist/cjs/providers/theme/index.js.map +1 -1
- package/dist/cjs/providers/theme/style.css +95 -0
- package/dist/cjs/style.css +95 -9
- package/dist/index.d.ts +301 -0
- package/dist/mjs/components/bar-chart/index.js +2 -3
- package/dist/mjs/components/bar-chart/index.js.map +1 -1
- package/dist/mjs/components/bar-chart/style.css +94 -5
- package/dist/mjs/components/grid-control/index.js +2 -3
- package/dist/mjs/components/grid-control/index.js.map +1 -1
- package/dist/mjs/components/grid-control/style.css +94 -2
- package/dist/mjs/components/legend/index.js +2 -3
- package/dist/mjs/components/legend/index.js.map +1 -1
- package/dist/mjs/components/legend/style.css +94 -2
- package/dist/mjs/components/line-chart/index.js +2 -3
- package/dist/mjs/components/line-chart/index.js.map +1 -1
- package/dist/mjs/components/line-chart/style.css +94 -3
- package/dist/mjs/components/pie-chart/index.js +2 -3
- package/dist/mjs/components/pie-chart/index.js.map +1 -1
- package/dist/mjs/components/pie-chart/style.css +94 -4
- package/dist/mjs/components/pie-semi-circle-chart/index.js +2 -3
- package/dist/mjs/components/pie-semi-circle-chart/index.js.map +1 -1
- package/dist/mjs/components/pie-semi-circle-chart/style.css +94 -4
- package/dist/mjs/components/tooltip/index.js +2 -3
- package/dist/mjs/components/tooltip/index.js.map +1 -1
- package/dist/mjs/components/tooltip/style.css +94 -2
- package/dist/mjs/index.js +2 -3
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/providers/theme/index.js +2 -3
- package/dist/mjs/providers/theme/index.js.map +1 -1
- package/dist/mjs/providers/theme/style.css +95 -0
- package/dist/mjs/style.css +95 -9
- package/global.d.ts +14 -0
- package/package.json +29 -8
- package/rollup.config.mjs +142 -0
- package/src/components/line-chart/line-chart.tsx +50 -15
- package/src/components/pie-chart/__tests__/pie-chart.test.tsx +59 -0
- package/src/components/pie-chart/pie-chart.tsx +91 -6
- package/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx +17 -12
- package/src/components/shared/with-responsive.tsx +4 -3
- package/src/types.ts +25 -0
- package/tests/jest.config.cjs +12 -0
- package/tests/jest.setup.js +13 -0
- package/dist/cjs/components/bar-chart/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/bar-chart/style.css.map +0 -1
- package/dist/cjs/components/grid-control/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/grid-control/style.css.map +0 -1
- package/dist/cjs/components/legend/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/legend/style.css.map +0 -1
- package/dist/cjs/components/line-chart/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/line-chart/style.css.map +0 -1
- package/dist/cjs/components/pie-chart/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/pie-chart/style.css.map +0 -1
- package/dist/cjs/components/pie-semi-circle-chart/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/pie-semi-circle-chart/style.css.map +0 -1
- package/dist/cjs/components/tooltip/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/tooltip/style.css.map +0 -1
- package/dist/cjs/index.js.LICENSE.txt +0 -9
- package/dist/cjs/providers/theme/index.js.LICENSE.txt +0 -9
- package/dist/cjs/style.css.map +0 -1
- package/dist/mjs/components/bar-chart/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/bar-chart/style.css.map +0 -1
- package/dist/mjs/components/grid-control/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/grid-control/style.css.map +0 -1
- package/dist/mjs/components/legend/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/legend/style.css.map +0 -1
- package/dist/mjs/components/line-chart/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/line-chart/style.css.map +0 -1
- package/dist/mjs/components/pie-chart/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/pie-chart/style.css.map +0 -1
- package/dist/mjs/components/pie-semi-circle-chart/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/pie-semi-circle-chart/style.css.map +0 -1
- package/dist/mjs/components/tooltip/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/tooltip/style.css.map +0 -1
- package/dist/mjs/index.js.LICENSE.txt +0 -9
- package/dist/mjs/providers/theme/index.js.LICENSE.txt +0 -9
- package/dist/mjs/style.css.map +0 -1
- package/dist/types/components/bar-chart/bar-chart.d.ts +0 -5
- package/dist/types/components/bar-chart/index.d.ts +0 -1
- package/dist/types/components/grid-control/grid-control.d.ts +0 -4
- package/dist/types/components/grid-control/index.d.ts +0 -1
- package/dist/types/components/legend/base-legend.d.ts +0 -3
- package/dist/types/components/legend/index.d.ts +0 -2
- package/dist/types/components/legend/types.d.ts +0 -12
- package/dist/types/components/line-chart/index.d.ts +0 -1
- package/dist/types/components/line-chart/line-chart.d.ts +0 -11
- package/dist/types/components/pie-chart/index.d.ts +0 -1
- package/dist/types/components/pie-chart/pie-chart.d.ts +0 -9
- package/dist/types/components/pie-semi-circle-chart/index.d.ts +0 -1
- package/dist/types/components/pie-semi-circle-chart/pie-semi-circle-chart.d.ts +0 -22
- package/dist/types/components/shared/with-responsive.d.ts +0 -17
- package/dist/types/components/tooltip/base-tooltip.d.ts +0 -29
- package/dist/types/components/tooltip/index.d.ts +0 -2
- package/dist/types/hooks/use-chart-mouse-handler.d.ts +0 -41
- package/dist/types/index.d.ts +0 -8
- package/dist/types/providers/theme/index.d.ts +0 -2
- package/dist/types/providers/theme/theme-provider.d.ts +0 -18
- package/dist/types/providers/theme/themes.d.ts +0 -14
- package/dist/types/types.d.ts +0 -137
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Orientation } from '@visx/axis';
|
|
3
|
+
import { CSSProperties, ComponentType, ReactNode, FC } from 'react';
|
|
4
|
+
import { scaleOrdinal } from '@visx/scale';
|
|
5
|
+
|
|
6
|
+
type ValueOf<T> = T[keyof T];
|
|
7
|
+
declare type OrientationType = ValueOf<typeof Orientation>;
|
|
8
|
+
type DataPoint = {
|
|
9
|
+
label: string;
|
|
10
|
+
value: number;
|
|
11
|
+
};
|
|
12
|
+
type DataPointDate = {
|
|
13
|
+
date: Date;
|
|
14
|
+
label?: string;
|
|
15
|
+
value: number;
|
|
16
|
+
};
|
|
17
|
+
type SeriesData = {
|
|
18
|
+
group?: string;
|
|
19
|
+
label: string;
|
|
20
|
+
data: DataPointDate[] | DataPoint[];
|
|
21
|
+
options: {
|
|
22
|
+
gradient?: {
|
|
23
|
+
from: string;
|
|
24
|
+
to: string;
|
|
25
|
+
toOpacity?: number;
|
|
26
|
+
};
|
|
27
|
+
stroke?: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type DataPointPercentage = {
|
|
31
|
+
/**
|
|
32
|
+
* Label for the data point
|
|
33
|
+
*/
|
|
34
|
+
label: string;
|
|
35
|
+
/**
|
|
36
|
+
* Numerical value
|
|
37
|
+
*/
|
|
38
|
+
value: number;
|
|
39
|
+
/**
|
|
40
|
+
* Formatted value for display
|
|
41
|
+
*/
|
|
42
|
+
valueDisplay?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Percentage value
|
|
45
|
+
*/
|
|
46
|
+
percentage: number;
|
|
47
|
+
/**
|
|
48
|
+
* Color code for the segment, by default colours are taken from the theme but this property can overrides it
|
|
49
|
+
*/
|
|
50
|
+
color?: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Theme configuration for chart components
|
|
54
|
+
*/
|
|
55
|
+
type ChartTheme = {
|
|
56
|
+
/** Background color for chart components */
|
|
57
|
+
backgroundColor: string;
|
|
58
|
+
/** Background color for labels */
|
|
59
|
+
labelBackgroundColor?: string;
|
|
60
|
+
/** Array of colors used for data visualization */
|
|
61
|
+
colors: string[];
|
|
62
|
+
/** Optional CSS styles for grid lines */
|
|
63
|
+
gridStyles?: CSSProperties;
|
|
64
|
+
/** Length of axis ticks in pixels */
|
|
65
|
+
tickLength: number;
|
|
66
|
+
/** Color of the grid lines */
|
|
67
|
+
gridColor: string;
|
|
68
|
+
/** Color of the grid lines in dark mode */
|
|
69
|
+
gridColorDark: string;
|
|
70
|
+
};
|
|
71
|
+
declare type AxisOptions = {
|
|
72
|
+
orientation?: OrientationType;
|
|
73
|
+
numTicks?: number;
|
|
74
|
+
axisClassName?: string;
|
|
75
|
+
axisLineClassName?: string;
|
|
76
|
+
labelClassName?: string;
|
|
77
|
+
tickClassName?: string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Base properties shared across all chart components
|
|
81
|
+
*/
|
|
82
|
+
type BaseChartProps<T = DataPoint | DataPointDate> = {
|
|
83
|
+
/**
|
|
84
|
+
* Array of data points to display in the chart
|
|
85
|
+
*/
|
|
86
|
+
data: T extends DataPoint | DataPointDate ? T[] : T;
|
|
87
|
+
/**
|
|
88
|
+
* Additional CSS class name for the chart container
|
|
89
|
+
*/
|
|
90
|
+
className?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Width of the chart in pixels
|
|
93
|
+
*/
|
|
94
|
+
width?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Height of the chart in pixels
|
|
97
|
+
*/
|
|
98
|
+
height?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Chart margins
|
|
101
|
+
*/
|
|
102
|
+
margin?: {
|
|
103
|
+
top: number;
|
|
104
|
+
right: number;
|
|
105
|
+
bottom: number;
|
|
106
|
+
left: number;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Whether to show tooltips on hover. False by default.
|
|
110
|
+
*/
|
|
111
|
+
withTooltips?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Whether to show legend
|
|
114
|
+
*/
|
|
115
|
+
showLegend?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Legend orientation
|
|
118
|
+
*/
|
|
119
|
+
legendOrientation?: 'horizontal' | 'vertical';
|
|
120
|
+
/**
|
|
121
|
+
* Grid visibility. x is default.
|
|
122
|
+
*/
|
|
123
|
+
gridVisibility?: 'x' | 'y' | 'xy' | 'none';
|
|
124
|
+
/**
|
|
125
|
+
* More options for the chart.
|
|
126
|
+
*/
|
|
127
|
+
options?: {
|
|
128
|
+
axis?: {
|
|
129
|
+
x?: AxisOptions;
|
|
130
|
+
y?: AxisOptions;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
interface BarChartProps extends BaseChartProps<SeriesData[]> {
|
|
136
|
+
}
|
|
137
|
+
declare const _default$3: (props: Omit<BarChartProps, "width" | "height" | "size">) => react_jsx_runtime.JSX.Element;
|
|
138
|
+
|
|
139
|
+
interface LineChartProps extends BaseChartProps<SeriesData[]> {
|
|
140
|
+
margin?: {
|
|
141
|
+
top: number;
|
|
142
|
+
right: number;
|
|
143
|
+
bottom: number;
|
|
144
|
+
left: number;
|
|
145
|
+
};
|
|
146
|
+
withGradientFill: boolean;
|
|
147
|
+
}
|
|
148
|
+
declare const _default$2: (props: Omit<LineChartProps, "width" | "height" | "size">) => react_jsx_runtime.JSX.Element;
|
|
149
|
+
|
|
150
|
+
type OmitBaseChartProps = Omit<BaseChartProps<DataPointPercentage[]>, 'width' | 'height'>;
|
|
151
|
+
interface PieChartProps extends OmitBaseChartProps {
|
|
152
|
+
/**
|
|
153
|
+
* Inner radius in pixels. If > 0, creates a donut chart. Defaults to 0.
|
|
154
|
+
*/
|
|
155
|
+
innerRadius?: number;
|
|
156
|
+
/**
|
|
157
|
+
* Size of the chart in pixels
|
|
158
|
+
*/
|
|
159
|
+
size?: number;
|
|
160
|
+
/**
|
|
161
|
+
* Add padding to the chart
|
|
162
|
+
*/
|
|
163
|
+
padding?: number;
|
|
164
|
+
/**
|
|
165
|
+
* Thickness of the pie chart.
|
|
166
|
+
* A value between 0 and 1, where 0 means no thickness
|
|
167
|
+
* and 1 means the maximum thickness.
|
|
168
|
+
*/
|
|
169
|
+
thickness?: number;
|
|
170
|
+
/**
|
|
171
|
+
* Scale of the gap between groups in the pie chart
|
|
172
|
+
* A value between 0 and 1, where 0 means no gap.
|
|
173
|
+
*/
|
|
174
|
+
gapScale?: number;
|
|
175
|
+
/**
|
|
176
|
+
* Scale of the corner radius for the pie chart segments.
|
|
177
|
+
* A value between 0 and 1, where 0 means no corner radius.
|
|
178
|
+
*/
|
|
179
|
+
cornerScale?: number;
|
|
180
|
+
}
|
|
181
|
+
declare const _default$1: (props: Omit<PieChartProps, "width" | "height" | "size">) => react_jsx_runtime.JSX.Element;
|
|
182
|
+
|
|
183
|
+
interface PieSemiCircleChartProps extends BaseChartProps<DataPointPercentage[]> {
|
|
184
|
+
/**
|
|
185
|
+
* Size of the chart in pixels
|
|
186
|
+
*/
|
|
187
|
+
size?: number;
|
|
188
|
+
/**
|
|
189
|
+
* Thickness of the pie chart. A value between 0 and 1
|
|
190
|
+
*/
|
|
191
|
+
thickness?: number;
|
|
192
|
+
/**
|
|
193
|
+
* Label text to display above the chart
|
|
194
|
+
*/
|
|
195
|
+
label?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Note text to display below the label
|
|
198
|
+
*/
|
|
199
|
+
note?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Direction of chart rendering
|
|
202
|
+
* true for clockwise, false for counter-clockwise
|
|
203
|
+
*/
|
|
204
|
+
clockwise?: boolean;
|
|
205
|
+
}
|
|
206
|
+
declare const _default: (props: Omit<PieSemiCircleChartProps, "width" | "height" | "size">) => react_jsx_runtime.JSX.Element;
|
|
207
|
+
|
|
208
|
+
type TooltipData = {
|
|
209
|
+
label: string;
|
|
210
|
+
value: number;
|
|
211
|
+
valueDisplay?: string;
|
|
212
|
+
};
|
|
213
|
+
type TooltipComponentProps = {
|
|
214
|
+
data: TooltipData;
|
|
215
|
+
className?: string;
|
|
216
|
+
};
|
|
217
|
+
type TooltipCommonProps = {
|
|
218
|
+
top: number;
|
|
219
|
+
left: number;
|
|
220
|
+
style?: CSSProperties;
|
|
221
|
+
className?: string;
|
|
222
|
+
};
|
|
223
|
+
type DefaultDataTooltip = {
|
|
224
|
+
data: TooltipData;
|
|
225
|
+
component?: ComponentType<TooltipComponentProps>;
|
|
226
|
+
children?: never;
|
|
227
|
+
};
|
|
228
|
+
type CustomTooltip = {
|
|
229
|
+
children: ReactNode;
|
|
230
|
+
data?: never;
|
|
231
|
+
component?: never;
|
|
232
|
+
};
|
|
233
|
+
type BaseTooltipProps = TooltipCommonProps & (DefaultDataTooltip | CustomTooltip);
|
|
234
|
+
declare const BaseTooltip: ({ data, top, left, component: Component, children, className, }: BaseTooltipProps) => react_jsx_runtime.JSX.Element;
|
|
235
|
+
|
|
236
|
+
type LegendItem = {
|
|
237
|
+
label: string;
|
|
238
|
+
value: number | string;
|
|
239
|
+
color: string;
|
|
240
|
+
};
|
|
241
|
+
type LegendProps = {
|
|
242
|
+
items: LegendItem[];
|
|
243
|
+
className?: string;
|
|
244
|
+
orientation?: 'horizontal' | 'vertical';
|
|
245
|
+
scale?: ReturnType<typeof scaleOrdinal>;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
declare const BaseLegend: FC<LegendProps>;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Props for the ThemeProvider component
|
|
252
|
+
*/
|
|
253
|
+
type ThemeProviderProps = {
|
|
254
|
+
/** Optional partial theme override */
|
|
255
|
+
theme?: Partial<ChartTheme>;
|
|
256
|
+
/** Child components that will have access to the theme */
|
|
257
|
+
children: ReactNode;
|
|
258
|
+
};
|
|
259
|
+
declare const ThemeProvider: FC<ThemeProviderProps>;
|
|
260
|
+
|
|
261
|
+
type UseChartMouseHandlerProps = {
|
|
262
|
+
/**
|
|
263
|
+
* Whether tooltips are enabled
|
|
264
|
+
*/
|
|
265
|
+
withTooltips: boolean;
|
|
266
|
+
};
|
|
267
|
+
type UseChartMouseHandlerReturn = {
|
|
268
|
+
/**
|
|
269
|
+
* Handler for mouse move events
|
|
270
|
+
*/
|
|
271
|
+
onMouseMove: (event: React.MouseEvent<SVGElement>, data: DataPoint) => void;
|
|
272
|
+
/**
|
|
273
|
+
* Handler for mouse leave events
|
|
274
|
+
*/
|
|
275
|
+
onMouseLeave: () => void;
|
|
276
|
+
/**
|
|
277
|
+
* Whether the tooltip is currently open
|
|
278
|
+
*/
|
|
279
|
+
tooltipOpen: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* The current tooltip data
|
|
282
|
+
*/
|
|
283
|
+
tooltipData: DataPoint | null;
|
|
284
|
+
/**
|
|
285
|
+
* The current tooltip left position
|
|
286
|
+
*/
|
|
287
|
+
tooltipLeft: number | undefined;
|
|
288
|
+
/**
|
|
289
|
+
* The current tooltip top position
|
|
290
|
+
*/
|
|
291
|
+
tooltipTop: number | undefined;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Hook to handle mouse interactions for chart components
|
|
295
|
+
*
|
|
296
|
+
* @param {UseChartMouseHandlerProps} props - Hook configuration
|
|
297
|
+
* @return {UseChartMouseHandlerReturn} Object containing handlers and tooltip state
|
|
298
|
+
*/
|
|
299
|
+
declare const useChartMouseHandler: ({ withTooltips, }: UseChartMouseHandlerProps) => UseChartMouseHandlerReturn;
|
|
300
|
+
|
|
301
|
+
export { _default$3 as BarChart, BaseTooltip, BaseLegend as Legend, _default$2 as LineChart, _default$1 as PieChart, _default as PieSemiCircleChart, ThemeProvider, useChartMouseHandler };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{AxisLeft as a,AxisBottom as i}from"@visx/axis";import{localPoint as o}from"@visx/event";import{Group as r}from"@visx/group";import{scaleOrdinal as n,scaleBand as d,scaleLinear as s}from"@visx/scale";import{Bar as c}from"@visx/shape";import{useTooltip as m}from"@visx/tooltip";import h from"clsx";import{createContext as g,useContext as p,useCallback as v}from"react";import{GridRows as u,GridColumns as b}from"@visx/grid";import{LegendOrdinal as _}from"@visx/legend";import{useParentSize as f}from"@visx/responsive";const x=g({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});var w="grid-control-module__grid-control__KOnZN";const N=({width:l,height:a,xScale:i,yScale:o,gridVisibility:r="x",top:n=0})=>e("g",{transform:`translate(0, ${n})`,className:w,children:[r.includes("x")&&t(u,{scale:i,width:l}),r.includes("y")&&t(b,{scale:o,height:a})]});var y={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const F={horizontal:"row",vertical:"column"},C=({items:l,className:a,orientation:i="horizontal"})=>{const o=n({domain:l.map((e=>e.label)),range:l.map((e=>e.color))});return t("div",{className:h(y.legend,y[`legend--${i}`],a),role:"list",children:t(_,{scale:o,direction:F[i],shape:"rect",shapeWidth:16,shapeHeight:16,className:y["legend-items"],children:a=>t("div",{className:y[`legend--${i}`],children:a.map((a=>e("div",{className:y["legend-item"],children:[t("svg",{width:16,height:16,children:t("rect",{width:16,height:16,fill:a.value,className:y["legend-item-swatch"]})}),e("span",{className:y["legend-item-label"],children:[a.text,l.find((e=>e.label===a.text))?.value&&t("span",{className:y["legend-item-value"],children:l.find((e=>e.label===a.text))?.value})]})]},a.text)))})})})};var L="base-tooltip-module__tooltip__OfX6n";const S=({data:t})=>e(l,{children:[t?.label,": ",t?.valueDisplay||t?.value]}),z=({data:e,top:l,left:a,component:i=S,children:o,className:r})=>t("div",{className:L,style:{top:l,left:a},role:"tooltip",children:o||e&&t(i,{data:e,className:r})});var D={"bar-chart":"bar-chart-module__bar-chart__lmYNi","bar-chart-legend":"bar-chart-module__bar-chart-legend__vgKKq"};const k=({data:l,margin:n={top:20,right:20,bottom:40,left:40},withTooltips:g=!1,showLegend:u=!1,legendOrientation:b="horizontal",className:_,gridVisibility:f="x",width:w,height:y=400})=>{const F=p(x),{tooltipOpen:L,tooltipLeft:S,tooltipTop:k,tooltipData:T,hideTooltip:M,showTooltip:$}=m(),B=v(((e,t,l,a,i)=>{const r=o(e);r&&$({tooltipData:{value:t,xLabel:l,yLabel:a,seriesIndex:i},tooltipLeft:r.x,tooltipTop:r.y-10})}),[$]),O=v((()=>{M()}),[M]);if(!l?.length)return t("div",{className:h("bar-chart-empty",D["bat-chart-empty"]),children:"Empty..."});const I=n,K=w-I.left-I.right,R=y-I.top-I.bottom,V=l[0].data?.map((e=>e?.label||"")),W=d({range:[0,K],domain:V,padding:.2}),j=d({range:[0,W.bandwidth()],domain:l.map(((e,t)=>t.toString())),padding:.1}),A=s({range:[R,0],domain:[0,Math.max(...l.map((e=>Math.max(...e.data.map((e=>e?.value||0))))))]}),H=l.map(((e,t)=>({label:e.label,value:"",color:F.colors[t%F.colors.length]})));return e("div",{className:h("bar-chart",_,D["bar-chart"]),children:[t("svg",{width:w,height:y,children:e(r,{left:I.left,top:I.top,children:[t(N,{width:K,height:R,xScale:W,yScale:A,gridVisibility:f}),l.map(((e,l)=>t(r,{children:e.data.map((a=>{const i=W(a?.label||"");if(void 0===i)return null;const o=j.bandwidth(),r=i+(j(l.toString())??0);return t(c,{x:r,y:A(a.value),width:o,height:R-(A(a.value)??0),fill:F.colors[l%F.colors.length],onMouseMove:g?t=>B(t,a.value,a?.label||"",e.label,l):void 0,onMouseLeave:g?O:void 0},`bar-${l}-${a.label}`)}))},l))),t(a,{scale:A}),t(i,{scale:W,top:R})]})}),g&&L&&T&&t(z,{top:k||0,left:S||0,children:e("div",{children:[t("div",{children:T.yLabel}),e("div",{children:[T.xLabel,": ",T.value]})]})}),u&&t(C,{items:H,orientation:b,className:D["bar-chart-legend"]})]})};k.displayName="BarChart";var T=function(e,l){const{maxWidth:a=1200,aspectRatio:i=.5,debounceTime:o=50}=l||{};return function(l){const{parentRef:r,width:n}=f({debounceTime:o,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),d=n?Math.min(n,a):600,s=d*i;return t("div",{ref:r,style:{width:"100%",minHeight:`${s}px`},children:t(e,{width:d,height:s,size:d,...l})})}}(k);export{T as BarChart};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/bar-chart/index.js","mappings":";wVASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC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,EAAAA,EAAAA,MAAA,OAAAI,SAAA,EACCE,EAAAA,EAAAA,KAAA,OAAAF,SAAO6E,EAAYO,UACnBxF,EAAAA,EAAAA,MAAA,OAAAI,SAAA,CACG6E,EAAYM,OAAQ,KAAIN,EAAY1C,cAMxC+B,IACDhE,EAAAA,EAAAA,KAACmH,EAAM,CACN1G,MAAQ2F,EACRzF,YAAcuD,EACdrE,UAAYwB,EAAQ,wBAKzB,EAEAkC,EAAS6D,YAAc,WACvB,SCtJCC,EDsJ+C9D,ECnJ+B+D,GAA9ErI,EAA4E,CAAC,GAArEsI,SAAAA,OAAQ,IAAAD,EAAG,KAAIA,EAAEE,OAAW,KAAbC,EAAAxI,EAAEuI,aAAc,GAAGC,EAAEC,OAAY,KAAdC,EAAA1I,EAAEyI,cAAe,GAAEC,EAEtD,SAA0BrM,GAChC,IAAAsM,GAA0CC,EAAAA,EAAAA,eAAe,CACxDH,aAAAA,EACAI,2BAA2B,EAC3BC,YAAa,CAAE7I,MAAO,IAAKC,OAAQ,OAH5B6I,EAASJ,EAATI,UAAkBC,EAAWL,EAAlB1I,MAObgJ,EAAiBD,EAAcjC,KAAKmC,IAAKF,EAAaV,GAAa,IACnEa,EAAkBF,EAAiBV,EAEzC,OACCxH,EAAAA,EAAAA,KAAA,OACCzF,IAAMyN,EACN1E,MAAQ,CACPpE,MAAO,OACPmJ,UAAW,GAAFzI,OAAMwI,EAAe,OAC5BtI,UAEHE,EAAAA,EAAAA,KAACqH,EAAgBiB,EAAA,CAChBpJ,MAAQgJ,EACR/I,OAASiJ,GAEF9M,KAIX,GAjCM,IACN+L,EAGApI,EAA8EqI,EAAtEC,EAAeE,EAAED,EAAiBG,EAAED","sources":["webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js","webpack://@automattic/charts/external module \"react\"","webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://@automattic/charts/external module \"@visx/axis\"","webpack://@automattic/charts/external module \"@visx/event\"","webpack://@automattic/charts/external module \"@visx/group\"","webpack://@automattic/charts/external module \"@visx/scale\"","webpack://@automattic/charts/external module \"@visx/shape\"","webpack://@automattic/charts/external module \"@visx/tooltip\"","webpack://@automattic/charts/external module \"clsx\"","webpack://@automattic/charts/./src/providers/theme/themes.ts","webpack://@automattic/charts/./src/providers/theme/theme-provider.tsx","webpack://@automattic/charts/external module \"@visx/grid\"","webpack://@automattic/charts/./src/components/grid-control/grid-control.tsx","webpack://@automattic/charts/./src/components/grid-control/grid-control.module.scss?a210","webpack://@automattic/charts/external module \"@visx/legend\"","webpack://@automattic/charts/./src/components/legend/legend.module.scss?843e","webpack://@automattic/charts/./src/components/legend/base-legend.tsx","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@automattic/charts/external module \"@visx/responsive\"","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss?1d14","webpack://@automattic/charts/./src/components/bar-chart/bar-chart.module.scss?9954","webpack://@automattic/charts/./src/components/bar-chart/bar-chart.tsx","webpack://@automattic/charts/./src/components/shared/with-responsive.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE_react__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nexport { _toConsumableArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nexport { _arrayWithoutHoles as default };","function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableSpread as default };","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"AxisBottom\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_axis_c51807aa__.AxisBottom), [\"AxisLeft\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_axis_c51807aa__.AxisLeft) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"localPoint\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_event_19f6f977__.localPoint) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"Group\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_group_7523624b__.Group) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"scaleBand\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_scale_2ec4ad68__.scaleBand), [\"scaleLinear\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_scale_2ec4ad68__.scaleLinear), [\"scaleOrdinal\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_scale_2ec4ad68__.scaleOrdinal) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"Bar\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_shape_3711bad4__.Bar) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"useTooltip\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_tooltip_83ba89e9__.useTooltip) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"default\"]: () => (__WEBPACK_EXTERNAL_MODULE_clsx__[\"default\"]) });","import type { ChartTheme } from '../../types';\n\n/**\n * Default theme configuration\n */\nconst defaultTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Jetpack theme configuration\n */\nconst jetpackTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Woo theme configuration\n */\nconst wooTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#80C8FF', '#B999FF', '#3858E9' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\nexport { defaultTheme, jetpackTheme, wooTheme };\n","import { createContext, useContext, FC, type ReactNode } from 'react';\nimport { defaultTheme } from './themes';\nimport type { ChartTheme } from '../../types';\n\n/**\n * Context for sharing theme configuration across components\n */\nconst ThemeContext = createContext< ChartTheme >( defaultTheme );\n\n/**\n * Hook to access chart theme\n * @return {object} A built theme configuration compatible with visx charts\n */\nconst useChartTheme = () => {\n\tconst theme = useContext( ThemeContext );\n\treturn theme;\n};\n\n/**\n * Props for the ThemeProvider component\n */\ntype ThemeProviderProps = {\n\t/** Optional partial theme override */\n\ttheme?: Partial< ChartTheme >;\n\t/** Child components that will have access to the theme */\n\tchildren: ReactNode;\n};\n\n// Provider component for chart theming\n// Allows theme customization through props while maintaining default values\nconst ThemeProvider: FC< ThemeProviderProps > = ( { theme = {}, children } ) => {\n\tconst mergedTheme = { ...defaultTheme, ...theme };\n\treturn <ThemeContext.Provider value={ mergedTheme }>{ children }</ThemeContext.Provider>;\n};\n\nexport { ThemeProvider, useChartTheme };\n","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"GridColumns\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_grid_89d2c099__.GridColumns), [\"GridRows\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_grid_89d2c099__.GridRows) });","import { GridRows, GridColumns } from '@visx/grid';\nimport React from 'react';\nimport styles from './grid-control.module.scss';\nimport type { GridProps } from '../../types';\n\nconst GridControl: React.FC< GridProps > = ( {\n\twidth,\n\theight,\n\txScale,\n\tyScale,\n\tgridVisibility = 'x',\n\ttop = 0,\n} ) => {\n\treturn (\n\t\t<g transform={ `translate(0, ${ top })` } className={ styles[ 'grid-control' ] }>\n\t\t\t{ gridVisibility.includes( 'x' ) && <GridRows scale={ xScale } width={ width } /> }\n\t\t\t{ gridVisibility.includes( 'y' ) && <GridColumns scale={ yScale } height={ height } /> }\n\t\t</g>\n\t);\n};\n\nexport default GridControl;\n","// extracted by mini-css-extract-plugin\nexport default {\"grid-control\":\"jfpeES0fbFrqCPR8dRN7\"};","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"LegendOrdinal\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_legend_118b7922__.LegendOrdinal) });","// extracted by mini-css-extract-plugin\nexport default {\"legend--horizontal\":\"b1_5FxxoK4aEFLoe67IA\",\"legend--vertical\":\"vpmQkJAPhp3XJ9Wb6vOw\",\"legend-item\":\"IKM8KG1lF9e5NzDqMLOJ\",\"legend-item-swatch\":\"_eccyBq0v2puKsHw8XND\",\"legend-item-label\":\"UeZrUEpEK0tLzXHmeUco\",\"legend-item-value\":\"R5msPOYKm79jYV13H0v7\"};","import { LegendOrdinal } from '@visx/legend';\nimport { scaleOrdinal } from '@visx/scale';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport styles from './legend.module.scss';\nimport type { LegendProps } from './types';\n\n/**\n * Base legend component that displays color-coded items with labels using visx\n * @param {object} props - Component properties\n * @param {Array} props.items - Array of legend items to display\n * @param {string} props.className - Additional CSS class names\n * @param {string} props.orientation - Layout orientation (horizontal/vertical)\n * @return {JSX.Element} Rendered legend component\n */\nconst orientationToFlexDirection = {\n\thorizontal: 'row' as const,\n\tvertical: 'column' as const,\n};\n\nexport const BaseLegend: FC< LegendProps > = ( {\n\titems,\n\tclassName,\n\torientation = 'horizontal',\n} ) => {\n\tconst legendScale = scaleOrdinal( {\n\t\tdomain: items.map( item => item.label ),\n\t\trange: items.map( item => item.color ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( styles.legend, styles[ `legend--${ orientation }` ], className ) }\n\t\t\trole=\"list\"\n\t\t>\n\t\t\t<LegendOrdinal\n\t\t\t\tscale={ legendScale }\n\t\t\t\tdirection={ orientationToFlexDirection[ orientation ] }\n\t\t\t\tshape=\"rect\"\n\t\t\t\tshapeWidth={ 16 }\n\t\t\t\tshapeHeight={ 16 }\n\t\t\t\tclassName={ styles[ 'legend-items' ] }\n\t\t\t>\n\t\t\t\t{ labels => (\n\t\t\t\t\t<div className={ styles[ `legend--${ orientation }` ] }>\n\t\t\t\t\t\t{ labels.map( label => (\n\t\t\t\t\t\t\t<div key={ label.text } className={ styles[ 'legend-item' ] }>\n\t\t\t\t\t\t\t\t<svg width={ 16 } height={ 16 }>\n\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\twidth={ 16 }\n\t\t\t\t\t\t\t\t\t\theight={ 16 }\n\t\t\t\t\t\t\t\t\t\tfill={ label.value }\n\t\t\t\t\t\t\t\t\t\tclassName={ styles[ 'legend-item-swatch' ] }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-label' ] }>\n\t\t\t\t\t\t\t\t\t{ label.text }\n\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value && (\n\t\t\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-value' ] }>\n\t\t\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</LegendOrdinal>\n\t\t</div>\n\t);\n};\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"useParentSize\"]: () => (__WEBPACK_EXTERNAL_MODULE__visx_responsive_eb017331__.useParentSize) });","import styles from './base-tooltip.module.scss';\nimport type { CSSProperties, ComponentType, ReactNode } from 'react';\n\ntype TooltipData = {\n\tlabel: string;\n\tvalue: number;\n\tvalueDisplay?: string;\n};\n\ntype TooltipComponentProps = {\n\tdata: TooltipData;\n\tclassName?: string;\n};\n\ntype TooltipCommonProps = {\n\ttop: number;\n\tleft: number;\n\tstyle?: CSSProperties;\n\tclassName?: string;\n};\n\ntype DefaultDataTooltip = {\n\tdata: TooltipData;\n\tcomponent?: ComponentType< TooltipComponentProps >;\n\tchildren?: never;\n};\n\ntype CustomTooltip = {\n\tchildren: ReactNode;\n\tdata?: never;\n\tcomponent?: never;\n};\n\ntype BaseTooltipProps = TooltipCommonProps & ( DefaultDataTooltip | CustomTooltip );\n\nconst DefaultTooltipContent = ( { data }: TooltipComponentProps ) => (\n\t<>\n\t\t{ data?.label }: { data?.valueDisplay || data?.value }\n\t</>\n);\n\nexport const BaseTooltip = ( {\n\tdata,\n\ttop,\n\tleft,\n\tcomponent: Component = DefaultTooltipContent,\n\tchildren,\n\tclassName,\n}: BaseTooltipProps ) => {\n\treturn (\n\t\t<div className={ styles.tooltip } style={ { top, left } } role=\"tooltip\">\n\t\t\t{ children || ( data && <Component data={ data } className={ className } /> ) }\n\t\t</div>\n\t);\n};\n\nexport type { BaseTooltipProps, TooltipData };\n","// extracted by mini-css-extract-plugin\nexport default {\"tooltip\":\"Jmgc7XAf2uAyK5059rBe\"};","// extracted by mini-css-extract-plugin\nexport default {\"bar-chart\":\"Vm_cn8YnIXBavFt6eHSp\",\"bar-chart-legend\":\"e4dhKgBP7e6FBRAX2SrP\"};","import { AxisLeft, AxisBottom } from '@visx/axis';\nimport { localPoint } from '@visx/event';\nimport { Group } from '@visx/group';\nimport { scaleBand, scaleLinear } from '@visx/scale';\nimport { Bar } from '@visx/shape';\nimport { useTooltip } from '@visx/tooltip';\nimport clsx from 'clsx';\nimport { FC, useCallback, type MouseEvent } from 'react';\nimport { useChartTheme } from '../../providers/theme';\nimport { GridControl } from '../grid-control';\nimport { Legend } from '../legend';\nimport { withResponsive } from '../shared/with-responsive';\nimport { BaseTooltip } from '../tooltip';\nimport styles from './bar-chart.module.scss';\nimport type { BaseChartProps, SeriesData } from '../../types';\n\ntype BarChartTooltipData = {\n\tvalue: number;\n\txLabel: string;\n\tyLabel: string;\n\tseriesIndex: number;\n};\n\ninterface BarChartProps extends BaseChartProps< SeriesData[] > {}\n\nconst BarChart: FC< BarChartProps > = ( {\n\tdata,\n\tmargin = { top: 20, right: 20, bottom: 40, left: 40 },\n\twithTooltips = false,\n\tshowLegend = false,\n\tlegendOrientation = 'horizontal',\n\tclassName,\n\tgridVisibility = 'x',\n\twidth,\n\theight = 400,\n} ) => {\n\tconst theme = useChartTheme();\n\tconst { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =\n\t\tuseTooltip< BarChartTooltipData >();\n\n\tconst handleMouseMove = useCallback(\n\t\t(\n\t\t\tevent: MouseEvent< SVGRectElement >,\n\t\t\tvalue: number,\n\t\t\txLabel: string,\n\t\t\tyLabel: string,\n\t\t\tseriesIndex: number\n\t\t) => {\n\t\t\tconst coords = localPoint( event );\n\t\t\tif ( ! coords ) return;\n\n\t\t\tshowTooltip( {\n\t\t\t\ttooltipData: { value, xLabel, yLabel, seriesIndex },\n\t\t\t\ttooltipLeft: coords.x,\n\t\t\t\ttooltipTop: coords.y - 10,\n\t\t\t} );\n\t\t},\n\t\t[ showTooltip ]\n\t);\n\n\tconst handleMouseLeave = useCallback( () => {\n\t\thideTooltip();\n\t}, [ hideTooltip ] );\n\n\tif ( ! data?.length ) {\n\t\treturn <div className={ clsx( 'bar-chart-empty', styles[ 'bat-chart-empty' ] ) }>Empty...</div>;\n\t}\n\n\tconst margins = margin;\n\tconst xMax = width - margins.left - margins.right;\n\tconst yMax = height - margins.top - margins.bottom;\n\n\t// Get labels for x-axis from the first series (assuming all series have same labels)\n\tconst labels = data[ 0 ].data?.map( d => d?.label || '' );\n\n\t// Create scales\n\tconst xScale = scaleBand< string >( {\n\t\trange: [ 0, xMax ],\n\t\tdomain: labels,\n\t\tpadding: 0.2,\n\t} );\n\n\tconst innerScale = scaleBand( {\n\t\trange: [ 0, xScale.bandwidth() ],\n\t\tdomain: data.map( ( _, i ) => i.toString() ),\n\t\tpadding: 0.1,\n\t} );\n\n\tconst yScale = scaleLinear< number >( {\n\t\trange: [ yMax, 0 ],\n\t\tdomain: [\n\t\t\t0,\n\t\t\tMath.max( ...data.map( series => Math.max( ...series.data.map( d => d?.value || 0 ) ) ) ),\n\t\t],\n\t} );\n\n\t// Create legend items from group labels, this iterates over groups rather than data points\n\tconst legendItems = data.map( ( group, index ) => ( {\n\t\tlabel: group.label, // Label for each unique group\n\t\tvalue: '', // Empty string since we don't want to show a specific value\n\t\tcolor: theme.colors[ index % theme.colors.length ],\n\t} ) );\n\n\treturn (\n\t\t<div className={ clsx( 'bar-chart', className, styles[ 'bar-chart' ] ) }>\n\t\t\t<svg width={ width } height={ height }>\n\t\t\t\t<Group left={ margins.left } top={ margins.top }>\n\t\t\t\t\t<GridControl\n\t\t\t\t\t\twidth={ xMax }\n\t\t\t\t\t\theight={ yMax }\n\t\t\t\t\t\txScale={ xScale }\n\t\t\t\t\t\tyScale={ yScale }\n\t\t\t\t\t\tgridVisibility={ gridVisibility }\n\t\t\t\t\t/>\n\t\t\t\t\t{ data.map( ( series, seriesIndex ) => (\n\t\t\t\t\t\t<Group key={ seriesIndex }>\n\t\t\t\t\t\t\t{ series.data.map( d => {\n\t\t\t\t\t\t\t\tconst xPos = xScale( d?.label || '' );\n\t\t\t\t\t\t\t\tif ( xPos === undefined ) return null;\n\n\t\t\t\t\t\t\t\tconst barWidth = innerScale.bandwidth();\n\t\t\t\t\t\t\t\tconst barX = xPos + ( innerScale( seriesIndex.toString() ) ?? 0 );\n\n\t\t\t\t\t\t\t\tconst handleBarMouseMove = ( event: MouseEvent< SVGRectElement > ) =>\n\t\t\t\t\t\t\t\t\thandleMouseMove( event, d.value, d?.label || '', series.label, seriesIndex );\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Bar\n\t\t\t\t\t\t\t\t\t\tkey={ `bar-${ seriesIndex }-${ d.label }` }\n\t\t\t\t\t\t\t\t\t\tx={ barX }\n\t\t\t\t\t\t\t\t\t\ty={ yScale( d.value ) }\n\t\t\t\t\t\t\t\t\t\twidth={ barWidth }\n\t\t\t\t\t\t\t\t\t\theight={ yMax - ( yScale( d.value ) ?? 0 ) }\n\t\t\t\t\t\t\t\t\t\tfill={ theme.colors[ seriesIndex % theme.colors.length ] }\n\t\t\t\t\t\t\t\t\t\tonMouseMove={ withTooltips ? handleBarMouseMove : undefined }\n\t\t\t\t\t\t\t\t\t\tonMouseLeave={ withTooltips ? handleMouseLeave : undefined }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</Group>\n\t\t\t\t\t) ) }\n\t\t\t\t\t<AxisLeft scale={ yScale } />\n\t\t\t\t\t<AxisBottom scale={ xScale } top={ yMax } />\n\t\t\t\t</Group>\n\t\t\t</svg>\n\n\t\t\t{ withTooltips && tooltipOpen && tooltipData && (\n\t\t\t\t<BaseTooltip top={ tooltipTop || 0 } left={ tooltipLeft || 0 }>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div>{ tooltipData.yLabel }</div>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t{ tooltipData.xLabel }: { tooltipData.value }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</BaseTooltip>\n\t\t\t) }\n\n\t\t\t{ showLegend && (\n\t\t\t\t<Legend\n\t\t\t\t\titems={ legendItems }\n\t\t\t\t\torientation={ legendOrientation }\n\t\t\t\t\tclassName={ styles[ 'bar-chart-legend' ] }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nBarChart.displayName = 'BarChart';\nexport default withResponsive< BarChartProps >( BarChart );\n","import { useParentSize } from '@visx/responsive';\nimport { ComponentType } from 'react';\nimport type { BaseChartProps } from '../../types';\n\ntype ResponsiveConfig = {\n\tmaxWidth?: number;\n\taspectRatio?: number;\n\tdebounceTime?: number;\n};\n\n/**\n * A higher-order component that provides responsive width and height\n * to the wrapped chart component using useParentSize from @visx/responsive.\n *\n * @param WrappedComponent - The chart component to be wrapped.\n * @param config - Optional configuration for responsive behavior\n * @return A functional component that renders the wrapped component with responsive dimensions.\n */\nexport function withResponsive< T extends BaseChartProps< unknown > >(\n\tWrappedComponent: ComponentType< T >,\n\tconfig?: ResponsiveConfig\n) {\n\tconst { maxWidth = 1200, aspectRatio = 0.5, debounceTime = 50 } = config || {};\n\n\treturn function ResponsiveChart( props: Omit< T, 'width' | 'height' > ) {\n\t\tconst { parentRef, width: parentWidth } = useParentSize( {\n\t\t\tdebounceTime,\n\t\t\tenableDebounceLeadingCall: true,\n\t\t\tinitialSize: { width: 600, height: 400 },\n\t\t} );\n\n\t\t// Calculate dimensions\n\t\tconst containerWidth = parentWidth ? Math.min( parentWidth, maxWidth ) : 600;\n\t\tconst containerHeight = containerWidth * aspectRatio;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ parentRef }\n\t\t\t\tstyle={ {\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\tminHeight: `${ containerHeight }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<WrappedComponent\n\t\t\t\t\twidth={ containerWidth }\n\t\t\t\t\theight={ containerHeight }\n\t\t\t\t\t// When width and height are passed as props, they will override the responsive values, and the chart will become fixed size.\n\t\t\t\t\t{ ...( props as T ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n}\n"],"names":["f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","Fragment","jsx","jsxs","module","__WEBPACK_EXTERNAL_MODULE_react__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","definition","o","defineProperty","enumerable","get","obj","prop","_arrayLikeToArray","r","length","Array","_toConsumableArray","isArray","iterator","from","t","toString","slice","constructor","name","test","TypeError","y","__WEBPACK_EXTERNAL_MODULE__visx_axis_c51807aa__","x","__WEBPACK_EXTERNAL_MODULE__visx_event_19f6f977__","__WEBPACK_EXTERNAL_MODULE__visx_group_7523624b__","__WEBPACK_EXTERNAL_MODULE__visx_scale_2ec4ad68__","__WEBPACK_EXTERNAL_MODULE__visx_shape_3711bad4__","__WEBPACK_EXTERNAL_MODULE__visx_tooltip_83ba89e9__","__WEBPACK_EXTERNAL_MODULE_clsx__","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","__WEBPACK_EXTERNAL_MODULE__visx_grid_89d2c099__","_ref","width","height","xScale","yScale","_ref$gridVisibility","gridVisibility","_ref$top","top","_jsxs","transform","concat","className","children","includes","_jsx","GridRows","scale","GridColumns","__WEBPACK_EXTERNAL_MODULE__visx_legend_118b7922__","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","clsx","styles","legend","role","LegendOrdinal","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","fill","value","text","find","_typeof","i","toPrimitive","String","toPropertyKey","configurable","writable","__WEBPACK_EXTERNAL_MODULE__visx_responsive_eb017331__","DefaultTooltipContent","data","_Fragment","valueDisplay","BaseTooltip","_ref2","left","_ref2$component","component","Component","style","BarChart","_data$0$data","_ref$margin","margin","right","bottom","_ref$withTooltips","withTooltips","_ref$showLegend","showLegend","_ref$legendOrientatio","legendOrientation","_ref$height","theme","useContext","_useTooltip","useTooltip","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","handleMouseMove","useCallback","event","xLabel","yLabel","seriesIndex","coords","localPoint","handleMouseLeave","margins","xMax","yMax","scaleBand","padding","innerScale","bandwidth","_","scaleLinear","Math","max","apply","series","legendItems","group","index","Group","GridControl","_innerScale","_yScale","xPos","barWidth","barX","Bar","onMouseMove","onMouseLeave","AxisLeft","AxisBottom","Legend","displayName","WrappedComponent","_ref$maxWidth","maxWidth","aspectRatio","_ref$aspectRatio","debounceTime","_ref$debounceTime","_useParentSize","useParentSize","enableDebounceLeadingCall","initialSize","parentRef","parentWidth","containerWidth","min","containerHeight","minHeight","_objectSpread"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/providers/theme/themes.ts","../../../../src/providers/theme/theme-provider.tsx","../../../../src/components/grid-control/grid-control.tsx","../../../../src/components/legend/base-legend.tsx","../../../../src/components/tooltip/base-tooltip.tsx","../../../../src/components/bar-chart/bar-chart.tsx","../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[null,null,null,null,null,null,null],"names":["ThemeContext","createContext","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","GridControl","width","height","xScale","yScale","gridVisibility","top","_jsxs","transform","className","styles","children","includes","_jsx","GridRows","scale","GridColumns","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","clsx","legend","role","LegendOrdinal","direction","shape","shapeWidth","shapeHeight","labels","fill","value","text","find","DefaultTooltipContent","data","_Fragment","valueDisplay","BaseTooltip","left","component","Component","style","BarChart","margin","right","bottom","withTooltips","showLegend","legendOrientation","theme","useContext","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","handleMouseMove","useCallback","event","xLabel","yLabel","seriesIndex","coords","localPoint","x","y","handleMouseLeave","length","margins","xMax","yMax","d","scaleBand","padding","innerScale","bandwidth","_","i","toString","scaleLinear","Math","max","series","legendItems","group","index","Group","xPos","undefined","barWidth","barX","Bar","onMouseMove","onMouseLeave","AxisLeft","AxisBottom","Legend","displayName","barChart","WrappedComponent","config","maxWidth","aspectRatio","debounceTime","props","parentRef","parentWidth","useParentSize","enableDebounceLeadingCall","initialSize","containerWidth","min","containerHeight","ref","minHeight","size","withResponsive"],"mappings":"2kBAKA,MCEMA,EAAeC,EDFY,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,sDEVhB,MAAMC,EAAqC,EAC1CC,QACAC,SACAC,SACAC,SACAC,iBAAiB,IACjBC,MAAM,KAGLC,EAA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
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.line-chart-module__line-chart__ITM3d {
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
.line-chart-module__line-chart__tooltip__aqcme {
|
|
8
|
+
background: #fff;
|
|
9
|
+
padding: 0.5rem;
|
|
10
|
+
}
|
|
11
|
+
.line-chart-module__line-chart__tooltip-date__4Dzab {
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
padding-bottom: 10px;
|
|
14
|
+
}
|
|
15
|
+
.line-chart-module__line-chart__tooltip-row__6A37G {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
padding: 4px 0;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
}
|
|
21
|
+
.line-chart-module__line-chart__tooltip-label__IvnFF {
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
padding-right: 1rem;
|
|
24
|
+
}
|
|
25
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
|
|
26
|
+
position: relative;
|
|
27
|
+
text-align: center;
|
|
28
|
+
}
|
|
29
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
|
|
30
|
+
margin-top: 1rem;
|
|
31
|
+
}
|
|
32
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
|
|
33
|
+
margin-bottom: 0px;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
font-size: 16px;
|
|
36
|
+
}
|
|
37
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
|
|
38
|
+
margin-top: 0px;
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
}
|
|
41
|
+
.grid-control-module__grid-control__KOnZN .visx-line {
|
|
42
|
+
stroke: #d7d6d6;
|
|
43
|
+
stroke-width: 1px;
|
|
44
|
+
shape-rendering: crispEdges;
|
|
45
|
+
}
|
|
46
|
+
.legend-module__legend--horizontal__IUN13 {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
gap: 16px;
|
|
51
|
+
}
|
|
52
|
+
.legend-module__legend--vertical__Scfzo {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
}
|
|
5
57
|
|
|
6
|
-
|
|
58
|
+
.legend-module__legend-item__feemn {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 8px;
|
|
62
|
+
font-size: 0.875rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.legend-module__legend-item-swatch__nRyXf {
|
|
66
|
+
border-radius: 2px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.legend-module__legend-item-label__ksx6I {
|
|
70
|
+
color: var(--jp-gray-80, #2c3338);
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: 0.5rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.legend-module__legend-item-value__d9x1j {
|
|
77
|
+
font-weight: 500;
|
|
78
|
+
}
|
|
79
|
+
.base-tooltip-module__tooltip__OfX6n {
|
|
80
|
+
padding: 0.5rem;
|
|
81
|
+
background-color: rgba(0, 0, 0, 0.85);
|
|
82
|
+
color: white;
|
|
83
|
+
border-radius: 4px;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
86
|
+
position: absolute;
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
transform: translate(-50%, -100%);
|
|
89
|
+
}
|
|
90
|
+
.bar-chart-module__bar-chart__lmYNi {
|
|
91
|
+
position: relative;
|
|
92
|
+
}
|
|
93
|
+
.bar-chart-module__bar-chart-legend__vgKKq {
|
|
94
|
+
margin-top: 1rem;
|
|
95
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{jsxs as i,jsx as r}from"react/jsx-runtime";import{GridRows as t,GridColumns as e}from"@visx/grid";import"react";var o="grid-control-module__grid-control__KOnZN";const c=({width:c,height:l,xScale:a,yScale:s,gridVisibility:d="x",top:n=0})=>i("g",{transform:`translate(0, ${n})`,className:o,children:[d.includes("x")&&r(t,{scale:a,width:c}),d.includes("y")&&r(e,{scale:s,height:l})]});export{c as GridControl};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/grid-control/grid-control.tsx"],"sourcesContent":[null],"names":["GridControl","width","height","xScale","yScale","gridVisibility","top","_jsxs","transform","className","styles","children","includes","_jsx","GridRows","scale","GridColumns"],"mappings":"wKAKM,MAAAA,EAAqC,EAC1CC,QACAC,SACAC,SACAC,SACAC,iBAAiB,IACjBC,MAAM,KAGLC,EAAG,IAAA,CAAAC,UAAY,gBAAiBF,KAAUG,UAAYC,EAAwBC,SAAA,CAC3EN,EAAeO,SAAU,MAASC,EAACC,EAAQ,CAACC,MAAQZ,EAASF,MAAQA,IACrEI,EAAeO,SAAU,MAASC,EAACG,EAAW,CAACD,MAAQX,EAASF,OAASA"}
|