@dwlf/charting 1.0.0 → 1.1.1

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.
Files changed (50) hide show
  1. package/README.md +225 -19
  2. package/dist/charting/__tests__/chartSpec.test.d.ts +1 -0
  3. package/dist/charting/scales.d.ts +14 -0
  4. package/dist/charting/types.d.ts +454 -0
  5. package/dist/charting.css +1 -1
  6. package/dist/components/DWLFChart.d.ts +119 -0
  7. package/dist/components/index.d.ts +2 -0
  8. package/dist/components/overlays/AlertLineAnnotationView.d.ts +14 -0
  9. package/dist/components/overlays/AnnotationLayer.d.ts +55 -0
  10. package/dist/components/overlays/ArrowAnnotationView.d.ts +24 -0
  11. package/dist/components/overlays/BosLineAnnotationView.d.ts +22 -0
  12. package/dist/components/overlays/BrushAnnotationView.d.ts +20 -0
  13. package/dist/components/overlays/ChannelAnnotationView.d.ts +23 -0
  14. package/dist/components/overlays/CrossLineAnnotationView.d.ts +29 -0
  15. package/dist/components/overlays/DiagonalLineOverlay.d.ts +31 -0
  16. package/dist/components/overlays/EmojiAnnotationView.d.ts +22 -0
  17. package/dist/components/overlays/FairValueGapAnnotationView.d.ts +23 -0
  18. package/dist/components/overlays/FibExtensionAnnotationView.d.ts +19 -0
  19. package/dist/components/overlays/FibRetracementAnnotationView.d.ts +19 -0
  20. package/dist/components/overlays/HLineAnnotationView.d.ts +15 -0
  21. package/dist/components/overlays/HorizontalLineOverlay.d.ts +23 -0
  22. package/dist/components/overlays/MarkerOverlay.d.ts +66 -0
  23. package/dist/components/overlays/MeasureAnnotationView.d.ts +25 -0
  24. package/dist/components/overlays/MessageBubbleOverlay.d.ts +55 -0
  25. package/dist/components/overlays/OrderBlockAnnotationView.d.ts +23 -0
  26. package/dist/components/overlays/PitchforkAnnotationView.d.ts +19 -0
  27. package/dist/components/overlays/PositionOverlay.d.ts +52 -0
  28. package/dist/components/overlays/RayAnnotationView.d.ts +30 -0
  29. package/dist/components/overlays/RectangleAnnotationView.d.ts +23 -0
  30. package/dist/components/overlays/SMAOverlay.d.ts +20 -0
  31. package/dist/components/overlays/TextAnnotationView.d.ts +24 -0
  32. package/dist/components/overlays/TimeRangeAnnotationView.d.ts +22 -0
  33. package/dist/components/overlays/TrendLineAnnotationView.d.ts +23 -0
  34. package/dist/components/overlays/VLineAnnotationView.d.ts +26 -0
  35. package/dist/components/overlays/annotationConstants.d.ts +21 -0
  36. package/dist/components/overlays/annotationUtils.d.ts +13 -0
  37. package/dist/components/overlays/useAnnotationDrag.d.ts +18 -0
  38. package/dist/components/overlays/usePointAnnotationDrag.d.ts +23 -0
  39. package/dist/hooks/useCandlestickChart.d.ts +18 -0
  40. package/dist/hooks/useChartAnimations.d.ts +49 -0
  41. package/dist/hooks/useChartLayout.d.ts +12 -0
  42. package/dist/hooks/useChartPanZoom.d.ts +7 -0
  43. package/dist/hooks/useChartPanZoomVirtual.d.ts +24 -0
  44. package/dist/hooks/useContainerSize.d.ts +4 -0
  45. package/dist/hooks/useOverlayToggles.d.ts +19 -0
  46. package/dist/index.cjs +1 -1
  47. package/dist/index.d.ts +56 -0
  48. package/dist/index.js +13 -13
  49. package/dist/utils/indicators.d.ts +40 -0
  50. package/package.json +4 -1
@@ -0,0 +1,24 @@
1
+ import { default as React } from 'react';
2
+ import { ArrowAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface ArrowAnnotationViewProps {
4
+ annotation: ArrowAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<ArrowAnnotation>) => void;
13
+ /** Convert raw timestamp to index when compressGaps is enabled */
14
+ timeToIndex?: (time: number) => number | undefined;
15
+ /** Convert index back to raw timestamp when compressGaps is enabled */
16
+ indexToTime?: (index: number) => number;
17
+ /** Number of data points */
18
+ dataLength?: number;
19
+ /** Pre-computed compressed times array */
20
+ compressedTimes?: number[];
21
+ onDoubleClick?: (id: string) => void;
22
+ }
23
+ declare const ArrowAnnotationView: React.FC<ArrowAnnotationViewProps>;
24
+ export default ArrowAnnotationView;
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { BosLineAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface BosLineAnnotationViewProps {
4
+ annotation: BosLineAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onDoubleClick?: (id: string) => void;
13
+ onMove?: (id: string, newPrice: number) => void;
14
+ /** Convert raw timestamp to index when compressGaps is enabled */
15
+ timeToIndex?: (time: number) => number | undefined;
16
+ /** Number of data points */
17
+ dataLength?: number;
18
+ /** Pre-computed compressed times array */
19
+ compressedTimes?: number[];
20
+ }
21
+ declare const BosLineAnnotationView: React.FC<BosLineAnnotationViewProps>;
22
+ export default BosLineAnnotationView;
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ import { BrushAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface BrushAnnotationViewProps {
4
+ annotation: BrushAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ darkMode?: boolean;
8
+ selected?: boolean;
9
+ onSelect?: (id: string | null) => void;
10
+ onDoubleClick?: (id: string) => void;
11
+ onMove?: (id: string, update: Partial<BrushAnnotation>) => void;
12
+ /** Convert raw timestamp to index when compressGaps is enabled */
13
+ timeToIndex?: (time: number) => number | undefined;
14
+ /** Convert index back to raw timestamp when compressGaps is enabled */
15
+ indexToTime?: (index: number) => number;
16
+ /** Pre-computed compressed times array */
17
+ compressedTimes?: number[];
18
+ }
19
+ declare const BrushAnnotationView: React.FC<BrushAnnotationViewProps>;
20
+ export default BrushAnnotationView;
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ import { ChannelAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface ChannelAnnotationViewProps {
4
+ annotation: ChannelAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<ChannelAnnotation>) => void;
13
+ /** Convert raw timestamp to index when compressGaps is enabled */
14
+ timeToIndex?: (time: number) => number | undefined;
15
+ /** Convert index back to raw timestamp when compressGaps is enabled */
16
+ indexToTime?: (index: number) => number;
17
+ /** Number of data points */
18
+ dataLength?: number;
19
+ /** Pre-computed compressed times array */
20
+ compressedTimes?: number[];
21
+ }
22
+ declare const ChannelAnnotationView: React.FC<ChannelAnnotationViewProps>;
23
+ export default ChannelAnnotationView;
@@ -0,0 +1,29 @@
1
+ import { default as React } from 'react';
2
+ import { CrossLineAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface CrossLineAnnotationViewProps {
4
+ annotation: CrossLineAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, newTime: number, newPrice: number) => void;
13
+ /** Convert raw timestamp to index when compressGaps is enabled */
14
+ timeToIndex?: (time: number) => number | undefined;
15
+ /** Convert index back to raw timestamp when compressGaps is enabled */
16
+ indexToTime?: (index: number) => number;
17
+ /** Number of data points */
18
+ dataLength?: number;
19
+ /** Pre-computed compressed times array */
20
+ compressedTimes?: number[];
21
+ /** Custom time formatter (defaults to MM/DD HH:MM) */
22
+ timeFormatter?: (t: number) => string;
23
+ }
24
+ /**
25
+ * Cross Line annotation — draws a horizontal + vertical line intersection
26
+ * at a single (time, price) point, showing both price and date.
27
+ */
28
+ declare const CrossLineAnnotationView: React.FC<CrossLineAnnotationViewProps>;
29
+ export default CrossLineAnnotationView;
@@ -0,0 +1,31 @@
1
+ export default DiagonalLineOverlay;
2
+ /**
3
+ * DiagonalLineOverlay
4
+ * Draws a straight line from (start.date, start.value) to (end.date, end.value).
5
+ *
6
+ * @param {Object} props
7
+ * @param {{ date: string | Date, value: number }} props.start - Start position
8
+ * @param {{ date: string | Date, value: number }} props.end - End position
9
+ * @param {Function} props.xScale - D3 time scale (date -> px)
10
+ * @param {Function} props.yScale - D3 linear scale (price -> px)
11
+ * @param {number} props.xBandwidth - Width of one candlestick band (used to center the line on the candle)
12
+ * @param {string} [props.stroke='purple'] - Line color
13
+ * @param {number} [props.strokeWidth=1.5] - Line thickness
14
+ * @param {string} [props.strokeDasharray] - Dash pattern (e.g., '5,5' for dashed)
15
+ */
16
+ declare function DiagonalLineOverlay({ start, end, xScale, yScale, xBandwidth, stroke, strokeWidth, strokeDasharray, }: {
17
+ start: {
18
+ date: string | Date;
19
+ value: number;
20
+ };
21
+ end: {
22
+ date: string | Date;
23
+ value: number;
24
+ };
25
+ xScale: Function;
26
+ yScale: Function;
27
+ xBandwidth: number;
28
+ stroke?: string | undefined;
29
+ strokeWidth?: number | undefined;
30
+ strokeDasharray?: string | undefined;
31
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { EmojiAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface EmojiAnnotationViewProps {
4
+ annotation: EmojiAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ paneHeight: number;
8
+ darkMode?: boolean;
9
+ selected?: boolean;
10
+ onSelect?: (id: string | null) => void;
11
+ onMove?: (id: string, newTime: number, newPrice: number) => void;
12
+ /** Convert raw timestamp to index when compressGaps is enabled */
13
+ timeToIndex?: (time: number) => number | undefined;
14
+ /** Convert index back to raw timestamp when compressGaps is enabled */
15
+ indexToTime?: (index: number) => number;
16
+ /** Number of data points (required for closest index search when compressGaps enabled) */
17
+ dataLength?: number;
18
+ /** Precomputed array of raw timestamps for each compressed index */
19
+ compressedTimes?: number[];
20
+ }
21
+ declare const EmojiAnnotationView: React.FC<EmojiAnnotationViewProps>;
22
+ export default EmojiAnnotationView;
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ import { FairValueGapAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface FairValueGapAnnotationViewProps {
4
+ annotation: FairValueGapAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<FairValueGapAnnotation>) => void;
13
+ /** Convert raw timestamp to index when compressGaps is enabled */
14
+ timeToIndex?: (time: number) => number | undefined;
15
+ /** Convert index back to raw timestamp when compressGaps is enabled */
16
+ indexToTime?: (index: number) => number;
17
+ /** Number of data points */
18
+ dataLength?: number;
19
+ /** Pre-computed compressed times array */
20
+ compressedTimes?: number[];
21
+ }
22
+ declare const FairValueGapAnnotationView: React.FC<FairValueGapAnnotationViewProps>;
23
+ export default FairValueGapAnnotationView;
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+ import { FibExtensionAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface FibExtensionAnnotationViewProps {
4
+ annotation: FibExtensionAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<FibExtensionAnnotation>) => void;
13
+ timeToIndex?: (time: number) => number | undefined;
14
+ indexToTime?: (index: number) => number;
15
+ dataLength?: number;
16
+ compressedTimes?: number[];
17
+ }
18
+ declare const FibExtensionAnnotationView: React.FC<FibExtensionAnnotationViewProps>;
19
+ export default FibExtensionAnnotationView;
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+ import { FibRetracementAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface FibRetracementAnnotationViewProps {
4
+ annotation: FibRetracementAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<FibRetracementAnnotation>) => void;
13
+ timeToIndex?: (time: number) => number | undefined;
14
+ indexToTime?: (index: number) => number;
15
+ dataLength?: number;
16
+ compressedTimes?: number[];
17
+ }
18
+ declare const FibRetracementAnnotationView: React.FC<FibRetracementAnnotationViewProps>;
19
+ export default FibRetracementAnnotationView;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ import { HLineAnnotation, PaneComputedScale } from '../../charting/types';
3
+ export interface HLineAnnotationViewProps {
4
+ annotation: HLineAnnotation;
5
+ yScale: PaneComputedScale;
6
+ chartWidth: number;
7
+ paneHeight: number;
8
+ darkMode?: boolean;
9
+ selected?: boolean;
10
+ onSelect?: (id: string | null) => void;
11
+ onDoubleClick?: (id: string) => void;
12
+ onMove?: (id: string, newPrice: number) => void;
13
+ }
14
+ declare const HLineAnnotationView: React.FC<HLineAnnotationViewProps>;
15
+ export default HLineAnnotationView;
@@ -0,0 +1,23 @@
1
+ export default HorizontalLineOverlay;
2
+ /**
3
+ * HorizontalLineOverlay
4
+ * @param {Object} props
5
+ * @param {number} props.value - The price level to draw the horizontal line at
6
+ * @param {Function} props.yScale - D3 scale for y-axis (value -> px)
7
+ * @param {number} props.width - Width of the chart area
8
+ * @param {string} [props.stroke='red'] - Line color
9
+ * @param {number} [props.strokeWidth=1.5] - Line thickness
10
+ * @param {string} [props.strokeDasharray] - Dash pattern (e.g., '5,5' for dashed line)
11
+ * @param {string} [props.label] - Optional label to display
12
+ * @param {boolean} [props.showLabel=true] - Whether to show the label
13
+ */
14
+ declare function HorizontalLineOverlay({ value, yScale, width, stroke, strokeWidth, strokeDasharray, label, showLabel }: {
15
+ value: number;
16
+ yScale: Function;
17
+ width: number;
18
+ stroke?: string | undefined;
19
+ strokeWidth?: number | undefined;
20
+ strokeDasharray?: string | undefined;
21
+ label?: string | undefined;
22
+ showLabel?: boolean | undefined;
23
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,66 @@
1
+ import { default as PropTypes } from 'prop-types';
2
+ /**
3
+ * MarkerOverlay renders symbols (arrows, circles, etc.) at specific date/price points on the chart.
4
+ *
5
+ * props:
6
+ * - points : Array<{ date: string | Date, price: number, tooltip?: string }>
7
+ * - xScale : d3 scaleTime – maps dates => x coord
8
+ * - yScale : d3 scaleLinear – maps prices => y coord
9
+ * - xBandwidth : number – candle width, used to centre markers over candlesticks
10
+ * - shape : 'arrow-up' | 'arrow-down' | 'circle' | 'none'
11
+ * - size : number – base size of the marker in px
12
+ * - color : string – fill / stroke colour
13
+ * - offsetY : number – Y-offset in px to fine-tune vertical placement (positive => down)
14
+ * - text : string – optional text label for the marker
15
+ * - fontSize : number – optional font size for the text label
16
+ * - textColor : string – optional text color for the label
17
+ * - textOffsetY : number – optional Y-offset for the text label
18
+ * - onMarkerClick : function – optional click handler (receives point data)
19
+ * - animationPhase : string – current animation phase for drop-in effects
20
+ * - staggerDelay : number – delay in ms between each marker animation
21
+ * - staggerStartIndex : number – base index offset for staggered animation
22
+ */
23
+ declare function MarkerOverlay({ points, xScale, yScale, xBandwidth, shape, size, color, offsetY, text, fontSize, textColor, textOffsetY, onMarkerClick, animationPhase, staggerDelay, staggerStartIndex, }: {
24
+ points?: never[] | undefined;
25
+ xScale: any;
26
+ yScale: any;
27
+ xBandwidth?: number | undefined;
28
+ shape?: string | undefined;
29
+ size?: number | undefined;
30
+ color?: string | undefined;
31
+ offsetY?: number | undefined;
32
+ text: any;
33
+ fontSize?: number | undefined;
34
+ textColor?: any;
35
+ textOffsetY?: number | undefined;
36
+ onMarkerClick: any;
37
+ animationPhase: any;
38
+ staggerDelay?: number | undefined;
39
+ staggerStartIndex?: number | undefined;
40
+ }): import("react/jsx-runtime").JSX.Element | null;
41
+ declare namespace MarkerOverlay {
42
+ namespace propTypes {
43
+ let points: PropTypes.Requireable<(PropTypes.InferProps<{
44
+ date: PropTypes.Validator<NonNullable<NonNullable<string | number | Date | null | undefined>>>;
45
+ price: PropTypes.Validator<number>;
46
+ text: PropTypes.Requireable<string>;
47
+ tooltip: PropTypes.Requireable<string>;
48
+ }> | null | undefined)[]>;
49
+ let xScale: PropTypes.Validator<(...args: any[]) => any>;
50
+ let yScale: PropTypes.Validator<(...args: any[]) => any>;
51
+ let xBandwidth: PropTypes.Requireable<number>;
52
+ let shape: PropTypes.Requireable<string>;
53
+ let size: PropTypes.Requireable<number>;
54
+ let color: PropTypes.Requireable<string>;
55
+ let offsetY: PropTypes.Requireable<number>;
56
+ let text: PropTypes.Requireable<string>;
57
+ let fontSize: PropTypes.Requireable<number>;
58
+ let textColor: PropTypes.Requireable<string>;
59
+ let textOffsetY: PropTypes.Requireable<number>;
60
+ let onMarkerClick: PropTypes.Requireable<(...args: any[]) => any>;
61
+ let animationPhase: PropTypes.Requireable<string>;
62
+ let staggerDelay: PropTypes.Requireable<number>;
63
+ let staggerStartIndex: PropTypes.Requireable<number>;
64
+ }
65
+ }
66
+ export default MarkerOverlay;
@@ -0,0 +1,25 @@
1
+ import { default as React } from 'react';
2
+ import { MeasureAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface MeasureAnnotationViewProps {
4
+ annotation: MeasureAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<MeasureAnnotation>) => void;
13
+ /** Current chart timeframe for bar count estimation */
14
+ currentTimeframe?: string;
15
+ /** Convert raw timestamp to index when compressGaps is enabled */
16
+ timeToIndex?: (time: number) => number | undefined;
17
+ /** Convert index back to raw timestamp when compressGaps is enabled */
18
+ indexToTime?: (index: number) => number;
19
+ /** Number of data points */
20
+ dataLength?: number;
21
+ /** Pre-computed compressed times array */
22
+ compressedTimes?: number[];
23
+ }
24
+ declare const MeasureAnnotationView: React.FC<MeasureAnnotationViewProps>;
25
+ export default MeasureAnnotationView;
@@ -0,0 +1,55 @@
1
+ import { default as PropTypes } from 'prop-types';
2
+ /**
3
+ * MessageBubbleOverlay
4
+ * Renders text bubbles that optionally point at a specific candle (date / price).
5
+ *
6
+ * props:
7
+ * - messages : Array<{
8
+ * date: string | Date,
9
+ * price: number,
10
+ * text: string,
11
+ * }>
12
+ * - xScale : d3 scaleTime – maps dates => x coord
13
+ * - yScale : d3 scaleLinear – maps prices => y coord
14
+ * - xBandwidth : number – candle width, used to centre pointer over candlesticks
15
+ * - chartWidth : number – inner drawing width of the chart (excluding margins)
16
+ * - chartHeight : number – inner drawing height of the chart (excluding margins)
17
+ * - bubbleColor : string – background colour of the bubble
18
+ * - textColor : string – colour of the text inside the bubble
19
+ * - fontSize : number – font size of the text
20
+ * - pointer : boolean – whether to draw a pointer/line towards the candle (default true)
21
+ * - padding : number – inner padding of the text inside the bubble (in px)
22
+ */
23
+ declare function MessageBubbleOverlay({ messages, xScale, yScale, xBandwidth, chartWidth, chartHeight, bubbleColor, textColor, fontSize, pointer, padding, }: {
24
+ messages?: never[] | undefined;
25
+ xScale: any;
26
+ yScale: any;
27
+ xBandwidth?: number | undefined;
28
+ chartWidth: any;
29
+ chartHeight: any;
30
+ bubbleColor?: string | undefined;
31
+ textColor?: string | undefined;
32
+ fontSize?: number | undefined;
33
+ pointer?: boolean | undefined;
34
+ padding?: number | undefined;
35
+ }): import("react/jsx-runtime").JSX.Element | null;
36
+ declare namespace MessageBubbleOverlay {
37
+ namespace propTypes {
38
+ let messages: PropTypes.Requireable<(PropTypes.InferProps<{
39
+ date: PropTypes.Validator<NonNullable<NonNullable<string | number | Date | null | undefined>>>;
40
+ price: PropTypes.Validator<number>;
41
+ text: PropTypes.Validator<string>;
42
+ }> | null | undefined)[]>;
43
+ let xScale: PropTypes.Validator<(...args: any[]) => any>;
44
+ let yScale: PropTypes.Validator<(...args: any[]) => any>;
45
+ let xBandwidth: PropTypes.Requireable<number>;
46
+ let chartWidth: PropTypes.Validator<number>;
47
+ let chartHeight: PropTypes.Validator<number>;
48
+ let bubbleColor: PropTypes.Requireable<string>;
49
+ let textColor: PropTypes.Requireable<string>;
50
+ let fontSize: PropTypes.Requireable<number>;
51
+ let pointer: PropTypes.Requireable<boolean>;
52
+ let padding: PropTypes.Requireable<number>;
53
+ }
54
+ }
55
+ export default MessageBubbleOverlay;
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ import { OrderBlockAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface OrderBlockAnnotationViewProps {
4
+ annotation: OrderBlockAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<OrderBlockAnnotation>) => void;
13
+ /** Convert raw timestamp to index when compressGaps is enabled */
14
+ timeToIndex?: (time: number) => number | undefined;
15
+ /** Convert index back to raw timestamp when compressGaps is enabled */
16
+ indexToTime?: (index: number) => number;
17
+ /** Number of data points */
18
+ dataLength?: number;
19
+ /** Pre-computed compressed times array */
20
+ compressedTimes?: number[];
21
+ }
22
+ declare const OrderBlockAnnotationView: React.FC<OrderBlockAnnotationViewProps>;
23
+ export default OrderBlockAnnotationView;
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+ import { PitchforkAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface PitchforkAnnotationViewProps {
4
+ annotation: PitchforkAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<PitchforkAnnotation>) => void;
13
+ timeToIndex?: (time: number) => number | undefined;
14
+ indexToTime?: (index: number) => number;
15
+ dataLength?: number;
16
+ compressedTimes?: number[];
17
+ }
18
+ declare const PitchforkAnnotationView: React.FC<PitchforkAnnotationViewProps>;
19
+ export default PitchforkAnnotationView;
@@ -0,0 +1,52 @@
1
+ import { default as PropTypes } from 'prop-types';
2
+ /**
3
+ * PositionOverlay draws two semi-transparent rectangles to visualise
4
+ * risk (entry ⇒ stop-loss) and reward (entry ⇒ take-profit).
5
+ */
6
+ declare function PositionOverlay({ startDate, endDate, entryPrice, stopPrice, takePrice, xScale, yScale, riskColor, rewardColor, messages, xBandwidth, chartWidth, chartHeight, bubbleColor, textColor, fontSize, pointer, padding, }: {
7
+ startDate: any;
8
+ endDate: any;
9
+ entryPrice: any;
10
+ stopPrice: any;
11
+ takePrice: any;
12
+ xScale: any;
13
+ yScale: any;
14
+ riskColor?: string | undefined;
15
+ rewardColor?: string | undefined;
16
+ messages?: never[] | undefined;
17
+ xBandwidth?: number | undefined;
18
+ chartWidth: any;
19
+ chartHeight: any;
20
+ bubbleColor?: string | undefined;
21
+ textColor?: string | undefined;
22
+ fontSize?: number | undefined;
23
+ pointer?: boolean | undefined;
24
+ padding?: number | undefined;
25
+ }): import("react/jsx-runtime").JSX.Element | null;
26
+ declare namespace PositionOverlay {
27
+ namespace propTypes {
28
+ let startDate: PropTypes.Validator<NonNullable<NonNullable<string | number | Date | null | undefined>>>;
29
+ let endDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
30
+ let entryPrice: PropTypes.Validator<number>;
31
+ let stopPrice: PropTypes.Validator<number>;
32
+ let takePrice: PropTypes.Validator<number>;
33
+ let xScale: PropTypes.Validator<(...args: any[]) => any>;
34
+ let yScale: PropTypes.Validator<(...args: any[]) => any>;
35
+ let riskColor: PropTypes.Requireable<string>;
36
+ let rewardColor: PropTypes.Requireable<string>;
37
+ let messages: PropTypes.Requireable<(PropTypes.InferProps<{
38
+ date: PropTypes.Validator<NonNullable<NonNullable<string | number | Date | null | undefined>>>;
39
+ price: PropTypes.Validator<number>;
40
+ text: PropTypes.Validator<string>;
41
+ }> | null | undefined)[]>;
42
+ let xBandwidth: PropTypes.Requireable<number>;
43
+ let chartWidth: PropTypes.Requireable<number>;
44
+ let chartHeight: PropTypes.Requireable<number>;
45
+ let bubbleColor: PropTypes.Requireable<string>;
46
+ let textColor: PropTypes.Requireable<string>;
47
+ let fontSize: PropTypes.Requireable<number>;
48
+ let pointer: PropTypes.Requireable<boolean>;
49
+ let padding: PropTypes.Requireable<number>;
50
+ }
51
+ }
52
+ export default PositionOverlay;
@@ -0,0 +1,30 @@
1
+ import { default as React } from 'react';
2
+ import { RayAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface RayAnnotationViewProps {
4
+ annotation: RayAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<RayAnnotation>) => void;
13
+ /** Convert raw timestamp to index when compressGaps is enabled */
14
+ timeToIndex?: (time: number) => number | undefined;
15
+ /** Convert index back to raw timestamp when compressGaps is enabled */
16
+ indexToTime?: (index: number) => number;
17
+ /** Number of data points */
18
+ dataLength?: number;
19
+ /** Pre-computed compressed times array */
20
+ compressedTimes?: number[];
21
+ }
22
+ /**
23
+ * Ray annotation — a two-point line that starts at point 1 and extends
24
+ * infinitely through and beyond point 2.
25
+ *
26
+ * Internally delegates to TrendLineAnnotationView with extendRight=true
27
+ * and extendLeft=false, avoiding code duplication.
28
+ */
29
+ declare const RayAnnotationView: React.FC<RayAnnotationViewProps>;
30
+ export default RayAnnotationView;
@@ -0,0 +1,23 @@
1
+ import { default as React } from 'react';
2
+ import { RectangleAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface RectangleAnnotationViewProps {
4
+ annotation: RectangleAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ chartWidth: number;
8
+ paneHeight: number;
9
+ darkMode?: boolean;
10
+ selected?: boolean;
11
+ onSelect?: (id: string | null) => void;
12
+ onMove?: (id: string, update: Partial<RectangleAnnotation>) => void;
13
+ /** Convert raw timestamp to index when compressGaps is enabled */
14
+ timeToIndex?: (time: number) => number | undefined;
15
+ /** Convert index back to raw timestamp when compressGaps is enabled */
16
+ indexToTime?: (index: number) => number;
17
+ /** Number of data points */
18
+ dataLength?: number;
19
+ /** Pre-computed compressed times array */
20
+ compressedTimes?: number[];
21
+ }
22
+ declare const RectangleAnnotationView: React.FC<RectangleAnnotationViewProps>;
23
+ export default RectangleAnnotationView;
@@ -0,0 +1,20 @@
1
+ export default SMAOverlay;
2
+ /**
3
+ * SMAOverlay
4
+ * @param {Object} props
5
+ * @param {Array<{ date: string, value: number }>} props.data
6
+ * @param {Function} props.xScale - D3 scale for x-axis (date -> px)
7
+ * @param {Function} props.yScale - D3 scale for y-axis (value -> px)
8
+ * @param {string} [props.stroke='orange'] - Line color
9
+ * @param {number} [props.strokeWidth=1.5] - Line thickness
10
+ */
11
+ declare function SMAOverlay({ data, xScale, yScale, stroke, strokeWidth }: {
12
+ data: Array<{
13
+ date: string;
14
+ value: number;
15
+ }>;
16
+ xScale: Function;
17
+ yScale: Function;
18
+ stroke?: string | undefined;
19
+ strokeWidth?: number | undefined;
20
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,24 @@
1
+ import { default as React } from 'react';
2
+ import { TextAnnotation, PaneComputedScale, XScale } from '../../charting/types';
3
+ export interface TextAnnotationViewProps {
4
+ annotation: TextAnnotation;
5
+ xScale: XScale;
6
+ yScale: PaneComputedScale;
7
+ paneHeight: number;
8
+ darkMode?: boolean;
9
+ selected?: boolean;
10
+ onSelect?: (id: string | null) => void;
11
+ onDoubleClick?: (id: string) => void;
12
+ onMove?: (id: string, newTime: number, newPrice: number) => void;
13
+ onTextEdit?: (id: string) => void;
14
+ /** Convert raw timestamp to index when compressGaps is enabled */
15
+ timeToIndex?: (time: number) => number | undefined;
16
+ /** Convert index back to raw timestamp when compressGaps is enabled */
17
+ indexToTime?: (index: number) => number;
18
+ /** Number of data points (required for closest index search when compressGaps enabled) */
19
+ dataLength?: number;
20
+ /** Precomputed array of raw timestamps for each compressed index */
21
+ compressedTimes?: number[];
22
+ }
23
+ declare const TextAnnotationView: React.FC<TextAnnotationViewProps>;
24
+ export default TextAnnotationView;
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { TimeRangeAnnotation, XScale } from '../../charting/types';
3
+ export interface TimeRangeAnnotationViewProps {
4
+ annotation: TimeRangeAnnotation;
5
+ xScale: XScale;
6
+ chartWidth: number;
7
+ paneHeight: number;
8
+ darkMode?: boolean;
9
+ selected?: boolean;
10
+ onSelect?: (id: string | null) => void;
11
+ onMove?: (id: string, update: Partial<TimeRangeAnnotation>) => void;
12
+ /** Convert raw timestamp to index when compressGaps is enabled */
13
+ timeToIndex?: (time: number) => number | undefined;
14
+ /** Convert index back to raw timestamp when compressGaps is enabled */
15
+ indexToTime?: (index: number) => number;
16
+ /** Number of data points */
17
+ dataLength?: number;
18
+ /** Pre-computed compressed times array */
19
+ compressedTimes?: number[];
20
+ }
21
+ declare const TimeRangeAnnotationView: React.FC<TimeRangeAnnotationViewProps>;
22
+ export default TimeRangeAnnotationView;