@coinbase/cds-web-visualization 3.4.0-beta.1 → 3.4.0-beta.11

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 (175) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dts/chart/CartesianChart.d.ts +38 -2
  3. package/dts/chart/CartesianChart.d.ts.map +1 -1
  4. package/dts/chart/Path.d.ts +27 -7
  5. package/dts/chart/Path.d.ts.map +1 -1
  6. package/dts/chart/PeriodSelector.d.ts +0 -4
  7. package/dts/chart/PeriodSelector.d.ts.map +1 -1
  8. package/dts/chart/area/Area.d.ts +54 -24
  9. package/dts/chart/area/Area.d.ts.map +1 -1
  10. package/dts/chart/area/AreaChart.d.ts +33 -6
  11. package/dts/chart/area/AreaChart.d.ts.map +1 -1
  12. package/dts/chart/area/DottedArea.d.ts +21 -44
  13. package/dts/chart/area/DottedArea.d.ts.map +1 -1
  14. package/dts/chart/area/GradientArea.d.ts +21 -12
  15. package/dts/chart/area/GradientArea.d.ts.map +1 -1
  16. package/dts/chart/area/SolidArea.d.ts +16 -1
  17. package/dts/chart/area/SolidArea.d.ts.map +1 -1
  18. package/dts/chart/axis/Axis.d.ts +109 -63
  19. package/dts/chart/axis/Axis.d.ts.map +1 -1
  20. package/dts/chart/axis/DefaultAxisTickLabel.d.ts +8 -0
  21. package/dts/chart/axis/DefaultAxisTickLabel.d.ts.map +1 -0
  22. package/dts/chart/axis/XAxis.d.ts +1 -1
  23. package/dts/chart/axis/XAxis.d.ts.map +1 -1
  24. package/dts/chart/axis/YAxis.d.ts +2 -2
  25. package/dts/chart/axis/YAxis.d.ts.map +1 -1
  26. package/dts/chart/axis/index.d.ts +1 -0
  27. package/dts/chart/axis/index.d.ts.map +1 -1
  28. package/dts/chart/bar/Bar.d.ts +16 -13
  29. package/dts/chart/bar/Bar.d.ts.map +1 -1
  30. package/dts/chart/bar/BarChart.d.ts +17 -8
  31. package/dts/chart/bar/BarChart.d.ts.map +1 -1
  32. package/dts/chart/bar/BarPlot.d.ts +2 -1
  33. package/dts/chart/bar/BarPlot.d.ts.map +1 -1
  34. package/dts/chart/bar/BarStack.d.ts +40 -48
  35. package/dts/chart/bar/BarStack.d.ts.map +1 -1
  36. package/dts/chart/bar/BarStackGroup.d.ts +1 -0
  37. package/dts/chart/bar/BarStackGroup.d.ts.map +1 -1
  38. package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
  39. package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
  40. package/dts/chart/gradient/Gradient.d.ts +35 -0
  41. package/dts/chart/gradient/Gradient.d.ts.map +1 -0
  42. package/dts/chart/gradient/index.d.ts +2 -0
  43. package/dts/chart/gradient/index.d.ts.map +1 -0
  44. package/dts/chart/index.d.ts +2 -1
  45. package/dts/chart/index.d.ts.map +1 -1
  46. package/dts/chart/line/DefaultReferenceLineLabel.d.ts +9 -0
  47. package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +1 -0
  48. package/dts/chart/line/DottedLine.d.ts +15 -3
  49. package/dts/chart/line/DottedLine.d.ts.map +1 -1
  50. package/dts/chart/line/Line.d.ts +87 -28
  51. package/dts/chart/line/Line.d.ts.map +1 -1
  52. package/dts/chart/line/LineChart.d.ts +26 -8
  53. package/dts/chart/line/LineChart.d.ts.map +1 -1
  54. package/dts/chart/line/ReferenceLine.d.ts +91 -44
  55. package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
  56. package/dts/chart/line/SolidLine.d.ts +14 -3
  57. package/dts/chart/line/SolidLine.d.ts.map +1 -1
  58. package/dts/chart/line/index.d.ts +1 -1
  59. package/dts/chart/line/index.d.ts.map +1 -1
  60. package/dts/chart/point/DefaultPointLabel.d.ts +10 -0
  61. package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
  62. package/dts/chart/point/Point.d.ts +201 -0
  63. package/dts/chart/point/Point.d.ts.map +1 -0
  64. package/dts/chart/point/index.d.ts +3 -0
  65. package/dts/chart/point/index.d.ts.map +1 -0
  66. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +24 -0
  67. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -0
  68. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +12 -0
  69. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -0
  70. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +10 -0
  71. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
  72. package/dts/chart/scrubber/Scrubber.d.ts +207 -66
  73. package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
  74. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +70 -0
  75. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
  76. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +32 -0
  77. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
  78. package/dts/chart/scrubber/index.d.ts +3 -0
  79. package/dts/chart/scrubber/index.d.ts.map +1 -1
  80. package/dts/chart/text/ChartText.d.ts +46 -43
  81. package/dts/chart/text/ChartText.d.ts.map +1 -1
  82. package/dts/chart/text/{SmartChartTextGroup.d.ts → ChartTextGroup.d.ts} +9 -3
  83. package/dts/chart/text/ChartTextGroup.d.ts.map +1 -0
  84. package/dts/chart/text/index.d.ts +1 -1
  85. package/dts/chart/text/index.d.ts.map +1 -1
  86. package/dts/chart/utils/axis.d.ts +25 -1
  87. package/dts/chart/utils/axis.d.ts.map +1 -1
  88. package/dts/chart/utils/chart.d.ts +27 -7
  89. package/dts/chart/utils/chart.d.ts.map +1 -1
  90. package/dts/chart/utils/context.d.ts +6 -0
  91. package/dts/chart/utils/context.d.ts.map +1 -1
  92. package/dts/chart/utils/gradient.d.ts +104 -0
  93. package/dts/chart/utils/gradient.d.ts.map +1 -0
  94. package/dts/chart/utils/index.d.ts +4 -0
  95. package/dts/chart/utils/index.d.ts.map +1 -1
  96. package/dts/chart/utils/interpolate.d.ts +112 -0
  97. package/dts/chart/utils/interpolate.d.ts.map +1 -0
  98. package/dts/chart/utils/path.d.ts +24 -1
  99. package/dts/chart/utils/path.d.ts.map +1 -1
  100. package/dts/chart/utils/point.d.ts +40 -7
  101. package/dts/chart/utils/point.d.ts.map +1 -1
  102. package/dts/chart/utils/scale.d.ts +11 -0
  103. package/dts/chart/utils/scale.d.ts.map +1 -1
  104. package/dts/chart/utils/scrubber.d.ts +39 -0
  105. package/dts/chart/utils/scrubber.d.ts.map +1 -0
  106. package/dts/chart/utils/transition.d.ts +65 -0
  107. package/dts/chart/utils/transition.d.ts.map +1 -0
  108. package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts.map +1 -1
  109. package/esm/chart/CartesianChart.js +140 -85
  110. package/esm/chart/Path.js +53 -47
  111. package/esm/chart/PeriodSelector.js +4 -18
  112. package/esm/chart/area/Area.js +24 -34
  113. package/esm/chart/area/AreaChart.js +24 -15
  114. package/esm/chart/area/DottedArea.js +35 -89
  115. package/esm/chart/area/GradientArea.js +34 -80
  116. package/esm/chart/area/SolidArea.js +29 -11
  117. package/esm/chart/axis/Axis.js +4 -39
  118. package/esm/chart/axis/DefaultAxisTickLabel.js +15 -0
  119. package/esm/chart/axis/XAxis.js +184 -63
  120. package/esm/chart/axis/YAxis.js +190 -57
  121. package/esm/chart/axis/index.js +1 -0
  122. package/esm/chart/bar/Bar.js +3 -1
  123. package/esm/chart/bar/BarChart.js +15 -32
  124. package/esm/chart/bar/BarPlot.js +3 -2
  125. package/esm/chart/bar/BarStack.js +65 -23
  126. package/esm/chart/bar/BarStackGroup.js +7 -17
  127. package/esm/chart/bar/DefaultBar.js +4 -7
  128. package/esm/chart/bar/DefaultBarStack.js +5 -7
  129. package/esm/chart/gradient/Gradient.js +104 -0
  130. package/esm/chart/gradient/index.js +1 -0
  131. package/esm/chart/index.js +2 -1
  132. package/esm/chart/line/DefaultReferenceLineLabel.js +81 -0
  133. package/esm/chart/line/DottedLine.js +38 -17
  134. package/esm/chart/line/Line.js +96 -70
  135. package/esm/chart/line/LineChart.js +18 -6
  136. package/esm/chart/line/ReferenceLine.js +41 -43
  137. package/esm/chart/line/SolidLine.js +36 -15
  138. package/esm/chart/line/index.js +1 -1
  139. package/esm/chart/{line/GradientLine.js → point/DefaultPointLabel.js} +31 -45
  140. package/esm/chart/point/Point.css +2 -0
  141. package/esm/chart/{Point.js → point/Point.js} +66 -57
  142. package/esm/chart/point/index.js +2 -0
  143. package/esm/chart/scrubber/DefaultScrubberBeacon.js +155 -0
  144. package/esm/chart/scrubber/{ScrubberBeaconLabel.js → DefaultScrubberBeaconLabel.js} +23 -10
  145. package/esm/chart/scrubber/DefaultScrubberLabel.js +30 -0
  146. package/esm/chart/scrubber/Scrubber.js +98 -392
  147. package/esm/chart/scrubber/ScrubberBeaconGroup.js +166 -0
  148. package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +186 -0
  149. package/esm/chart/scrubber/index.js +3 -1
  150. package/esm/chart/text/ChartText.js +15 -20
  151. package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +4 -3
  152. package/esm/chart/text/index.js +1 -1
  153. package/esm/chart/utils/axis.js +45 -29
  154. package/esm/chart/utils/chart.js +29 -3
  155. package/esm/chart/utils/gradient.js +257 -0
  156. package/esm/chart/utils/index.js +4 -0
  157. package/esm/chart/utils/interpolate.js +644 -0
  158. package/esm/chart/utils/path.js +32 -9
  159. package/esm/chart/utils/point.js +99 -12
  160. package/esm/chart/utils/scale.js +13 -2
  161. package/esm/chart/utils/scrubber.js +132 -0
  162. package/esm/chart/utils/transition.js +111 -0
  163. package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +8 -4
  164. package/package.json +9 -9
  165. package/dts/chart/Point.d.ts +0 -153
  166. package/dts/chart/Point.d.ts.map +0 -1
  167. package/dts/chart/line/GradientLine.d.ts +0 -42
  168. package/dts/chart/line/GradientLine.d.ts.map +0 -1
  169. package/dts/chart/scrubber/ScrubberBeacon.d.ts +0 -93
  170. package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +0 -1
  171. package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts +0 -7
  172. package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts.map +0 -1
  173. package/dts/chart/text/SmartChartTextGroup.d.ts.map +0 -1
  174. package/esm/chart/Point.css +0 -2
  175. package/esm/chart/scrubber/ScrubberBeacon.js +0 -195
@@ -1,153 +0,0 @@
1
- import React from 'react';
2
- import type { SVGProps } from 'react';
3
- import type { SharedProps } from '@coinbase/cds-common/types';
4
- import type { ChartTextChildren } from './text/ChartText';
5
- import { type ChartTextProps } from './text';
6
- /**
7
- * Parameters passed to renderPoints callback function.
8
- */
9
- export type RenderPointsParams = {
10
- /**
11
- * X coordinate in SVG pixel space.
12
- */
13
- x: number;
14
- /**
15
- * Y coordinate in SVG pixel space.
16
- */
17
- y: number;
18
- /**
19
- * X coordinate in data space (usually same as index).
20
- */
21
- dataX: number;
22
- /**
23
- * Y coordinate in data space (same as value).
24
- */
25
- dataY: number;
26
- };
27
- /**
28
- * Shared configuration for point appearance and behavior.
29
- * Used by line-associated points rendered via Line/LineChart components.
30
- */
31
- export type PointConfig = {
32
- /**
33
- * The fill color of the point.
34
- */
35
- fill?: string;
36
- /**
37
- * Optional Y-axis id to specify which axis to plot along.
38
- * Defaults to the first y-axis
39
- */
40
- yAxisId?: string;
41
- /**
42
- * Radius of the point.
43
- * @default 4
44
- */
45
- radius?: number;
46
- /**
47
- * Opacity of the point.
48
- */
49
- opacity?: number;
50
- /**
51
- * Handler for when the point is clicked.
52
- */
53
- onClick?: (
54
- event: React.MouseEvent,
55
- point: {
56
- x: number;
57
- y: number;
58
- dataX: number;
59
- dataY: number;
60
- },
61
- ) => void;
62
- /**
63
- * Handler for when the scrubber enters this point.
64
- */
65
- onScrubberEnter?: (point: { x: number; y: number }) => void;
66
- /**
67
- * Color of the outer stroke around the point.
68
- * @default 'var(--color-bg)'
69
- */
70
- stroke?: string;
71
- /**
72
- * Outer stroke width of the point.
73
- * Set to 0 to remove the stroke.
74
- * @default 2
75
- */
76
- strokeWidth?: number;
77
- /**
78
- * Custom class name for the point.
79
- */
80
- className?: string;
81
- /**
82
- * Custom styles for the point.
83
- */
84
- style?: React.CSSProperties;
85
- /**
86
- * Accessibility label for screen readers to describe the point.
87
- * If not provided, a default label will be generated using the data coordinates.
88
- */
89
- accessibilityLabel?: string;
90
- /**
91
- * Simple text label to display at the point position.
92
- * If provided, a ChartText will be automatically rendered.
93
- */
94
- label?: ChartTextChildren;
95
- /**
96
- * Configuration for the automatically rendered label.
97
- * Only used when `label` prop is provided.
98
- */
99
- labelProps?: Omit<ChartTextProps, 'x' | 'y' | 'children'>;
100
- };
101
- export type PointProps = SharedProps &
102
- PointConfig &
103
- Omit<SVGProps<SVGCircleElement>, 'onClick'> & {
104
- /**
105
- * X coordinate in data space (not pixel coordinates).
106
- */
107
- dataX: number;
108
- /**
109
- * Y coordinate in data space (not pixel coordinates).
110
- */
111
- dataY: number;
112
- /**
113
- * Coordinates in SVG pixel space.
114
- * Overrides dataX and dataY for pixel coordinate calculation.
115
- */
116
- pixelCoordinates?: {
117
- x: number;
118
- y: number;
119
- };
120
- /**
121
- * Override the chart's animation setting for this specific point.
122
- * When undefined, uses the chart context's animation setting.
123
- */
124
- animate?: boolean;
125
- /**
126
- * Custom class names for the component.
127
- */
128
- classNames?: {
129
- /**
130
- * Custom class name for the point container element.
131
- */
132
- container?: string;
133
- /**
134
- * Custom class name for the inner circle element.
135
- */
136
- point?: string;
137
- };
138
- /**
139
- * Custom styles for the component.
140
- */
141
- styles?: {
142
- /**
143
- * Custom styles for the point container element.
144
- */
145
- container?: React.CSSProperties;
146
- /**
147
- * Custom styles for the inner circle element.
148
- */
149
- point?: React.CSSProperties;
150
- };
151
- };
152
- export declare const Point: React.NamedExoticComponent<PointProps>;
153
- //# sourceMappingURL=Point.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../src/chart/Point.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAK9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAqBxD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,KAAK,CAAC,UAAU,EACvB,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAC1D,IAAI,CAAC;IACV;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,GAAG,UAAU,CAAC,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,GAClC,WAAW,GACX,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC,GAAG;IAC5C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,gBAAgB,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAChC;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC7B,CAAC;CACH,CAAC;AAEJ,eAAO,MAAM,KAAK,wCAsKjB,CAAC"}
@@ -1,42 +0,0 @@
1
- import type { SharedProps } from '@coinbase/cds-common/types';
2
- import { type PathProps } from '../Path';
3
- import type { LineComponentProps } from './Line';
4
- export type GradientLineProps = SharedProps &
5
- Omit<PathProps, 'stroke' | 'strokeOpacity' | 'strokeWidth'> &
6
- Pick<LineComponentProps, 'strokeWidth'> & {
7
- /**
8
- * The color of the line.
9
- * @default 'var(--color-bgLine)'
10
- */
11
- stroke?: string;
12
- /**
13
- * Opacity of the line.
14
- * @default 1
15
- */
16
- strokeOpacity?: number;
17
- /**
18
- * The color of the start of the gradient.
19
- * @default stroke or 'var(--color-bgLine)'
20
- */
21
- startColor?: string;
22
- /**
23
- * The color of the end of the gradient.
24
- * @default stroke or 'var(--color-bgLine)'
25
- */
26
- endColor?: string;
27
- /**
28
- * Opacity of the start color.
29
- * @default strokeOpacity
30
- */
31
- startOpacity?: number;
32
- /**
33
- * Opacity of the end color.
34
- * @default strokeOpacity
35
- */
36
- endOpacity?: number;
37
- };
38
- /**
39
- * A gradient line component which uses path element.
40
- */
41
- export declare const GradientLine: import('react').NamedExoticComponent<GradientLineProps>;
42
- //# sourceMappingURL=GradientLine.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GradientLine.d.ts","sourceRoot":"","sources":["../../../src/chart/line/GradientLine.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,WAAW,GACzC,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,eAAe,GAAG,aAAa,CAAC,GAC3D,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAAG;IACxC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,YAAY,yDAqCxB,CAAC"}
@@ -1,93 +0,0 @@
1
- import type { SharedProps } from '@coinbase/cds-common/types';
2
- export type ScrubberBeaconRef = {
3
- /**
4
- * Triggers a single pulse animation.
5
- * Only works when the scrubber is in idle state (not actively scrubbing).
6
- */
7
- pulse: () => void;
8
- };
9
- export type ScrubberBeaconProps = SharedProps & {
10
- /**
11
- * Optional data X coordinate to position the beacon.
12
- * If not provided, uses the scrubber position from context.
13
- */
14
- dataX?: number;
15
- /**
16
- * Optional data Y coordinate to position the beacon.
17
- * If not provided, looks up the Y value from series data at scrubber position.
18
- */
19
- dataY?: number;
20
- /**
21
- * Filter to only show dot for specific series (used for hover-based positioning).
22
- */
23
- seriesId?: string;
24
- /**
25
- * Color of the beacon point.
26
- * If not provided, uses the series color.
27
- */
28
- color?: string;
29
- /**
30
- * Opacity of the beacon.
31
- * @default 1
32
- */
33
- opacity?: number;
34
- /**
35
- * Pulse the scrubber beacon while it is at rest.
36
- */
37
- idlePulse?: boolean;
38
- /**
39
- * Custom className for styling.
40
- */
41
- className?: string;
42
- /**
43
- * Custom inline styles.
44
- */
45
- style?: React.CSSProperties;
46
- };
47
- /**
48
- * The ScrubberBeacon is a special instance of a Point used to mark the scrubber's position on a specific series.
49
- * It renders a glow effect around the point to highlight the scrubber position.
50
- */
51
- export declare const ScrubberBeacon: import('react').MemoExoticComponent<
52
- import('react').ForwardRefExoticComponent<
53
- SharedProps & {
54
- /**
55
- * Optional data X coordinate to position the beacon.
56
- * If not provided, uses the scrubber position from context.
57
- */
58
- dataX?: number;
59
- /**
60
- * Optional data Y coordinate to position the beacon.
61
- * If not provided, looks up the Y value from series data at scrubber position.
62
- */
63
- dataY?: number;
64
- /**
65
- * Filter to only show dot for specific series (used for hover-based positioning).
66
- */
67
- seriesId?: string;
68
- /**
69
- * Color of the beacon point.
70
- * If not provided, uses the series color.
71
- */
72
- color?: string;
73
- /**
74
- * Opacity of the beacon.
75
- * @default 1
76
- */
77
- opacity?: number;
78
- /**
79
- * Pulse the scrubber beacon while it is at rest.
80
- */
81
- idlePulse?: boolean;
82
- /**
83
- * Custom className for styling.
84
- */
85
- className?: string;
86
- /**
87
- * Custom inline styles.
88
- */
89
- style?: React.CSSProperties;
90
- } & import('react').RefAttributes<ScrubberBeaconRef>
91
- >
92
- >;
93
- //# sourceMappingURL=ScrubberBeacon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScrubberBeacon.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberBeacon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAiB9D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAMF,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAC9C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc;IA1CzB;;;OAGG;YACK,MAAM;IACd;;;OAGG;YACK,MAAM;IACd;;OAEG;eACQ,MAAM;IACjB;;;OAGG;YACK,MAAM;IACd;;;OAGG;cACO,MAAM;IAChB;;OAEG;gBACS,OAAO;IACnB;;OAEG;gBACS,MAAM;IAClB;;OAEG;YACK,KAAK,CAAC,aAAa;sDAqM5B,CAAC"}
@@ -1,7 +0,0 @@
1
- import { type ChartTextProps } from '../text';
2
- export type ScrubberBeaconLabelProps = ChartTextProps;
3
- /**
4
- * The ScrubberBeaconLabel is a special instance of ChartText used to label a series' scrubber beacon (i.e. a point on the series pinned to the scrubber position).
5
- */
6
- export declare const ScrubberBeaconLabel: import('react').NamedExoticComponent<ChartTextProps>;
7
- //# sourceMappingURL=ScrubberBeaconLabel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScrubberBeaconLabel.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberBeaconLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzD,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,mBAAmB,sDAsB/B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SmartChartTextGroup.d.ts","sourceRoot":"","sources":["../../../src/chart/text/SmartChartTextGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,KAAK,EAAE,iBAAiB,CAAC;IACzB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAiBF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,gEAoM/B,CAAC"}
@@ -1,2 +0,0 @@
1
- .cds-containerCss-c137x6qr{outline:none;}
2
- .cds-innerPointCss-i1qyub1f{border-radius:var(--borderRadius-1000);outline:none;}.cds-innerPointCss-i1qyub1f:focus{outline:none;}.cds-innerPointCss-i1qyub1f:focus-visible{outline:2px solid var(--color-fgPrimary);outline-offset:2px;}
@@ -1,195 +0,0 @@
1
- import { forwardRef, memo, useImperativeHandle, useMemo } from 'react';
2
- import { m as motion, useAnimate } from 'framer-motion';
3
- import { useCartesianChartContext } from '../ChartProvider';
4
- import { projectPoint, useScrubberContext } from '../utils';
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- const pulseTransitionConfig = {
7
- duration: 2,
8
- repeat: Infinity,
9
- ease: 'easeInOut'
10
- };
11
- const singlePulseTransitionConfig = {
12
- duration: 1,
13
- ease: 'easeInOut'
14
- };
15
- const radius = 5;
16
- const glowRadius = 10;
17
- const pulseRadius = 15;
18
- /**
19
- * The ScrubberBeacon is a special instance of a Point used to mark the scrubber's position on a specific series.
20
- * It renders a glow effect around the point to highlight the scrubber position.
21
- */
22
- export const ScrubberBeacon = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
23
- var _ref2;
24
- let {
25
- seriesId,
26
- dataX: dataXProp,
27
- dataY: dataYProp,
28
- color,
29
- testID,
30
- idlePulse,
31
- opacity = 1,
32
- className,
33
- style
34
- } = _ref;
35
- const [scope, animate] = useAnimate();
36
- const {
37
- getSeries,
38
- getXScale,
39
- getYScale,
40
- getSeriesData,
41
- animate: animationEnabled
42
- } = useCartesianChartContext();
43
- const {
44
- scrubberPosition
45
- } = useScrubberContext();
46
- const targetSeries = getSeries(seriesId);
47
- const sourceData = getSeriesData(seriesId);
48
- const xScale = getXScale();
49
- const yScale = getYScale(targetSeries === null || targetSeries === void 0 ? void 0 : targetSeries.yAxisId);
50
- const isIdleState = scrubberPosition === undefined;
51
-
52
- // Expose imperative handle for triggering pulse animations
53
- useImperativeHandle(ref, () => ({
54
- pulse: () => {
55
- // Only pulse when idle
56
- if (isIdleState && scope.current) {
57
- animate(scope.current, {
58
- opacity: [0.1, 0]
59
- }, singlePulseTransitionConfig);
60
- }
61
- }
62
- }));
63
- const {
64
- dataX,
65
- dataY
66
- } = useMemo(() => {
67
- let x;
68
- let y;
69
- if (xScale && yScale) {
70
- if (dataXProp !== undefined && dataYProp !== undefined && !isNaN(dataYProp) && !isNaN(dataXProp)) {
71
- // Use direct coordinates if provided
72
- x = dataXProp;
73
- y = dataYProp;
74
- } else if (sourceData && scrubberPosition != null && scrubberPosition >= 0 && scrubberPosition < sourceData.length) {
75
- // Use series data at highlight index
76
- x = scrubberPosition;
77
- const dataValue = sourceData[scrubberPosition];
78
- if (typeof dataValue === 'number') {
79
- y = dataValue;
80
- } else if (Array.isArray(dataValue)) {
81
- const validValues = dataValue.filter(val => val !== null);
82
- if (validValues.length >= 2) {
83
- y = validValues[1];
84
- }
85
- }
86
- }
87
- }
88
- return {
89
- dataX: x,
90
- dataY: y
91
- };
92
- }, [dataXProp, dataYProp, sourceData, scrubberPosition, xScale, yScale]);
93
- const pixelCoordinate = useMemo(() => {
94
- if (!xScale || !yScale || dataX === undefined || dataY === undefined) {
95
- return null;
96
- }
97
- return projectPoint({
98
- x: dataX,
99
- y: dataY,
100
- xScale,
101
- yScale
102
- });
103
- }, [xScale, yScale, dataX, dataY]);
104
- if (!pixelCoordinate) {
105
- return null;
106
- }
107
- const pointColor = (_ref2 = color !== null && color !== void 0 ? color : targetSeries === null || targetSeries === void 0 ? void 0 : targetSeries.color) !== null && _ref2 !== void 0 ? _ref2 : 'var(--color-fgPrimary)';
108
- const shouldPulse = animationEnabled && isIdleState && idlePulse;
109
- if (animationEnabled && isIdleState) {
110
- return /*#__PURE__*/_jsxs("g", {
111
- "data-testid": testID,
112
- opacity: opacity,
113
- children: [/*#__PURE__*/_jsx(motion.circle, {
114
- animate: {
115
- cx: pixelCoordinate.x,
116
- cy: pixelCoordinate.y
117
- },
118
- cx: pixelCoordinate.x,
119
- cy: pixelCoordinate.y,
120
- fill: pointColor,
121
- initial: false,
122
- opacity: 0.15,
123
- r: glowRadius,
124
- transition: {
125
- duration: 0.3,
126
- ease: 'easeInOut'
127
- }
128
- }), /*#__PURE__*/_jsx(motion.g, {
129
- animate: {
130
- x: pixelCoordinate.x,
131
- y: pixelCoordinate.y
132
- },
133
- initial: false,
134
- transition: {
135
- duration: 0.3,
136
- ease: 'easeInOut'
137
- },
138
- children: /*#__PURE__*/_jsx(motion.circle, {
139
- ref: scope,
140
- animate: shouldPulse ? {
141
- opacity: [0.1, 0, 0.1],
142
- transition: pulseTransitionConfig
143
- } : {
144
- opacity: 0
145
- },
146
- cx: 0,
147
- cy: 0,
148
- fill: pointColor,
149
- initial: {
150
- opacity: shouldPulse ? 0.1 : 0
151
- },
152
- r: pulseRadius
153
- })
154
- }), /*#__PURE__*/_jsx(motion.circle, {
155
- animate: {
156
- cx: pixelCoordinate.x,
157
- cy: pixelCoordinate.y
158
- },
159
- className: className,
160
- cx: pixelCoordinate.x,
161
- cy: pixelCoordinate.y,
162
- fill: pointColor,
163
- initial: false,
164
- r: radius,
165
- stroke: "var(--color-bg)",
166
- strokeWidth: 2,
167
- style: style,
168
- transition: {
169
- duration: 0.3,
170
- ease: 'easeInOut'
171
- }
172
- })]
173
- });
174
- }
175
- return /*#__PURE__*/_jsxs("g", {
176
- "data-testid": testID,
177
- opacity: opacity,
178
- children: [/*#__PURE__*/_jsx("circle", {
179
- cx: pixelCoordinate.x,
180
- cy: pixelCoordinate.y,
181
- fill: pointColor,
182
- opacity: 0.15,
183
- r: glowRadius
184
- }), /*#__PURE__*/_jsx("circle", {
185
- className: className,
186
- cx: pixelCoordinate.x,
187
- cy: pixelCoordinate.y,
188
- fill: pointColor,
189
- r: radius,
190
- stroke: "var(--color-bg)",
191
- strokeWidth: 2,
192
- style: style
193
- })]
194
- });
195
- }));