@semcore/d3-chart 18.0.0-prerelease.1 → 18.0.0-prerelease.5
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 +52 -1
- package/README.md +0 -1
- package/lib/cjs/Area.js +123 -23
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +109 -97
- package/lib/cjs/Axis.js.map +1 -1
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +14 -14
- package/lib/cjs/ChartMetaData.js +44 -0
- package/lib/cjs/ChartMetaData.js.map +1 -0
- package/lib/cjs/CompactHorizontalBar.js +17 -17
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +18 -19
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +67 -13
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +5 -2
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +55 -52
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +82 -17
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Pattern.js +113 -2
- package/lib/cjs/Pattern.js.map +1 -1
- package/lib/cjs/Plot.js +5 -2
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +19 -19
- package/lib/cjs/RadialTree.js +12 -12
- package/lib/cjs/Reference.js +55 -18
- package/lib/cjs/Reference.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +9 -9
- package/lib/cjs/Tooltip.js +16 -14
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +9 -9
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +29 -23
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AbstractChart.type.js +19 -0
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +21 -7
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +17 -8
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +4 -0
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +5 -1
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +0 -1
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.js +6 -3
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +16 -6
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/index.js +43 -0
- package/lib/cjs/component/Chart/index.js.map +1 -1
- package/lib/cjs/component/ChartLegend/BaseLegend.js +0 -4
- package/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +19 -17
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +28 -21
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/legend-table.shadow.css +31 -15
- package/lib/cjs/component/Cigarette/Cigarette.js +0 -1
- package/lib/cjs/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/cjs/component/Metric/Metric.js +78 -0
- package/lib/cjs/component/Metric/Metric.js.map +1 -0
- package/lib/cjs/component/Metric/Metric.type.js +2 -0
- package/lib/cjs/component/Metric/Metric.type.js.map +1 -0
- package/lib/cjs/index.js +62 -8
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/abstract-chart.shadow.css +13 -3
- package/lib/cjs/style/area.shadow.css +8 -7
- package/lib/cjs/style/axis.shadow.css +51 -60
- package/lib/cjs/style/bar.shadow.css +7 -9
- package/lib/cjs/style/bubble.shadow.css +4 -6
- package/lib/cjs/style/donut.shadow.css +3 -5
- package/lib/cjs/style/dot.shadow.css +37 -4
- package/lib/cjs/style/hover.shadow.css +30 -13
- package/lib/cjs/style/line.shadow.css +3 -5
- package/lib/cjs/style/pattern.shadow.css +10 -0
- package/lib/cjs/style/plotA11yView.shadow.css +3 -3
- package/lib/cjs/style/radar.shadow.css +7 -7
- package/lib/cjs/style/radial-tree.shadow.css +3 -5
- package/lib/cjs/style/reference.shadow.css +5 -5
- package/lib/cjs/style/scatterplot.shadow.css +2 -4
- package/lib/cjs/style/tooltip.shadow.css +12 -14
- package/lib/cjs/style/venn.shadow.css +0 -2
- package/lib/cjs/types/Axis.d.js.map +1 -1
- package/lib/cjs/types/Donut.d.js.map +1 -1
- package/lib/cjs/types/Hover.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +20 -0
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +21 -1
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/Area.js +125 -25
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +109 -97
- package/lib/es6/Axis.js.map +1 -1
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +14 -14
- package/lib/es6/ChartMetaData.js +36 -0
- package/lib/es6/ChartMetaData.js.map +1 -0
- package/lib/es6/CompactHorizontalBar.js +17 -17
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +18 -19
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +68 -14
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +5 -2
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +55 -52
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +84 -19
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Pattern.js +108 -2
- package/lib/es6/Pattern.js.map +1 -1
- package/lib/es6/Plot.js +5 -2
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +19 -19
- package/lib/es6/RadialTree.js +12 -12
- package/lib/es6/Reference.js +55 -18
- package/lib/es6/Reference.js.map +1 -1
- package/lib/es6/ScatterPlot.js +9 -9
- package/lib/es6/Tooltip.js +16 -14
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +9 -9
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +29 -23
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AbstractChart.type.js +14 -1
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +21 -7
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +17 -8
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +4 -0
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +5 -1
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +0 -1
- package/lib/es6/component/Chart/DonutChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.js +6 -3
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +14 -4
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/Chart/index.js +2 -0
- package/lib/es6/component/Chart/index.js.map +1 -1
- package/lib/es6/component/ChartLegend/BaseLegend.js +0 -4
- package/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +19 -17
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +28 -21
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/legend-table.shadow.css +31 -15
- package/lib/es6/component/Cigarette/Cigarette.js +0 -1
- package/lib/es6/component/Cigarette/Cigarette.js.map +1 -1
- package/lib/es6/component/Metric/Metric.js +72 -0
- package/lib/es6/component/Metric/Metric.js.map +1 -0
- package/lib/es6/component/Metric/Metric.type.js +2 -0
- package/lib/es6/component/Metric/Metric.type.js.map +1 -0
- package/lib/es6/index.js +2 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/abstract-chart.shadow.css +13 -3
- package/lib/es6/style/area.shadow.css +8 -7
- package/lib/es6/style/axis.shadow.css +51 -60
- package/lib/es6/style/bar.shadow.css +7 -9
- package/lib/es6/style/bubble.shadow.css +4 -6
- package/lib/es6/style/donut.shadow.css +3 -5
- package/lib/es6/style/dot.shadow.css +37 -4
- package/lib/es6/style/hover.shadow.css +30 -13
- package/lib/es6/style/line.shadow.css +3 -5
- package/lib/es6/style/pattern.shadow.css +10 -0
- package/lib/es6/style/plotA11yView.shadow.css +3 -3
- package/lib/es6/style/radar.shadow.css +7 -7
- package/lib/es6/style/radial-tree.shadow.css +3 -5
- package/lib/es6/style/reference.shadow.css +5 -5
- package/lib/es6/style/scatterplot.shadow.css +2 -4
- package/lib/es6/style/tooltip.shadow.css +12 -14
- package/lib/es6/style/venn.shadow.css +0 -2
- package/lib/es6/types/Axis.d.js.map +1 -1
- package/lib/es6/types/Donut.d.js.map +1 -1
- package/lib/es6/types/Hover.d.js.map +1 -1
- package/lib/es6/types/index.d.js +5 -7
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/es6/utils.js +18 -0
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/Area.mjs +127 -26
- package/lib/esm/Axis.mjs +110 -98
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +15 -15
- package/lib/esm/ChartMetaData.mjs +38 -0
- package/lib/esm/CompactHorizontalBar.mjs +18 -18
- package/lib/esm/Donut.mjs +19 -20
- package/lib/esm/Dots.mjs +66 -15
- package/lib/esm/GroupBar.mjs +5 -2
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +56 -53
- package/lib/esm/Line.mjs +86 -20
- package/lib/esm/Pattern.mjs +119 -0
- package/lib/esm/Plot.mjs +6 -3
- package/lib/esm/Radar.mjs +20 -20
- package/lib/esm/RadialTree.mjs +13 -13
- package/lib/esm/Reference.mjs +56 -19
- package/lib/esm/ScatterPlot.mjs +10 -10
- package/lib/esm/Tooltip.mjs +17 -15
- package/lib/esm/Venn.mjs +10 -10
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +28 -24
- package/lib/esm/component/Chart/AbstractChart.type.mjs +16 -0
- package/lib/esm/component/Chart/AreaChart.mjs +21 -7
- package/lib/esm/component/Chart/BarChart.mjs +17 -8
- package/lib/esm/component/Chart/BubbleChart.mjs +4 -0
- package/lib/esm/component/Chart/CigaretteChart.mjs +5 -1
- package/lib/esm/component/Chart/DonutChart.mjs +0 -1
- package/lib/esm/component/Chart/HistogramChart.mjs +6 -3
- package/lib/esm/component/Chart/LineChart.mjs +14 -4
- package/lib/esm/component/Chart/index.mjs +8 -0
- package/lib/esm/component/ChartLegend/BaseLegend.mjs +0 -4
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
- package/lib/esm/component/ChartLegend/LegendFlex/legend-flex.shadow.css +2 -2
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +20 -18
- package/lib/esm/component/ChartLegend/LegendItem/legend-item.shadow.css +11 -11
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +29 -22
- package/lib/esm/component/ChartLegend/LegendTable/legend-table.shadow.css +31 -15
- package/lib/esm/component/Cigarette/Cigarette.mjs +0 -1
- package/lib/esm/component/Metric/Metric.mjs +62 -0
- package/lib/esm/index.mjs +42 -34
- package/lib/esm/style/abstract-chart.shadow.css +13 -3
- package/lib/esm/style/area.shadow.css +8 -7
- package/lib/esm/style/axis.shadow.css +51 -60
- package/lib/esm/style/bar.shadow.css +7 -9
- package/lib/esm/style/bubble.shadow.css +4 -6
- package/lib/esm/style/donut.shadow.css +3 -5
- package/lib/esm/style/dot.shadow.css +37 -4
- package/lib/esm/style/hover.shadow.css +30 -13
- package/lib/esm/style/line.shadow.css +3 -5
- package/lib/esm/style/pattern.shadow.css +10 -0
- package/lib/esm/style/plotA11yView.shadow.css +3 -3
- package/lib/esm/style/radar.shadow.css +7 -7
- package/lib/esm/style/radial-tree.shadow.css +3 -5
- package/lib/esm/style/reference.shadow.css +5 -5
- package/lib/esm/style/scatterplot.shadow.css +2 -4
- package/lib/esm/style/tooltip.shadow.css +12 -14
- package/lib/esm/style/venn.shadow.css +0 -2
- package/lib/esm/utils.mjs +20 -0
- package/lib/types/Axis.d.ts +3 -2
- package/lib/types/ChartMetaData.d.ts +17 -0
- package/lib/types/ChartMetaData.d.ts.map +1 -0
- package/lib/types/Donut.d.ts +1 -1
- package/lib/types/Hover.d.ts +2 -0
- package/lib/types/Pattern.d.ts +18 -0
- package/lib/types/Pattern.d.ts.map +1 -1
- package/lib/types/component/Chart/AbstractChart.d.ts +8 -4
- package/lib/types/component/Chart/AbstractChart.d.ts.map +1 -1
- package/lib/types/component/Chart/AbstractChart.type.d.ts +28 -8
- package/lib/types/component/Chart/AbstractChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/AreaChart.d.ts.map +1 -1
- package/lib/types/component/Chart/AreaChart.type.d.ts +8 -4
- package/lib/types/component/Chart/AreaChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/BarChart.d.ts.map +1 -1
- package/lib/types/component/Chart/BarChart.type.d.ts +3 -0
- package/lib/types/component/Chart/BarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/BubbleChart.d.ts.map +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/CigaretteChart.d.ts.map +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/DonutChart.d.ts.map +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -2
- package/lib/types/component/Chart/DonutChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/HistogramChart.d.ts.map +1 -1
- package/lib/types/component/Chart/HistogramChart.type.d.ts +1 -0
- package/lib/types/component/Chart/HistogramChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.d.ts.map +1 -1
- package/lib/types/component/Chart/LineChart.type.d.ts +1 -0
- package/lib/types/component/Chart/LineChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts.map +1 -1
- package/lib/types/component/Chart/index.d.ts +2 -0
- package/lib/types/component/Chart/index.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/BaseLegend.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.d.ts.map +1 -1
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts +5 -3
- package/lib/types/component/ChartLegend/LegendTable/LegendTable.type.d.ts.map +1 -1
- package/lib/types/component/Metric/Metric.d.ts +9 -0
- package/lib/types/component/Metric/Metric.d.ts.map +1 -0
- package/lib/types/component/Metric/Metric.type.d.ts +33 -0
- package/lib/types/component/Metric/Metric.type.d.ts.map +1 -0
- package/lib/types/index.d.ts +5 -7
- package/lib/types/utils.d.ts +4 -1
- package/lib/types/utils.d.ts.map +1 -1
- package/package.json +16 -15
- package/lib/cjs/color.js +0 -132
- package/lib/cjs/color.js.map +0 -1
- package/lib/cjs/style/var.css +0 -125
- package/lib/es6/color.js +0 -127
- package/lib/es6/color.js.map +0 -1
- package/lib/es6/style/var.css +0 -125
- package/lib/esm/color.mjs +0 -127
- package/lib/esm/utils/TextMeasurer.mjs +0 -27
package/lib/esm/Area.mjs
CHANGED
|
@@ -6,31 +6,34 @@ import { bisector } from "d3-array";
|
|
|
6
6
|
import { line, curveLinear, area } from "d3-shape";
|
|
7
7
|
import React from "react";
|
|
8
8
|
import AnimatedClipPath from "./AnimatedClipPath.mjs";
|
|
9
|
+
import "./component/Chart/index.mjs";
|
|
9
10
|
import { SvgElement } from "./component/SvgElement.mjs";
|
|
10
11
|
import createElement from "./createElement.mjs";
|
|
11
12
|
import Dots from "./Dots.mjs";
|
|
12
|
-
import { PatternFill } from "./Pattern.mjs";
|
|
13
|
-
import { interpolateValue, getNullData, definedNullData, eventToPoint, invert, definedData, scaleOfBandwidth } from "./utils.mjs";
|
|
13
|
+
import { ForecastGradient, StrokeMask, PotentialGradient, PatternFill } from "./Pattern.mjs";
|
|
14
|
+
import { interpolateValue, getNullData, definedNullData, eventToPoint, invert, getDataOfType, definedData, scaleOfBandwidth } from "./utils.mjs";
|
|
15
|
+
import { FORECAST, POTENTIAL, DATA_TYPE } from "./component/Chart/AbstractChart.type.mjs";
|
|
14
16
|
/*!__reshadow-styles__:"./style/area.shadow.css"*/
|
|
15
17
|
const style = (
|
|
16
18
|
/*__reshadow_css_start__*/
|
|
17
19
|
(sstyled.insert(
|
|
18
20
|
/*__inner_css_start__*/
|
|
19
|
-
".
|
|
21
|
+
".___SArea_mf3t1_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));fill-opacity:.1}.___SArea_mf3t1_gg_.__withGradient_mf3t1_gg_{-webkit-mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000);mask-image:linear-gradient(180deg,#000 0,#0000007a 60%,#0000)}.___SArea_mf3t1_gg_.__color_mf3t1_gg_{fill:var(--color_mf3t1)}.___SArea_mf3t1_gg_.__pattern_mf3t1_gg_{fill:var(--pattern_mf3t1);fill-opacity:.5}.___SArea_mf3t1_gg_.__transparent_mf3t1_gg_{opacity:.3}.___SAreaLine_mf3t1_gg_{stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));stroke-width:2;fill:#0000}.___SAreaLine_mf3t1_gg_.__color_mf3t1_gg_{stroke:var(--color_mf3t1)}.___SAreaLine_mf3t1_gg_.__transparent_mf3t1_gg_{opacity:.3}.___SAreaLine_mf3t1_gg_,.___SArea_mf3t1_gg_{transition-property:d;transition-duration:var(--duration_mf3t1);transition-timing-function:ease-in-out}.___SNull_mf3t1_gg_{fill:#0000;stroke:var(--intergalactic-chart-palette-order-null,oklch(.9 .009 234));stroke-dasharray:4}.___SNull_mf3t1_gg_.__hide_mf3t1_gg_{display:none}",
|
|
20
22
|
/*__inner_css_end__*/
|
|
21
|
-
"
|
|
23
|
+
"mf3t1_gg_"
|
|
22
24
|
), /*__reshadow_css_end__*/
|
|
23
25
|
{
|
|
24
|
-
"__SArea": "
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
26
|
+
"__SArea": "___SArea_mf3t1_gg_",
|
|
27
|
+
"_withGradient": "__withGradient_mf3t1_gg_",
|
|
28
|
+
"_color": "__color_mf3t1_gg_",
|
|
29
|
+
"--color": "--color_mf3t1",
|
|
30
|
+
"_pattern": "__pattern_mf3t1_gg_",
|
|
31
|
+
"--pattern": "--pattern_mf3t1",
|
|
32
|
+
"_transparent": "__transparent_mf3t1_gg_",
|
|
33
|
+
"__SAreaLine": "___SAreaLine_mf3t1_gg_",
|
|
34
|
+
"--duration": "--duration_mf3t1",
|
|
35
|
+
"__SNull": "___SNull_mf3t1_gg_",
|
|
36
|
+
"_hide": "__hide_mf3t1_gg_"
|
|
34
37
|
})
|
|
35
38
|
);
|
|
36
39
|
class AreaRoot extends Component {
|
|
@@ -107,8 +110,99 @@ class AreaRoot extends Component {
|
|
|
107
110
|
const index = bisector((d) => d[x]).center(data, vX);
|
|
108
111
|
onClick(index, e);
|
|
109
112
|
}
|
|
110
|
-
|
|
113
|
+
renderForecast() {
|
|
111
114
|
var _ref;
|
|
115
|
+
const SArea = SvgElement;
|
|
116
|
+
const SAreaLine = SvgElement;
|
|
117
|
+
const {
|
|
118
|
+
styles,
|
|
119
|
+
hide,
|
|
120
|
+
d3,
|
|
121
|
+
d3Line,
|
|
122
|
+
color,
|
|
123
|
+
uid,
|
|
124
|
+
duration,
|
|
125
|
+
y,
|
|
126
|
+
transparent,
|
|
127
|
+
resolveColor
|
|
128
|
+
} = this.asProps;
|
|
129
|
+
const data = getDataOfType(this.asProps.data, FORECAST, y);
|
|
130
|
+
return _ref = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SAreaLine, _ref.cn("SAreaLine", {
|
|
131
|
+
"tag": "path",
|
|
132
|
+
"aria-hidden": true,
|
|
133
|
+
"clipPath": `url(#${uid}-animation)`,
|
|
134
|
+
"d": d3Line(data),
|
|
135
|
+
"color": resolveColor(color),
|
|
136
|
+
"use:duration": `${duration}ms`,
|
|
137
|
+
"transparent": transparent,
|
|
138
|
+
"strokeDasharray": "0 4",
|
|
139
|
+
"strokeLinecap": "round"
|
|
140
|
+
})), /* @__PURE__ */ React.createElement(SArea, _ref.cn("SArea", {
|
|
141
|
+
"aria-hidden": true,
|
|
142
|
+
"tag": "path",
|
|
143
|
+
"clipPath": `url(#${uid})`,
|
|
144
|
+
"d": d3(data),
|
|
145
|
+
"hide": hide,
|
|
146
|
+
"pattern": `url(#${uid}-forecast-gradient)`,
|
|
147
|
+
"mask": `url(#${uid}-forecast-mask)`,
|
|
148
|
+
"use:duration": `${duration}ms`,
|
|
149
|
+
"transparent": transparent,
|
|
150
|
+
"onClickCapture": this.handlerOnClick.bind(this)
|
|
151
|
+
})), /* @__PURE__ */ React.createElement(ForecastGradient, _ref.cn("ForecastGradient", {
|
|
152
|
+
"id": `${uid}-forecast-gradient`,
|
|
153
|
+
"color": resolveColor(color)
|
|
154
|
+
})), /* @__PURE__ */ React.createElement(StrokeMask, _ref.cn("StrokeMask", {
|
|
155
|
+
"id": `${uid}-forecast-mask`,
|
|
156
|
+
"color": resolveColor(color)
|
|
157
|
+
})));
|
|
158
|
+
}
|
|
159
|
+
renderPotential() {
|
|
160
|
+
var _ref2;
|
|
161
|
+
const SArea = SvgElement;
|
|
162
|
+
const SAreaLine = SvgElement;
|
|
163
|
+
const {
|
|
164
|
+
styles,
|
|
165
|
+
hide,
|
|
166
|
+
d3,
|
|
167
|
+
d3Line,
|
|
168
|
+
uid,
|
|
169
|
+
duration,
|
|
170
|
+
y,
|
|
171
|
+
transparent
|
|
172
|
+
} = this.asProps;
|
|
173
|
+
const data = getDataOfType(this.asProps.data, POTENTIAL, y);
|
|
174
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SAreaLine, _ref2.cn("SAreaLine", {
|
|
175
|
+
"tag": "path",
|
|
176
|
+
"aria-hidden": true,
|
|
177
|
+
"clipPath": `url(#${uid}-animation)`,
|
|
178
|
+
"d": d3Line(data),
|
|
179
|
+
"color": `url(#${uid}-potential-gradient-line)`,
|
|
180
|
+
"use:duration": `${duration}ms`,
|
|
181
|
+
"transparent": transparent,
|
|
182
|
+
"strokeDasharray": "4 4"
|
|
183
|
+
})), /* @__PURE__ */ React.createElement(SArea, _ref2.cn("SArea", {
|
|
184
|
+
"aria-hidden": true,
|
|
185
|
+
"tag": "path",
|
|
186
|
+
"clipPath": `url(#${uid})`,
|
|
187
|
+
"d": d3(data),
|
|
188
|
+
"hide": hide,
|
|
189
|
+
"pattern": `url(#${uid}-potential-gradient)`,
|
|
190
|
+
"mask": `url(#${uid}-potential-mask)`,
|
|
191
|
+
"use:duration": `${duration}ms`,
|
|
192
|
+
"transparent": transparent,
|
|
193
|
+
"onClickCapture": this.handlerOnClick.bind(this)
|
|
194
|
+
})), /* @__PURE__ */ React.createElement(PotentialGradient, _ref2.cn("PotentialGradient", {
|
|
195
|
+
"id": `${uid}-potential-gradient`,
|
|
196
|
+
"type": "area"
|
|
197
|
+
})), /* @__PURE__ */ React.createElement(PotentialGradient, _ref2.cn("PotentialGradient", {
|
|
198
|
+
"id": `${uid}-potential-gradient-line`,
|
|
199
|
+
"type": "line"
|
|
200
|
+
})), /* @__PURE__ */ React.createElement(StrokeMask, _ref2.cn("StrokeMask", {
|
|
201
|
+
"id": `${uid}-potential-mask`
|
|
202
|
+
})));
|
|
203
|
+
}
|
|
204
|
+
render() {
|
|
205
|
+
var _ref3;
|
|
112
206
|
const SArea = this.Element;
|
|
113
207
|
const SAreaLine = SvgElement;
|
|
114
208
|
const {
|
|
@@ -126,13 +220,14 @@ class AreaRoot extends Component {
|
|
|
126
220
|
transparent,
|
|
127
221
|
forcedAdvancedMode,
|
|
128
222
|
resolveColor,
|
|
129
|
-
patterns
|
|
223
|
+
patterns,
|
|
224
|
+
withGradient
|
|
130
225
|
} = this.asProps;
|
|
131
226
|
const advancedMode = forcedAdvancedMode || !!findComponent(Children, [Area.Line.displayName]);
|
|
132
|
-
const data = this.asProps.data.filter((item) => item[y] !== interpolateValue);
|
|
227
|
+
const data = this.asProps.data.filter((item) => item[y] !== interpolateValue && item[DATA_TYPE] !== FORECAST && item[DATA_TYPE] !== POTENTIAL);
|
|
133
228
|
this.asProps.dataHintsHandler.specifyDataRowFields(x, y);
|
|
134
229
|
this.asProps.dataHintsHandler.establishDataType("time-series");
|
|
135
|
-
return
|
|
230
|
+
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, !advancedMode && /* @__PURE__ */ React.createElement(SAreaLine, _ref3.cn("SAreaLine", {
|
|
136
231
|
"tag": "path",
|
|
137
232
|
"aria-hidden": true,
|
|
138
233
|
"clipPath": `url(#${uid}-animation)`,
|
|
@@ -140,7 +235,7 @@ class AreaRoot extends Component {
|
|
|
140
235
|
"color": resolveColor(color),
|
|
141
236
|
"use:duration": `${duration}ms`,
|
|
142
237
|
"transparent": transparent
|
|
143
|
-
})), /* @__PURE__ */ React.createElement(SArea,
|
|
238
|
+
})), this.renderForecast(), this.renderPotential(), /* @__PURE__ */ React.createElement(SArea, _ref3.cn("SArea", {
|
|
144
239
|
"aria-hidden": true,
|
|
145
240
|
"clipPath": `url(#${uid})`,
|
|
146
241
|
"render": "path",
|
|
@@ -150,13 +245,19 @@ class AreaRoot extends Component {
|
|
|
150
245
|
"color": resolveColor(color),
|
|
151
246
|
"use:duration": `${duration}ms`,
|
|
152
247
|
"transparent": transparent,
|
|
153
|
-
"onClickCapture": this.handlerOnClick.bind(this)
|
|
154
|
-
|
|
248
|
+
"onClickCapture": this.handlerOnClick.bind(this),
|
|
249
|
+
"withGradient": patterns ? void 0 : withGradient
|
|
250
|
+
})), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, _ref3.cn("AnimatedClipPath", {
|
|
155
251
|
"duration": duration,
|
|
156
252
|
"id": uid,
|
|
157
253
|
"width": 0,
|
|
158
254
|
"height": size[1]
|
|
159
|
-
})),
|
|
255
|
+
})), duration && /* @__PURE__ */ React.createElement(AnimatedClipPath, _ref3.cn("AnimatedClipPath", {
|
|
256
|
+
"duration": duration,
|
|
257
|
+
"id": `${uid}-animation`,
|
|
258
|
+
"width": 0,
|
|
259
|
+
"height": size[1]
|
|
260
|
+
})), patterns && /* @__PURE__ */ React.createElement(PatternFill, _ref3.cn("PatternFill", {
|
|
160
261
|
"id": `${uid}-pattern`,
|
|
161
262
|
"patternKey": color,
|
|
162
263
|
"color": resolveColor(color),
|
|
@@ -184,7 +285,7 @@ _defineProperty(AreaRoot, "defaultProps", ({
|
|
|
184
285
|
};
|
|
185
286
|
});
|
|
186
287
|
function Line(props) {
|
|
187
|
-
var
|
|
288
|
+
var _ref4;
|
|
188
289
|
const {
|
|
189
290
|
Element: SAreaLine,
|
|
190
291
|
styles,
|
|
@@ -196,7 +297,7 @@ function Line(props) {
|
|
|
196
297
|
uid,
|
|
197
298
|
transparent
|
|
198
299
|
} = props;
|
|
199
|
-
return
|
|
300
|
+
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SAreaLine, _ref4.cn("SAreaLine", {
|
|
200
301
|
"render": "path",
|
|
201
302
|
"clipPath": `url(#${uid})`,
|
|
202
303
|
"d": d3(data),
|
|
@@ -206,7 +307,7 @@ function Line(props) {
|
|
|
206
307
|
}));
|
|
207
308
|
}
|
|
208
309
|
function Null(props) {
|
|
209
|
-
var
|
|
310
|
+
var _ref5;
|
|
210
311
|
const {
|
|
211
312
|
Element: SNull,
|
|
212
313
|
styles,
|
|
@@ -216,7 +317,7 @@ function Null(props) {
|
|
|
216
317
|
color,
|
|
217
318
|
resolveColor
|
|
218
319
|
} = props;
|
|
219
|
-
return
|
|
320
|
+
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SNull, _ref5.cn("SNull", {
|
|
220
321
|
"render": "path",
|
|
221
322
|
"d": d3(data),
|
|
222
323
|
"hide": hide,
|
package/lib/esm/Axis.mjs
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import { sstyled, Component } from "@semcore/core";
|
|
4
|
+
import { getFocusableIn } from "@semcore/core/lib/utils/focus-lock/getFocusableIn";
|
|
5
|
+
import propsForElement from "@semcore/core/lib/utils/propsForElement";
|
|
6
|
+
import useEnhancedEffect from "@semcore/core/lib/utils/use/useEnhancedEffect";
|
|
4
7
|
import React from "react";
|
|
5
8
|
import createElement from "./createElement.mjs";
|
|
6
9
|
import { scaleOfBandwidth } from "./utils.mjs";
|
|
7
|
-
import { TextMeasurer } from "./utils/TextMeasurer.mjs";
|
|
8
10
|
/*!__reshadow-styles__:"./style/axis.shadow.css"*/
|
|
9
11
|
const style = (
|
|
10
12
|
/*__reshadow_css_start__*/
|
|
11
13
|
(sstyled.insert(
|
|
12
14
|
/*__inner_css_start__*/
|
|
13
|
-
|
|
15
|
+
'.___SAxis_ae62s_gg_{stroke:var(--intergalactic-chart-grid-x-axis,oklch(.88 .011 234.9))}.___SAxis_ae62s_gg_.__hide_ae62s_gg_{display:none}.___STick_ae62s_gg_{display:block;font-size:var(--intergalactic-fs-100,12px);font-feature-settings:"tnum";font-variant-numeric:tabular-nums;line-height:var(--intergalactic-lh-100,1.3334);color:var(--intergalactic-chart-grid-text-label,#00132466);overflow:visible}.___STick_ae62s_gg_ [data-tick-content]{height:100%}.___STick_ae62s_gg_._position_bottom_ae62s_gg_{text-align:center}.___STick_ae62s_gg_._position_left_ae62s_gg_{text-align:right;dominant-baseline:central}.___STick_ae62s_gg_._position_left_ae62s_gg_ [data-tick-content]{align-content:center}.___STick_ae62s_gg_._position_top_ae62s_gg_{text-align:center}.___STick_ae62s_gg_._position_top_ae62s_gg_ [data-tick-content]{align-content:end}.___STick_ae62s_gg_._position_right_ae62s_gg_{dominant-baseline:central}.___STick_ae62s_gg_._position_right_ae62s_gg_ [data-tick-content]{align-content:center}.___STick_ae62s_gg_.__hide_ae62s_gg_{display:none}.___STick_ae62s_gg_.__primaryText_ae62s_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245))}.___SGrid_ae62s_gg_{fill:#0000;stroke:var(--intergalactic-chart-grid-line,oklch(.7 .021 242));stroke-dasharray:0 6;stroke-linecap:round}.___STitle_ae62s_gg_{font-size:var(--intergalactic-fs-100,12px);fill:var(--intergalactic-chart-grid-text-label,#00132466);transform-origin:var(--transform-origin_ae62s)}.___STitle_ae62s_gg_._position_top_ae62s_gg_{text-anchor:middle}.___STitle_ae62s_gg_._position_bottom_ae62s_gg_{text-anchor:middle;dominant-baseline:hanging}.___STitle_ae62s_gg_._position_left_ae62s_gg_,.___STitle_ae62s_gg_._position_right_ae62s_gg_{transform:rotate(-90deg);dominant-baseline:middle;text-anchor:middle}.___STitle_ae62s_gg_._position_left_ae62s_gg_.__verticalWritingMode_ae62s_gg_,.___STitle_ae62s_gg_._position_right_ae62s_gg_.__verticalWritingMode_ae62s_gg_{writing-mode:vertical-rl;transform:none}.___STick_ae62s_gg_._position_custom_0_ae62s_gg_{transform:translateY(12px);text-anchor:middle;dominant-baseline:hanging}.___STick_ae62s_gg_._position_custom_0_ae62s_gg_ tspan{dominant-baseline:hanging}.___STick_ae62s_gg_._position_custom_1_ae62s_gg_{transform:translateX(-16px);text-anchor:end;dominant-baseline:middle}.___STick_ae62s_gg_._position_custom_1_ae62s_gg_ tspan{dominant-baseline:middle}',
|
|
14
16
|
/*__inner_css_end__*/
|
|
15
|
-
"
|
|
17
|
+
"ae62s_gg_"
|
|
16
18
|
), /*__reshadow_css_end__*/
|
|
17
19
|
{
|
|
18
|
-
"__SAxis": "
|
|
19
|
-
"_hide": "
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"_position_custom_1": "_position_custom_1_17qfg_gg_"
|
|
20
|
+
"__SAxis": "___SAxis_ae62s_gg_",
|
|
21
|
+
"_hide": "__hide_ae62s_gg_",
|
|
22
|
+
"__SGrid": "___SGrid_ae62s_gg_",
|
|
23
|
+
"__STitle": "___STitle_ae62s_gg_",
|
|
24
|
+
"--transform-origin": "--transform-origin_ae62s",
|
|
25
|
+
"_position_top": "_position_top_ae62s_gg_",
|
|
26
|
+
"_position_bottom": "_position_bottom_ae62s_gg_",
|
|
27
|
+
"_position_right": "_position_right_ae62s_gg_",
|
|
28
|
+
"_position_left": "_position_left_ae62s_gg_",
|
|
29
|
+
"_verticalWritingMode": "__verticalWritingMode_ae62s_gg_",
|
|
30
|
+
"__STick": "___STick_ae62s_gg_",
|
|
31
|
+
"_primaryText": "__primaryText_ae62s_gg_",
|
|
32
|
+
"_position_custom_0": "_position_custom_0_ae62s_gg_",
|
|
33
|
+
"_position_custom_1": "_position_custom_1_ae62s_gg_"
|
|
33
34
|
})
|
|
34
35
|
);
|
|
36
|
+
const TICK_MARGIN_X = 16;
|
|
37
|
+
const TICK_MARGIN_Y = 8;
|
|
35
38
|
const CUSTOM_0 = /* @__PURE__ */ Symbol("custom_0");
|
|
36
39
|
const CUSTOM_1 = /* @__PURE__ */ Symbol("custom_1");
|
|
37
40
|
const MAP_INDEX_SCALE_SYMBOL = {
|
|
@@ -105,32 +108,46 @@ const MAP_POSITION_AXIS = {
|
|
|
105
108
|
}
|
|
106
109
|
};
|
|
107
110
|
const MAP_POSITION_TICK = {
|
|
108
|
-
top: ([xScale, yScale], value
|
|
111
|
+
top: ([xScale, yScale], value, _, {
|
|
112
|
+
width,
|
|
113
|
+
height
|
|
114
|
+
}) => {
|
|
109
115
|
const yRange = yScale.range();
|
|
116
|
+
const [translateX, translateY] = [-width / 2, -height - TICK_MARGIN_Y];
|
|
110
117
|
return {
|
|
111
|
-
x: scaleOfBandwidth(xScale, value),
|
|
112
|
-
y: yRange[1]
|
|
118
|
+
x: scaleOfBandwidth(xScale, value) + translateX,
|
|
119
|
+
y: yRange[1] + translateY
|
|
113
120
|
};
|
|
114
121
|
},
|
|
115
|
-
bottom: ([xScale, yScale], value
|
|
122
|
+
bottom: ([xScale, yScale], value, _, {
|
|
123
|
+
width
|
|
124
|
+
}) => {
|
|
116
125
|
const yRange = yScale.range();
|
|
126
|
+
const [translateX, translateY] = [-width / 2, TICK_MARGIN_Y];
|
|
117
127
|
return {
|
|
118
|
-
x: scaleOfBandwidth(xScale, value),
|
|
119
|
-
y: yRange[0]
|
|
128
|
+
x: scaleOfBandwidth(xScale, value) + translateX,
|
|
129
|
+
y: yRange[0] + translateY
|
|
120
130
|
};
|
|
121
131
|
},
|
|
122
|
-
right: ([xScale, yScale], value
|
|
132
|
+
right: ([xScale, yScale], value, _, {
|
|
133
|
+
height
|
|
134
|
+
}) => {
|
|
123
135
|
const xRange = xScale.range();
|
|
136
|
+
const [translateX, translateY] = [TICK_MARGIN_X, -height / 2];
|
|
124
137
|
return {
|
|
125
|
-
x: xRange[1],
|
|
126
|
-
y: scaleOfBandwidth(yScale, value)
|
|
138
|
+
x: xRange[1] + translateX,
|
|
139
|
+
y: scaleOfBandwidth(yScale, value) + translateY
|
|
127
140
|
};
|
|
128
141
|
},
|
|
129
|
-
left: ([xScale, yScale], value
|
|
142
|
+
left: ([xScale, yScale], value, _, {
|
|
143
|
+
width,
|
|
144
|
+
height
|
|
145
|
+
}) => {
|
|
130
146
|
const xRange = xScale.range();
|
|
147
|
+
const [translateX, translateY] = [-width - TICK_MARGIN_X, -height / 2];
|
|
131
148
|
return {
|
|
132
|
-
x: xRange[0],
|
|
133
|
-
y: scaleOfBandwidth(yScale, value)
|
|
149
|
+
x: xRange[0] + translateX,
|
|
150
|
+
y: scaleOfBandwidth(yScale, value) + translateY
|
|
134
151
|
};
|
|
135
152
|
},
|
|
136
153
|
[CUSTOM_0]: ([xScale, yScale], value, pos) => {
|
|
@@ -199,49 +216,35 @@ const MAP_POSITION_TITlE = {
|
|
|
199
216
|
};
|
|
200
217
|
}
|
|
201
218
|
};
|
|
202
|
-
function renderValue(value) {
|
|
219
|
+
function renderValue(value, locale = "en") {
|
|
203
220
|
if (value instanceof Date) {
|
|
204
|
-
return
|
|
221
|
+
return new Intl.DateTimeFormat(locale, {
|
|
222
|
+
day: "numeric",
|
|
223
|
+
month: "short"
|
|
224
|
+
}).format(value);
|
|
205
225
|
}
|
|
206
226
|
return value;
|
|
207
227
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const {
|
|
229
|
-
width: currentLineWidth
|
|
230
|
-
} = measurer2.measure(currentLine);
|
|
231
|
-
if (currentLineWidth > maxWidth) {
|
|
232
|
-
lines.push(currentLine);
|
|
233
|
-
currentLine = "";
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
if (currentLine) {
|
|
238
|
-
lines.push(currentLine);
|
|
239
|
-
}
|
|
240
|
-
return lines;
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
const measurer = new TextMeasurer();
|
|
228
|
+
const TickForeignObject = /* @__PURE__ */ React.forwardRef(function({
|
|
229
|
+
children,
|
|
230
|
+
isRenderProp,
|
|
231
|
+
"aria-hidden": ariaHidden,
|
|
232
|
+
...props
|
|
233
|
+
}, ref) {
|
|
234
|
+
const contentRef = React.useRef(null);
|
|
235
|
+
const [interactive, setInteractive] = React.useState(false);
|
|
236
|
+
useEnhancedEffect(() => {
|
|
237
|
+
if (!isRenderProp || !contentRef.current) return;
|
|
238
|
+
setInteractive(getFocusableIn(contentRef.current).length > 0);
|
|
239
|
+
}, []);
|
|
240
|
+
return /* @__PURE__ */ React.createElement("foreignObject", _extends({
|
|
241
|
+
ref,
|
|
242
|
+
"aria-hidden": interactive ? void 0 : true
|
|
243
|
+
}, propsForElement(props, "foreignObject")), /* @__PURE__ */ React.createElement("div", {
|
|
244
|
+
ref: contentRef,
|
|
245
|
+
"data-tick-content": true
|
|
246
|
+
}, children));
|
|
247
|
+
});
|
|
245
248
|
class AxisRoot extends Component {
|
|
246
249
|
get ticks() {
|
|
247
250
|
const {
|
|
@@ -270,8 +273,7 @@ class AxisRoot extends Component {
|
|
|
270
273
|
return {
|
|
271
274
|
ticks: this.ticks,
|
|
272
275
|
indexScale,
|
|
273
|
-
position
|
|
274
|
-
splitTextByWidth: splitTextByWidth(measurer)
|
|
276
|
+
position
|
|
275
277
|
};
|
|
276
278
|
}
|
|
277
279
|
getGridProps() {
|
|
@@ -316,17 +318,24 @@ function Ticks(props) {
|
|
|
316
318
|
dataHintsHandler,
|
|
317
319
|
children,
|
|
318
320
|
childrenPosition = "inside",
|
|
319
|
-
|
|
320
|
-
|
|
321
|
+
locale,
|
|
322
|
+
primaryText,
|
|
323
|
+
size,
|
|
324
|
+
meta
|
|
321
325
|
} = props;
|
|
322
|
-
const
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
326
|
+
const isRenderProp = typeof children === "function";
|
|
327
|
+
const isXScale = indexScale === 0;
|
|
328
|
+
const axis = isXScale ? "horizontal" : "vertical";
|
|
329
|
+
const [_, plotHeight] = size;
|
|
330
|
+
const currentScale = scale[indexScale];
|
|
331
|
+
const secondaryScale = scale[isXScale ? 1 : 0];
|
|
332
|
+
const [startPointCurrentScale, endPointCurrentScale] = currentScale.range();
|
|
333
|
+
const [startPointSecondaryScale, endPointSecondaryScale] = secondaryScale.range();
|
|
334
|
+
const tickStepSize = currentScale?.step?.() ?? Math.abs(startPointCurrentScale - endPointCurrentScale) / ticks.length;
|
|
335
|
+
const [tickWidth, tickHeight] = isXScale ? [tickStepSize, Math.max(Math.abs(plotHeight - startPointSecondaryScale), endPointSecondaryScale)] : [startPointSecondaryScale, tickStepSize];
|
|
327
336
|
const pos = MAP_POSITION_TICK[position] ?? MAP_POSITION_TICK[MAP_INDEX_SCALE_SYMBOL[indexScale]];
|
|
328
337
|
const positionClass = MAP_POSITION_TICK[position] ? position : `custom_${indexScale}`;
|
|
329
|
-
if (
|
|
338
|
+
if (isRenderProp) {
|
|
330
339
|
const labelGetter = (value) => {
|
|
331
340
|
const result = children({
|
|
332
341
|
value
|
|
@@ -339,30 +348,33 @@ function Ticks(props) {
|
|
|
339
348
|
dataHintsHandler.addKeyLabelGetter("horizontal", labelGetter);
|
|
340
349
|
}
|
|
341
350
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
351
|
+
meta.setTicksSize(axis, {
|
|
352
|
+
width: tickWidth,
|
|
353
|
+
height: tickHeight
|
|
354
|
+
});
|
|
355
|
+
meta.setTicksVisibility(axis, !hide);
|
|
356
|
+
meta.setTicksPosition(axis, position);
|
|
357
|
+
return ticks.map((value, i) => {
|
|
346
358
|
var _ref2;
|
|
347
|
-
const displayValue =
|
|
359
|
+
const displayValue = isRenderProp ? void 0 : renderValue(value, locale);
|
|
348
360
|
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(STick, _ref2.cn("STick", {
|
|
349
|
-
"aria-hidden": true,
|
|
350
361
|
"key": i,
|
|
351
|
-
"render": "text",
|
|
352
|
-
"childrenPosition": childrenPosition,
|
|
353
|
-
"__excludeProps": ["data", "scale", "format", "value"],
|
|
354
|
-
"value": value,
|
|
355
362
|
"index": i,
|
|
363
|
+
"render": TickForeignObject,
|
|
364
|
+
"childrenPosition": childrenPosition,
|
|
365
|
+
"width": tickWidth,
|
|
366
|
+
"height": tickHeight,
|
|
356
367
|
"position": positionClass,
|
|
357
368
|
"hide": hide,
|
|
358
|
-
"
|
|
359
|
-
"
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
369
|
+
"primaryText": primaryText,
|
|
370
|
+
"value": value,
|
|
371
|
+
"isRenderProp": isRenderProp,
|
|
372
|
+
"__excludeProps": ["data", "scale", "format", "value"],
|
|
373
|
+
...pos(scale, value, position, {
|
|
374
|
+
width: tickWidth,
|
|
375
|
+
height: tickHeight
|
|
376
|
+
})
|
|
377
|
+
}), displayValue);
|
|
366
378
|
});
|
|
367
379
|
}
|
|
368
380
|
function Grid(props) {
|
package/lib/esm/Bar.mjs
CHANGED
|
@@ -12,26 +12,26 @@ const style = (
|
|
|
12
12
|
/*__reshadow_css_start__*/
|
|
13
13
|
(sstyled.insert(
|
|
14
14
|
/*__inner_css_start__*/
|
|
15
|
-
".
|
|
15
|
+
".___SBar_1d6up_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));transition-property:height,width,y;transition-duration:var(--duration_1d6up);transition-timing-function:ease-in-out}.___SBar_1d6up_gg_.__color_1d6up_gg_{fill:var(--color_1d6up)}.___SBar_1d6up_gg_.__pattern_1d6up_gg_.__color_1d6up_gg_{fill:var(--pattern_1d6up);stroke:var(--color_1d6up);stroke-width:1px}.___SBar_1d6up_gg_.__hide_1d6up_gg_{display:none}.___SBar_1d6up_gg_.__transparent_1d6up_gg_{opacity:.3}.___SBar_1d6up_gg_.__onClick_1d6up_gg_{cursor:pointer}.___SBackground_1d6up_gg_{fill:var(--intergalactic-chart-grid-bar-base-bg,oklch(.92 .008 233.5));opacity:.4}.___SBackground_1d6up_gg_.__onClick_1d6up_gg_{cursor:pointer}.___SBarAnnotation_1d6up_gg_{display:flex;justify-content:space-between}.___SBarLabel_1d6up_gg_{color:var(--intergalactic-text-primary,oklch(.23 .009 245));margin-right:auto}.___SBarLabel_1d6up_gg_,.___SBarPercent_1d6up_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286)}.___SBarPercent_1d6up_gg_{color:var(--intergalactic-text-secondary,oklch(.182 .045 244.8/.593));margin-right:var(--intergalactic-spacing-2x,8px)}.___SBarValue_1d6up_gg_{min-width:52px;display:flex;justify-content:flex-end;color:var(--intergalactic-text-primary,oklch(.23 .009 245));font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,1.4286);text-align:right}.___SCompactHorizontalBarHoverRect_1d6up_gg_{fill:var(--intergalactic-chart-grid-bar-hover,oklch(.375 .09 242.7/.05))}",
|
|
16
16
|
/*__inner_css_end__*/
|
|
17
|
-
"
|
|
17
|
+
"1d6up_gg_"
|
|
18
18
|
), /*__reshadow_css_end__*/
|
|
19
19
|
{
|
|
20
|
-
"__SBar": "
|
|
21
|
-
"--duration": "--
|
|
22
|
-
"_color": "
|
|
23
|
-
"--color": "--
|
|
24
|
-
"_pattern": "
|
|
25
|
-
"--pattern": "--
|
|
26
|
-
"_hide": "
|
|
27
|
-
"_transparent": "
|
|
28
|
-
"_onClick": "
|
|
29
|
-
"__SBackground": "
|
|
30
|
-
"__SBarAnnotation": "
|
|
31
|
-
"__SBarLabel": "
|
|
32
|
-
"__SBarPercent": "
|
|
33
|
-
"__SBarValue": "
|
|
34
|
-
"__SCompactHorizontalBarHoverRect": "
|
|
20
|
+
"__SBar": "___SBar_1d6up_gg_",
|
|
21
|
+
"--duration": "--duration_1d6up",
|
|
22
|
+
"_color": "__color_1d6up_gg_",
|
|
23
|
+
"--color": "--color_1d6up",
|
|
24
|
+
"_pattern": "__pattern_1d6up_gg_",
|
|
25
|
+
"--pattern": "--pattern_1d6up",
|
|
26
|
+
"_hide": "__hide_1d6up_gg_",
|
|
27
|
+
"_transparent": "__transparent_1d6up_gg_",
|
|
28
|
+
"_onClick": "__onClick_1d6up_gg_",
|
|
29
|
+
"__SBackground": "___SBackground_1d6up_gg_",
|
|
30
|
+
"__SBarAnnotation": "___SBarAnnotation_1d6up_gg_",
|
|
31
|
+
"__SBarLabel": "___SBarLabel_1d6up_gg_",
|
|
32
|
+
"__SBarPercent": "___SBarPercent_1d6up_gg_",
|
|
33
|
+
"__SBarValue": "___SBarValue_1d6up_gg_",
|
|
34
|
+
"__SCompactHorizontalBarHoverRect": "___SCompactHorizontalBarHoverRect_1d6up_gg_"
|
|
35
35
|
})
|
|
36
36
|
);
|
|
37
37
|
const MIN_HEIGHT = 2;
|
package/lib/esm/Bubble.mjs
CHANGED
|
@@ -15,24 +15,24 @@ const style = (
|
|
|
15
15
|
/*__reshadow_css_start__*/
|
|
16
16
|
(sstyled.insert(
|
|
17
17
|
/*__inner_css_start__*/
|
|
18
|
-
".
|
|
18
|
+
".___SBubble_1fxbq_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245));stroke:var(--intergalactic-chart-grid-border,#fff);stroke-width:2px;transition-property:cx,cy;transition-duration:var(--duration_1fxbq);transition-timing-function:ease-in-out;opacity:.5}@media (hover:hover){.___SBubble_1fxbq_gg_:hover{opacity:.8}}g._visible_false_1fxbq_gg_{display:none}.___SBubble_1fxbq_gg_.__clickable_1fxbq_gg_{cursor:pointer}.___SBubble_1fxbq_gg_.__color_1fxbq_gg_{fill:var(--color_1fxbq)}.___SBubble_1fxbq_gg_.__pattern_1fxbq_gg_.__color_1fxbq_gg_{fill:var(--pattern_1fxbq);stroke:var(--color_1fxbq);stroke-width:1px}.___SBubble_1fxbq_gg_.__transparent_1fxbq_gg_{opacity:.3}.___SCenter_1fxbq_gg_{text-anchor:middle;font-size:calc(var(--intergalactic-fs-100, 12px) - 1px);stroke:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SCenter_1fxbq_gg_.__color_1fxbq_gg_{stroke:var(--color_1fxbq)}.___SCenter_1fxbq_gg_.__transparent_1fxbq_gg_{opacity:.3}.___SLabel_1fxbq_gg_{fill:var(--intergalactic-chart-palette-order-1,oklch(.23 .009 245))}.___SLabel_1fxbq_gg_._position_right_1fxbq_gg_{text-anchor:end}.___SLabel_1fxbq_gg_._position_left_1fxbq_gg_{text-anchor:start}.___SLabel_1fxbq_gg_.__color_1fxbq_gg_{fill:var(--color_1fxbq)}.___SLabel_1fxbq_gg_.__transparent_1fxbq_gg_{opacity:.3}",
|
|
19
19
|
/*__inner_css_end__*/
|
|
20
|
-
"
|
|
20
|
+
"1fxbq_gg_"
|
|
21
21
|
), /*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"_visible_false": "
|
|
24
|
-
"__SBubble": "
|
|
25
|
-
"_clickable": "
|
|
26
|
-
"_color": "
|
|
27
|
-
"--color": "--
|
|
28
|
-
"_pattern": "
|
|
29
|
-
"--pattern": "--
|
|
30
|
-
"_transparent": "
|
|
31
|
-
"__SCenter": "
|
|
32
|
-
"__SLabel": "
|
|
33
|
-
"_position_right": "
|
|
34
|
-
"_position_left": "
|
|
35
|
-
"--duration": "--
|
|
23
|
+
"_visible_false": "_visible_false_1fxbq_gg_",
|
|
24
|
+
"__SBubble": "___SBubble_1fxbq_gg_",
|
|
25
|
+
"_clickable": "__clickable_1fxbq_gg_",
|
|
26
|
+
"_color": "__color_1fxbq_gg_",
|
|
27
|
+
"--color": "--color_1fxbq",
|
|
28
|
+
"_pattern": "__pattern_1fxbq_gg_",
|
|
29
|
+
"--pattern": "--pattern_1fxbq",
|
|
30
|
+
"_transparent": "__transparent_1fxbq_gg_",
|
|
31
|
+
"__SCenter": "___SCenter_1fxbq_gg_",
|
|
32
|
+
"__SLabel": "___SLabel_1fxbq_gg_",
|
|
33
|
+
"_position_right": "_position_right_1fxbq_gg_",
|
|
34
|
+
"_position_left": "_position_left_1fxbq_gg_",
|
|
35
|
+
"--duration": "--duration_1fxbq"
|
|
36
36
|
})
|
|
37
37
|
);
|
|
38
38
|
class BubbleRoot extends Component {
|