@recharts/devtools 0.0.7 → 0.0.9
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/annotations/AnnotationsController.d.ts +40 -0
- package/dist/annotations/AnnotationsController.js +241 -0
- package/dist/annotations/Blanket.d.ts +31 -0
- package/dist/annotations/Blanket.js +19 -0
- package/dist/annotations/CircleAnnotation.d.ts +15 -0
- package/dist/annotations/CircleAnnotation.js +32 -0
- package/dist/annotations/Crosshair.d.ts +23 -0
- package/dist/annotations/Crosshair.js +42 -0
- package/dist/annotations/FreeformLine.d.ts +15 -0
- package/dist/annotations/FreeformLine.js +35 -0
- package/dist/annotations/HorizontalLine.d.ts +15 -0
- package/dist/annotations/HorizontalLine.js +23 -0
- package/dist/annotations/LabelAnnotation.d.ts +23 -0
- package/dist/annotations/LabelAnnotation.js +41 -0
- package/dist/annotations/RectangleAnnotation.d.ts +15 -0
- package/dist/annotations/RectangleAnnotation.js +36 -0
- package/dist/annotations/RenderAnnotations.d.ts +31 -0
- package/dist/annotations/RenderAnnotations.js +114 -0
- package/dist/annotations/VerticalLine.d.ts +15 -0
- package/dist/annotations/VerticalLine.js +23 -0
- package/dist/annotations/annotationColors.d.ts +20 -0
- package/dist/annotations/annotationColors.js +34 -0
- package/dist/annotations/getDistance.d.ts +2 -0
- package/dist/annotations/getDistance.js +4 -0
- package/dist/annotations/index.d.ts +17 -0
- package/dist/annotations/index.js +17 -0
- package/dist/annotations/types.d.ts +38 -0
- package/dist/annotations/types.js +1 -0
- package/dist/annotations/useAnnotationsManager.d.ts +35 -0
- package/dist/annotations/useAnnotationsManager.js +136 -0
- package/dist/annotations/useSnap.d.ts +44 -0
- package/dist/annotations/useSnap.js +127 -0
- package/dist/components/RechartsAnnotations.d.ts +19 -0
- package/dist/components/RechartsAnnotations.js +38 -0
- package/dist/components/RechartsDevtools.d.ts +1 -1
- package/dist/components/RechartsDevtools.js +21 -15
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/context/RechartsDevtoolsContext.d.ts +5 -0
- package/dist/context/RechartsDevtoolsContext.js +10 -1
- package/dist/hooks/useWhyDidYouRender.d.ts +10 -0
- package/dist/hooks/useWhyDidYouRender.js +44 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +5 -2
- package/package.json +3 -3
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for snapping pixel coordinates to the nearest data point.
|
|
3
|
+
*
|
|
4
|
+
* This uses the Recharts scale hooks to convert between pixel and data coordinates,
|
|
5
|
+
* enabling "magnetic" annotation placement that snaps to actual data points.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This imports from 'recharts' using hooks that are not yet published.
|
|
8
|
+
* TypeScript/ESLint errors are expected until recharts 3.8 is released.
|
|
9
|
+
*
|
|
10
|
+
* The hook detects this by checking if the inverse scale returns a value that differs
|
|
11
|
+
* significantly from the pixel position when converted back. If the roundtrip produces
|
|
12
|
+
* a very different value, it indicates snapping occurred, and we use that. Otherwise,
|
|
13
|
+
* we keep the original coordinate for smooth freeform positioning.
|
|
14
|
+
*/
|
|
15
|
+
import { useCallback } from 'react';
|
|
16
|
+
import { getRelativeCoordinate, useXAxisInverseDataSnapScale, useYAxisInverseDataSnapScale, useXAxisInverseTickSnapScale, useYAxisInverseTickSnapScale, useXAxisScale, useYAxisScale, } from 'recharts';
|
|
17
|
+
/**
|
|
18
|
+
* Hook that provides a function to snap pixel coordinates to the nearest data point.
|
|
19
|
+
*
|
|
20
|
+
* When snap-to-data is enabled, this will:
|
|
21
|
+
* 1. Convert pixel coordinates to data values using inverse scale
|
|
22
|
+
* 2. Find the closest data point in the domain (categories)
|
|
23
|
+
* 3. Convert back to pixel coordinates for display
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* const snapToData = useSnapToData({ enabled: true });
|
|
28
|
+
*
|
|
29
|
+
* const handleMouseMove = (x: number, y: number) => {
|
|
30
|
+
* const snapped = snapToData(x, y);
|
|
31
|
+
* setPosition({ x: snapped.x, y: snapped.y });
|
|
32
|
+
* };
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export function useSnap(snapMode) {
|
|
36
|
+
// Get inverse scale functions for converting pixels -> data
|
|
37
|
+
const xInverseDataSnapScale = useXAxisInverseDataSnapScale();
|
|
38
|
+
const yInverseDataSnapScale = useYAxisInverseDataSnapScale();
|
|
39
|
+
const xInverseTickSnapScale = useXAxisInverseTickSnapScale();
|
|
40
|
+
const yInverseTickSnapScale = useYAxisInverseTickSnapScale();
|
|
41
|
+
// And forward scales for data -> pixels
|
|
42
|
+
const scaleX = useXAxisScale();
|
|
43
|
+
const scaleY = useYAxisScale();
|
|
44
|
+
return useCallback((e) => {
|
|
45
|
+
if (xInverseDataSnapScale == null ||
|
|
46
|
+
yInverseDataSnapScale == null ||
|
|
47
|
+
xInverseTickSnapScale == null ||
|
|
48
|
+
yInverseTickSnapScale == null ||
|
|
49
|
+
scaleX == null ||
|
|
50
|
+
scaleY == null) {
|
|
51
|
+
/*
|
|
52
|
+
* Scales not available yet (e.g., outside of chart context, or chart not fully initialized)
|
|
53
|
+
* Just return zeroes to avoid errors
|
|
54
|
+
*/
|
|
55
|
+
return {
|
|
56
|
+
interactionCoordinate: { x: 0, y: 0 },
|
|
57
|
+
snappedCoordinate: undefined,
|
|
58
|
+
dataPoint: undefined,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/*
|
|
62
|
+
* Here we get pixel coordinates relative to the chart area (accounting for transforms)
|
|
63
|
+
* These are exact mouse interaction coordinates.
|
|
64
|
+
* Next, we need to "snap" these to the nearest data point if snapMode is enabled.
|
|
65
|
+
*/
|
|
66
|
+
const interactionCoordinate = getRelativeCoordinate(e);
|
|
67
|
+
let snappedDataPoint = undefined;
|
|
68
|
+
if (snapMode === 'data') {
|
|
69
|
+
snappedDataPoint = {
|
|
70
|
+
x: xInverseDataSnapScale(interactionCoordinate.relativeX),
|
|
71
|
+
y: yInverseDataSnapScale(interactionCoordinate.relativeY),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
else if (snapMode === 'tick') {
|
|
75
|
+
snappedDataPoint = {
|
|
76
|
+
x: xInverseTickSnapScale(interactionCoordinate.relativeX),
|
|
77
|
+
y: yInverseTickSnapScale(interactionCoordinate.relativeY),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (snappedDataPoint == null) {
|
|
81
|
+
// If snapping failed for some reason, just return the original interaction coordinates
|
|
82
|
+
return {
|
|
83
|
+
interactionCoordinate: {
|
|
84
|
+
x: interactionCoordinate.relativeX,
|
|
85
|
+
y: interactionCoordinate.relativeY,
|
|
86
|
+
},
|
|
87
|
+
snappedCoordinate: undefined,
|
|
88
|
+
dataPoint: undefined,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/*
|
|
92
|
+
* Converts snapped data point back to pixel coordinates.
|
|
93
|
+
* Some components will read the snapped data point to display values, while others will use the snapped pixel coordinates for positioning.
|
|
94
|
+
* We return here both the snapped data point (for display) and the snapped pixel coordinates (for positioning) for convenience.
|
|
95
|
+
* If you are using ReferenceLine/ReferenceDot, you can skip this step and use the snappedDataPoint directly.
|
|
96
|
+
*/
|
|
97
|
+
const snappedX = scaleX(snappedDataPoint.x);
|
|
98
|
+
const snappedY = scaleY(snappedDataPoint.y);
|
|
99
|
+
if (snappedX == null || snappedY == null) {
|
|
100
|
+
// If the snapped data point is outside the chart area, just return the original interaction coordinates
|
|
101
|
+
return {
|
|
102
|
+
interactionCoordinate: {
|
|
103
|
+
x: interactionCoordinate.relativeX,
|
|
104
|
+
y: interactionCoordinate.relativeY,
|
|
105
|
+
},
|
|
106
|
+
snappedCoordinate: undefined,
|
|
107
|
+
dataPoint: undefined,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
interactionCoordinate: {
|
|
112
|
+
x: interactionCoordinate.relativeX,
|
|
113
|
+
y: interactionCoordinate.relativeY,
|
|
114
|
+
},
|
|
115
|
+
snappedCoordinate: { x: snappedX, y: snappedY },
|
|
116
|
+
dataPoint: snappedDataPoint,
|
|
117
|
+
};
|
|
118
|
+
}, [
|
|
119
|
+
snapMode,
|
|
120
|
+
xInverseDataSnapScale,
|
|
121
|
+
yInverseDataSnapScale,
|
|
122
|
+
xInverseTickSnapScale,
|
|
123
|
+
yInverseTickSnapScale,
|
|
124
|
+
scaleX,
|
|
125
|
+
scaleY,
|
|
126
|
+
]);
|
|
127
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileOverview RechartsAnnotations component for adding interactive annotations to charts.
|
|
3
|
+
*
|
|
4
|
+
* This component follows the same pattern as RechartsDevtools:
|
|
5
|
+
* - Renders SVG overlays directly in the chart context
|
|
6
|
+
* - Uses a portal to render the UI controls in an external container
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <AreaChart data={data}>
|
|
11
|
+
* <XAxis dataKey="name" />
|
|
12
|
+
* <YAxis />
|
|
13
|
+
* <Area dataKey="value" />
|
|
14
|
+
* <RechartsAnnotations />
|
|
15
|
+
* </AreaChart>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import React from 'react';
|
|
19
|
+
export declare const RechartsAnnotations: () => React.JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileOverview RechartsAnnotations component for adding interactive annotations to charts.
|
|
3
|
+
*
|
|
4
|
+
* This component follows the same pattern as RechartsDevtools:
|
|
5
|
+
* - Renders SVG overlays directly in the chart context
|
|
6
|
+
* - Uses a portal to render the UI controls in an external container
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <AreaChart data={data}>
|
|
11
|
+
* <XAxis dataKey="name" />
|
|
12
|
+
* <YAxis />
|
|
13
|
+
* <Area dataKey="value" />
|
|
14
|
+
* <RechartsAnnotations />
|
|
15
|
+
* </AreaChart>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { createPortal } from 'react-dom';
|
|
20
|
+
import { RECHARTS_ANNOTATIONS_PORTAL_ID } from '../constants.js';
|
|
21
|
+
import { useRechartsDevtoolsContext } from '../context/RechartsDevtoolsContext.js';
|
|
22
|
+
import { AnnotationsController, RenderAnnotations, useAnnotationsManager } from '../annotations/index.js';
|
|
23
|
+
export const RechartsAnnotations = () => {
|
|
24
|
+
const contextId = useRechartsDevtoolsContext();
|
|
25
|
+
// Use annotations-specific portal ID, falling back to global constant
|
|
26
|
+
const portalId = contextId ? `${contextId}-annotations` : RECHARTS_ANNOTATIONS_PORTAL_ID;
|
|
27
|
+
const [container, setContainer] = React.useState(null);
|
|
28
|
+
const annotationsManager = useAnnotationsManager();
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
const el = document.getElementById(portalId);
|
|
31
|
+
setContainer(el);
|
|
32
|
+
}, [portalId]);
|
|
33
|
+
return (React.createElement(React.Fragment, null,
|
|
34
|
+
React.createElement(RenderAnnotations, { annotations: annotationsManager.annotations, isAdding: annotationsManager.isAdding, followerPosition: annotationsManager.followerPosition, firstClickPosition: annotationsManager.firstClickPosition, snapMode: annotationsManager.snapMode, onChartClick: annotationsManager.onChartClick, onChartMouseDown: annotationsManager.onChartMouseDown, onChartMouseUp: annotationsManager.onChartMouseUp, onChartMouseMove: annotationsManager.onChartMouseMove, onChartMouseLeave: annotationsManager.onChartMouseLeave }),
|
|
35
|
+
container &&
|
|
36
|
+
createPortal(React.createElement("div", { className: "recharts-annotations", style: { fontFamily: 'monospace', fontSize: '12px' } },
|
|
37
|
+
React.createElement(AnnotationsController, { annotations: annotationsManager.annotations, isAdding: annotationsManager.isAdding, selectedAnnotationId: annotationsManager.selectedAnnotationId, snapMode: annotationsManager.snapMode, onStartAdding: annotationsManager.startAddingAnnotation, onCancelAdding: annotationsManager.cancelAddingAnnotation, onDeleteAnnotation: annotationsManager.deleteAnnotation, onUpdateAnnotation: annotationsManager.updateAnnotation, onSelectAnnotation: annotationsManager.selectAnnotation, onSnapModeChange: annotationsManager.setSnapMode })), container)));
|
|
38
|
+
};
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { InspectorDef } from '../types.js';
|
|
3
3
|
declare const INSPECTORS: Record<string, InspectorDef>;
|
|
4
4
|
export type InspectorKey = keyof typeof INSPECTORS;
|
|
5
|
-
export declare const RechartsDevtools: () => React.JSX.Element
|
|
5
|
+
export declare const RechartsDevtools: () => React.JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -11,6 +11,7 @@ import { YAxisDomainInspector } from '../inspectors/YAxisDomainInspector.js';
|
|
|
11
11
|
import { ActiveTooltipLabelInspector } from '../inspectors/ActiveTooltipLabelInspector.js';
|
|
12
12
|
import { useSessionStorageState } from '../hooks/useSessionStorageState.js';
|
|
13
13
|
import { useRechartsDevtoolsContext } from '../context/RechartsDevtoolsContext.js';
|
|
14
|
+
import { RechartsAnnotations } from './RechartsAnnotations.js';
|
|
14
15
|
const INSPECTORS = {
|
|
15
16
|
'useChartWidth | useChartHeight': ChartDimensionInspector,
|
|
16
17
|
useMargin: MarginInspector,
|
|
@@ -48,21 +49,26 @@ export const RechartsDevtools = () => {
|
|
|
48
49
|
}
|
|
49
50
|
}, [portalId, setSelectedInspectorId]);
|
|
50
51
|
const [isOverlayEnabled, setIsOverlayEnabled] = useSessionStorageState('rechartsDevtoolsOverlayEnabled', false);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
const { Inspector, Overlay } = selectedInspector;
|
|
52
|
+
const Inspector = selectedInspector?.Inspector;
|
|
53
|
+
const Overlay = selectedInspector?.Overlay;
|
|
55
54
|
return (React.createElement(React.Fragment, null,
|
|
56
55
|
Overlay && isOverlayEnabled && React.createElement(Overlay, null),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
container &&
|
|
57
|
+
selectedInspector &&
|
|
58
|
+
createPortal(React.createElement("div", { className: "recharts-devtools", style: { fontFamily: 'monospace', fontSize: '12px' } },
|
|
59
|
+
React.createElement("div", { style: {
|
|
60
|
+
marginBottom: '10px',
|
|
61
|
+
paddingBottom: '10px',
|
|
62
|
+
borderBottom: '1px solid #ccc',
|
|
63
|
+
} },
|
|
64
|
+
React.createElement("div", { style: { display: 'flex', alignItems: 'center', marginBottom: '4px', gap: '8px' } },
|
|
65
|
+
React.createElement("label", null, "Inspect Hook:"),
|
|
66
|
+
React.createElement("select", { value: selectedInspectorId, onChange: (e) => setSelectedInspectorId(e.target.value), style: { padding: '4px' } }, Object.keys(INSPECTORS).map((key) => (React.createElement("option", { key: key, value: key }, key)))),
|
|
67
|
+
Overlay && (React.createElement("div", { style: { marginTop: '4px' } },
|
|
68
|
+
React.createElement("label", { style: { cursor: 'pointer', display: 'flex', alignItems: 'center' } },
|
|
69
|
+
React.createElement("input", { type: "checkbox", checked: isOverlayEnabled, onChange: (e) => setIsOverlayEnabled(e.target.checked), style: { marginRight: '4px' } }),
|
|
70
|
+
"Show Overlay on chart"))))),
|
|
71
|
+
React.createElement("div", { style: { padding: '10px 0' } },
|
|
72
|
+
React.createElement(Inspector, null))), container),
|
|
73
|
+
React.createElement(RechartsAnnotations, null)));
|
|
68
74
|
};
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -8,4 +8,9 @@ export declare const useRechartsDevtoolsContext: () => string | null;
|
|
|
8
8
|
export declare const RechartsDevtoolsPortal: React.FC<React.HTMLAttributes<HTMLDivElement> & {
|
|
9
9
|
initialTab?: InspectorKey;
|
|
10
10
|
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Portal container for annotations UI.
|
|
13
|
+
* Place this component where you want the annotations controller to render.
|
|
14
|
+
*/
|
|
15
|
+
export declare const RechartsAnnotationsPortal: React.FC<React.HTMLAttributes<HTMLDivElement>>;
|
|
11
16
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { createContext, useContext, useId } from 'react';
|
|
2
|
-
import { RECHARTS_DEVTOOLS_PORTAL_ID } from '../constants.js';
|
|
2
|
+
import { RECHARTS_DEVTOOLS_PORTAL_ID, RECHARTS_ANNOTATIONS_PORTAL_ID } from '../constants.js';
|
|
3
3
|
const Context = createContext(null);
|
|
4
4
|
export const RechartsDevtoolsContext = ({ children }) => {
|
|
5
5
|
// Generate a unique ID for this instance.
|
|
@@ -17,3 +17,12 @@ export const RechartsDevtoolsPortal = ({ initialTab, ...props }) => {
|
|
|
17
17
|
const id = contextId ?? RECHARTS_DEVTOOLS_PORTAL_ID;
|
|
18
18
|
return React.createElement("div", { id: id, "data-initial-tab": initialTab, ...props });
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Portal container for annotations UI.
|
|
22
|
+
* Place this component where you want the annotations controller to render.
|
|
23
|
+
*/
|
|
24
|
+
export const RechartsAnnotationsPortal = (props) => {
|
|
25
|
+
const contextId = useRechartsDevtoolsContext();
|
|
26
|
+
const id = contextId ? `${contextId}-annotations` : RECHARTS_ANNOTATIONS_PORTAL_ID;
|
|
27
|
+
return React.createElement("div", { id: id, ...props });
|
|
28
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This hook is used to log component re-renders in development mode.
|
|
3
|
+
* It is useful for debugging performance issues and understanding why a component is re-rendering.
|
|
4
|
+
* It should only be used in development mode and not in production.
|
|
5
|
+
* @param componentName The name of the component to log
|
|
6
|
+
* @param props The props of the component
|
|
7
|
+
* @param hooks Optional hooks or other properties to observe for changes
|
|
8
|
+
* @returns void
|
|
9
|
+
*/
|
|
10
|
+
export declare function useWhyDidYouRender<T extends Record<string, any>>(componentName: string, props: T, hooks?: Record<string, any>): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* This hook is used to log component re-renders in development mode.
|
|
4
|
+
* It is useful for debugging performance issues and understanding why a component is re-rendering.
|
|
5
|
+
* It should only be used in development mode and not in production.
|
|
6
|
+
* @param componentName The name of the component to log
|
|
7
|
+
* @param props The props of the component
|
|
8
|
+
* @param hooks Optional hooks or other properties to observe for changes
|
|
9
|
+
* @returns void
|
|
10
|
+
*/
|
|
11
|
+
export function useWhyDidYouRender(componentName, props, hooks) {
|
|
12
|
+
const previousProps = useRef();
|
|
13
|
+
const previousHooks = useRef();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const allProps = { ...props, ...hooks };
|
|
16
|
+
if (previousProps.current) {
|
|
17
|
+
const previousAllProps = { ...previousProps.current, ...previousHooks.current };
|
|
18
|
+
const allKeys = Object.keys({ ...allProps, ...previousAllProps });
|
|
19
|
+
const changesObj = {};
|
|
20
|
+
allKeys.forEach((key) => {
|
|
21
|
+
if (previousAllProps[key] !== allProps[key]) {
|
|
22
|
+
changesObj[key] = {
|
|
23
|
+
from: previousAllProps[key],
|
|
24
|
+
to: allProps[key],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const changedKeys = Object.keys(changesObj);
|
|
29
|
+
if (changedKeys.length) {
|
|
30
|
+
const prev = Object.fromEntries(changedKeys.map((key) => [key, previousAllProps[key]]));
|
|
31
|
+
const curr = Object.fromEntries(changedKeys.map((key) => [key, allProps[key]]));
|
|
32
|
+
console.log('[why-did-you-render?]', componentName, Object.keys(changesObj).join(', '), {
|
|
33
|
+
prev,
|
|
34
|
+
curr,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
console.log('[why-did-you-render?]', componentName, 'initial render', allProps);
|
|
40
|
+
}
|
|
41
|
+
previousProps.current = props;
|
|
42
|
+
previousHooks.current = hooks;
|
|
43
|
+
});
|
|
44
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,9 @@ export { between, random } from './random.js';
|
|
|
2
2
|
export { generateMockData } from './generateMockData.js';
|
|
3
3
|
export { generateMockMarketData } from './generateMockMarketData.js';
|
|
4
4
|
export { RechartsDevtools } from './components/RechartsDevtools.js';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
5
|
+
export { RechartsAnnotations } from './components/RechartsAnnotations.js';
|
|
6
|
+
export { RechartsDevtoolsPortal, RechartsAnnotationsPortal, RechartsDevtoolsContext, } from './context/RechartsDevtoolsContext.js';
|
|
7
|
+
export { RECHARTS_DEVTOOLS_PORTAL_ID, RECHARTS_ANNOTATIONS_PORTAL_ID } from './constants.js';
|
|
8
|
+
export type { Annotation, AnnotationType, AnnotationStyle, } from './annotations/types.js';
|
|
9
|
+
export { useAnnotationsManager } from './annotations/useAnnotationsManager.js';
|
|
10
|
+
export { useWhyDidYouRender } from './hooks/useWhyDidYouRender.js';
|
package/dist/index.js
CHANGED
|
@@ -2,5 +2,8 @@ export { between, random } from './random.js';
|
|
|
2
2
|
export { generateMockData } from './generateMockData.js';
|
|
3
3
|
export { generateMockMarketData } from './generateMockMarketData.js';
|
|
4
4
|
export { RechartsDevtools } from './components/RechartsDevtools.js';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
5
|
+
export { RechartsAnnotations } from './components/RechartsAnnotations.js';
|
|
6
|
+
export { RechartsDevtoolsPortal, RechartsAnnotationsPortal, RechartsDevtoolsContext, } from './context/RechartsDevtoolsContext.js';
|
|
7
|
+
export { RECHARTS_DEVTOOLS_PORTAL_ID, RECHARTS_ANNOTATIONS_PORTAL_ID } from './constants.js';
|
|
8
|
+
export { useAnnotationsManager } from './annotations/useAnnotationsManager.js';
|
|
9
|
+
export { useWhyDidYouRender } from './hooks/useWhyDidYouRender.js';
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.9",
|
|
8
8
|
"description": "Devtools and helper functions for Recharts",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"vitest": "^1.0.0",
|
|
43
43
|
"react": "^19.0.0",
|
|
44
44
|
"react-dom": "^19.0.0",
|
|
45
|
-
"recharts": "
|
|
45
|
+
"recharts": "^3.8.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": "^18.0.0 || ^19.0.0",
|
|
49
49
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
50
|
-
"recharts": "^3.
|
|
50
|
+
"recharts": "^3.8.0"
|
|
51
51
|
}
|
|
52
52
|
}
|