@moderneinc/react-charts 1.2.0-next.fe4657 → 1.3.0-next.44efd5
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/components/d3-stacked-bar-chart/d3-stacked-bar-chart.component.d.ts +7 -0
- package/dist/components/d3-stacked-bar-chart/d3-stacked-bar-chart.types.d.ts +89 -0
- package/dist/components/d3-stacked-bar-chart/hooks/use-d3-stacked-bar.hook.d.ts +31 -0
- package/dist/components/stacked-area-with-timeline/hooks/use-stacked-area-with-timeline.hook.d.ts +4 -3
- package/dist/components/stacked-area-with-timeline/utils/render-timeline-track.d.ts +3 -11
- package/dist/index.cjs +25 -120
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10156 -25812
- package/dist/{components/stacked-area-chart/stacked-area-chart.constants.d.ts → theme/chart-palettes.d.ts} +4 -60
- package/dist/theme/timeline-defaults.d.ts +0 -8
- package/package.json +6 -16
- package/dist/components/morph-chart/index.d.ts +0 -2
- package/dist/components/morph-chart/utils/accordion-generator.d.ts +0 -102
- package/dist/components/morph-chart/utils/animation-utils.d.ts +0 -44
- package/dist/components/morph-chart/utils/arc-path-calculator.d.ts +0 -53
- package/dist/components/morph-chart/utils/morph-interpolator.d.ts +0 -96
- package/dist/components/morph-chart/utils/segment-transformer.d.ts +0 -70
- package/dist/components/morph-chart/utils/slinky-3d-generator.d.ts +0 -35
- package/dist/components/morph-chart/utils/svg-slinky-generator.d.ts +0 -25
- package/dist/components/stacked-area-chart/hooks/use-stacked-area-chart.hook.d.ts +0 -6
- package/dist/components/stacked-area-chart/stacked-area-chart.component.d.ts +0 -10
- package/dist/components/stacked-area-chart/stacked-area-chart.types.d.ts +0 -186
- package/dist/components/stacked-area-chart/utils/color.utils.d.ts +0 -4
- package/dist/components/stacked-area-with-timeline/index.d.ts +0 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { D3StackedBarChartProps } from './d3-stacked-bar-chart.types';
|
|
3
|
+
/**
|
|
4
|
+
* D3-based stacked bar chart component
|
|
5
|
+
* Timeline-based bar chart with crosshair cursor and brush selection
|
|
6
|
+
*/
|
|
7
|
+
export declare const D3StackedBarChart: FunctionComponent<D3StackedBarChartProps>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* D3-based stacked bar chart types
|
|
3
|
+
* Timeline-based bar chart with crosshair cursor and brush selection
|
|
4
|
+
*/
|
|
5
|
+
export type D3StackedBarDataPoint = {
|
|
6
|
+
timestamp: number;
|
|
7
|
+
[category: string]: number;
|
|
8
|
+
};
|
|
9
|
+
export type D3StackedBarCategory = {
|
|
10
|
+
dataKey: string;
|
|
11
|
+
label: string;
|
|
12
|
+
color: string;
|
|
13
|
+
fillOpacity?: number;
|
|
14
|
+
};
|
|
15
|
+
export type D3StackedBarChartProps = {
|
|
16
|
+
/** Array of data points sorted by timestamp */
|
|
17
|
+
data: D3StackedBarDataPoint[];
|
|
18
|
+
/** Array of category definitions */
|
|
19
|
+
categories: D3StackedBarCategory[];
|
|
20
|
+
/** Chart title */
|
|
21
|
+
title?: string;
|
|
22
|
+
/** Chart subtitle */
|
|
23
|
+
subtitle?: string;
|
|
24
|
+
/** Show header (title and subtitle) */
|
|
25
|
+
showHeader?: boolean;
|
|
26
|
+
/** Show legend */
|
|
27
|
+
showLegend?: boolean;
|
|
28
|
+
/** Show tooltips on hover */
|
|
29
|
+
showTooltip?: boolean;
|
|
30
|
+
/** Chart dimensions */
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: number;
|
|
33
|
+
/** Margins for axes */
|
|
34
|
+
margin?: {
|
|
35
|
+
top: number;
|
|
36
|
+
right: number;
|
|
37
|
+
bottom: number;
|
|
38
|
+
left: number;
|
|
39
|
+
};
|
|
40
|
+
/** Time range for x-axis */
|
|
41
|
+
timeRange?: [number, number];
|
|
42
|
+
/** Show grid lines */
|
|
43
|
+
showGrid?: boolean;
|
|
44
|
+
/** Show axes (deprecated: use showXAxis and showYAxis instead) */
|
|
45
|
+
showAxes?: boolean;
|
|
46
|
+
/** Show X-axis */
|
|
47
|
+
showXAxis?: boolean;
|
|
48
|
+
/** Show Y-axis */
|
|
49
|
+
showYAxis?: boolean;
|
|
50
|
+
/** Format date for axis and tooltip */
|
|
51
|
+
formatDate?: (timestamp: number) => string;
|
|
52
|
+
/** Format value for axis and tooltip */
|
|
53
|
+
formatValue?: (value: number) => string;
|
|
54
|
+
/** Callback when time range changes */
|
|
55
|
+
onTimeRangeChange?: (range: [number, number]) => void;
|
|
56
|
+
/** Enable brush selection */
|
|
57
|
+
enableBrush?: boolean;
|
|
58
|
+
/** Zoom to selection - when true, brush clears after selection */
|
|
59
|
+
zoomToSelection?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Color for brush selection overlay.
|
|
62
|
+
* @default '#69b3a2'
|
|
63
|
+
*/
|
|
64
|
+
brushColor?: string;
|
|
65
|
+
/** Show crosshair cursor on hover */
|
|
66
|
+
showCrosshair?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Color for crosshair lines
|
|
69
|
+
* @default '#666'
|
|
70
|
+
*/
|
|
71
|
+
crosshairColor?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Dash array pattern for crosshair lines
|
|
74
|
+
* @default '4,4'
|
|
75
|
+
*/
|
|
76
|
+
crosshairDashArray?: string;
|
|
77
|
+
};
|
|
78
|
+
export type TooltipData = {
|
|
79
|
+
visible: boolean;
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
category: {
|
|
83
|
+
label: string;
|
|
84
|
+
color: string;
|
|
85
|
+
};
|
|
86
|
+
value: number;
|
|
87
|
+
startTime: number;
|
|
88
|
+
endTime: number;
|
|
89
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { D3StackedBarCategory, D3StackedBarDataPoint, TooltipData } from '../d3-stacked-bar-chart.types';
|
|
3
|
+
type UseD3StackedBarProps = {
|
|
4
|
+
containerRef: RefObject<SVGSVGElement | null>;
|
|
5
|
+
data: D3StackedBarDataPoint[];
|
|
6
|
+
categories: D3StackedBarCategory[];
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
margin: {
|
|
10
|
+
top: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
left: number;
|
|
14
|
+
};
|
|
15
|
+
timeRange?: [number, number];
|
|
16
|
+
showGrid?: boolean;
|
|
17
|
+
showXAxis?: boolean;
|
|
18
|
+
showYAxis?: boolean;
|
|
19
|
+
enableBrush?: boolean;
|
|
20
|
+
zoomToSelection?: boolean;
|
|
21
|
+
onTimeRangeChange?: (range: [number, number]) => void;
|
|
22
|
+
formatDate?: (timestamp: number) => string;
|
|
23
|
+
formatValue?: (value: number) => string;
|
|
24
|
+
showCrosshair?: boolean;
|
|
25
|
+
crosshairColor?: string;
|
|
26
|
+
crosshairDashArray?: string;
|
|
27
|
+
brushColor?: string;
|
|
28
|
+
onTooltipChange?: (tooltip: TooltipData | null) => void;
|
|
29
|
+
};
|
|
30
|
+
export declare const useD3StackedBar: ({ containerRef, data, categories, width, height, margin, timeRange, showGrid, showXAxis, showYAxis, enableBrush, zoomToSelection, onTimeRangeChange, formatDate, formatValue, showCrosshair, crosshairColor, crosshairDashArray, brushColor, onTooltipChange }: UseD3StackedBarProps) => void;
|
|
31
|
+
export {};
|
package/dist/components/stacked-area-with-timeline/hooks/use-stacked-area-with-timeline.hook.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { D3StackedAreaCategory } from '../../d3-stacked-area-chart/d3-stacked-area-chart.types';
|
|
3
3
|
import { HoveredData, HoveredMarker, HoveredTimelineEvent, StackedAreaDataPoint, TimelineEvent } from '../stacked-area-with-timeline.types';
|
|
4
|
-
|
|
4
|
+
type UseStackedAreaWithTimelineOptions = {
|
|
5
5
|
containerRef: RefObject<SVGSVGElement | null>;
|
|
6
6
|
data: StackedAreaDataPoint[];
|
|
7
7
|
categories: D3StackedAreaCategory[];
|
|
@@ -38,15 +38,16 @@ export type UseStackedAreaWithTimelineOptions = {
|
|
|
38
38
|
hoveredCategory?: string | null;
|
|
39
39
|
onTimelineEventHover?: (event: HoveredTimelineEvent) => void;
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
type VisibleMarker = {
|
|
42
42
|
timestamp: number;
|
|
43
43
|
label?: string;
|
|
44
44
|
color?: string;
|
|
45
45
|
x: number;
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
type UseStackedAreaWithTimelineResult = {
|
|
48
48
|
hoveredTimelineEvent: HoveredTimelineEvent;
|
|
49
49
|
hoveredMarker: HoveredMarker;
|
|
50
50
|
visibleMarkers: VisibleMarker[];
|
|
51
51
|
};
|
|
52
52
|
export declare const useStackedAreaWithTimeline: ({ containerRef, data, categories, width, height, margin, timelineEvents, showTimeline, timelineHeight, timelineOffset, timeRange, showGrid, showAxes, axisLabelColor, axisLabelSize, enableBrush, onTimeRangeChange, minAllowedTime, maxAllowedTime, brushColor, formatDate, formatValue, markers, onHoveredDataChange, hoveredCategory, onTimelineEventHover }: UseStackedAreaWithTimelineOptions) => UseStackedAreaWithTimelineResult;
|
|
53
|
+
export {};
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import { ScaleTime } from 'd3-scale';
|
|
2
2
|
import { Selection } from 'd3-selection';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
eventName: string;
|
|
6
|
-
color?: string;
|
|
7
|
-
};
|
|
8
|
-
export type HoveredTimelineEvent = {
|
|
9
|
-
timestamp: number;
|
|
10
|
-
eventName: string;
|
|
11
|
-
x: number;
|
|
12
|
-
} | null;
|
|
13
|
-
export type RenderTimelineTrackOptions = {
|
|
3
|
+
import { HoveredTimelineEvent, TimelineEvent } from '../stacked-area-with-timeline.types';
|
|
4
|
+
type RenderTimelineTrackOptions = {
|
|
14
5
|
/** D3 SVG selection */
|
|
15
6
|
svg: Selection<SVGSVGElement, unknown, null, undefined>;
|
|
16
7
|
/** Timeline events to display */
|
|
@@ -52,3 +43,4 @@ export type RenderTimelineTrackOptions = {
|
|
|
52
43
|
* - Double-click to reset to full time range
|
|
53
44
|
*/
|
|
54
45
|
export declare function renderTimelineTrack({ svg, events, xScale, chartHeight, chartWidth, timelineHeight, timelineOffset, instanceId, setHoveredTimelineEvent, enableBrush, onTimeRangeChange, minAllowedTime, maxAllowedTime, brushColor, mainGroupSelector }: RenderTimelineTrackOptions): void;
|
|
46
|
+
export {};
|