@gaulatti/bleecker 0.1.32 → 0.1.33
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.
|
@@ -6,7 +6,9 @@ export interface LineChartProps {
|
|
|
6
6
|
xAxisKey: string;
|
|
7
7
|
showGrid?: boolean;
|
|
8
8
|
showLegend?: boolean;
|
|
9
|
+
xAxisLabel?: string;
|
|
10
|
+
yAxisLabel?: string;
|
|
9
11
|
yAxisTickFormatter?: (value: number) => string;
|
|
10
12
|
tooltipFormatter?: (value: number) => string;
|
|
11
13
|
}
|
|
12
|
-
export declare function LineChart({ data, height, series, xAxisKey, showGrid, showLegend, yAxisTickFormatter, tooltipFormatter }: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function LineChart({ data, height, series, xAxisKey, showGrid, showLegend, xAxisLabel, yAxisLabel, yAxisTickFormatter, tooltipFormatter }: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CartesianGrid, Legend, Line, LineChart as RechartsLineChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
|
3
3
|
import { chartTheme } from './chart-theme.js';
|
|
4
|
-
export function LineChart({ data, height = 300, series, xAxisKey, showGrid = true, showLegend = true, yAxisTickFormatter, tooltipFormatter }) {
|
|
5
|
-
return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsLineChart, { data: data, margin: { top: 10, right: 20, bottom: 5, left: 0 }, children: [showGrid && _jsx(CartesianGrid, { stroke: chartTheme.grid.stroke, strokeDasharray: chartTheme.grid.strokeDasharray, vertical: false }), _jsx(XAxis, { dataKey: xAxisKey, stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false }), _jsx(YAxis, { stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, tickFormatter: yAxisTickFormatter }), _jsx(Tooltip, { ...chartTheme.tooltip, formatter: (value, name) => [
|
|
4
|
+
export function LineChart({ data, height = 300, series, xAxisKey, showGrid = true, showLegend = true, xAxisLabel, yAxisLabel, yAxisTickFormatter, tooltipFormatter }) {
|
|
5
|
+
return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsLineChart, { data: data, margin: { top: 10, right: 20, bottom: xAxisLabel ? 25 : 5, left: yAxisLabel ? 20 : 0 }, children: [showGrid && _jsx(CartesianGrid, { stroke: chartTheme.grid.stroke, strokeDasharray: chartTheme.grid.strokeDasharray, vertical: false }), _jsx(XAxis, { dataKey: xAxisKey, stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, label: xAxisLabel ? { value: xAxisLabel, position: 'insideBottom', offset: -15, fill: 'var(--color-text-secondary)', fontSize: 12 } : undefined }), _jsx(YAxis, { stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, tickFormatter: yAxisTickFormatter, label: yAxisLabel ? { value: yAxisLabel, angle: -90, position: 'insideLeft', fill: 'var(--color-text-secondary)', fontSize: 12 } : undefined }), _jsx(Tooltip, { ...chartTheme.tooltip, formatter: (value, name) => [
|
|
6
6
|
tooltipFormatter && typeof value === 'number' ? tooltipFormatter(value) : value ?? '',
|
|
7
7
|
name
|
|
8
8
|
] }), showLegend && _jsx(Legend, { wrapperStyle: { paddingTop: '1rem' } }), series.map((s, i) => (_jsx(Line, { type: 'monotone', dataKey: s.key, name: s.name, stroke: s.color ?? chartTheme.palette[i % chartTheme.palette.length], strokeWidth: 2, dot: false, activeDot: { r: 5, strokeWidth: 2, stroke: 'var(--color-card)' } }, s.key)))] }) }) }));
|
|
@@ -5,6 +5,7 @@ export interface ScatterSeries {
|
|
|
5
5
|
yKey: string;
|
|
6
6
|
zKey?: string;
|
|
7
7
|
color?: string;
|
|
8
|
+
data?: Record<string, unknown>[];
|
|
8
9
|
}
|
|
9
10
|
export interface ScatterChartProps {
|
|
10
11
|
data: Record<string, unknown>[];
|
|
@@ -12,8 +13,10 @@ export interface ScatterChartProps {
|
|
|
12
13
|
series: ScatterSeries[];
|
|
13
14
|
showGrid?: boolean;
|
|
14
15
|
showLegend?: boolean;
|
|
16
|
+
xAxisLabel?: string;
|
|
17
|
+
yAxisLabel?: string;
|
|
15
18
|
xAxisTickFormatter?: (value: number | string) => string;
|
|
16
19
|
yAxisTickFormatter?: (value: number | string) => string;
|
|
17
20
|
tooltipFormatter?: (value: number) => string;
|
|
18
21
|
}
|
|
19
|
-
export declare function ScatterChart({ data, height, series, showGrid, showLegend, xAxisTickFormatter, yAxisTickFormatter, tooltipFormatter }: ScatterChartProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function ScatterChart({ data, height, series, showGrid, showLegend, xAxisLabel, yAxisLabel, xAxisTickFormatter, yAxisTickFormatter, tooltipFormatter }: ScatterChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CartesianGrid, Legend, ResponsiveContainer, Scatter as RechartsScatter, ScatterChart as RechartsScatterChart, Tooltip, XAxis, YAxis, ZAxis } from 'recharts';
|
|
3
3
|
import { chartTheme } from './chart-theme.js';
|
|
4
|
-
export function ScatterChart({ data, height = 350, series, showGrid = true, showLegend = true, xAxisTickFormatter, yAxisTickFormatter, tooltipFormatter }) {
|
|
5
|
-
return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsScatterChart, { margin: { top: 10, right: 20, bottom: 5, left: 0 }, children: [showGrid && _jsx(CartesianGrid, { stroke: chartTheme.grid.stroke, strokeDasharray: chartTheme.grid.strokeDasharray }), _jsx(XAxis, { type: 'number', dataKey: (entry) => entry[series[0].xKey], stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, tickFormatter: xAxisTickFormatter }), _jsx(YAxis, { type: 'number', dataKey: (entry) => entry[series[0].yKey], stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, tickFormatter: yAxisTickFormatter }), _jsx(ZAxis, { type: 'number', dataKey: (entry) => (series[0].zKey ? entry[series[0].zKey] : 1), range: [60, 400] }), _jsx(Tooltip, { ...chartTheme.tooltip, cursor: { strokeDasharray: '3 3' }, formatter: (value) => [tooltipFormatter && typeof value === 'number' ? tooltipFormatter(value) : value,
|
|
4
|
+
export function ScatterChart({ data, height = 350, series, showGrid = true, showLegend = true, xAxisLabel, yAxisLabel, xAxisTickFormatter, yAxisTickFormatter, tooltipFormatter }) {
|
|
5
|
+
return (_jsx("div", { className: 'w-full', style: { height }, children: _jsx(ResponsiveContainer, { width: '100%', height: '100%', children: _jsxs(RechartsScatterChart, { margin: { top: 10, right: 20, bottom: xAxisLabel ? 25 : 5, left: yAxisLabel ? 20 : 0 }, children: [showGrid && _jsx(CartesianGrid, { stroke: chartTheme.grid.stroke, strokeDasharray: chartTheme.grid.strokeDasharray }), _jsx(XAxis, { type: 'number', dataKey: (entry) => entry[series[0].xKey], stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, tickFormatter: xAxisTickFormatter, label: xAxisLabel ? { value: xAxisLabel, position: 'insideBottom', offset: -15, fill: 'var(--color-text-secondary)', fontSize: 12 } : undefined }), _jsx(YAxis, { type: 'number', dataKey: (entry) => entry[series[0].yKey], stroke: chartTheme.axis.stroke, tick: chartTheme.axis.tick, tickLine: false, axisLine: false, tickFormatter: yAxisTickFormatter, label: yAxisLabel ? { value: yAxisLabel, angle: -90, position: 'insideLeft', fill: 'var(--color-text-secondary)', fontSize: 12 } : undefined }), _jsx(ZAxis, { type: 'number', dataKey: (entry) => (series[0].zKey ? entry[series[0].zKey] : 1), range: [60, 400] }), _jsx(Tooltip, { ...chartTheme.tooltip, cursor: { strokeDasharray: '3 3' }, formatter: (value, name) => [tooltipFormatter && typeof value === 'number' ? tooltipFormatter(value) : value, name] }), showLegend && _jsx(Legend, { wrapperStyle: { paddingTop: '1rem' } }), series.map((s, i) => (_jsx(RechartsScatter, { name: s.name, data: s.data ?? data, fill: s.color ?? chartTheme.palette[i % chartTheme.palette.length] }, s.key)))] }) }) }));
|
|
6
6
|
}
|