@coinbase/cds-mobile-visualization 3.4.0-beta.8 → 3.4.0
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/CHANGELOG.md +142 -0
- package/dts/chart/CartesianChart.d.ts +92 -7
- package/dts/chart/CartesianChart.d.ts.map +1 -1
- package/dts/chart/ChartContextBridge.d.ts.map +1 -1
- package/dts/chart/ChartProvider.d.ts +3 -0
- package/dts/chart/ChartProvider.d.ts.map +1 -1
- package/dts/chart/Path.d.ts +36 -13
- package/dts/chart/Path.d.ts.map +1 -1
- package/dts/chart/PeriodSelector.d.ts +21 -6
- package/dts/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/chart/area/Area.d.ts +14 -11
- package/dts/chart/area/Area.d.ts.map +1 -1
- package/dts/chart/area/AreaChart.d.ts +33 -9
- package/dts/chart/area/AreaChart.d.ts.map +1 -1
- package/dts/chart/area/DottedArea.d.ts.map +1 -1
- package/dts/chart/area/GradientArea.d.ts.map +1 -1
- package/dts/chart/area/SolidArea.d.ts.map +1 -1
- package/dts/chart/axis/Axis.d.ts +22 -42
- package/dts/chart/axis/Axis.d.ts.map +1 -1
- package/dts/chart/axis/XAxis.d.ts +6 -0
- package/dts/chart/axis/XAxis.d.ts.map +1 -1
- package/dts/chart/axis/YAxis.d.ts +1 -0
- package/dts/chart/axis/YAxis.d.ts.map +1 -1
- package/dts/chart/bar/Bar.d.ts +51 -51
- package/dts/chart/bar/Bar.d.ts.map +1 -1
- package/dts/chart/bar/BarChart.d.ts +56 -11
- package/dts/chart/bar/BarChart.d.ts.map +1 -1
- package/dts/chart/bar/BarPlot.d.ts +2 -1
- package/dts/chart/bar/BarPlot.d.ts.map +1 -1
- package/dts/chart/bar/BarStack.d.ts +45 -20
- package/dts/chart/bar/BarStack.d.ts.map +1 -1
- package/dts/chart/bar/BarStackGroup.d.ts +2 -1
- package/dts/chart/bar/BarStackGroup.d.ts.map +1 -1
- package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
- package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
- package/dts/chart/gradient/Gradient.d.ts +5 -0
- package/dts/chart/gradient/Gradient.d.ts.map +1 -1
- package/dts/chart/index.d.ts +1 -0
- package/dts/chart/index.d.ts.map +1 -1
- package/dts/chart/legend/DefaultLegendEntry.d.ts +5 -0
- package/dts/chart/legend/DefaultLegendEntry.d.ts.map +1 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts +5 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts.map +1 -0
- package/dts/chart/legend/Legend.d.ts +168 -0
- package/dts/chart/legend/Legend.d.ts.map +1 -0
- package/dts/chart/legend/index.d.ts +4 -0
- package/dts/chart/legend/index.d.ts.map +1 -0
- package/dts/chart/line/DottedLine.d.ts.map +1 -1
- package/dts/chart/line/Line.d.ts +23 -19
- package/dts/chart/line/Line.d.ts.map +1 -1
- package/dts/chart/line/LineChart.d.ts +26 -9
- package/dts/chart/line/LineChart.d.ts.map +1 -1
- package/dts/chart/line/ReferenceLine.d.ts +1 -0
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/chart/line/SolidLine.d.ts.map +1 -1
- package/dts/chart/point/Point.d.ts +26 -2
- package/dts/chart/point/Point.d.ts.map +1 -1
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +32 -2
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -1
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +2 -1
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -1
- package/dts/chart/scrubber/Scrubber.d.ts +86 -17
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberAccessibilityView.d.ts +12 -0
- package/dts/chart/scrubber/ScrubberAccessibilityView.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +10 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +16 -1
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -1
- package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -1
- package/dts/chart/utils/axis.d.ts +45 -10
- package/dts/chart/utils/axis.d.ts.map +1 -1
- package/dts/chart/utils/bar.d.ts +190 -0
- package/dts/chart/utils/bar.d.ts.map +1 -1
- package/dts/chart/utils/chart.d.ts +32 -0
- package/dts/chart/utils/chart.d.ts.map +1 -1
- package/dts/chart/utils/context.d.ts +21 -6
- package/dts/chart/utils/context.d.ts.map +1 -1
- package/dts/chart/utils/gradient.d.ts +3 -1
- package/dts/chart/utils/gradient.d.ts.map +1 -1
- package/dts/chart/utils/path.d.ts +26 -0
- package/dts/chart/utils/path.d.ts.map +1 -1
- package/dts/chart/utils/point.d.ts +24 -12
- package/dts/chart/utils/point.d.ts.map +1 -1
- package/dts/chart/utils/scale.d.ts +11 -0
- package/dts/chart/utils/scale.d.ts.map +1 -1
- package/dts/chart/utils/scrubber.d.ts +2 -1
- package/dts/chart/utils/scrubber.d.ts.map +1 -1
- package/dts/chart/utils/transition.d.ts +63 -22
- package/dts/chart/utils/transition.d.ts.map +1 -1
- package/dts/sparkline/Sparkline.d.ts +2 -1
- package/dts/sparkline/Sparkline.d.ts.map +1 -1
- package/dts/sparkline/SparklineArea.d.ts +2 -1
- package/dts/sparkline/SparklineArea.d.ts.map +1 -1
- package/dts/sparkline/SparklineGradient.d.ts +2 -1
- package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +2 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
- package/esm/chart/CartesianChart.js +176 -82
- package/esm/chart/ChartContextBridge.js +14 -3
- package/esm/chart/ChartProvider.js +2 -2
- package/esm/chart/Path.js +34 -29
- package/esm/chart/PeriodSelector.js +6 -2
- package/esm/chart/__stories__/CartesianChart.stories.js +27 -86
- package/esm/chart/__stories__/ChartAccessibility.stories.js +721 -0
- package/esm/chart/__stories__/ChartTransitions.stories.js +625 -0
- package/esm/chart/__stories__/PeriodSelector.stories.js +102 -4
- package/esm/chart/area/Area.js +21 -9
- package/esm/chart/area/AreaChart.js +18 -13
- package/esm/chart/area/DottedArea.js +28 -18
- package/esm/chart/area/GradientArea.js +14 -7
- package/esm/chart/area/SolidArea.js +6 -2
- package/esm/chart/area/__stories__/AreaChart.stories.js +47 -5
- package/esm/chart/axis/Axis.js +5 -41
- package/esm/chart/axis/XAxis.js +116 -47
- package/esm/chart/axis/YAxis.js +105 -26
- package/esm/chart/axis/__stories__/Axis.stories.js +324 -48
- package/esm/chart/bar/Bar.js +17 -15
- package/esm/chart/bar/BarChart.js +38 -33
- package/esm/chart/bar/BarPlot.js +40 -45
- package/esm/chart/bar/BarStack.js +92 -475
- package/esm/chart/bar/BarStackGroup.js +37 -27
- package/esm/chart/bar/DefaultBar.js +27 -18
- package/esm/chart/bar/DefaultBarStack.js +25 -9
- package/esm/chart/bar/__stories__/BarChart.stories.js +728 -54
- package/esm/chart/gradient/Gradient.js +2 -1
- package/esm/chart/index.js +1 -0
- package/esm/chart/legend/DefaultLegendEntry.js +42 -0
- package/esm/chart/legend/DefaultLegendShape.js +64 -0
- package/esm/chart/legend/Legend.js +59 -0
- package/esm/chart/legend/__stories__/Legend.stories.js +574 -0
- package/esm/chart/legend/index.js +3 -0
- package/esm/chart/line/DottedLine.js +6 -2
- package/esm/chart/line/Line.js +42 -38
- package/esm/chart/line/LineChart.js +36 -12
- package/esm/chart/line/SolidLine.js +6 -2
- package/esm/chart/line/__stories__/LineChart.stories.js +241 -594
- package/esm/chart/line/__stories__/ReferenceLine.stories.js +95 -1
- package/esm/chart/point/Point.js +35 -36
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +41 -38
- package/esm/chart/scrubber/DefaultScrubberLabel.js +26 -10
- package/esm/chart/scrubber/Scrubber.js +67 -35
- package/esm/chart/scrubber/ScrubberAccessibilityView.js +177 -0
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +30 -22
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +35 -8
- package/esm/chart/scrubber/ScrubberProvider.js +29 -24
- package/esm/chart/scrubber/__stories__/Scrubber.stories.js +946 -0
- package/esm/chart/utils/axis.js +88 -44
- package/esm/chart/utils/bar.js +820 -0
- package/esm/chart/utils/chart.js +34 -7
- package/esm/chart/utils/context.js +7 -0
- package/esm/chart/utils/gradient.js +8 -4
- package/esm/chart/utils/path.js +91 -61
- package/esm/chart/utils/point.js +92 -39
- package/esm/chart/utils/scale.js +13 -2
- package/esm/chart/utils/scrubber.js +12 -5
- package/esm/chart/utils/transition.js +108 -60
- package/esm/sparkline/Sparkline.js +2 -1
- package/esm/sparkline/SparklineArea.js +2 -1
- package/esm/sparkline/SparklineGradient.js +2 -1
- package/esm/sparkline/__figma__/Sparkline.figma.js +1 -1
- package/esm/sparkline/__stories__/Sparkline.stories.js +11 -7
- package/esm/sparkline/__stories__/SparklineGradient.stories.js +7 -4
- package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +2 -1
- package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +51 -26
- package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +1 -1
- package/esm/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.js +19 -9
- package/package.json +13 -10
- package/esm/chart/__stories__/Chart.stories.js +0 -77
|
@@ -9,7 +9,7 @@ import { useTheme } from '@coinbase/cds-mobile/hooks/useTheme';
|
|
|
9
9
|
import { SegmentedTabs } from '@coinbase/cds-mobile/tabs';
|
|
10
10
|
import { SegmentedTab } from '@coinbase/cds-mobile/tabs/SegmentedTab';
|
|
11
11
|
import { tabsSpringConfig } from '@coinbase/cds-mobile/tabs/Tabs';
|
|
12
|
-
import { Text } from '@coinbase/cds-mobile/typography
|
|
12
|
+
import { Text } from '@coinbase/cds-mobile/typography';
|
|
13
13
|
|
|
14
14
|
// Animated active indicator to support smooth transition of background color
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -24,7 +24,8 @@ export const PeriodSelectorActiveIndicator = _ref => {
|
|
|
24
24
|
const {
|
|
25
25
|
width,
|
|
26
26
|
height,
|
|
27
|
-
x
|
|
27
|
+
x,
|
|
28
|
+
y
|
|
28
29
|
} = activeTabRect;
|
|
29
30
|
|
|
30
31
|
// Get the target background color
|
|
@@ -38,6 +39,7 @@ export const PeriodSelectorActiveIndicator = _ref => {
|
|
|
38
39
|
// Combined animated value for position, size, and color
|
|
39
40
|
const newAnimatedValues = {
|
|
40
41
|
x,
|
|
42
|
+
y,
|
|
41
43
|
width,
|
|
42
44
|
backgroundColor: targetColor
|
|
43
45
|
};
|
|
@@ -51,6 +53,8 @@ export const PeriodSelectorActiveIndicator = _ref => {
|
|
|
51
53
|
const animatedStyles = useAnimatedStyle(() => ({
|
|
52
54
|
transform: [{
|
|
53
55
|
translateX: animatedValues.value.x
|
|
56
|
+
}, {
|
|
57
|
+
translateY: animatedValues.value.y
|
|
54
58
|
}],
|
|
55
59
|
width: animatedValues.value.width,
|
|
56
60
|
backgroundColor: animatedValues.value.backgroundColor
|
|
@@ -6,8 +6,8 @@ import { candles as btcCandles } from '@coinbase/cds-common/internal/data/candle
|
|
|
6
6
|
import { Example, ExampleScreen } from '@coinbase/cds-mobile/examples/ExampleScreen';
|
|
7
7
|
import { useTheme } from '@coinbase/cds-mobile/hooks/useTheme';
|
|
8
8
|
import { Box, HStack, VStack } from '@coinbase/cds-mobile/layout';
|
|
9
|
-
import {
|
|
10
|
-
import { Circle, Group
|
|
9
|
+
import { Text } from '@coinbase/cds-mobile/typography';
|
|
10
|
+
import { Circle, Group } from '@shopify/react-native-skia';
|
|
11
11
|
import { Area } from '../area/Area';
|
|
12
12
|
import { XAxis, YAxis } from '../axis';
|
|
13
13
|
import { BarPlot } from '../bar/BarPlot';
|
|
@@ -155,7 +155,7 @@ const EarningsHistory = () => {
|
|
|
155
155
|
backgroundColor: theme.color.bgPositive
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
|
-
const
|
|
158
|
+
const LegendEntry = /*#__PURE__*/memo(_ref2 => {
|
|
159
159
|
let {
|
|
160
160
|
opacity = 1,
|
|
161
161
|
label
|
|
@@ -168,7 +168,8 @@ const EarningsHistory = () => {
|
|
|
168
168
|
style: [styles.legendDot, {
|
|
169
169
|
opacity
|
|
170
170
|
}]
|
|
171
|
-
}), /*#__PURE__*/_jsx(
|
|
171
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
172
|
+
font: "label2",
|
|
172
173
|
children: label
|
|
173
174
|
})]
|
|
174
175
|
});
|
|
@@ -216,10 +217,10 @@ const EarningsHistory = () => {
|
|
|
216
217
|
}), /*#__PURE__*/_jsxs(HStack, {
|
|
217
218
|
gap: 2,
|
|
218
219
|
justifyContent: "flex-end",
|
|
219
|
-
children: [/*#__PURE__*/_jsx(
|
|
220
|
+
children: [/*#__PURE__*/_jsx(LegendEntry, {
|
|
220
221
|
label: "Estimated EPS",
|
|
221
222
|
opacity: 0.5
|
|
222
|
-
}), /*#__PURE__*/_jsx(
|
|
223
|
+
}), /*#__PURE__*/_jsx(LegendEntry, {
|
|
223
224
|
label: "Actual EPS"
|
|
224
225
|
})]
|
|
225
226
|
})]
|
|
@@ -249,11 +250,21 @@ const PriceWithVolumeChart = /*#__PURE__*/memo(_ref3 => {
|
|
|
249
250
|
day: 'numeric'
|
|
250
251
|
});
|
|
251
252
|
}, []);
|
|
253
|
+
const formatVolume = useCallback(volume => {
|
|
254
|
+
return (volume / 1000).toFixed(2) + "K";
|
|
255
|
+
}, []);
|
|
252
256
|
const scrubberLabel = useCallback(dataIndex => {
|
|
253
257
|
return formatDate(btcDates[dataIndex]);
|
|
254
258
|
}, [formatDate]);
|
|
259
|
+
const chartAccessibilityLabel = useMemo(() => {
|
|
260
|
+
const lastIndex = btcPrices.length - 1;
|
|
261
|
+
return "Bitcoin chart. Current date " + formatDate(btcDates[lastIndex]) + ". Current price " + formatPriceInThousands(btcPrices[lastIndex]) + ". Current volume " + formatVolume(btcVolumes[lastIndex]) + ".";
|
|
262
|
+
}, [formatDate, formatPriceInThousands, formatVolume]);
|
|
263
|
+
const getScrubberAccessibilityLabel = useCallback(dataIndex => "Bitcoin on " + formatDate(btcDates[dataIndex]) + ". Price " + formatPriceInThousands(btcPrices[dataIndex]) + ". Volume " + formatVolume(btcVolumes[dataIndex]) + ".", [formatDate, formatPriceInThousands, formatVolume]);
|
|
255
264
|
return /*#__PURE__*/_jsxs(CartesianChart, {
|
|
256
265
|
enableScrubbing: true,
|
|
266
|
+
accessibilityLabel: chartAccessibilityLabel,
|
|
267
|
+
getScrubberAccessibilityLabel: getScrubberAccessibilityLabel,
|
|
257
268
|
height: defaultChartHeight,
|
|
258
269
|
onScrubberPositionChange: onScrubberPositionChange,
|
|
259
270
|
series: [{
|
|
@@ -350,9 +361,11 @@ const PriceWithVolumeHeader = /*#__PURE__*/memo(_ref7 => {
|
|
|
350
361
|
paddingX: 0,
|
|
351
362
|
children: [/*#__PURE__*/_jsxs(VStack, {
|
|
352
363
|
gap: 0,
|
|
353
|
-
children: [/*#__PURE__*/_jsx(
|
|
364
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
365
|
+
font: "title1",
|
|
354
366
|
children: "Bitcoin"
|
|
355
|
-
}), /*#__PURE__*/_jsx(
|
|
367
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
368
|
+
font: "title2",
|
|
356
369
|
children: formatPrice(currentPrice)
|
|
357
370
|
})]
|
|
358
371
|
}), /*#__PURE__*/_jsxs(HStack, {
|
|
@@ -360,9 +373,11 @@ const PriceWithVolumeHeader = /*#__PURE__*/memo(_ref7 => {
|
|
|
360
373
|
children: [/*#__PURE__*/_jsxs(VStack, {
|
|
361
374
|
alignItems: "flex-end",
|
|
362
375
|
justifyContent: "center",
|
|
363
|
-
children: [/*#__PURE__*/_jsx(
|
|
376
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
377
|
+
font: "label1",
|
|
364
378
|
children: formatDate(currentDate)
|
|
365
|
-
}), /*#__PURE__*/_jsx(
|
|
379
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
380
|
+
font: "label2",
|
|
366
381
|
children: volumeText
|
|
367
382
|
})]
|
|
368
383
|
}), /*#__PURE__*/_jsx(VStack, {
|
|
@@ -480,80 +495,6 @@ function TradingTrends() {
|
|
|
480
495
|
})]
|
|
481
496
|
});
|
|
482
497
|
}
|
|
483
|
-
const UVGradient = {
|
|
484
|
-
axis: 'y',
|
|
485
|
-
stops: [{
|
|
486
|
-
offset: 0,
|
|
487
|
-
color: 'green'
|
|
488
|
-
}, {
|
|
489
|
-
offset: 3,
|
|
490
|
-
color: 'yellow'
|
|
491
|
-
}, {
|
|
492
|
-
offset: 5,
|
|
493
|
-
color: 'orange'
|
|
494
|
-
}, {
|
|
495
|
-
offset: 8,
|
|
496
|
-
color: 'red'
|
|
497
|
-
}, {
|
|
498
|
-
offset: 10,
|
|
499
|
-
color: 'purple'
|
|
500
|
-
}]
|
|
501
|
-
};
|
|
502
|
-
const PreviousData = /*#__PURE__*/memo(_ref0 => {
|
|
503
|
-
let {
|
|
504
|
-
children,
|
|
505
|
-
currentHour,
|
|
506
|
-
clipOffset = 0
|
|
507
|
-
} = _ref0;
|
|
508
|
-
// we will clip the data to the current hour
|
|
509
|
-
const {
|
|
510
|
-
drawingArea,
|
|
511
|
-
getXScale
|
|
512
|
-
} = useCartesianChartContext();
|
|
513
|
-
const xScale = getXScale();
|
|
514
|
-
const currentHourX = xScale == null ? void 0 : xScale(currentHour);
|
|
515
|
-
const clipPath = useMemo(() => {
|
|
516
|
-
if (!xScale || currentHourX === undefined) return null;
|
|
517
|
-
|
|
518
|
-
// Create a rectangle from top-left of drawing area to currentHourX on the right
|
|
519
|
-
// Apply clipOffset to left, top, and bottom edges only (NOT to currentHourX)
|
|
520
|
-
const pathString = "M " + (drawingArea.x - clipOffset) + " " + (drawingArea.y - clipOffset) + " L " + currentHourX + " " + (drawingArea.y - clipOffset) + " L " + currentHourX + " " + (drawingArea.y + drawingArea.height + clipOffset) + " L " + (drawingArea.x - clipOffset) + " " + (drawingArea.y + drawingArea.height + clipOffset) + " Z";
|
|
521
|
-
return Skia.Path.MakeFromSVGString(pathString);
|
|
522
|
-
}, [xScale, currentHourX, drawingArea, clipOffset]);
|
|
523
|
-
if (!clipPath) return null;
|
|
524
|
-
return /*#__PURE__*/_jsx(Group, {
|
|
525
|
-
clip: clipPath,
|
|
526
|
-
opacity: 0.75,
|
|
527
|
-
children: children
|
|
528
|
-
});
|
|
529
|
-
});
|
|
530
|
-
const FutureData = /*#__PURE__*/memo(_ref1 => {
|
|
531
|
-
let {
|
|
532
|
-
children,
|
|
533
|
-
currentHour,
|
|
534
|
-
clipOffset = 0
|
|
535
|
-
} = _ref1;
|
|
536
|
-
// we will clip the data from the current hour to the right edge
|
|
537
|
-
const {
|
|
538
|
-
drawingArea,
|
|
539
|
-
getXScale
|
|
540
|
-
} = useCartesianChartContext();
|
|
541
|
-
const xScale = getXScale();
|
|
542
|
-
const currentHourX = xScale == null ? void 0 : xScale(currentHour);
|
|
543
|
-
const clipPath = useMemo(() => {
|
|
544
|
-
if (!xScale || currentHourX === undefined) return null;
|
|
545
|
-
|
|
546
|
-
// Create a rectangle from currentHourX to right edge of drawing area
|
|
547
|
-
// Apply clipOffset to top, bottom, and right, but NOT left (currentHourX)
|
|
548
|
-
const pathString = "M " + currentHourX + " " + (drawingArea.y - clipOffset) + " L " + (drawingArea.x + drawingArea.width + clipOffset) + " " + (drawingArea.y - clipOffset) + " L " + (drawingArea.x + drawingArea.width + clipOffset) + " " + (drawingArea.y + drawingArea.height + clipOffset) + " L " + currentHourX + " " + (drawingArea.y + drawingArea.height + clipOffset) + " Z";
|
|
549
|
-
return Skia.Path.MakeFromSVGString(pathString);
|
|
550
|
-
}, [xScale, currentHourX, drawingArea, clipOffset]);
|
|
551
|
-
if (!clipPath) return null;
|
|
552
|
-
return /*#__PURE__*/_jsx(Group, {
|
|
553
|
-
clip: clipPath,
|
|
554
|
-
children: children
|
|
555
|
-
});
|
|
556
|
-
});
|
|
557
498
|
const ScatterplotWithCustomLabels = /*#__PURE__*/memo(() => {
|
|
558
499
|
const theme = useTheme();
|
|
559
500
|
const dataPoints = useMemo(() => [{
|
|
@@ -637,13 +578,13 @@ const ScatterplotWithCustomLabels = /*#__PURE__*/memo(() => {
|
|
|
637
578
|
const yMax = Math.max(...yValues);
|
|
638
579
|
|
|
639
580
|
// Custom label component that places labels to the top-right
|
|
640
|
-
const TopRightPointLabel = useCallback(
|
|
581
|
+
const TopRightPointLabel = useCallback(_ref0 => {
|
|
641
582
|
let {
|
|
642
583
|
x,
|
|
643
584
|
y,
|
|
644
585
|
offset = 0,
|
|
645
586
|
children
|
|
646
|
-
} =
|
|
587
|
+
} = _ref0;
|
|
647
588
|
return /*#__PURE__*/_jsx(ChartText, {
|
|
648
589
|
font: "label1",
|
|
649
590
|
fontWeight: 600,
|