react-native-metrify 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +332 -0
- package/dist/cjs/core/animation/index.js +99 -0
- package/dist/cjs/core/animation/index.js.map +1 -0
- package/dist/cjs/core/animation/index.web.js +95 -0
- package/dist/cjs/core/animation/index.web.js.map +1 -0
- package/dist/cjs/core/hooks/index.js +50 -0
- package/dist/cjs/core/hooks/index.js.map +1 -0
- package/dist/cjs/core/index.js +36 -0
- package/dist/cjs/core/index.js.map +1 -0
- package/dist/cjs/core/layout/index.js +80 -0
- package/dist/cjs/core/layout/index.js.map +1 -0
- package/dist/cjs/core/math/index.js +62 -0
- package/dist/cjs/core/math/index.js.map +1 -0
- package/dist/cjs/core/theme/ThemeProvider.js +63 -0
- package/dist/cjs/core/theme/ThemeProvider.js.map +1 -0
- package/dist/cjs/core/theme/index.js +13 -0
- package/dist/cjs/core/theme/index.js.map +1 -0
- package/dist/cjs/core/theme/themes.js +120 -0
- package/dist/cjs/core/theme/themes.js.map +1 -0
- package/dist/cjs/core/types/index.js +11 -0
- package/dist/cjs/core/types/index.js.map +1 -0
- package/dist/cjs/core/utils/responsive.js +118 -0
- package/dist/cjs/core/utils/responsive.js.map +1 -0
- package/dist/cjs/core/utils/time.js +84 -0
- package/dist/cjs/core/utils/time.js.map +1 -0
- package/dist/cjs/index.js +28 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/renderer-svg/adapters/index.js +67 -0
- package/dist/cjs/renderer-svg/adapters/index.js.map +1 -0
- package/dist/cjs/renderer-svg/index.js +25 -0
- package/dist/cjs/renderer-svg/index.js.map +1 -0
- package/dist/cjs/renderer-svg/paths/arc.js +79 -0
- package/dist/cjs/renderer-svg/paths/arc.js.map +1 -0
- package/dist/cjs/renderer-svg/paths/index.js +23 -0
- package/dist/cjs/renderer-svg/paths/index.js.map +1 -0
- package/dist/cjs/renderer-svg/paths/line.js +70 -0
- package/dist/cjs/renderer-svg/paths/line.js.map +1 -0
- package/dist/cjs/renderer-svg/paths/rect.js +54 -0
- package/dist/cjs/renderer-svg/paths/rect.js.map +1 -0
- package/dist/cjs/renderer-svg/primitives/AnimatedCircle.js +54 -0
- package/dist/cjs/renderer-svg/primitives/AnimatedCircle.js.map +1 -0
- package/dist/cjs/renderer-svg/primitives/AnimatedPath.js +54 -0
- package/dist/cjs/renderer-svg/primitives/AnimatedPath.js.map +1 -0
- package/dist/cjs/renderer-svg/primitives/Text.js +66 -0
- package/dist/cjs/renderer-svg/primitives/Text.js.map +1 -0
- package/dist/cjs/renderer-svg/primitives/index.js +23 -0
- package/dist/cjs/renderer-svg/primitives/index.js.map +1 -0
- package/dist/cjs/widgets/AreaChart/AreaChart.js +179 -0
- package/dist/cjs/widgets/AreaChart/AreaChart.js.map +1 -0
- package/dist/cjs/widgets/AreaChart/index.js +6 -0
- package/dist/cjs/widgets/AreaChart/index.js.map +1 -0
- package/dist/cjs/widgets/AreaChart/types.js +3 -0
- package/dist/cjs/widgets/AreaChart/types.js.map +1 -0
- package/dist/cjs/widgets/BarChart/BarChart.js +203 -0
- package/dist/cjs/widgets/BarChart/BarChart.js.map +1 -0
- package/dist/cjs/widgets/BarChart/index.js +9 -0
- package/dist/cjs/widgets/BarChart/index.js.map +1 -0
- package/dist/cjs/widgets/BarChart/types.js +3 -0
- package/dist/cjs/widgets/BarChart/types.js.map +1 -0
- package/dist/cjs/widgets/BoxPlot/BoxPlot.js +186 -0
- package/dist/cjs/widgets/BoxPlot/BoxPlot.js.map +1 -0
- package/dist/cjs/widgets/BoxPlot/index.js +6 -0
- package/dist/cjs/widgets/BoxPlot/index.js.map +1 -0
- package/dist/cjs/widgets/BoxPlot/types.js +3 -0
- package/dist/cjs/widgets/BoxPlot/types.js.map +1 -0
- package/dist/cjs/widgets/BubbleChart/BubbleChart.js +158 -0
- package/dist/cjs/widgets/BubbleChart/BubbleChart.js.map +1 -0
- package/dist/cjs/widgets/BubbleChart/index.js +6 -0
- package/dist/cjs/widgets/BubbleChart/index.js.map +1 -0
- package/dist/cjs/widgets/BubbleChart/types.js +3 -0
- package/dist/cjs/widgets/BubbleChart/types.js.map +1 -0
- package/dist/cjs/widgets/CandlestickChart/CandlestickChart.js +168 -0
- package/dist/cjs/widgets/CandlestickChart/CandlestickChart.js.map +1 -0
- package/dist/cjs/widgets/CandlestickChart/index.js +6 -0
- package/dist/cjs/widgets/CandlestickChart/index.js.map +1 -0
- package/dist/cjs/widgets/CandlestickChart/types.js +3 -0
- package/dist/cjs/widgets/CandlestickChart/types.js.map +1 -0
- package/dist/cjs/widgets/FunnelChart/FunnelChart.js +149 -0
- package/dist/cjs/widgets/FunnelChart/FunnelChart.js.map +1 -0
- package/dist/cjs/widgets/FunnelChart/index.js +6 -0
- package/dist/cjs/widgets/FunnelChart/index.js.map +1 -0
- package/dist/cjs/widgets/FunnelChart/types.js +3 -0
- package/dist/cjs/widgets/FunnelChart/types.js.map +1 -0
- package/dist/cjs/widgets/Gauge/Gauge.js +171 -0
- package/dist/cjs/widgets/Gauge/Gauge.js.map +1 -0
- package/dist/cjs/widgets/Gauge/index.js +9 -0
- package/dist/cjs/widgets/Gauge/index.js.map +1 -0
- package/dist/cjs/widgets/Gauge/types.js +3 -0
- package/dist/cjs/widgets/Gauge/types.js.map +1 -0
- package/dist/cjs/widgets/GroupedBarChart/GroupedBarChart.js +155 -0
- package/dist/cjs/widgets/GroupedBarChart/GroupedBarChart.js.map +1 -0
- package/dist/cjs/widgets/GroupedBarChart/index.js +6 -0
- package/dist/cjs/widgets/GroupedBarChart/index.js.map +1 -0
- package/dist/cjs/widgets/GroupedBarChart/types.js +3 -0
- package/dist/cjs/widgets/GroupedBarChart/types.js.map +1 -0
- package/dist/cjs/widgets/Heatmap/Heatmap.js +182 -0
- package/dist/cjs/widgets/Heatmap/Heatmap.js.map +1 -0
- package/dist/cjs/widgets/Heatmap/index.js +6 -0
- package/dist/cjs/widgets/Heatmap/index.js.map +1 -0
- package/dist/cjs/widgets/Heatmap/types.js +3 -0
- package/dist/cjs/widgets/Heatmap/types.js.map +1 -0
- package/dist/cjs/widgets/Histogram/Histogram.js +152 -0
- package/dist/cjs/widgets/Histogram/Histogram.js.map +1 -0
- package/dist/cjs/widgets/Histogram/index.js +6 -0
- package/dist/cjs/widgets/Histogram/index.js.map +1 -0
- package/dist/cjs/widgets/Histogram/types.js +3 -0
- package/dist/cjs/widgets/Histogram/types.js.map +1 -0
- package/dist/cjs/widgets/HorizontalBarChart/HorizontalBarChart.js +124 -0
- package/dist/cjs/widgets/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/dist/cjs/widgets/HorizontalBarChart/index.js +6 -0
- package/dist/cjs/widgets/HorizontalBarChart/index.js.map +1 -0
- package/dist/cjs/widgets/HorizontalBarChart/types.js +3 -0
- package/dist/cjs/widgets/HorizontalBarChart/types.js.map +1 -0
- package/dist/cjs/widgets/KPI/KPI.js +195 -0
- package/dist/cjs/widgets/KPI/KPI.js.map +1 -0
- package/dist/cjs/widgets/KPI/index.js +9 -0
- package/dist/cjs/widgets/KPI/index.js.map +1 -0
- package/dist/cjs/widgets/KPI/types.js +3 -0
- package/dist/cjs/widgets/KPI/types.js.map +1 -0
- package/dist/cjs/widgets/LineChart/LineChart.js +298 -0
- package/dist/cjs/widgets/LineChart/LineChart.js.map +1 -0
- package/dist/cjs/widgets/LineChart/index.js +9 -0
- package/dist/cjs/widgets/LineChart/index.js.map +1 -0
- package/dist/cjs/widgets/LineChart/types.js +3 -0
- package/dist/cjs/widgets/LineChart/types.js.map +1 -0
- package/dist/cjs/widgets/MultiLineSparkline/MultiLineSparkline.js +192 -0
- package/dist/cjs/widgets/MultiLineSparkline/MultiLineSparkline.js.map +1 -0
- package/dist/cjs/widgets/MultiLineSparkline/index.js +9 -0
- package/dist/cjs/widgets/MultiLineSparkline/index.js.map +1 -0
- package/dist/cjs/widgets/MultiLineSparkline/types.js +3 -0
- package/dist/cjs/widgets/MultiLineSparkline/types.js.map +1 -0
- package/dist/cjs/widgets/PieChart/PieChart.js +241 -0
- package/dist/cjs/widgets/PieChart/PieChart.js.map +1 -0
- package/dist/cjs/widgets/PieChart/index.js +9 -0
- package/dist/cjs/widgets/PieChart/index.js.map +1 -0
- package/dist/cjs/widgets/PieChart/types.js +3 -0
- package/dist/cjs/widgets/PieChart/types.js.map +1 -0
- package/dist/cjs/widgets/Progress/Progress.js +166 -0
- package/dist/cjs/widgets/Progress/Progress.js.map +1 -0
- package/dist/cjs/widgets/Progress/index.js +9 -0
- package/dist/cjs/widgets/Progress/index.js.map +1 -0
- package/dist/cjs/widgets/Progress/types.js +3 -0
- package/dist/cjs/widgets/Progress/types.js.map +1 -0
- package/dist/cjs/widgets/RadarChart/RadarChart.js +162 -0
- package/dist/cjs/widgets/RadarChart/RadarChart.js.map +1 -0
- package/dist/cjs/widgets/RadarChart/index.js +6 -0
- package/dist/cjs/widgets/RadarChart/index.js.map +1 -0
- package/dist/cjs/widgets/RadarChart/types.js +3 -0
- package/dist/cjs/widgets/RadarChart/types.js.map +1 -0
- package/dist/cjs/widgets/SankeyDiagram/SankeyDiagram.js +211 -0
- package/dist/cjs/widgets/SankeyDiagram/SankeyDiagram.js.map +1 -0
- package/dist/cjs/widgets/SankeyDiagram/index.js +6 -0
- package/dist/cjs/widgets/SankeyDiagram/index.js.map +1 -0
- package/dist/cjs/widgets/SankeyDiagram/types.js +3 -0
- package/dist/cjs/widgets/SankeyDiagram/types.js.map +1 -0
- package/dist/cjs/widgets/ScatterPlot/ScatterPlot.js +152 -0
- package/dist/cjs/widgets/ScatterPlot/ScatterPlot.js.map +1 -0
- package/dist/cjs/widgets/ScatterPlot/index.js +6 -0
- package/dist/cjs/widgets/ScatterPlot/index.js.map +1 -0
- package/dist/cjs/widgets/ScatterPlot/types.js +3 -0
- package/dist/cjs/widgets/ScatterPlot/types.js.map +1 -0
- package/dist/cjs/widgets/Sparkline/Sparkline.js +154 -0
- package/dist/cjs/widgets/Sparkline/Sparkline.js.map +1 -0
- package/dist/cjs/widgets/Sparkline/index.js +9 -0
- package/dist/cjs/widgets/Sparkline/index.js.map +1 -0
- package/dist/cjs/widgets/Sparkline/types.js +3 -0
- package/dist/cjs/widgets/Sparkline/types.js.map +1 -0
- package/dist/cjs/widgets/StackedBarChart/StackedBarChart.js +152 -0
- package/dist/cjs/widgets/StackedBarChart/StackedBarChart.js.map +1 -0
- package/dist/cjs/widgets/StackedBarChart/index.js +6 -0
- package/dist/cjs/widgets/StackedBarChart/index.js.map +1 -0
- package/dist/cjs/widgets/StackedBarChart/types.js +3 -0
- package/dist/cjs/widgets/StackedBarChart/types.js.map +1 -0
- package/dist/cjs/widgets/SunburstChart/SunburstChart.js +134 -0
- package/dist/cjs/widgets/SunburstChart/SunburstChart.js.map +1 -0
- package/dist/cjs/widgets/SunburstChart/index.js +6 -0
- package/dist/cjs/widgets/SunburstChart/index.js.map +1 -0
- package/dist/cjs/widgets/SunburstChart/types.js +3 -0
- package/dist/cjs/widgets/SunburstChart/types.js.map +1 -0
- package/dist/cjs/widgets/Treemap/Treemap.js +145 -0
- package/dist/cjs/widgets/Treemap/Treemap.js.map +1 -0
- package/dist/cjs/widgets/Treemap/index.js +6 -0
- package/dist/cjs/widgets/Treemap/index.js.map +1 -0
- package/dist/cjs/widgets/Treemap/types.js +3 -0
- package/dist/cjs/widgets/Treemap/types.js.map +1 -0
- package/dist/cjs/widgets/WaterfallChart/WaterfallChart.js +175 -0
- package/dist/cjs/widgets/WaterfallChart/WaterfallChart.js.map +1 -0
- package/dist/cjs/widgets/WaterfallChart/index.js +6 -0
- package/dist/cjs/widgets/WaterfallChart/index.js.map +1 -0
- package/dist/cjs/widgets/WaterfallChart/types.js +3 -0
- package/dist/cjs/widgets/WaterfallChart/types.js.map +1 -0
- package/dist/cjs/widgets/index.js +51 -0
- package/dist/cjs/widgets/index.js.map +1 -0
- package/dist/core/animation/index.d.ts +66 -0
- package/dist/core/animation/index.d.ts.map +1 -0
- package/dist/core/animation/index.web.d.ts +63 -0
- package/dist/core/animation/index.web.d.ts.map +1 -0
- package/dist/core/hooks/index.d.ts +34 -0
- package/dist/core/hooks/index.d.ts.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/layout/index.d.ts +39 -0
- package/dist/core/layout/index.d.ts.map +1 -0
- package/dist/core/math/index.d.ts +37 -0
- package/dist/core/math/index.d.ts.map +1 -0
- package/dist/core/theme/ThemeProvider.d.ts +19 -0
- package/dist/core/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/core/theme/index.d.ts +6 -0
- package/dist/core/theme/index.d.ts.map +1 -0
- package/dist/core/theme/themes.d.ts +13 -0
- package/dist/core/theme/themes.d.ts.map +1 -0
- package/dist/core/types/index.d.ts +137 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/core/utils/responsive.d.ts +92 -0
- package/dist/core/utils/responsive.d.ts.map +1 -0
- package/dist/core/utils/time.d.ts +20 -0
- package/dist/core/utils/time.d.ts.map +1 -0
- package/dist/esm/core/animation/index.js +88 -0
- package/dist/esm/core/animation/index.js.map +1 -0
- package/dist/esm/core/animation/index.web.js +81 -0
- package/dist/esm/core/animation/index.web.js.map +1 -0
- package/dist/esm/core/hooks/index.js +44 -0
- package/dist/esm/core/hooks/index.js.map +1 -0
- package/dist/esm/core/index.js +20 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/core/layout/index.js +73 -0
- package/dist/esm/core/layout/index.js.map +1 -0
- package/dist/esm/core/math/index.js +54 -0
- package/dist/esm/core/math/index.js.map +1 -0
- package/dist/esm/core/theme/ThemeProvider.js +26 -0
- package/dist/esm/core/theme/ThemeProvider.js.map +1 -0
- package/dist/esm/core/theme/index.js +6 -0
- package/dist/esm/core/theme/index.js.map +1 -0
- package/dist/esm/core/theme/themes.js +117 -0
- package/dist/esm/core/theme/themes.js.map +1 -0
- package/dist/esm/core/types/index.js +10 -0
- package/dist/esm/core/types/index.js.map +1 -0
- package/dist/esm/core/utils/responsive.js +112 -0
- package/dist/esm/core/utils/responsive.js.map +1 -0
- package/dist/esm/core/utils/time.js +79 -0
- package/dist/esm/core/utils/time.js.map +1 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/renderer-svg/adapters/index.js +62 -0
- package/dist/esm/renderer-svg/adapters/index.js.map +1 -0
- package/dist/esm/renderer-svg/index.js +9 -0
- package/dist/esm/renderer-svg/index.js.map +1 -0
- package/dist/esm/renderer-svg/paths/arc.js +74 -0
- package/dist/esm/renderer-svg/paths/arc.js.map +1 -0
- package/dist/esm/renderer-svg/paths/index.js +7 -0
- package/dist/esm/renderer-svg/paths/index.js.map +1 -0
- package/dist/esm/renderer-svg/paths/line.js +64 -0
- package/dist/esm/renderer-svg/paths/line.js.map +1 -0
- package/dist/esm/renderer-svg/paths/rect.js +50 -0
- package/dist/esm/renderer-svg/paths/rect.js.map +1 -0
- package/dist/esm/renderer-svg/primitives/AnimatedCircle.js +15 -0
- package/dist/esm/renderer-svg/primitives/AnimatedCircle.js.map +1 -0
- package/dist/esm/renderer-svg/primitives/AnimatedPath.js +15 -0
- package/dist/esm/renderer-svg/primitives/AnimatedPath.js.map +1 -0
- package/dist/esm/renderer-svg/primitives/Text.js +29 -0
- package/dist/esm/renderer-svg/primitives/Text.js.map +1 -0
- package/dist/esm/renderer-svg/primitives/index.js +7 -0
- package/dist/esm/renderer-svg/primitives/index.js.map +1 -0
- package/dist/esm/widgets/AreaChart/AreaChart.js +143 -0
- package/dist/esm/widgets/AreaChart/AreaChart.js.map +1 -0
- package/dist/esm/widgets/AreaChart/index.js +2 -0
- package/dist/esm/widgets/AreaChart/index.js.map +1 -0
- package/dist/esm/widgets/AreaChart/types.js +2 -0
- package/dist/esm/widgets/AreaChart/types.js.map +1 -0
- package/dist/esm/widgets/BarChart/BarChart.js +167 -0
- package/dist/esm/widgets/BarChart/BarChart.js.map +1 -0
- package/dist/esm/widgets/BarChart/index.js +5 -0
- package/dist/esm/widgets/BarChart/index.js.map +1 -0
- package/dist/esm/widgets/BarChart/types.js +2 -0
- package/dist/esm/widgets/BarChart/types.js.map +1 -0
- package/dist/esm/widgets/BoxPlot/BoxPlot.js +150 -0
- package/dist/esm/widgets/BoxPlot/BoxPlot.js.map +1 -0
- package/dist/esm/widgets/BoxPlot/index.js +2 -0
- package/dist/esm/widgets/BoxPlot/index.js.map +1 -0
- package/dist/esm/widgets/BoxPlot/types.js +2 -0
- package/dist/esm/widgets/BoxPlot/types.js.map +1 -0
- package/dist/esm/widgets/BubbleChart/BubbleChart.js +122 -0
- package/dist/esm/widgets/BubbleChart/BubbleChart.js.map +1 -0
- package/dist/esm/widgets/BubbleChart/index.js +2 -0
- package/dist/esm/widgets/BubbleChart/index.js.map +1 -0
- package/dist/esm/widgets/BubbleChart/types.js +2 -0
- package/dist/esm/widgets/BubbleChart/types.js.map +1 -0
- package/dist/esm/widgets/CandlestickChart/CandlestickChart.js +132 -0
- package/dist/esm/widgets/CandlestickChart/CandlestickChart.js.map +1 -0
- package/dist/esm/widgets/CandlestickChart/index.js +2 -0
- package/dist/esm/widgets/CandlestickChart/index.js.map +1 -0
- package/dist/esm/widgets/CandlestickChart/types.js +2 -0
- package/dist/esm/widgets/CandlestickChart/types.js.map +1 -0
- package/dist/esm/widgets/FunnelChart/FunnelChart.js +113 -0
- package/dist/esm/widgets/FunnelChart/FunnelChart.js.map +1 -0
- package/dist/esm/widgets/FunnelChart/index.js +2 -0
- package/dist/esm/widgets/FunnelChart/index.js.map +1 -0
- package/dist/esm/widgets/FunnelChart/types.js +2 -0
- package/dist/esm/widgets/FunnelChart/types.js.map +1 -0
- package/dist/esm/widgets/Gauge/Gauge.js +132 -0
- package/dist/esm/widgets/Gauge/Gauge.js.map +1 -0
- package/dist/esm/widgets/Gauge/index.js +5 -0
- package/dist/esm/widgets/Gauge/index.js.map +1 -0
- package/dist/esm/widgets/Gauge/types.js +2 -0
- package/dist/esm/widgets/Gauge/types.js.map +1 -0
- package/dist/esm/widgets/GroupedBarChart/GroupedBarChart.js +119 -0
- package/dist/esm/widgets/GroupedBarChart/GroupedBarChart.js.map +1 -0
- package/dist/esm/widgets/GroupedBarChart/index.js +2 -0
- package/dist/esm/widgets/GroupedBarChart/index.js.map +1 -0
- package/dist/esm/widgets/GroupedBarChart/types.js +2 -0
- package/dist/esm/widgets/GroupedBarChart/types.js.map +1 -0
- package/dist/esm/widgets/Heatmap/Heatmap.js +146 -0
- package/dist/esm/widgets/Heatmap/Heatmap.js.map +1 -0
- package/dist/esm/widgets/Heatmap/index.js +2 -0
- package/dist/esm/widgets/Heatmap/index.js.map +1 -0
- package/dist/esm/widgets/Heatmap/types.js +2 -0
- package/dist/esm/widgets/Heatmap/types.js.map +1 -0
- package/dist/esm/widgets/Histogram/Histogram.js +116 -0
- package/dist/esm/widgets/Histogram/Histogram.js.map +1 -0
- package/dist/esm/widgets/Histogram/index.js +2 -0
- package/dist/esm/widgets/Histogram/index.js.map +1 -0
- package/dist/esm/widgets/Histogram/types.js +2 -0
- package/dist/esm/widgets/Histogram/types.js.map +1 -0
- package/dist/esm/widgets/HorizontalBarChart/HorizontalBarChart.js +88 -0
- package/dist/esm/widgets/HorizontalBarChart/HorizontalBarChart.js.map +1 -0
- package/dist/esm/widgets/HorizontalBarChart/index.js +2 -0
- package/dist/esm/widgets/HorizontalBarChart/index.js.map +1 -0
- package/dist/esm/widgets/HorizontalBarChart/types.js +2 -0
- package/dist/esm/widgets/HorizontalBarChart/types.js.map +1 -0
- package/dist/esm/widgets/KPI/KPI.js +159 -0
- package/dist/esm/widgets/KPI/KPI.js.map +1 -0
- package/dist/esm/widgets/KPI/index.js +5 -0
- package/dist/esm/widgets/KPI/index.js.map +1 -0
- package/dist/esm/widgets/KPI/types.js +2 -0
- package/dist/esm/widgets/KPI/types.js.map +1 -0
- package/dist/esm/widgets/LineChart/LineChart.js +262 -0
- package/dist/esm/widgets/LineChart/LineChart.js.map +1 -0
- package/dist/esm/widgets/LineChart/index.js +5 -0
- package/dist/esm/widgets/LineChart/index.js.map +1 -0
- package/dist/esm/widgets/LineChart/types.js +2 -0
- package/dist/esm/widgets/LineChart/types.js.map +1 -0
- package/dist/esm/widgets/MultiLineSparkline/MultiLineSparkline.js +153 -0
- package/dist/esm/widgets/MultiLineSparkline/MultiLineSparkline.js.map +1 -0
- package/dist/esm/widgets/MultiLineSparkline/index.js +5 -0
- package/dist/esm/widgets/MultiLineSparkline/index.js.map +1 -0
- package/dist/esm/widgets/MultiLineSparkline/types.js +2 -0
- package/dist/esm/widgets/MultiLineSparkline/types.js.map +1 -0
- package/dist/esm/widgets/PieChart/PieChart.js +205 -0
- package/dist/esm/widgets/PieChart/PieChart.js.map +1 -0
- package/dist/esm/widgets/PieChart/index.js +5 -0
- package/dist/esm/widgets/PieChart/index.js.map +1 -0
- package/dist/esm/widgets/PieChart/types.js +2 -0
- package/dist/esm/widgets/PieChart/types.js.map +1 -0
- package/dist/esm/widgets/Progress/Progress.js +130 -0
- package/dist/esm/widgets/Progress/Progress.js.map +1 -0
- package/dist/esm/widgets/Progress/index.js +5 -0
- package/dist/esm/widgets/Progress/index.js.map +1 -0
- package/dist/esm/widgets/Progress/types.js +2 -0
- package/dist/esm/widgets/Progress/types.js.map +1 -0
- package/dist/esm/widgets/RadarChart/RadarChart.js +126 -0
- package/dist/esm/widgets/RadarChart/RadarChart.js.map +1 -0
- package/dist/esm/widgets/RadarChart/index.js +2 -0
- package/dist/esm/widgets/RadarChart/index.js.map +1 -0
- package/dist/esm/widgets/RadarChart/types.js +2 -0
- package/dist/esm/widgets/RadarChart/types.js.map +1 -0
- package/dist/esm/widgets/SankeyDiagram/SankeyDiagram.js +175 -0
- package/dist/esm/widgets/SankeyDiagram/SankeyDiagram.js.map +1 -0
- package/dist/esm/widgets/SankeyDiagram/index.js +2 -0
- package/dist/esm/widgets/SankeyDiagram/index.js.map +1 -0
- package/dist/esm/widgets/SankeyDiagram/types.js +2 -0
- package/dist/esm/widgets/SankeyDiagram/types.js.map +1 -0
- package/dist/esm/widgets/ScatterPlot/ScatterPlot.js +116 -0
- package/dist/esm/widgets/ScatterPlot/ScatterPlot.js.map +1 -0
- package/dist/esm/widgets/ScatterPlot/index.js +2 -0
- package/dist/esm/widgets/ScatterPlot/index.js.map +1 -0
- package/dist/esm/widgets/ScatterPlot/types.js +2 -0
- package/dist/esm/widgets/ScatterPlot/types.js.map +1 -0
- package/dist/esm/widgets/Sparkline/Sparkline.js +118 -0
- package/dist/esm/widgets/Sparkline/Sparkline.js.map +1 -0
- package/dist/esm/widgets/Sparkline/index.js +5 -0
- package/dist/esm/widgets/Sparkline/index.js.map +1 -0
- package/dist/esm/widgets/Sparkline/types.js +2 -0
- package/dist/esm/widgets/Sparkline/types.js.map +1 -0
- package/dist/esm/widgets/StackedBarChart/StackedBarChart.js +116 -0
- package/dist/esm/widgets/StackedBarChart/StackedBarChart.js.map +1 -0
- package/dist/esm/widgets/StackedBarChart/index.js +2 -0
- package/dist/esm/widgets/StackedBarChart/index.js.map +1 -0
- package/dist/esm/widgets/StackedBarChart/types.js +2 -0
- package/dist/esm/widgets/StackedBarChart/types.js.map +1 -0
- package/dist/esm/widgets/SunburstChart/SunburstChart.js +98 -0
- package/dist/esm/widgets/SunburstChart/SunburstChart.js.map +1 -0
- package/dist/esm/widgets/SunburstChart/index.js +2 -0
- package/dist/esm/widgets/SunburstChart/index.js.map +1 -0
- package/dist/esm/widgets/SunburstChart/types.js +2 -0
- package/dist/esm/widgets/SunburstChart/types.js.map +1 -0
- package/dist/esm/widgets/Treemap/Treemap.js +109 -0
- package/dist/esm/widgets/Treemap/Treemap.js.map +1 -0
- package/dist/esm/widgets/Treemap/index.js +2 -0
- package/dist/esm/widgets/Treemap/index.js.map +1 -0
- package/dist/esm/widgets/Treemap/types.js +2 -0
- package/dist/esm/widgets/Treemap/types.js.map +1 -0
- package/dist/esm/widgets/WaterfallChart/WaterfallChart.js +139 -0
- package/dist/esm/widgets/WaterfallChart/WaterfallChart.js.map +1 -0
- package/dist/esm/widgets/WaterfallChart/index.js +2 -0
- package/dist/esm/widgets/WaterfallChart/index.js.map +1 -0
- package/dist/esm/widgets/WaterfallChart/types.js +2 -0
- package/dist/esm/widgets/WaterfallChart/types.js.map +1 -0
- package/dist/esm/widgets/index.js +35 -0
- package/dist/esm/widgets/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/renderer-svg/adapters/index.d.ts +21 -0
- package/dist/renderer-svg/adapters/index.d.ts.map +1 -0
- package/dist/renderer-svg/index.d.ts +9 -0
- package/dist/renderer-svg/index.d.ts.map +1 -0
- package/dist/renderer-svg/paths/arc.d.ts +24 -0
- package/dist/renderer-svg/paths/arc.d.ts.map +1 -0
- package/dist/renderer-svg/paths/index.d.ts +7 -0
- package/dist/renderer-svg/paths/index.d.ts.map +1 -0
- package/dist/renderer-svg/paths/line.d.ts +21 -0
- package/dist/renderer-svg/paths/line.d.ts.map +1 -0
- package/dist/renderer-svg/paths/rect.d.ts +24 -0
- package/dist/renderer-svg/paths/rect.d.ts.map +1 -0
- package/dist/renderer-svg/primitives/AnimatedCircle.d.ts +19 -0
- package/dist/renderer-svg/primitives/AnimatedCircle.d.ts.map +1 -0
- package/dist/renderer-svg/primitives/AnimatedPath.d.ts +19 -0
- package/dist/renderer-svg/primitives/AnimatedPath.d.ts.map +1 -0
- package/dist/renderer-svg/primitives/Text.d.ts +25 -0
- package/dist/renderer-svg/primitives/Text.d.ts.map +1 -0
- package/dist/renderer-svg/primitives/index.d.ts +7 -0
- package/dist/renderer-svg/primitives/index.d.ts.map +1 -0
- package/dist/widgets/AreaChart/AreaChart.d.ts +7 -0
- package/dist/widgets/AreaChart/AreaChart.d.ts.map +1 -0
- package/dist/widgets/AreaChart/index.d.ts +3 -0
- package/dist/widgets/AreaChart/index.d.ts.map +1 -0
- package/dist/widgets/AreaChart/types.d.ts +30 -0
- package/dist/widgets/AreaChart/types.d.ts.map +1 -0
- package/dist/widgets/BarChart/BarChart.d.ts +10 -0
- package/dist/widgets/BarChart/BarChart.d.ts.map +1 -0
- package/dist/widgets/BarChart/index.d.ts +6 -0
- package/dist/widgets/BarChart/index.d.ts.map +1 -0
- package/dist/widgets/BarChart/types.d.ts +24 -0
- package/dist/widgets/BarChart/types.d.ts.map +1 -0
- package/dist/widgets/BoxPlot/BoxPlot.d.ts +7 -0
- package/dist/widgets/BoxPlot/BoxPlot.d.ts.map +1 -0
- package/dist/widgets/BoxPlot/index.d.ts +3 -0
- package/dist/widgets/BoxPlot/index.d.ts.map +1 -0
- package/dist/widgets/BoxPlot/types.d.ts +25 -0
- package/dist/widgets/BoxPlot/types.d.ts.map +1 -0
- package/dist/widgets/BubbleChart/BubbleChart.d.ts +7 -0
- package/dist/widgets/BubbleChart/BubbleChart.d.ts.map +1 -0
- package/dist/widgets/BubbleChart/index.d.ts +3 -0
- package/dist/widgets/BubbleChart/index.d.ts.map +1 -0
- package/dist/widgets/BubbleChart/types.d.ts +30 -0
- package/dist/widgets/BubbleChart/types.d.ts.map +1 -0
- package/dist/widgets/CandlestickChart/CandlestickChart.d.ts +7 -0
- package/dist/widgets/CandlestickChart/CandlestickChart.d.ts.map +1 -0
- package/dist/widgets/CandlestickChart/index.d.ts +3 -0
- package/dist/widgets/CandlestickChart/index.d.ts.map +1 -0
- package/dist/widgets/CandlestickChart/types.d.ts +27 -0
- package/dist/widgets/CandlestickChart/types.d.ts.map +1 -0
- package/dist/widgets/FunnelChart/FunnelChart.d.ts +7 -0
- package/dist/widgets/FunnelChart/FunnelChart.d.ts.map +1 -0
- package/dist/widgets/FunnelChart/index.d.ts +3 -0
- package/dist/widgets/FunnelChart/index.d.ts.map +1 -0
- package/dist/widgets/FunnelChart/types.d.ts +20 -0
- package/dist/widgets/FunnelChart/types.d.ts.map +1 -0
- package/dist/widgets/Gauge/Gauge.d.ts +11 -0
- package/dist/widgets/Gauge/Gauge.d.ts.map +1 -0
- package/dist/widgets/Gauge/index.d.ts +6 -0
- package/dist/widgets/Gauge/index.d.ts.map +1 -0
- package/dist/widgets/Gauge/types.d.ts +18 -0
- package/dist/widgets/Gauge/types.d.ts.map +1 -0
- package/dist/widgets/GroupedBarChart/GroupedBarChart.d.ts +7 -0
- package/dist/widgets/GroupedBarChart/GroupedBarChart.d.ts.map +1 -0
- package/dist/widgets/GroupedBarChart/index.d.ts +3 -0
- package/dist/widgets/GroupedBarChart/index.d.ts.map +1 -0
- package/dist/widgets/GroupedBarChart/types.d.ts +27 -0
- package/dist/widgets/GroupedBarChart/types.d.ts.map +1 -0
- package/dist/widgets/Heatmap/Heatmap.d.ts +7 -0
- package/dist/widgets/Heatmap/Heatmap.d.ts.map +1 -0
- package/dist/widgets/Heatmap/index.d.ts +3 -0
- package/dist/widgets/Heatmap/index.d.ts.map +1 -0
- package/dist/widgets/Heatmap/types.d.ts +25 -0
- package/dist/widgets/Heatmap/types.d.ts.map +1 -0
- package/dist/widgets/Histogram/Histogram.d.ts +7 -0
- package/dist/widgets/Histogram/Histogram.d.ts.map +1 -0
- package/dist/widgets/Histogram/index.d.ts +3 -0
- package/dist/widgets/Histogram/index.d.ts.map +1 -0
- package/dist/widgets/Histogram/types.d.ts +17 -0
- package/dist/widgets/Histogram/types.d.ts.map +1 -0
- package/dist/widgets/HorizontalBarChart/HorizontalBarChart.d.ts +7 -0
- package/dist/widgets/HorizontalBarChart/HorizontalBarChart.d.ts.map +1 -0
- package/dist/widgets/HorizontalBarChart/index.d.ts +3 -0
- package/dist/widgets/HorizontalBarChart/index.d.ts.map +1 -0
- package/dist/widgets/HorizontalBarChart/types.d.ts +21 -0
- package/dist/widgets/HorizontalBarChart/types.d.ts.map +1 -0
- package/dist/widgets/KPI/KPI.d.ts +11 -0
- package/dist/widgets/KPI/KPI.d.ts.map +1 -0
- package/dist/widgets/KPI/index.d.ts +6 -0
- package/dist/widgets/KPI/index.d.ts.map +1 -0
- package/dist/widgets/KPI/types.d.ts +17 -0
- package/dist/widgets/KPI/types.d.ts.map +1 -0
- package/dist/widgets/LineChart/LineChart.d.ts +10 -0
- package/dist/widgets/LineChart/LineChart.d.ts.map +1 -0
- package/dist/widgets/LineChart/index.d.ts +6 -0
- package/dist/widgets/LineChart/index.d.ts.map +1 -0
- package/dist/widgets/LineChart/types.d.ts +31 -0
- package/dist/widgets/LineChart/types.d.ts.map +1 -0
- package/dist/widgets/MultiLineSparkline/MultiLineSparkline.d.ts +10 -0
- package/dist/widgets/MultiLineSparkline/MultiLineSparkline.d.ts.map +1 -0
- package/dist/widgets/MultiLineSparkline/index.d.ts +6 -0
- package/dist/widgets/MultiLineSparkline/index.d.ts.map +1 -0
- package/dist/widgets/MultiLineSparkline/types.d.ts +22 -0
- package/dist/widgets/MultiLineSparkline/types.d.ts.map +1 -0
- package/dist/widgets/PieChart/PieChart.d.ts +10 -0
- package/dist/widgets/PieChart/PieChart.d.ts.map +1 -0
- package/dist/widgets/PieChart/index.d.ts +6 -0
- package/dist/widgets/PieChart/index.d.ts.map +1 -0
- package/dist/widgets/PieChart/types.d.ts +23 -0
- package/dist/widgets/PieChart/types.d.ts.map +1 -0
- package/dist/widgets/Progress/Progress.d.ts +11 -0
- package/dist/widgets/Progress/Progress.d.ts.map +1 -0
- package/dist/widgets/Progress/index.d.ts +6 -0
- package/dist/widgets/Progress/index.d.ts.map +1 -0
- package/dist/widgets/Progress/types.d.ts +17 -0
- package/dist/widgets/Progress/types.d.ts.map +1 -0
- package/dist/widgets/RadarChart/RadarChart.d.ts +7 -0
- package/dist/widgets/RadarChart/RadarChart.d.ts.map +1 -0
- package/dist/widgets/RadarChart/index.d.ts +3 -0
- package/dist/widgets/RadarChart/index.d.ts.map +1 -0
- package/dist/widgets/RadarChart/types.d.ts +26 -0
- package/dist/widgets/RadarChart/types.d.ts.map +1 -0
- package/dist/widgets/SankeyDiagram/SankeyDiagram.d.ts +7 -0
- package/dist/widgets/SankeyDiagram/SankeyDiagram.d.ts.map +1 -0
- package/dist/widgets/SankeyDiagram/index.d.ts +3 -0
- package/dist/widgets/SankeyDiagram/index.d.ts.map +1 -0
- package/dist/widgets/SankeyDiagram/types.d.ts +26 -0
- package/dist/widgets/SankeyDiagram/types.d.ts.map +1 -0
- package/dist/widgets/ScatterPlot/ScatterPlot.d.ts +7 -0
- package/dist/widgets/ScatterPlot/ScatterPlot.d.ts.map +1 -0
- package/dist/widgets/ScatterPlot/index.d.ts +3 -0
- package/dist/widgets/ScatterPlot/index.d.ts.map +1 -0
- package/dist/widgets/ScatterPlot/types.d.ts +29 -0
- package/dist/widgets/ScatterPlot/types.d.ts.map +1 -0
- package/dist/widgets/Sparkline/Sparkline.d.ts +11 -0
- package/dist/widgets/Sparkline/Sparkline.d.ts.map +1 -0
- package/dist/widgets/Sparkline/index.d.ts +6 -0
- package/dist/widgets/Sparkline/index.d.ts.map +1 -0
- package/dist/widgets/Sparkline/types.d.ts +16 -0
- package/dist/widgets/Sparkline/types.d.ts.map +1 -0
- package/dist/widgets/StackedBarChart/StackedBarChart.d.ts +7 -0
- package/dist/widgets/StackedBarChart/StackedBarChart.d.ts.map +1 -0
- package/dist/widgets/StackedBarChart/index.d.ts +3 -0
- package/dist/widgets/StackedBarChart/index.d.ts.map +1 -0
- package/dist/widgets/StackedBarChart/types.d.ts +26 -0
- package/dist/widgets/StackedBarChart/types.d.ts.map +1 -0
- package/dist/widgets/SunburstChart/SunburstChart.d.ts +7 -0
- package/dist/widgets/SunburstChart/SunburstChart.d.ts.map +1 -0
- package/dist/widgets/SunburstChart/index.d.ts +3 -0
- package/dist/widgets/SunburstChart/index.d.ts.map +1 -0
- package/dist/widgets/SunburstChart/types.d.ts +20 -0
- package/dist/widgets/SunburstChart/types.d.ts.map +1 -0
- package/dist/widgets/Treemap/Treemap.d.ts +7 -0
- package/dist/widgets/Treemap/Treemap.d.ts.map +1 -0
- package/dist/widgets/Treemap/index.d.ts +3 -0
- package/dist/widgets/Treemap/index.d.ts.map +1 -0
- package/dist/widgets/Treemap/types.d.ts +21 -0
- package/dist/widgets/Treemap/types.d.ts.map +1 -0
- package/dist/widgets/WaterfallChart/WaterfallChart.d.ts +7 -0
- package/dist/widgets/WaterfallChart/WaterfallChart.d.ts.map +1 -0
- package/dist/widgets/WaterfallChart/index.d.ts +3 -0
- package/dist/widgets/WaterfallChart/index.d.ts.map +1 -0
- package/dist/widgets/WaterfallChart/types.d.ts +24 -0
- package/dist/widgets/WaterfallChart/types.d.ts.map +1 -0
- package/dist/widgets/index.d.ts +29 -0
- package/dist/widgets/index.d.ts.map +1 -0
- package/package.json +84 -0
- package/src/core/animation/index.ts +113 -0
- package/src/core/animation/index.web.ts +112 -0
- package/src/core/hooks/index.ts +66 -0
- package/src/core/index.ts +26 -0
- package/src/core/layout/index.ts +101 -0
- package/src/core/math/index.ts +72 -0
- package/src/core/package.json +13 -0
- package/src/core/theme/ThemeProvider.tsx +36 -0
- package/src/core/theme/index.ts +5 -0
- package/src/core/theme/themes.ts +132 -0
- package/src/core/types/index.ts +164 -0
- package/src/core/utils/responsive.ts +203 -0
- package/src/core/utils/time.ts +100 -0
- package/src/index.ts +13 -0
- package/src/renderer-svg/adapters/index.ts +84 -0
- package/src/renderer-svg/index.ts +8 -0
- package/src/renderer-svg/package.json +17 -0
- package/src/renderer-svg/paths/arc.ts +93 -0
- package/src/renderer-svg/paths/index.ts +6 -0
- package/src/renderer-svg/paths/line.ts +83 -0
- package/src/renderer-svg/paths/rect.ts +80 -0
- package/src/renderer-svg/primitives/AnimatedCircle.tsx +48 -0
- package/src/renderer-svg/primitives/AnimatedPath.tsx +48 -0
- package/src/renderer-svg/primitives/Text.tsx +73 -0
- package/src/renderer-svg/primitives/index.ts +6 -0
- package/src/widgets/AreaChart/AreaChart.tsx +213 -0
- package/src/widgets/AreaChart/index.ts +2 -0
- package/src/widgets/AreaChart/types.ts +34 -0
- package/src/widgets/BarChart/BarChart.tsx +249 -0
- package/src/widgets/BarChart/index.ts +10 -0
- package/src/widgets/BarChart/types.ts +27 -0
- package/src/widgets/BoxPlot/BoxPlot.tsx +252 -0
- package/src/widgets/BoxPlot/index.ts +2 -0
- package/src/widgets/BoxPlot/types.ts +27 -0
- package/src/widgets/BubbleChart/BubbleChart.tsx +175 -0
- package/src/widgets/BubbleChart/index.ts +2 -0
- package/src/widgets/BubbleChart/types.ts +33 -0
- package/src/widgets/CandlestickChart/CandlestickChart.tsx +204 -0
- package/src/widgets/CandlestickChart/index.ts +2 -0
- package/src/widgets/CandlestickChart/types.ts +29 -0
- package/src/widgets/FunnelChart/FunnelChart.tsx +172 -0
- package/src/widgets/FunnelChart/index.ts +2 -0
- package/src/widgets/FunnelChart/types.ts +22 -0
- package/src/widgets/Gauge/Gauge.tsx +235 -0
- package/src/widgets/Gauge/index.ts +5 -0
- package/src/widgets/Gauge/types.ts +19 -0
- package/src/widgets/GroupedBarChart/GroupedBarChart.tsx +190 -0
- package/src/widgets/GroupedBarChart/index.ts +2 -0
- package/src/widgets/GroupedBarChart/types.ts +30 -0
- package/src/widgets/Heatmap/Heatmap.tsx +216 -0
- package/src/widgets/Heatmap/index.ts +2 -0
- package/src/widgets/Heatmap/types.ts +27 -0
- package/src/widgets/Histogram/Histogram.tsx +173 -0
- package/src/widgets/Histogram/index.ts +2 -0
- package/src/widgets/Histogram/types.ts +18 -0
- package/src/widgets/HorizontalBarChart/HorizontalBarChart.tsx +125 -0
- package/src/widgets/HorizontalBarChart/index.ts +2 -0
- package/src/widgets/HorizontalBarChart/types.ts +23 -0
- package/src/widgets/KPI/KPI.tsx +222 -0
- package/src/widgets/KPI/index.ts +5 -0
- package/src/widgets/KPI/types.ts +19 -0
- package/src/widgets/LineChart/LineChart.tsx +364 -0
- package/src/widgets/LineChart/index.ts +10 -0
- package/src/widgets/LineChart/types.ts +34 -0
- package/src/widgets/MultiLineSparkline/MultiLineSparkline.tsx +234 -0
- package/src/widgets/MultiLineSparkline/index.ts +10 -0
- package/src/widgets/MultiLineSparkline/types.ts +25 -0
- package/src/widgets/PieChart/PieChart.tsx +275 -0
- package/src/widgets/PieChart/index.ts +10 -0
- package/src/widgets/PieChart/types.ts +26 -0
- package/src/widgets/Progress/Progress.tsx +201 -0
- package/src/widgets/Progress/index.ts +5 -0
- package/src/widgets/Progress/types.ts +19 -0
- package/src/widgets/RadarChart/RadarChart.tsx +213 -0
- package/src/widgets/RadarChart/index.ts +2 -0
- package/src/widgets/RadarChart/types.ts +29 -0
- package/src/widgets/SankeyDiagram/SankeyDiagram.tsx +272 -0
- package/src/widgets/SankeyDiagram/index.ts +2 -0
- package/src/widgets/SankeyDiagram/types.ts +29 -0
- package/src/widgets/ScatterPlot/ScatterPlot.tsx +167 -0
- package/src/widgets/ScatterPlot/index.ts +2 -0
- package/src/widgets/ScatterPlot/types.ts +32 -0
- package/src/widgets/Sparkline/Sparkline.tsx +203 -0
- package/src/widgets/Sparkline/index.ts +5 -0
- package/src/widgets/Sparkline/types.ts +18 -0
- package/src/widgets/StackedBarChart/StackedBarChart.tsx +181 -0
- package/src/widgets/StackedBarChart/index.ts +2 -0
- package/src/widgets/StackedBarChart/types.ts +29 -0
- package/src/widgets/SunburstChart/SunburstChart.tsx +176 -0
- package/src/widgets/SunburstChart/index.ts +2 -0
- package/src/widgets/SunburstChart/types.ts +22 -0
- package/src/widgets/Treemap/Treemap.tsx +191 -0
- package/src/widgets/Treemap/index.ts +2 -0
- package/src/widgets/Treemap/types.ts +23 -0
- package/src/widgets/WaterfallChart/WaterfallChart.tsx +226 -0
- package/src/widgets/WaterfallChart/index.ts +2 -0
- package/src/widgets/WaterfallChart/types.ts +26 -0
- package/src/widgets/index.ts +40 -0
- package/src/widgets/package.json +18 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LineChart Widget - Full line chart with X and Y axes
|
|
3
|
+
*/
|
|
4
|
+
import React, { memo, useMemo } from 'react';
|
|
5
|
+
import { View, Text as RNText, StyleSheet } from 'react-native';
|
|
6
|
+
import Svg, { Line as SvgLine } from 'react-native-svg';
|
|
7
|
+
import {
|
|
8
|
+
useWidgetDimensions,
|
|
9
|
+
useWidgetTheme,
|
|
10
|
+
normalize,
|
|
11
|
+
formatTimeLabel,
|
|
12
|
+
reduceLabels,
|
|
13
|
+
} from '../../core';
|
|
14
|
+
import {
|
|
15
|
+
createLinePath,
|
|
16
|
+
AnimatedPath,
|
|
17
|
+
Text,
|
|
18
|
+
} from '../../renderer-svg';
|
|
19
|
+
import { LineChartWidgetProps } from './types';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* LineChart Widget Component
|
|
23
|
+
*/
|
|
24
|
+
export const LineChart = memo<LineChartWidgetProps>(({
|
|
25
|
+
data: widgetData,
|
|
26
|
+
width,
|
|
27
|
+
height,
|
|
28
|
+
loading = false,
|
|
29
|
+
theme: themeOverride,
|
|
30
|
+
showXAxis = true,
|
|
31
|
+
showYAxis = true,
|
|
32
|
+
showGrid = true,
|
|
33
|
+
showLegend = true,
|
|
34
|
+
maxXLabels = 6,
|
|
35
|
+
maxYLabels = 5,
|
|
36
|
+
curveType = 'linear',
|
|
37
|
+
testID,
|
|
38
|
+
}) => {
|
|
39
|
+
const theme = useWidgetTheme(themeOverride);
|
|
40
|
+
const dimensions = useWidgetDimensions(width, height, 350, 250);
|
|
41
|
+
|
|
42
|
+
// Handle states
|
|
43
|
+
if (loading) {
|
|
44
|
+
return (
|
|
45
|
+
<View
|
|
46
|
+
style={[
|
|
47
|
+
styles.container,
|
|
48
|
+
{
|
|
49
|
+
width: dimensions.width,
|
|
50
|
+
height: dimensions.height,
|
|
51
|
+
backgroundColor: theme.colors.surface,
|
|
52
|
+
borderRadius: theme.radius.md,
|
|
53
|
+
},
|
|
54
|
+
]}
|
|
55
|
+
testID={`${testID}-loading`}
|
|
56
|
+
>
|
|
57
|
+
<RNText style={[styles.loadingText, { color: theme.colors.textSecondary }]}>
|
|
58
|
+
Loading...
|
|
59
|
+
</RNText>
|
|
60
|
+
</View>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!widgetData || !widgetData.series || widgetData.series.length === 0) {
|
|
65
|
+
return (
|
|
66
|
+
<View
|
|
67
|
+
style={[
|
|
68
|
+
styles.container,
|
|
69
|
+
{
|
|
70
|
+
width: dimensions.width,
|
|
71
|
+
height: dimensions.height,
|
|
72
|
+
backgroundColor: theme.colors.surface,
|
|
73
|
+
borderRadius: theme.radius.md,
|
|
74
|
+
},
|
|
75
|
+
]}
|
|
76
|
+
testID={`${testID}-empty`}
|
|
77
|
+
>
|
|
78
|
+
<RNText style={[styles.emptyText, { color: theme.colors.textSecondary }]}>
|
|
79
|
+
No data
|
|
80
|
+
</RNText>
|
|
81
|
+
</View>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const { series, title, xAxisLabel, yAxisLabel, timeInterval } = widgetData;
|
|
86
|
+
|
|
87
|
+
// Calculate chart dimensions
|
|
88
|
+
const padding = theme.spacing.md;
|
|
89
|
+
const titleHeight = title ? theme.fontScale.md + theme.spacing.sm : 0;
|
|
90
|
+
const legendHeight = showLegend ? 30 : 0;
|
|
91
|
+
const xAxisHeight = showXAxis ? 30 : 0;
|
|
92
|
+
const yAxisWidth = showYAxis ? 40 : 0;
|
|
93
|
+
|
|
94
|
+
const chartWidth = dimensions.width - padding * 2 - yAxisWidth;
|
|
95
|
+
const chartHeight = dimensions.height - padding * 2 - titleHeight - legendHeight - xAxisHeight;
|
|
96
|
+
|
|
97
|
+
// Find global min/max for all series
|
|
98
|
+
const { globalMinY, globalMaxY, xLabels } = useMemo(() => {
|
|
99
|
+
let minY = Infinity;
|
|
100
|
+
let maxY = -Infinity;
|
|
101
|
+
const allXValues: (number | Date)[] = [];
|
|
102
|
+
|
|
103
|
+
series.forEach(s => {
|
|
104
|
+
s.data.forEach(point => {
|
|
105
|
+
if (point.y < minY) minY = point.y;
|
|
106
|
+
if (point.y > maxY) maxY = point.y;
|
|
107
|
+
allXValues.push(point.x);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Generate X-axis labels
|
|
112
|
+
const labels = allXValues.map((x, idx) => {
|
|
113
|
+
if (x instanceof Date) {
|
|
114
|
+
return timeInterval ? formatTimeLabel(x, timeInterval) : x.toLocaleDateString();
|
|
115
|
+
}
|
|
116
|
+
return x.toString();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
globalMinY: minY,
|
|
121
|
+
globalMaxY: maxY,
|
|
122
|
+
xLabels: labels,
|
|
123
|
+
};
|
|
124
|
+
}, [series, timeInterval]);
|
|
125
|
+
|
|
126
|
+
// Y-axis labels
|
|
127
|
+
const yAxisLabels = useMemo(() => {
|
|
128
|
+
const range = globalMaxY - globalMinY;
|
|
129
|
+
const step = range / (maxYLabels - 1);
|
|
130
|
+
return Array.from({ length: maxYLabels }, (_, i) => ({
|
|
131
|
+
value: globalMinY + i * step,
|
|
132
|
+
y: chartHeight - (i * chartHeight) / (maxYLabels - 1),
|
|
133
|
+
}));
|
|
134
|
+
}, [globalMinY, globalMaxY, maxYLabels, chartHeight]);
|
|
135
|
+
|
|
136
|
+
// X-axis labels (reduced to fit)
|
|
137
|
+
const xAxisLabelsReduced = useMemo(() => {
|
|
138
|
+
return reduceLabels(xLabels, maxXLabels);
|
|
139
|
+
}, [xLabels, maxXLabels]);
|
|
140
|
+
|
|
141
|
+
// Generate paths for each series
|
|
142
|
+
const seriesPaths = useMemo(() => {
|
|
143
|
+
return series.map(s => {
|
|
144
|
+
const points = s.data.map((point, index) => {
|
|
145
|
+
const x = (index / (s.data.length - 1 || 1)) * chartWidth;
|
|
146
|
+
const normalizedY = normalize(point.y, globalMinY, globalMaxY);
|
|
147
|
+
const y = chartHeight - normalizedY * chartHeight;
|
|
148
|
+
return { x, y };
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
path: createLinePath(points),
|
|
153
|
+
color: s.color,
|
|
154
|
+
strokeWidth: s.strokeWidth || 2,
|
|
155
|
+
label: s.label,
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
}, [series, chartWidth, chartHeight, globalMinY, globalMaxY]);
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<View
|
|
162
|
+
style={[
|
|
163
|
+
styles.wrapper,
|
|
164
|
+
{
|
|
165
|
+
width: dimensions.width,
|
|
166
|
+
height: dimensions.height,
|
|
167
|
+
backgroundColor: theme.colors.surface,
|
|
168
|
+
borderRadius: theme.radius.md,
|
|
169
|
+
padding,
|
|
170
|
+
},
|
|
171
|
+
]}
|
|
172
|
+
testID={testID}
|
|
173
|
+
>
|
|
174
|
+
{/* Title */}
|
|
175
|
+
{title && (
|
|
176
|
+
<RNText
|
|
177
|
+
style={[
|
|
178
|
+
styles.title,
|
|
179
|
+
{
|
|
180
|
+
color: theme.colors.text,
|
|
181
|
+
fontSize: theme.fontScale.md,
|
|
182
|
+
fontWeight: 'bold',
|
|
183
|
+
marginBottom: theme.spacing.sm,
|
|
184
|
+
},
|
|
185
|
+
]}
|
|
186
|
+
>
|
|
187
|
+
{title}
|
|
188
|
+
</RNText>
|
|
189
|
+
)}
|
|
190
|
+
|
|
191
|
+
{/* Chart */}
|
|
192
|
+
<View style={styles.chartRow}>
|
|
193
|
+
{/* Y-Axis */}
|
|
194
|
+
{showYAxis && (
|
|
195
|
+
<View style={[styles.yAxis, { width: yAxisWidth }]}>
|
|
196
|
+
{yAxisLabels.map((label, index) => (
|
|
197
|
+
<RNText
|
|
198
|
+
key={`y-${index}`}
|
|
199
|
+
style={[
|
|
200
|
+
styles.yAxisLabel,
|
|
201
|
+
{
|
|
202
|
+
color: theme.colors.textSecondary,
|
|
203
|
+
fontSize: theme.fontScale.xs,
|
|
204
|
+
top: label.y - 6,
|
|
205
|
+
},
|
|
206
|
+
]}
|
|
207
|
+
>
|
|
208
|
+
{label.value.toFixed(0)}
|
|
209
|
+
</RNText>
|
|
210
|
+
))}
|
|
211
|
+
</View>
|
|
212
|
+
)}
|
|
213
|
+
|
|
214
|
+
{/* Chart SVG */}
|
|
215
|
+
<View>
|
|
216
|
+
<Svg width={chartWidth} height={chartHeight}>
|
|
217
|
+
{/* Grid lines */}
|
|
218
|
+
{showGrid && yAxisLabels.map((label, index) => (
|
|
219
|
+
<SvgLine
|
|
220
|
+
key={`grid-${index}`}
|
|
221
|
+
x1={0}
|
|
222
|
+
y1={label.y}
|
|
223
|
+
x2={chartWidth}
|
|
224
|
+
y2={label.y}
|
|
225
|
+
stroke={theme.colors.borderLight}
|
|
226
|
+
strokeWidth={1}
|
|
227
|
+
/>
|
|
228
|
+
))}
|
|
229
|
+
|
|
230
|
+
{/* Line series */}
|
|
231
|
+
{seriesPaths.map((series, index) => (
|
|
232
|
+
<AnimatedPath
|
|
233
|
+
key={`series-${index}`}
|
|
234
|
+
d={series.path}
|
|
235
|
+
stroke={series.color}
|
|
236
|
+
strokeWidth={series.strokeWidth}
|
|
237
|
+
strokeLinecap="round"
|
|
238
|
+
strokeLinejoin="round"
|
|
239
|
+
fill="transparent"
|
|
240
|
+
/>
|
|
241
|
+
))}
|
|
242
|
+
</Svg>
|
|
243
|
+
|
|
244
|
+
{/* X-Axis */}
|
|
245
|
+
{showXAxis && (
|
|
246
|
+
<View style={[styles.xAxis, { width: chartWidth }]}>
|
|
247
|
+
{xAxisLabelsReduced.map((item, index) => (
|
|
248
|
+
<RNText
|
|
249
|
+
key={`x-${index}`}
|
|
250
|
+
style={[
|
|
251
|
+
styles.xAxisLabel,
|
|
252
|
+
{
|
|
253
|
+
color: theme.colors.textSecondary,
|
|
254
|
+
fontSize: theme.fontScale.xs,
|
|
255
|
+
left: (item.index / (xLabels.length - 1 || 1)) * chartWidth - 20,
|
|
256
|
+
},
|
|
257
|
+
]}
|
|
258
|
+
>
|
|
259
|
+
{item.label}
|
|
260
|
+
</RNText>
|
|
261
|
+
))}
|
|
262
|
+
</View>
|
|
263
|
+
)}
|
|
264
|
+
</View>
|
|
265
|
+
</View>
|
|
266
|
+
|
|
267
|
+
{/* Legend */}
|
|
268
|
+
{showLegend && (
|
|
269
|
+
<View style={styles.legend}>
|
|
270
|
+
{seriesPaths.map((series, index) => (
|
|
271
|
+
series.label && (
|
|
272
|
+
<View key={`legend-${index}`} style={styles.legendItem}>
|
|
273
|
+
<View
|
|
274
|
+
style={[
|
|
275
|
+
styles.legendColor,
|
|
276
|
+
{ backgroundColor: series.color },
|
|
277
|
+
]}
|
|
278
|
+
/>
|
|
279
|
+
<RNText
|
|
280
|
+
style={[
|
|
281
|
+
styles.legendText,
|
|
282
|
+
{
|
|
283
|
+
color: theme.colors.textSecondary,
|
|
284
|
+
fontSize: theme.fontScale.xs,
|
|
285
|
+
},
|
|
286
|
+
]}
|
|
287
|
+
>
|
|
288
|
+
{series.label}
|
|
289
|
+
</RNText>
|
|
290
|
+
</View>
|
|
291
|
+
)
|
|
292
|
+
))}
|
|
293
|
+
</View>
|
|
294
|
+
)}
|
|
295
|
+
</View>
|
|
296
|
+
);
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
LineChart.displayName = 'LineChart';
|
|
300
|
+
|
|
301
|
+
const styles = StyleSheet.create({
|
|
302
|
+
wrapper: {
|
|
303
|
+
justifyContent: 'flex-start',
|
|
304
|
+
alignItems: 'flex-start',
|
|
305
|
+
},
|
|
306
|
+
container: {
|
|
307
|
+
justifyContent: 'center',
|
|
308
|
+
alignItems: 'center',
|
|
309
|
+
},
|
|
310
|
+
loadingText: {
|
|
311
|
+
fontSize: 16,
|
|
312
|
+
},
|
|
313
|
+
emptyText: {
|
|
314
|
+
fontSize: 16,
|
|
315
|
+
},
|
|
316
|
+
title: {
|
|
317
|
+
textAlign: 'center',
|
|
318
|
+
width: '100%',
|
|
319
|
+
},
|
|
320
|
+
chartRow: {
|
|
321
|
+
flexDirection: 'row',
|
|
322
|
+
alignItems: 'flex-start',
|
|
323
|
+
},
|
|
324
|
+
yAxis: {
|
|
325
|
+
position: 'relative',
|
|
326
|
+
marginRight: 8,
|
|
327
|
+
},
|
|
328
|
+
yAxisLabel: {
|
|
329
|
+
position: 'absolute',
|
|
330
|
+
right: 0,
|
|
331
|
+
textAlign: 'right',
|
|
332
|
+
},
|
|
333
|
+
xAxis: {
|
|
334
|
+
position: 'relative',
|
|
335
|
+
height: 30,
|
|
336
|
+
marginTop: 4,
|
|
337
|
+
},
|
|
338
|
+
xAxisLabel: {
|
|
339
|
+
position: 'absolute',
|
|
340
|
+
width: 40,
|
|
341
|
+
textAlign: 'center',
|
|
342
|
+
},
|
|
343
|
+
legend: {
|
|
344
|
+
flexDirection: 'row',
|
|
345
|
+
flexWrap: 'wrap',
|
|
346
|
+
justifyContent: 'center',
|
|
347
|
+
marginTop: 12,
|
|
348
|
+
gap: 12,
|
|
349
|
+
},
|
|
350
|
+
legendItem: {
|
|
351
|
+
flexDirection: 'row',
|
|
352
|
+
alignItems: 'center',
|
|
353
|
+
gap: 6,
|
|
354
|
+
},
|
|
355
|
+
legendColor: {
|
|
356
|
+
width: 12,
|
|
357
|
+
height: 12,
|
|
358
|
+
borderRadius: 2,
|
|
359
|
+
},
|
|
360
|
+
legendText: {
|
|
361
|
+
textTransform: 'uppercase',
|
|
362
|
+
letterSpacing: 0.5,
|
|
363
|
+
},
|
|
364
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LineChart Widget types - Full line chart with axes
|
|
3
|
+
*/
|
|
4
|
+
import { BaseWidgetProps, TimeInterval } from '../../core';
|
|
5
|
+
|
|
6
|
+
export interface LineChartDataPoint {
|
|
7
|
+
x: number | Date;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface LineChartSeries {
|
|
12
|
+
data: LineChartDataPoint[];
|
|
13
|
+
color: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
strokeWidth?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface LineChartData {
|
|
19
|
+
series: LineChartSeries[];
|
|
20
|
+
title?: string;
|
|
21
|
+
xAxisLabel?: string;
|
|
22
|
+
yAxisLabel?: string;
|
|
23
|
+
timeInterval?: TimeInterval;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface LineChartWidgetProps extends BaseWidgetProps<LineChartData> {
|
|
27
|
+
showXAxis?: boolean;
|
|
28
|
+
showYAxis?: boolean;
|
|
29
|
+
showGrid?: boolean;
|
|
30
|
+
showLegend?: boolean;
|
|
31
|
+
maxXLabels?: number;
|
|
32
|
+
maxYLabels?: number;
|
|
33
|
+
curveType?: 'linear' | 'smooth';
|
|
34
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultiLineSparkline Widget - Multiple trends on same chart
|
|
3
|
+
*/
|
|
4
|
+
import React, { memo, useMemo } from 'react';
|
|
5
|
+
import { View, Text as RNText, StyleSheet } from 'react-native';
|
|
6
|
+
import Svg from 'react-native-svg';
|
|
7
|
+
import {
|
|
8
|
+
useWidgetDimensions,
|
|
9
|
+
useWidgetTheme,
|
|
10
|
+
useWidgetPadding,
|
|
11
|
+
useInnerDimensions,
|
|
12
|
+
} from '../../core';
|
|
13
|
+
import {
|
|
14
|
+
createLinePath,
|
|
15
|
+
AnimatedPath,
|
|
16
|
+
dataToPoints,
|
|
17
|
+
} from '../../renderer-svg';
|
|
18
|
+
import { MultiLineSparklineWidgetProps } from './types';
|
|
19
|
+
|
|
20
|
+
const MAX_DATA_POINTS = 100;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* MultiLineSparkline Widget Component
|
|
24
|
+
*/
|
|
25
|
+
export const MultiLineSparkline = memo<MultiLineSparklineWidgetProps>(({
|
|
26
|
+
data: widgetData,
|
|
27
|
+
width,
|
|
28
|
+
height,
|
|
29
|
+
loading = false,
|
|
30
|
+
theme: themeOverride,
|
|
31
|
+
style = 'line',
|
|
32
|
+
showLegend = true,
|
|
33
|
+
maxDataPoints = MAX_DATA_POINTS,
|
|
34
|
+
minHeight = 120,
|
|
35
|
+
testID,
|
|
36
|
+
}) => {
|
|
37
|
+
const theme = useWidgetTheme(themeOverride);
|
|
38
|
+
const dimensions = useWidgetDimensions(width, height, 300, minHeight);
|
|
39
|
+
const padding = useWidgetPadding(theme);
|
|
40
|
+
|
|
41
|
+
// Calculate inner dimensions
|
|
42
|
+
const legendHeight = showLegend ? 30 : 0;
|
|
43
|
+
const svgHeight = dimensions.height - legendHeight - padding.vertical;
|
|
44
|
+
|
|
45
|
+
const innerDimensions = useInnerDimensions(
|
|
46
|
+
dimensions.width,
|
|
47
|
+
svgHeight,
|
|
48
|
+
padding
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Handle states
|
|
52
|
+
if (loading) {
|
|
53
|
+
return (
|
|
54
|
+
<View
|
|
55
|
+
style={[
|
|
56
|
+
styles.container,
|
|
57
|
+
{
|
|
58
|
+
width: dimensions.width,
|
|
59
|
+
height: dimensions.height,
|
|
60
|
+
backgroundColor: theme.colors.surface,
|
|
61
|
+
borderRadius: theme.radius.md,
|
|
62
|
+
},
|
|
63
|
+
]}
|
|
64
|
+
testID={`${testID}-loading`}
|
|
65
|
+
>
|
|
66
|
+
<RNText style={[styles.loadingText, { color: theme.colors.textSecondary }]}>
|
|
67
|
+
Loading...
|
|
68
|
+
</RNText>
|
|
69
|
+
</View>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!widgetData || !widgetData.series || widgetData.series.length === 0) {
|
|
74
|
+
return (
|
|
75
|
+
<View
|
|
76
|
+
style={[
|
|
77
|
+
styles.container,
|
|
78
|
+
{
|
|
79
|
+
width: dimensions.width,
|
|
80
|
+
height: dimensions.height,
|
|
81
|
+
backgroundColor: theme.colors.surface,
|
|
82
|
+
borderRadius: theme.radius.md,
|
|
83
|
+
},
|
|
84
|
+
]}
|
|
85
|
+
testID={`${testID}-empty`}
|
|
86
|
+
>
|
|
87
|
+
<RNText style={[styles.emptyText, { color: theme.colors.textSecondary }]}>
|
|
88
|
+
No data
|
|
89
|
+
</RNText>
|
|
90
|
+
</View>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const { series } = widgetData;
|
|
95
|
+
|
|
96
|
+
// Find global min/max across all series for consistent scaling
|
|
97
|
+
const { globalMin, globalMax } = useMemo(() => {
|
|
98
|
+
let min = Infinity;
|
|
99
|
+
let max = -Infinity;
|
|
100
|
+
|
|
101
|
+
series.forEach(s => {
|
|
102
|
+
const seriesMin = Math.min(...s.data);
|
|
103
|
+
const seriesMax = Math.max(...s.data);
|
|
104
|
+
if (seriesMin < min) min = seriesMin;
|
|
105
|
+
if (seriesMax > max) max = seriesMax;
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
return { globalMin: min, globalMax: max };
|
|
109
|
+
}, [series]);
|
|
110
|
+
|
|
111
|
+
// Generate paths for each series
|
|
112
|
+
const seriesPaths = useMemo(() => {
|
|
113
|
+
return series.map(s => {
|
|
114
|
+
// Cap data points if needed
|
|
115
|
+
const cappedData = s.data.length > maxDataPoints
|
|
116
|
+
? s.data.filter((_, idx) => idx % Math.ceil(s.data.length / maxDataPoints) === 0)
|
|
117
|
+
: s.data;
|
|
118
|
+
|
|
119
|
+
// Normalize all series to same scale
|
|
120
|
+
const normalizedData = cappedData.map(val =>
|
|
121
|
+
((val - globalMin) / (globalMax - globalMin || 1)) * 100
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const points = dataToPoints(
|
|
125
|
+
normalizedData,
|
|
126
|
+
innerDimensions.width,
|
|
127
|
+
innerDimensions.height,
|
|
128
|
+
theme.spacing.xs
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
path: createLinePath(points),
|
|
133
|
+
color: s.color,
|
|
134
|
+
strokeWidth: s.strokeWidth || 2,
|
|
135
|
+
label: s.label,
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
}, [series, maxDataPoints, innerDimensions, theme.spacing.xs, globalMin, globalMax]);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<View
|
|
142
|
+
style={[
|
|
143
|
+
styles.container,
|
|
144
|
+
{
|
|
145
|
+
width: dimensions.width,
|
|
146
|
+
height: dimensions.height,
|
|
147
|
+
backgroundColor: theme.colors.surface,
|
|
148
|
+
borderRadius: theme.radius.md,
|
|
149
|
+
padding: theme.spacing.md,
|
|
150
|
+
},
|
|
151
|
+
]}
|
|
152
|
+
testID={testID}
|
|
153
|
+
>
|
|
154
|
+
<Svg width={dimensions.width - theme.spacing.md * 2} height={svgHeight - theme.spacing.md}>
|
|
155
|
+
{seriesPaths.map((series, index) => (
|
|
156
|
+
<AnimatedPath
|
|
157
|
+
key={`series-${index}`}
|
|
158
|
+
d={series.path}
|
|
159
|
+
stroke={series.color}
|
|
160
|
+
strokeWidth={series.strokeWidth}
|
|
161
|
+
strokeLinecap="round"
|
|
162
|
+
strokeLinejoin="round"
|
|
163
|
+
fill="transparent"
|
|
164
|
+
/>
|
|
165
|
+
))}
|
|
166
|
+
</Svg>
|
|
167
|
+
|
|
168
|
+
{/* Legend */}
|
|
169
|
+
{showLegend && (
|
|
170
|
+
<View style={styles.legend}>
|
|
171
|
+
{seriesPaths.map((series, index) => (
|
|
172
|
+
series.label && (
|
|
173
|
+
<View key={`legend-${index}`} style={styles.legendItem}>
|
|
174
|
+
<View
|
|
175
|
+
style={[
|
|
176
|
+
styles.legendColor,
|
|
177
|
+
{ backgroundColor: series.color },
|
|
178
|
+
]}
|
|
179
|
+
/>
|
|
180
|
+
<RNText
|
|
181
|
+
style={[
|
|
182
|
+
styles.legendText,
|
|
183
|
+
{
|
|
184
|
+
color: theme.colors.textSecondary,
|
|
185
|
+
fontSize: theme.fontScale.xs,
|
|
186
|
+
},
|
|
187
|
+
]}
|
|
188
|
+
>
|
|
189
|
+
{series.label}
|
|
190
|
+
</RNText>
|
|
191
|
+
</View>
|
|
192
|
+
)
|
|
193
|
+
))}
|
|
194
|
+
</View>
|
|
195
|
+
)}
|
|
196
|
+
</View>
|
|
197
|
+
);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
MultiLineSparkline.displayName = 'MultiLineSparkline';
|
|
201
|
+
|
|
202
|
+
const styles = StyleSheet.create({
|
|
203
|
+
container: {
|
|
204
|
+
justifyContent: 'center',
|
|
205
|
+
alignItems: 'center',
|
|
206
|
+
},
|
|
207
|
+
loadingText: {
|
|
208
|
+
fontSize: 16,
|
|
209
|
+
},
|
|
210
|
+
emptyText: {
|
|
211
|
+
fontSize: 16,
|
|
212
|
+
},
|
|
213
|
+
legend: {
|
|
214
|
+
flexDirection: 'row',
|
|
215
|
+
flexWrap: 'wrap',
|
|
216
|
+
justifyContent: 'center',
|
|
217
|
+
marginTop: 8,
|
|
218
|
+
gap: 12,
|
|
219
|
+
},
|
|
220
|
+
legendItem: {
|
|
221
|
+
flexDirection: 'row',
|
|
222
|
+
alignItems: 'center',
|
|
223
|
+
gap: 6,
|
|
224
|
+
},
|
|
225
|
+
legendColor: {
|
|
226
|
+
width: 12,
|
|
227
|
+
height: 12,
|
|
228
|
+
borderRadius: 2,
|
|
229
|
+
},
|
|
230
|
+
legendText: {
|
|
231
|
+
textTransform: 'uppercase',
|
|
232
|
+
letterSpacing: 0.5,
|
|
233
|
+
},
|
|
234
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultiLineSparkline Widget types
|
|
3
|
+
*/
|
|
4
|
+
import { BaseWidgetProps } from '../../core/types';
|
|
5
|
+
|
|
6
|
+
export interface SparklineSeries {
|
|
7
|
+
data: number[];
|
|
8
|
+
color: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface MultiLineSparklineData {
|
|
14
|
+
series: SparklineSeries[];
|
|
15
|
+
labels?: string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type SparklineRenderStyle = 'line' | 'area';
|
|
19
|
+
|
|
20
|
+
export interface MultiLineSparklineWidgetProps extends BaseWidgetProps<MultiLineSparklineData> {
|
|
21
|
+
style?: SparklineRenderStyle;
|
|
22
|
+
showLegend?: boolean;
|
|
23
|
+
maxDataPoints?: number;
|
|
24
|
+
minHeight?: number;
|
|
25
|
+
}
|