@coinbase/cds-mobile-visualization 3.3.0 → 3.4.0-beta.10
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 +80 -0
- package/dts/chart/CartesianChart.d.ts +125 -0
- package/dts/chart/CartesianChart.d.ts.map +1 -0
- package/dts/chart/ChartContextBridge.d.ts +28 -0
- package/dts/chart/ChartContextBridge.d.ts.map +1 -0
- package/dts/chart/ChartProvider.d.ts +6 -0
- package/dts/chart/ChartProvider.d.ts.map +1 -0
- package/dts/chart/Path.d.ts +91 -0
- package/dts/chart/Path.d.ts.map +1 -0
- package/dts/chart/PeriodSelector.d.ts +85 -0
- package/dts/chart/PeriodSelector.d.ts.map +1 -0
- package/dts/chart/area/Area.d.ts +77 -0
- package/dts/chart/area/Area.d.ts.map +1 -0
- package/dts/chart/area/AreaChart.d.ts +131 -0
- package/dts/chart/area/AreaChart.d.ts.map +1 -0
- package/dts/chart/area/DottedArea.d.ts +46 -0
- package/dts/chart/area/DottedArea.d.ts.map +1 -0
- package/dts/chart/area/GradientArea.d.ts +36 -0
- package/dts/chart/area/GradientArea.d.ts.map +1 -0
- package/dts/chart/area/SolidArea.d.ts +23 -0
- package/dts/chart/area/SolidArea.d.ts.map +1 -0
- package/dts/chart/area/index.d.ts +6 -0
- package/dts/chart/area/index.d.ts.map +1 -0
- package/dts/chart/axis/Axis.d.ts +194 -0
- package/dts/chart/axis/Axis.d.ts.map +1 -0
- package/dts/chart/axis/DefaultAxisTickLabel.d.ts +8 -0
- package/dts/chart/axis/DefaultAxisTickLabel.d.ts.map +1 -0
- package/dts/chart/axis/XAxis.d.ts +16 -0
- package/dts/chart/axis/XAxis.d.ts.map +1 -0
- package/dts/chart/axis/YAxis.d.ts +21 -0
- package/dts/chart/axis/YAxis.d.ts.map +1 -0
- package/dts/chart/axis/index.d.ts +5 -0
- package/dts/chart/axis/index.d.ts.map +1 -0
- package/dts/chart/bar/Bar.d.ts +92 -0
- package/dts/chart/bar/Bar.d.ts.map +1 -0
- package/dts/chart/bar/BarChart.d.ts +113 -0
- package/dts/chart/bar/BarChart.d.ts.map +1 -0
- package/dts/chart/bar/BarPlot.d.ts +30 -0
- package/dts/chart/bar/BarPlot.d.ts.map +1 -0
- package/dts/chart/bar/BarStack.d.ts +102 -0
- package/dts/chart/bar/BarStack.d.ts.map +1 -0
- package/dts/chart/bar/BarStackGroup.d.ts +36 -0
- package/dts/chart/bar/BarStackGroup.d.ts.map +1 -0
- package/dts/chart/bar/DefaultBar.d.ts +7 -0
- package/dts/chart/bar/DefaultBar.d.ts.map +1 -0
- package/dts/chart/bar/DefaultBarStack.d.ts +7 -0
- package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -0
- package/dts/chart/bar/index.d.ts +8 -0
- package/dts/chart/bar/index.d.ts.map +1 -0
- package/dts/chart/gradient/Gradient.d.ts +25 -0
- package/dts/chart/gradient/Gradient.d.ts.map +1 -0
- package/dts/chart/gradient/index.d.ts +2 -0
- package/dts/chart/gradient/index.d.ts.map +1 -0
- package/dts/chart/index.d.ts +15 -0
- package/dts/chart/index.d.ts.map +1 -0
- package/dts/chart/line/DefaultReferenceLineLabel.d.ts +9 -0
- package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +1 -0
- package/dts/chart/line/DottedLine.d.ts +20 -0
- package/dts/chart/line/DottedLine.d.ts.map +1 -0
- package/dts/chart/line/Line.d.ts +115 -0
- package/dts/chart/line/Line.d.ts.map +1 -0
- package/dts/chart/line/LineChart.d.ts +118 -0
- package/dts/chart/line/LineChart.d.ts.map +1 -0
- package/dts/chart/line/ReferenceLine.d.ts +139 -0
- package/dts/chart/line/ReferenceLine.d.ts.map +1 -0
- package/dts/chart/line/SolidLine.d.ts +15 -0
- package/dts/chart/line/SolidLine.d.ts.map +1 -0
- package/dts/chart/line/index.d.ts +7 -0
- package/dts/chart/line/index.d.ts.map +1 -0
- package/dts/chart/point/DefaultPointLabel.d.ts +10 -0
- package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
- package/dts/chart/point/Point.d.ts +120 -0
- package/dts/chart/point/Point.d.ts.map +1 -0
- package/dts/chart/point/index.d.ts +3 -0
- package/dts/chart/point/index.d.ts.map +1 -0
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +8 -0
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -0
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +12 -0
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -0
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +11 -0
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
- package/dts/chart/scrubber/Scrubber.d.ts +233 -0
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +44 -0
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +31 -0
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
- package/dts/chart/scrubber/ScrubberProvider.d.ts +20 -0
- package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -0
- package/dts/chart/scrubber/index.d.ts +5 -0
- package/dts/chart/scrubber/index.d.ts.map +1 -0
- package/dts/chart/text/ChartText.d.ts +164 -0
- package/dts/chart/text/ChartText.d.ts.map +1 -0
- package/dts/chart/text/ChartTextGroup.d.ts +61 -0
- package/dts/chart/text/ChartTextGroup.d.ts.map +1 -0
- package/dts/chart/text/index.d.ts +3 -0
- package/dts/chart/text/index.d.ts.map +1 -0
- package/dts/chart/utils/axis.d.ts +342 -0
- package/dts/chart/utils/axis.d.ts.map +1 -0
- package/dts/chart/utils/bar.d.ts +20 -0
- package/dts/chart/utils/bar.d.ts.map +1 -0
- package/dts/chart/utils/chart.d.ts +124 -0
- package/dts/chart/utils/chart.d.ts.map +1 -0
- package/dts/chart/utils/context.d.ts +116 -0
- package/dts/chart/utils/context.d.ts.map +1 -0
- package/dts/chart/utils/gradient.d.ts +117 -0
- package/dts/chart/utils/gradient.d.ts.map +1 -0
- package/dts/chart/utils/index.d.ts +11 -0
- package/dts/chart/utils/index.d.ts.map +1 -0
- package/dts/chart/utils/path.d.ts +160 -0
- package/dts/chart/utils/path.d.ts.map +1 -0
- package/dts/chart/utils/point.d.ts +134 -0
- package/dts/chart/utils/point.d.ts.map +1 -0
- package/dts/chart/utils/scale.d.ts +134 -0
- package/dts/chart/utils/scale.d.ts.map +1 -0
- package/dts/chart/utils/scrubber.d.ts +39 -0
- package/dts/chart/utils/scrubber.d.ts.map +1 -0
- package/dts/chart/utils/transition.d.ts +140 -0
- package/dts/chart/utils/transition.d.ts.map +1 -0
- package/dts/index.d.ts +2 -1
- package/dts/index.d.ts.map +1 -1
- package/dts/sparkline/Counter.d.ts +7 -2
- package/dts/sparkline/Sparkline.d.ts +67 -16
- package/dts/sparkline/Sparkline.d.ts.map +1 -1
- package/dts/sparkline/SparklineArea.d.ts +10 -4
- package/dts/sparkline/SparklineArea.d.ts.map +1 -1
- package/dts/sparkline/SparklineAreaPattern.d.ts +12 -4
- package/dts/sparkline/SparklineAreaPattern.d.ts.map +1 -1
- package/dts/sparkline/SparklineGradient.d.ts +21 -10
- package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
- package/dts/sparkline/__figma__/Sparkline.figma.d.ts +1 -1
- package/dts/sparkline/generateSparklineWithId.d.ts +8 -2
- package/dts/sparkline/generateSparklineWithId.d.ts.map +1 -1
- package/dts/sparkline/index.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineAccessibleView.d.ts +8 -3
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +132 -110
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +22 -9
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts +18 -7
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts +9 -4
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts +11 -6
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMinMax.d.ts +7 -5
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.d.ts +22 -10
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +21 -7
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts.map +1 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts +21 -16
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts +29 -23
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.d.ts +22 -14
- package/dts/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.d.ts +9 -5
- package/dts/sparkline/sparkline-interactive/useMinMaxTransform.d.ts +11 -6
- package/dts/sparkline/sparkline-interactive/useOpacityAnimation.d.ts +5 -2
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts +17 -17
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.d.ts +16 -13
- package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts +106 -98
- package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts +1 -1
- package/dts/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.d.ts +22 -19
- package/esm/chart/CartesianChart.js +335 -0
- package/esm/chart/ChartContextBridge.js +148 -0
- package/esm/chart/ChartProvider.js +10 -0
- package/esm/chart/Path.js +218 -0
- package/esm/chart/PeriodSelector.js +136 -0
- package/esm/chart/__stories__/CartesianChart.stories.js +723 -0
- package/esm/chart/__stories__/Chart.stories.js +77 -0
- package/esm/chart/__stories__/PeriodSelector.stories.js +322 -0
- package/esm/chart/area/Area.js +75 -0
- package/esm/chart/area/AreaChart.js +151 -0
- package/esm/chart/area/DottedArea.js +80 -0
- package/esm/chart/area/GradientArea.js +54 -0
- package/esm/chart/area/SolidArea.js +38 -0
- package/esm/chart/area/__stories__/AreaChart.stories.js +100 -0
- package/esm/chart/area/index.js +7 -0
- package/esm/chart/axis/Axis.js +45 -0
- package/esm/chart/axis/DefaultAxisTickLabel.js +11 -0
- package/esm/chart/axis/XAxis.js +188 -0
- package/esm/chart/axis/YAxis.js +177 -0
- package/esm/chart/axis/__stories__/Axis.stories.js +276 -0
- package/esm/chart/axis/index.js +6 -0
- package/esm/chart/bar/Bar.js +69 -0
- package/esm/chart/bar/BarChart.js +125 -0
- package/esm/chart/bar/BarPlot.js +102 -0
- package/esm/chart/bar/BarStack.js +551 -0
- package/esm/chart/bar/BarStackGroup.js +79 -0
- package/esm/chart/bar/DefaultBar.js +56 -0
- package/esm/chart/bar/DefaultBarStack.js +47 -0
- package/esm/chart/bar/__stories__/BarChart.stories.js +668 -0
- package/esm/chart/bar/index.js +9 -0
- package/esm/chart/gradient/Gradient.js +53 -0
- package/esm/chart/gradient/index.js +1 -0
- package/esm/chart/index.js +16 -0
- package/esm/chart/line/DefaultReferenceLineLabel.js +66 -0
- package/esm/chart/line/DottedLine.js +50 -0
- package/esm/chart/line/Line.js +178 -0
- package/esm/chart/line/LineChart.js +121 -0
- package/esm/chart/line/ReferenceLine.js +132 -0
- package/esm/chart/line/SolidLine.js +46 -0
- package/esm/chart/line/__stories__/LineChart.stories.js +2372 -0
- package/esm/chart/line/__stories__/ReferenceLine.stories.js +132 -0
- package/esm/chart/line/index.js +8 -0
- package/esm/chart/point/DefaultPointLabel.js +39 -0
- package/esm/chart/point/Point.js +188 -0
- package/esm/chart/point/index.js +2 -0
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +179 -0
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +43 -0
- package/esm/chart/scrubber/DefaultScrubberLabel.js +28 -0
- package/esm/chart/scrubber/Scrubber.js +166 -0
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +161 -0
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +185 -0
- package/esm/chart/scrubber/ScrubberProvider.js +135 -0
- package/esm/chart/scrubber/index.js +4 -0
- package/esm/chart/text/ChartText.js +305 -0
- package/esm/chart/text/ChartTextGroup.js +211 -0
- package/esm/chart/text/index.js +4 -0
- package/esm/chart/utils/axis.js +592 -0
- package/esm/chart/utils/bar.js +24 -0
- package/esm/chart/utils/chart.js +270 -0
- package/esm/chart/utils/context.js +15 -0
- package/esm/chart/utils/gradient.js +305 -0
- package/esm/chart/utils/index.js +12 -0
- package/esm/chart/utils/path.js +274 -0
- package/esm/chart/utils/point.js +229 -0
- package/esm/chart/utils/scale.js +277 -0
- package/esm/chart/utils/scrubber.js +139 -0
- package/esm/chart/utils/transition.js +185 -0
- package/esm/index.js +4 -1
- package/esm/sparkline/Sparkline.js +129 -16
- package/esm/sparkline/SparklineArea.js +7 -2
- package/esm/sparkline/SparklineAreaPattern.js +4 -2
- package/esm/sparkline/SparklineGradient.js +4 -0
- package/esm/sparkline/__stories__/Sparkline.stories.js +11 -7
- package/esm/sparkline/__stories__/SparklineGradient.stories.js +7 -4
- package/esm/sparkline/generateSparklineWithId.js +3 -2
- package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +5 -1
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.js +5 -2
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePaths.js +4 -0
- package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +76 -24
- package/esm/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.js +17 -9
- package/package.json +17 -11
- package/dts/sparkline/__stories__/Sparkline.stories.d.ts +0 -3
- package/dts/sparkline/__stories__/Sparkline.stories.d.ts.map +0 -1
- package/dts/sparkline/__stories__/SparklineGradient.stories.d.ts +0 -3
- package/dts/sparkline/__stories__/SparklineGradient.stories.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts +0 -3
- package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveHoverDate.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveHoverDate.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePanGestureHandler.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePanGestureHandler.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveTimeseriesPaths.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveTimeseriesPaths.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__tests__/useMinMaxTransform.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__tests__/useMinMaxTransform.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts +0 -4
- package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__tests__/useSparklineInteractiveHeaderStyles.test.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive-header/__tests__/useSparklineInteractiveHeaderStyles.test.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/point.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE9E,OAAO,EAEL,KAAK,kBAAkB,EAIvB,KAAK,iBAAiB,EACvB,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,EAAE,OAAO,kBAAkB,KAAG,MAc9E,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAc/F;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,EAChD,CAAC,EACD,CAAC,EACD,MAAM,EACN,MAAM,GACP,EAAE;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,iBAAiB,CAAC;CAC3B,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAM3B;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,GAAI,2BAK1B;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,kBAAkB,CAAC;CAC5B,KAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAEzB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,yCAM3B;IACD,IAAI,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IACnD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,kBAAkB,CAAC;CAC5B,KAAG,KAAK,CAAC;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAqDxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,kBAAkB,KAC3B;IAAE,mBAAmB,EAAE,uBAAuB,CAAC;IAAC,iBAAiB,EAAE,qBAAqB,CAAA;CAyB1F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,GAAG,MAAM,EACT,GAAG,MAAM,EACT,UAAU,kBAAkB,EAC5B,QAAQ,MAAM,KACb;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CA0BxB,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { ScaleBand, ScaleLinear, ScaleLogarithmic } from 'd3-scale';
|
|
2
|
+
import type { AxisBounds } from './chart';
|
|
3
|
+
export type ChartAxisScaleType = 'linear' | 'log' | 'band';
|
|
4
|
+
export type NumericScale =
|
|
5
|
+
| ScaleLinear<number, number, never>
|
|
6
|
+
| ScaleLogarithmic<number, number, never>;
|
|
7
|
+
export type CategoricalScale = ScaleBand<number>;
|
|
8
|
+
export type ChartScaleFunction = NumericScale | CategoricalScale;
|
|
9
|
+
export declare const isCategoricalScale: (scale: ChartScaleFunction) => scale is CategoricalScale;
|
|
10
|
+
export declare const isNumericScale: (scale: ChartScaleFunction) => scale is NumericScale;
|
|
11
|
+
/**
|
|
12
|
+
* Type guard to check if a scale is logarithmic.
|
|
13
|
+
*/
|
|
14
|
+
export declare const isLogScale: (
|
|
15
|
+
scale: ChartScaleFunction,
|
|
16
|
+
) => scale is ScaleLogarithmic<number, number, never>;
|
|
17
|
+
/**
|
|
18
|
+
* Type guard to check if a scale is a SerializableScale.
|
|
19
|
+
* This can be used in worklets to differentiate between scale objects and scale functions.
|
|
20
|
+
*/
|
|
21
|
+
export declare const isSerializableScale: (
|
|
22
|
+
scale: SerializableScale | ChartScaleFunction,
|
|
23
|
+
) => scale is SerializableScale;
|
|
24
|
+
/**
|
|
25
|
+
* Create a numeric scale (linear or logarithmic)
|
|
26
|
+
* @returns A numeric scale function
|
|
27
|
+
*/
|
|
28
|
+
export declare const getNumericScale: ({
|
|
29
|
+
scaleType,
|
|
30
|
+
domain,
|
|
31
|
+
range,
|
|
32
|
+
}: {
|
|
33
|
+
scaleType: 'linear' | 'log';
|
|
34
|
+
domain: AxisBounds;
|
|
35
|
+
range: AxisBounds;
|
|
36
|
+
}) => NumericScale;
|
|
37
|
+
/**
|
|
38
|
+
* Create a categorical scale (band)
|
|
39
|
+
* @returns A categorical scale function
|
|
40
|
+
*/
|
|
41
|
+
export declare const getCategoricalScale: ({
|
|
42
|
+
domain,
|
|
43
|
+
range,
|
|
44
|
+
padding,
|
|
45
|
+
}: {
|
|
46
|
+
domain: AxisBounds;
|
|
47
|
+
range: AxisBounds;
|
|
48
|
+
padding?: number;
|
|
49
|
+
}) => CategoricalScale;
|
|
50
|
+
/**
|
|
51
|
+
* Convert a D3 scale to a serializable scale configuration that can be used in worklets
|
|
52
|
+
*/
|
|
53
|
+
export declare function convertToSerializableScale(
|
|
54
|
+
d3Scale: ChartScaleFunction,
|
|
55
|
+
): SerializableScale | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Convert multiple D3 scales to serializable scales
|
|
58
|
+
*/
|
|
59
|
+
export declare function convertScalesToSerializableScales(
|
|
60
|
+
xScale?: ChartScaleFunction,
|
|
61
|
+
yScales?: Map<string, ChartScaleFunction>,
|
|
62
|
+
): {
|
|
63
|
+
xScale?: SerializableScale;
|
|
64
|
+
yScales: Record<string, SerializableScale>;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Serializable scale implementations based on D3 scale concepts.
|
|
68
|
+
* These scales can be used directly on the UI thread in Reanimated worklets.
|
|
69
|
+
*/
|
|
70
|
+
export type SerializableLinearScale = {
|
|
71
|
+
type: 'linear';
|
|
72
|
+
domain: [number, number];
|
|
73
|
+
range: [number, number];
|
|
74
|
+
};
|
|
75
|
+
export type SerializableLogScale = {
|
|
76
|
+
type: 'log';
|
|
77
|
+
domain: [number, number];
|
|
78
|
+
range: [number, number];
|
|
79
|
+
base?: number;
|
|
80
|
+
};
|
|
81
|
+
export type SerializableBandScale = {
|
|
82
|
+
type: 'band';
|
|
83
|
+
domain: [number, number];
|
|
84
|
+
range: [number, number];
|
|
85
|
+
bandwidth: number;
|
|
86
|
+
step: number;
|
|
87
|
+
};
|
|
88
|
+
export type SerializableScale =
|
|
89
|
+
| SerializableLinearScale
|
|
90
|
+
| SerializableLogScale
|
|
91
|
+
| SerializableBandScale;
|
|
92
|
+
/**
|
|
93
|
+
* Serializable linear scale function
|
|
94
|
+
*/
|
|
95
|
+
export declare function applyLinearScale(value: number, scale: SerializableLinearScale): number;
|
|
96
|
+
/**
|
|
97
|
+
* Serializable log scale function
|
|
98
|
+
*/
|
|
99
|
+
export declare function applyLogScale(value: number, scale: SerializableLogScale): number;
|
|
100
|
+
/**
|
|
101
|
+
* Serializable band scale function
|
|
102
|
+
*/
|
|
103
|
+
export declare function applyBandScale(value: number, scale: SerializableBandScale): number;
|
|
104
|
+
/**
|
|
105
|
+
* Universal serializable scale function that handles any scale type
|
|
106
|
+
*/
|
|
107
|
+
export declare function applySerializableScale(value: number, scale: SerializableScale): number;
|
|
108
|
+
/**
|
|
109
|
+
* Get bandwidth for band scales (returns 0 for other scale types)
|
|
110
|
+
*/
|
|
111
|
+
export declare function getScaleBandwidth(scale: SerializableBandScale): number;
|
|
112
|
+
/**
|
|
113
|
+
* Invert a linear scale - convert from range value back to domain value
|
|
114
|
+
*/
|
|
115
|
+
export declare function invertLinearScale(
|
|
116
|
+
rangeValue: number,
|
|
117
|
+
scale: SerializableLinearScale,
|
|
118
|
+
): number;
|
|
119
|
+
/**
|
|
120
|
+
* Invert a log scale - convert from range value back to domain value
|
|
121
|
+
*/
|
|
122
|
+
export declare function invertLogScale(rangeValue: number, scale: SerializableLogScale): number;
|
|
123
|
+
/**
|
|
124
|
+
* Invert a band scale - convert from range value back to domain index
|
|
125
|
+
*/
|
|
126
|
+
export declare function invertBandScale(rangeValue: number, scale: SerializableBandScale): number;
|
|
127
|
+
/**
|
|
128
|
+
* Universal serializable scale invert function that handles any scale type
|
|
129
|
+
*/
|
|
130
|
+
export declare function invertSerializableScale(
|
|
131
|
+
rangeValue: number,
|
|
132
|
+
scale: SerializableScale,
|
|
133
|
+
): number;
|
|
134
|
+
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/scale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3D,MAAM,MAAM,YAAY,GACpB,WAAW,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,CAatF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAOtE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,GAAG,MAAM,CAQ5F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAuBtF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAYxF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAa5F"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Rect } from '@coinbase/cds-common/types';
|
|
2
|
+
export type ScrubberLabelPosition = 'left' | 'right';
|
|
3
|
+
export type LabelPosition = {
|
|
4
|
+
seriesId: string;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
export type LabelDimensions = {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Determines which side (left/right) to place scrubber labels based on available space.
|
|
14
|
+
* Prefers right side, switches to left when labels would overflow.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getLabelPosition: (
|
|
17
|
+
beaconX: number,
|
|
18
|
+
maxLabelWidth: number,
|
|
19
|
+
drawingArea: Rect,
|
|
20
|
+
xOffset?: number,
|
|
21
|
+
) => ScrubberLabelPosition;
|
|
22
|
+
type LabelDimension = {
|
|
23
|
+
seriesId: string;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
preferredX: number;
|
|
27
|
+
preferredY: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Calculates Y positions for all labels avoiding overlaps while maintaining order.
|
|
31
|
+
*/
|
|
32
|
+
export declare const calculateLabelYPositions: (
|
|
33
|
+
dimensions: LabelDimension[],
|
|
34
|
+
drawingArea: Rect,
|
|
35
|
+
labelHeight: number,
|
|
36
|
+
minGap: number,
|
|
37
|
+
) => Map<string, number>;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=scrubber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrubber.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/scrubber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEvD,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,MAAM,EACf,eAAe,MAAM,EACrB,aAAa,IAAI,EACjB,UAAS,MAAW,KACnB,qBAWF,CAAC;AAQF,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,cAAc,EAAE,EAC5B,aAAa,IAAI,EACjB,aAAa,MAAM,EACnB,QAAQ,MAAM,KACb,GAAG,CAAC,MAAM,EAAE,MAAM,CAsIpB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ExtrapolationType,
|
|
3
|
+
type SharedValue,
|
|
4
|
+
type WithSpringConfig,
|
|
5
|
+
type WithTimingConfig,
|
|
6
|
+
} from 'react-native-reanimated';
|
|
7
|
+
import { type SkPath } from '@shopify/react-native-skia';
|
|
8
|
+
/**
|
|
9
|
+
* Transition for animations.
|
|
10
|
+
* Supports timing and spring animation types.
|
|
11
|
+
* Used for paths, positions, opacity, and any other animated properties.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Spring animation
|
|
15
|
+
* { type: 'spring', damping: 10, stiffness: 100 }
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Timing animation
|
|
19
|
+
* { type: 'timing', duration: 500, easing: Easing.inOut(Easing.ease) }
|
|
20
|
+
*/
|
|
21
|
+
export type Transition =
|
|
22
|
+
| ({
|
|
23
|
+
type: 'timing';
|
|
24
|
+
} & WithTimingConfig)
|
|
25
|
+
| ({
|
|
26
|
+
type: 'spring';
|
|
27
|
+
} & WithSpringConfig);
|
|
28
|
+
/**
|
|
29
|
+
* Default transition configuration used across all chart components.
|
|
30
|
+
*/
|
|
31
|
+
export declare const defaultTransition: Transition;
|
|
32
|
+
/**
|
|
33
|
+
* Duration in milliseconds for accessory elements to fade in.
|
|
34
|
+
*/
|
|
35
|
+
export declare const accessoryFadeTransitionDuration = 150;
|
|
36
|
+
/**
|
|
37
|
+
* Delay in milliseconds before accessory elements fade in.
|
|
38
|
+
*/
|
|
39
|
+
export declare const accessoryFadeTransitionDelay = 350;
|
|
40
|
+
/**
|
|
41
|
+
* Custom hook that uses d3-interpolate-path for more robust path interpolation.
|
|
42
|
+
* then use Skia's native interpolation in the worklet.
|
|
43
|
+
*
|
|
44
|
+
* @param progress - Shared value between 0 and 1
|
|
45
|
+
* @param fromPath - Starting path as SVG string
|
|
46
|
+
* @param toPath - Ending path as SVG string
|
|
47
|
+
* @returns Interpolated SkPath as a shared value
|
|
48
|
+
*/
|
|
49
|
+
export declare const useD3PathInterpolation: (
|
|
50
|
+
progress: SharedValue<number>,
|
|
51
|
+
fromPath: string,
|
|
52
|
+
toPath: string,
|
|
53
|
+
) => SharedValue<SkPath>;
|
|
54
|
+
/**
|
|
55
|
+
* @worklet
|
|
56
|
+
*/
|
|
57
|
+
type Interpolator<T> = (
|
|
58
|
+
value: number,
|
|
59
|
+
input: number[],
|
|
60
|
+
output: T[],
|
|
61
|
+
options: ExtrapolationType,
|
|
62
|
+
result: T,
|
|
63
|
+
) => T;
|
|
64
|
+
export declare const useInterpolator: <T>(
|
|
65
|
+
factory: () => T,
|
|
66
|
+
value: SharedValue<number>,
|
|
67
|
+
interpolator: Interpolator<T>,
|
|
68
|
+
input: number[],
|
|
69
|
+
output: T[],
|
|
70
|
+
options?: ExtrapolationType,
|
|
71
|
+
) => SharedValue<T>;
|
|
72
|
+
/**
|
|
73
|
+
* Builds a react-native-reanimated animation based on the configuration.
|
|
74
|
+
*
|
|
75
|
+
* @param targetValue - The target value to animate to
|
|
76
|
+
* @param config - The transition configuration
|
|
77
|
+
* @returns The animation value to assign to a shared value
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* // Use directly for animation
|
|
81
|
+
* progress.value = 0;
|
|
82
|
+
* progress.value = buildTransition(1, { type: 'spring', damping: 10, stiffness: 100 });
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* // Coordinate animations
|
|
86
|
+
* animatedX.value = buildTransition(100, { type: 'spring', damping: 10, stiffness: 100 });
|
|
87
|
+
* animatedY.value = buildTransition(200, { type: 'spring', damping: 10, stiffness: 100 });
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* // Timing animation
|
|
91
|
+
* progress.value = buildTransition(1, { type: 'timing', duration: 500 });
|
|
92
|
+
*/
|
|
93
|
+
export declare const buildTransition: (targetValue: number, transition: Transition) => number;
|
|
94
|
+
/**
|
|
95
|
+
* Hook for path animation state and transitions.
|
|
96
|
+
*
|
|
97
|
+
* @param currentPath - Current target path to animate to
|
|
98
|
+
* @param initialPath - Initial path for enter animation. When provided, the first animation will go from initialPath to currentPath.
|
|
99
|
+
* @param transition - Transition configuration
|
|
100
|
+
* @returns Animated SkPath as a shared value
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* // Simple path transition
|
|
104
|
+
* const path = usePathTransition({
|
|
105
|
+
* currentPath: d ?? '',
|
|
106
|
+
* animate: shouldAnimate,
|
|
107
|
+
* transition: { type: 'timing', duration: 3000 }
|
|
108
|
+
* });
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* // Enter animation with different initial config (like DefaultBar)
|
|
112
|
+
* const path = usePathTransition({
|
|
113
|
+
* currentPath: targetPath,
|
|
114
|
+
* initialPath: baselinePath,
|
|
115
|
+
* animate: true,
|
|
116
|
+
* transition: { type: 'timing', duration: 300 }
|
|
117
|
+
* });
|
|
118
|
+
*/
|
|
119
|
+
export declare const usePathTransition: ({
|
|
120
|
+
currentPath,
|
|
121
|
+
initialPath,
|
|
122
|
+
transition,
|
|
123
|
+
}: {
|
|
124
|
+
/**
|
|
125
|
+
* Current target path to animate to.
|
|
126
|
+
*/
|
|
127
|
+
currentPath: string;
|
|
128
|
+
/**
|
|
129
|
+
* Initial path for enter animation.
|
|
130
|
+
* When provided, the first animation will go from initialPath to currentPath.
|
|
131
|
+
* If not provided, defaults to currentPath (no enter animation).
|
|
132
|
+
*/
|
|
133
|
+
initialPath?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Transition configuration
|
|
136
|
+
*/
|
|
137
|
+
transition?: Transition;
|
|
138
|
+
}) => SharedValue<SkPath>;
|
|
139
|
+
export {};
|
|
140
|
+
//# sourceMappingURL=transition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAIhB,KAAK,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AI/B;IACD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,KAAG,WAAW,CAAC,MAAM,CAwBrB,CAAC"}
|
package/dts/index.d.ts
CHANGED
package/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { CounterBaseProps } from '@coinbase/cds-mobile/visualizations/Counter';
|
|
2
|
-
export declare const Counter: ({
|
|
3
|
-
|
|
2
|
+
export declare const Counter: ({
|
|
3
|
+
startNum,
|
|
4
|
+
endNum,
|
|
5
|
+
renderNum,
|
|
6
|
+
durationInMillis,
|
|
7
|
+
}: CounterBaseProps) => import('react/jsx-runtime').JSX.Element;
|
|
8
|
+
//# sourceMappingURL=Counter.d.ts.map
|
|
@@ -1,22 +1,73 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Path } from 'react-native-svg';
|
|
2
3
|
import type { ElementChildren, SharedProps } from '@coinbase/cds-common/types';
|
|
3
4
|
import type { SparklineAreaBaseProps } from './SparklineArea';
|
|
5
|
+
export type SparklineStrokeType = 'gradient' | 'solid';
|
|
6
|
+
export type SparklineFillType = 'dotted' | 'gradient' | 'gradientDotted';
|
|
4
7
|
export type SparklineBaseProps = SharedProps & {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
/** @danger Use this only if the background color beneath the Sparkline is a non-CDS color. It ensures an accessible contrast by returning either white or black when color is set to 'auto'. Accepts any valid color format (hex, RGB, RGBA). */
|
|
9
|
+
background?: string;
|
|
10
|
+
/** The color of the Sparkline graph's line. Accepts any raw color value (hex, rgba, hsl, etc) or 'auto'. Using 'auto' dynamically selects black or white for optimal accessibility. Does not work with CDS theme color names like 'fgPrimary' or CSS variables. */
|
|
11
|
+
color: string;
|
|
12
|
+
/** Height of the Sparkline */
|
|
13
|
+
height: number;
|
|
14
|
+
/** Svg path as string. CDS offers a `useSparklinePath` which is useful to generate this string. This is accessible via `import { useSparklinePath } from '@coinbase/cds-common/visualizations/useSparklinePath';`. Alternatively, you can use product tailored tooling to generate the SVG path. This component only requires a valid path string is provided. */
|
|
15
|
+
path?: string;
|
|
16
|
+
/** Width of the Sparkline */
|
|
17
|
+
width: number;
|
|
18
|
+
/** an optional SparklineArea that can be used to fill in the Sparkline */
|
|
19
|
+
children?: ElementChildren<SparklineAreaBaseProps>;
|
|
20
|
+
/** Scales the sparkline to show more or less variance. Use a number less than 1 for less variance and a number greater than 1 for more variance. If you use a number greater than 1 it may clip the boundaries of the sparkline. */
|
|
21
|
+
yAxisScalingFactor?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Type of stroke to use for the line
|
|
24
|
+
* - 'gradient': Gradient colored stroke line
|
|
25
|
+
* - 'solid': Solid colored stroke line
|
|
26
|
+
*
|
|
27
|
+
* @default 'solid'
|
|
28
|
+
*/
|
|
29
|
+
strokeType?: SparklineStrokeType;
|
|
30
|
+
/**
|
|
31
|
+
* Type of fill to use for the area
|
|
32
|
+
* @default 'dotted'
|
|
33
|
+
*/
|
|
34
|
+
fillType?: SparklineFillType;
|
|
19
35
|
};
|
|
20
36
|
export type SparklineProps = SparklineBaseProps;
|
|
21
|
-
|
|
22
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use LineChart instead.
|
|
39
|
+
*/
|
|
40
|
+
export declare const Sparkline: React.MemoExoticComponent<
|
|
41
|
+
React.ForwardRefExoticComponent<
|
|
42
|
+
SharedProps & {
|
|
43
|
+
/** @danger Use this only if the background color beneath the Sparkline is a non-CDS color. It ensures an accessible contrast by returning either white or black when color is set to 'auto'. Accepts any valid color format (hex, RGB, RGBA). */
|
|
44
|
+
background?: string;
|
|
45
|
+
/** The color of the Sparkline graph's line. Accepts any raw color value (hex, rgba, hsl, etc) or 'auto'. Using 'auto' dynamically selects black or white for optimal accessibility. Does not work with CDS theme color names like 'fgPrimary' or CSS variables. */
|
|
46
|
+
color: string;
|
|
47
|
+
/** Height of the Sparkline */
|
|
48
|
+
height: number;
|
|
49
|
+
/** Svg path as string. CDS offers a `useSparklinePath` which is useful to generate this string. This is accessible via `import { useSparklinePath } from '@coinbase/cds-common/visualizations/useSparklinePath';`. Alternatively, you can use product tailored tooling to generate the SVG path. This component only requires a valid path string is provided. */
|
|
50
|
+
path?: string;
|
|
51
|
+
/** Width of the Sparkline */
|
|
52
|
+
width: number;
|
|
53
|
+
/** an optional SparklineArea that can be used to fill in the Sparkline */
|
|
54
|
+
children?: ElementChildren<SparklineAreaBaseProps>;
|
|
55
|
+
/** Scales the sparkline to show more or less variance. Use a number less than 1 for less variance and a number greater than 1 for more variance. If you use a number greater than 1 it may clip the boundaries of the sparkline. */
|
|
56
|
+
yAxisScalingFactor?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Type of stroke to use for the line
|
|
59
|
+
* - 'gradient': Gradient colored stroke line
|
|
60
|
+
* - 'solid': Solid colored stroke line
|
|
61
|
+
*
|
|
62
|
+
* @default 'solid'
|
|
63
|
+
*/
|
|
64
|
+
strokeType?: SparklineStrokeType;
|
|
65
|
+
/**
|
|
66
|
+
* Type of fill to use for the area
|
|
67
|
+
* @default 'dotted'
|
|
68
|
+
*/
|
|
69
|
+
fillType?: SparklineFillType;
|
|
70
|
+
} & React.RefAttributes<Path | null>
|
|
71
|
+
>
|
|
72
|
+
>;
|
|
73
|
+
//# sourceMappingURL=Sparkline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sparkline.d.ts","sourceRoot":"","sources":["../../src/sparkline/Sparkline.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Sparkline.d.ts","sourceRoot":"","sources":["../../src/sparkline/Sparkline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AACjE,OAAO,EAAiC,IAAI,EAAmB,MAAM,kBAAkB,CAAC;AAGxF,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAQ/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,OAAO,CAAC;AACvD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAEzE,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG;IAC7C,iPAAiP;IACjP,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oQAAoQ;IACpQ,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,kWAAkW;IAClW,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,eAAe,CAAC,sBAAsB,CAAC,CAAC;IACnD,oOAAoO;IACpO,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,SAAS;IAlCpB,iPAAiP;iBACpO,MAAM;IACnB,oQAAoQ;WAC7P,MAAM;IACb,8BAA8B;YACtB,MAAM;IACd,kWAAkW;WAC3V,MAAM;IACb,6BAA6B;WACtB,MAAM;IACb,0EAA0E;eAC/D,eAAe,CAAC,sBAAsB,CAAC;IAClD,oOAAoO;yBAC/M,MAAM;IAC3B;;;;;;OAMG;iBACU,mBAAmB;IAChC;;;OAGG;eACQ,iBAAiB;sCAiK7B,CAAC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Path } from 'react-native-svg';
|
|
3
3
|
export type SparklineAreaBaseProps = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
area?: string;
|
|
5
|
+
patternId?: string;
|
|
6
|
+
maskId?: string;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use AreaChart instead.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SparklineArea: React.MemoExoticComponent<
|
|
12
|
+
React.ForwardRefExoticComponent<SparklineAreaBaseProps & React.RefAttributes<Path | null>>
|
|
13
|
+
>;
|
|
14
|
+
//# sourceMappingURL=SparklineArea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparklineArea.d.ts","sourceRoot":"","sources":["../../src/sparkline/SparklineArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"SparklineArea.d.ts","sourceRoot":"","sources":["../../src/sparkline/SparklineArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,uHAazB,CAAC"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export type SparklineAreaPatternBaseProps = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
color: string;
|
|
3
|
+
id: string;
|
|
4
|
+
/**
|
|
5
|
+
* Opacity for the pattern. If not provided, uses theme-based opacity from useSparklineAreaOpacity.
|
|
6
|
+
*/
|
|
7
|
+
opacity?: number;
|
|
4
8
|
};
|
|
5
|
-
export declare const SparklineAreaPattern: ({
|
|
6
|
-
|
|
9
|
+
export declare const SparklineAreaPattern: ({
|
|
10
|
+
color,
|
|
11
|
+
id,
|
|
12
|
+
opacity,
|
|
13
|
+
}: SparklineAreaPatternBaseProps) => import('react/jsx-runtime').JSX.Element;
|
|
14
|
+
//# sourceMappingURL=SparklineAreaPattern.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparklineAreaPattern.d.ts","sourceRoot":"","sources":["../../src/sparkline/SparklineAreaPattern.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"SparklineAreaPattern.d.ts","sourceRoot":"","sources":["../../src/sparkline/SparklineAreaPattern.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,wBAAwB,6BAA6B,4CAazF,CAAC"}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Path } from 'react-native-svg';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use LineChart instead.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SparklineGradient: React.MemoExoticComponent<
|
|
7
|
+
React.ForwardRefExoticComponent<
|
|
8
|
+
import('@coinbase/cds-common').SharedProps & {
|
|
9
|
+
background?: string;
|
|
10
|
+
color: string;
|
|
11
|
+
height: number;
|
|
12
|
+
path?: string;
|
|
13
|
+
width: number;
|
|
14
|
+
children?: import('@coinbase/cds-common').ElementChildren<
|
|
15
|
+
import('./SparklineArea').SparklineAreaBaseProps
|
|
16
|
+
>;
|
|
17
|
+
yAxisScalingFactor?: number;
|
|
18
|
+
strokeType?: import('./Sparkline').SparklineStrokeType;
|
|
19
|
+
fillType?: import('./Sparkline').SparklineFillType;
|
|
20
|
+
} & React.RefAttributes<Path | null>
|
|
21
|
+
>
|
|
22
|
+
>;
|
|
23
|
+
//# sourceMappingURL=SparklineGradient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparklineGradient.d.ts","sourceRoot":"","sources":["../../src/sparkline/SparklineGradient.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AACjE,OAAO,EAA2B,IAAI,EAAa,MAAM,kBAAkB,CAAC;AAY5E,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"SparklineGradient.d.ts","sourceRoot":"","sources":["../../src/sparkline/SparklineGradient.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AACjE,OAAO,EAA2B,IAAI,EAAa,MAAM,kBAAkB,CAAC;AAY5E;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;sCAqD7B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=Sparkline.figma.d.ts.map
|
|
2
|
+
//# sourceMappingURL=Sparkline.figma.d.ts.map
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { ElementChildren } from '@coinbase/cds-common/types';
|
|
3
3
|
import type { SparklineAreaBaseProps } from './SparklineArea';
|
|
4
|
-
export declare function generateSparklineAreaWithId(
|
|
5
|
-
|
|
4
|
+
export declare function generateSparklineAreaWithId(
|
|
5
|
+
id: string,
|
|
6
|
+
children: ElementChildren<SparklineAreaBaseProps>,
|
|
7
|
+
maskId?: string,
|
|
8
|
+
):
|
|
9
|
+
| React.ReactElement<SparklineAreaBaseProps, string | React.JSXElementConstructor<any>>
|
|
10
|
+
| undefined;
|
|
11
|
+
//# sourceMappingURL=generateSparklineWithId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSparklineWithId.d.ts","sourceRoot":"","sources":["../../src/sparkline/generateSparklineWithId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,eAAe,CAAC,sBAAsB,CAAC,
|
|
1
|
+
{"version":3,"file":"generateSparklineWithId.d.ts","sourceRoot":"","sources":["../../src/sparkline/generateSparklineWithId.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,eAAe,CAAC,sBAAsB,CAAC,EACjD,MAAM,CAAC,EAAE,MAAM,qGAQhB"}
|
package/dts/sparkline/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export * from './sparkline-interactive/SparklineInteractive';
|
|
|
3
3
|
export * from './sparkline-interactive-header/SparklineInteractiveHeader';
|
|
4
4
|
export * from './SparklineArea';
|
|
5
5
|
export * from './SparklineGradient';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SparklineInteractiveBaseProps } from './SparklineInteractive';
|
|
3
3
|
type SparklineAccessibleViewProps<Period extends string> = {
|
|
4
|
-
|
|
4
|
+
selectedPeriod: Period;
|
|
5
5
|
} & Pick<SparklineInteractiveBaseProps<Period>, 'data'>;
|
|
6
6
|
/**
|
|
7
7
|
* SparklineAccessibleView renders an accessible view for Sparkline Chart.
|
|
@@ -13,6 +13,11 @@ type SparklineAccessibleViewProps<Period extends string> = {
|
|
|
13
13
|
* @param data - The sparkline data mapped by time period
|
|
14
14
|
* @param selectedPeriod - The currently selected time period
|
|
15
15
|
*/
|
|
16
|
-
export declare const SparklineAccessibleView: React.MemoExoticComponent<
|
|
16
|
+
export declare const SparklineAccessibleView: React.MemoExoticComponent<
|
|
17
|
+
<Period extends string>({
|
|
18
|
+
data,
|
|
19
|
+
selectedPeriod,
|
|
20
|
+
}: SparklineAccessibleViewProps<Period>) => import('react/jsx-runtime').JSX.Element
|
|
21
|
+
>;
|
|
17
22
|
export {};
|
|
18
|
-
//# sourceMappingURL=SparklineAccessibleView.d.ts.map
|
|
23
|
+
//# sourceMappingURL=SparklineAccessibleView.d.ts.map
|