@antv/gpt-vis 0.5.14 → 1.0.0-beta.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/README.md +183 -114
- package/README.zh-CN.md +185 -112
- package/dist/cjs/gpt-vis/index.d.ts +108 -0
- package/dist/cjs/gpt-vis/index.js +173 -0
- package/dist/cjs/index.d.ts +44 -13
- package/dist/cjs/index.js +65 -35
- package/dist/cjs/syntax/index.d.ts +2 -0
- package/dist/cjs/{Text/mini-charts/hooks → syntax}/index.js +9 -7
- package/dist/cjs/syntax/parser.d.ts +67 -0
- package/dist/cjs/syntax/parser.js +235 -0
- package/dist/cjs/types/index.d.ts +33 -2
- package/dist/cjs/types/index.js +0 -6
- package/dist/cjs/util/theme.d.ts +21 -0
- package/dist/cjs/{theme.js → util/theme.js} +63 -14
- package/dist/cjs/vis/area/index.d.ts +60 -0
- package/dist/cjs/vis/area/index.js +151 -0
- package/dist/cjs/vis/bar/index.d.ts +60 -0
- package/dist/cjs/vis/bar/index.js +122 -0
- package/dist/cjs/vis/boxplot/index.d.ts +59 -0
- package/dist/cjs/vis/boxplot/index.js +106 -0
- package/dist/cjs/vis/column/index.d.ts +60 -0
- package/dist/cjs/vis/column/index.js +121 -0
- package/dist/cjs/vis/dual-axes/index.d.ts +64 -0
- package/dist/cjs/vis/dual-axes/index.js +147 -0
- package/dist/cjs/vis/funnel/index.d.ts +54 -0
- package/dist/cjs/vis/funnel/index.js +189 -0
- package/dist/cjs/vis/histogram/index.d.ts +47 -0
- package/dist/cjs/vis/histogram/index.js +112 -0
- package/dist/cjs/vis/line/index.d.ts +59 -0
- package/dist/cjs/vis/line/index.js +104 -0
- package/dist/cjs/vis/liquid/index.d.ts +44 -0
- package/dist/cjs/vis/liquid/index.js +87 -0
- package/dist/cjs/vis/pie/index.d.ts +55 -0
- package/dist/cjs/vis/pie/index.js +108 -0
- package/dist/cjs/vis/radar/index.d.ts +57 -0
- package/dist/cjs/vis/radar/index.js +152 -0
- package/dist/cjs/vis/sankey/index.d.ts +56 -0
- package/dist/cjs/vis/sankey/index.js +93 -0
- package/dist/cjs/vis/scatter/index.d.ts +54 -0
- package/dist/cjs/vis/scatter/index.js +94 -0
- package/dist/cjs/vis/summary/index.d.ts +41 -0
- package/dist/cjs/{Text/utils/getThemeColor.js → vis/summary/index.js} +33 -22
- package/dist/cjs/vis/table/index.d.ts +49 -0
- package/dist/cjs/vis/table/index.js +173 -0
- package/dist/cjs/vis/treemap/index.d.ts +68 -0
- package/dist/cjs/vis/treemap/index.js +105 -0
- package/dist/cjs/vis/venn/index.d.ts +54 -0
- package/dist/cjs/vis/venn/index.js +100 -0
- package/dist/cjs/vis/violin/index.d.ts +59 -0
- package/dist/cjs/vis/violin/index.js +155 -0
- package/dist/cjs/vis/waterfall/index.d.ts +67 -0
- package/dist/cjs/vis/waterfall/index.js +172 -0
- package/dist/cjs/vis/word-cloud/index.d.ts +53 -0
- package/dist/cjs/vis/word-cloud/index.js +89 -0
- package/dist/cjs/vis-wrapper/icons.d.ts +8 -0
- package/dist/cjs/vis-wrapper/icons.js +63 -0
- package/dist/cjs/vis-wrapper/index.d.ts +24 -0
- package/dist/cjs/vis-wrapper/index.js +231 -0
- package/dist/cjs/vis-wrapper/styles.d.ts +8 -0
- package/dist/cjs/vis-wrapper/styles.js +214 -0
- package/dist/esm/gpt-vis/index.d.ts +108 -0
- package/dist/esm/gpt-vis/index.js +224 -0
- package/dist/esm/index.d.ts +44 -13
- package/dist/esm/index.js +22 -15
- package/dist/esm/syntax/index.d.ts +2 -0
- package/dist/esm/syntax/index.js +1 -0
- package/dist/esm/syntax/parser.d.ts +67 -0
- package/dist/esm/syntax/parser.js +401 -0
- package/dist/esm/types/index.d.ts +33 -2
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/util/theme.d.ts +21 -0
- package/dist/esm/util/theme.js +141 -0
- package/dist/esm/vis/area/index.d.ts +60 -0
- package/dist/esm/vis/area/index.js +230 -0
- package/dist/esm/vis/bar/index.d.ts +60 -0
- package/dist/esm/vis/bar/index.js +203 -0
- package/dist/esm/vis/boxplot/index.d.ts +59 -0
- package/dist/esm/vis/boxplot/index.js +164 -0
- package/dist/esm/vis/column/index.d.ts +60 -0
- package/dist/esm/vis/column/index.js +198 -0
- package/dist/esm/vis/dual-axes/index.d.ts +64 -0
- package/dist/esm/vis/dual-axes/index.js +234 -0
- package/dist/esm/vis/funnel/index.d.ts +54 -0
- package/dist/esm/vis/funnel/index.js +246 -0
- package/dist/esm/vis/histogram/index.d.ts +47 -0
- package/dist/esm/vis/histogram/index.js +148 -0
- package/dist/esm/vis/line/index.d.ts +59 -0
- package/dist/esm/vis/line/index.js +172 -0
- package/dist/esm/vis/liquid/index.d.ts +44 -0
- package/dist/esm/vis/liquid/index.js +130 -0
- package/dist/esm/vis/pie/index.d.ts +55 -0
- package/dist/esm/vis/pie/index.js +168 -0
- package/dist/esm/vis/radar/index.d.ts +57 -0
- package/dist/esm/vis/radar/index.js +222 -0
- package/dist/esm/vis/sankey/index.d.ts +56 -0
- package/dist/esm/vis/sankey/index.js +135 -0
- package/dist/esm/vis/scatter/index.d.ts +54 -0
- package/dist/esm/vis/scatter/index.js +158 -0
- package/dist/esm/vis/summary/index.d.ts +41 -0
- package/dist/esm/vis/summary/index.js +80 -0
- package/dist/esm/vis/table/index.d.ts +49 -0
- package/dist/esm/vis/table/index.js +160 -0
- package/dist/esm/vis/treemap/index.d.ts +68 -0
- package/dist/esm/vis/treemap/index.js +158 -0
- package/dist/esm/vis/venn/index.d.ts +54 -0
- package/dist/esm/vis/venn/index.js +142 -0
- package/dist/esm/vis/violin/index.d.ts +59 -0
- package/dist/esm/vis/violin/index.js +245 -0
- package/dist/esm/vis/waterfall/index.d.ts +67 -0
- package/dist/esm/vis/waterfall/index.js +245 -0
- package/dist/esm/vis/word-cloud/index.d.ts +53 -0
- package/dist/esm/vis/word-cloud/index.js +128 -0
- package/dist/esm/vis-wrapper/icons.d.ts +8 -0
- package/dist/esm/vis-wrapper/icons.js +29 -0
- package/dist/esm/vis-wrapper/index.d.ts +24 -0
- package/dist/esm/vis-wrapper/index.js +237 -0
- package/dist/esm/vis-wrapper/styles.d.ts +8 -0
- package/dist/esm/vis-wrapper/styles.js +21 -0
- package/dist/umd/index.min.js +1 -1
- package/package.json +26 -65
- package/src/gpt-vis/index.ts +283 -0
- package/src/index.ts +44 -0
- package/src/readme.md +37 -0
- package/src/syntax/index.ts +2 -0
- package/src/syntax/parser.ts +411 -0
- package/src/types/index.ts +29 -0
- package/src/util/theme.ts +167 -0
- package/src/vis/area/README.md +143 -0
- package/src/vis/area/index.ts +212 -0
- package/src/vis/bar/README.md +158 -0
- package/src/vis/bar/index.ts +186 -0
- package/src/vis/boxplot/README.md +168 -0
- package/src/vis/boxplot/index.ts +162 -0
- package/src/vis/column/README.md +158 -0
- package/src/vis/column/index.ts +185 -0
- package/src/vis/dual-axes/README.md +191 -0
- package/src/vis/dual-axes/index.ts +218 -0
- package/src/vis/funnel/README.md +143 -0
- package/src/vis/funnel/index.ts +238 -0
- package/src/vis/histogram/README.md +130 -0
- package/src/vis/histogram/index.ts +153 -0
- package/src/vis/line/README.md +138 -0
- package/src/vis/line/index.ts +159 -0
- package/src/vis/liquid/README.md +150 -0
- package/src/vis/liquid/index.ts +130 -0
- package/src/vis/pie/README.md +127 -0
- package/src/vis/pie/index.ts +163 -0
- package/src/vis/radar/README.md +184 -0
- package/src/vis/radar/index.ts +214 -0
- package/src/vis/sankey/README.md +144 -0
- package/src/vis/sankey/index.ts +144 -0
- package/src/vis/scatter/README.md +145 -0
- package/src/vis/scatter/index.ts +147 -0
- package/src/vis/summary/README.md +272 -0
- package/src/vis/summary/index.ts +91 -0
- package/src/vis/table/README.md +174 -0
- package/src/vis/table/index.ts +241 -0
- package/src/vis/treemap/README.md +199 -0
- package/src/vis/treemap/index.ts +167 -0
- package/src/vis/venn/README.md +153 -0
- package/src/vis/venn/index.ts +149 -0
- package/src/vis/violin/README.md +168 -0
- package/src/vis/violin/index.ts +216 -0
- package/src/vis/waterfall/README.md +178 -0
- package/src/vis/waterfall/index.ts +258 -0
- package/src/vis/word-cloud/README.md +137 -0
- package/src/vis/word-cloud/index.ts +137 -0
- package/src/vis-wrapper/README.md +159 -0
- package/src/vis-wrapper/icons.ts +35 -0
- package/src/vis-wrapper/index.ts +276 -0
- package/src/vis-wrapper/styles.ts +195 -0
- package/README.ja-JP.md +0 -164
- package/dist/cjs/Area/index.d.ts +0 -11
- package/dist/cjs/Area/index.js +0 -105
- package/dist/cjs/Bar/index.d.ts +0 -14
- package/dist/cjs/Bar/index.js +0 -101
- package/dist/cjs/Boxplot/index.d.ts +0 -11
- package/dist/cjs/Boxplot/index.js +0 -88
- package/dist/cjs/ChartCodeRender/Loading.d.ts +0 -6
- package/dist/cjs/ChartCodeRender/Loading.js +0 -54
- package/dist/cjs/ChartCodeRender/VisChart.d.ts +0 -19
- package/dist/cjs/ChartCodeRender/VisChart.js +0 -335
- package/dist/cjs/ChartCodeRender/icon.d.ts +0 -10
- package/dist/cjs/ChartCodeRender/icon.js +0 -162
- package/dist/cjs/ChartCodeRender/index.d.ts +0 -8
- package/dist/cjs/ChartCodeRender/index.js +0 -113
- package/dist/cjs/ChartCodeRender/styles.d.ts +0 -19
- package/dist/cjs/ChartCodeRender/styles.js +0 -232
- package/dist/cjs/ChartCodeRender/type.d.ts +0 -176
- package/dist/cjs/ChartCodeRender/type.js +0 -17
- package/dist/cjs/ChartCodeRender/utils.d.ts +0 -1
- package/dist/cjs/ChartCodeRender/utils.js +0 -51
- package/dist/cjs/Column/index.d.ts +0 -14
- package/dist/cjs/Column/index.js +0 -102
- package/dist/cjs/ConfigProvider/context.d.ts +0 -3
- package/dist/cjs/ConfigProvider/context.js +0 -41
- package/dist/cjs/ConfigProvider/hooks/index.d.ts +0 -1
- package/dist/cjs/ConfigProvider/hooks/index.js +0 -23
- package/dist/cjs/ConfigProvider/hooks/useConfig.d.ts +0 -13
- package/dist/cjs/ConfigProvider/hooks/useConfig.js +0 -109
- package/dist/cjs/ConfigProvider/index.d.ts +0 -7
- package/dist/cjs/ConfigProvider/index.js +0 -43
- package/dist/cjs/DualAxes/index.d.ts +0 -20
- package/dist/cjs/DualAxes/index.js +0 -84
- package/dist/cjs/DualAxes/util.d.ts +0 -9
- package/dist/cjs/DualAxes/util.js +0 -77
- package/dist/cjs/FishboneDiagram/index.d.ts +0 -7
- package/dist/cjs/FishboneDiagram/index.js +0 -66
- package/dist/cjs/FlowDiagram/helper.d.ts +0 -7
- package/dist/cjs/FlowDiagram/helper.js +0 -83
- package/dist/cjs/FlowDiagram/index.d.ts +0 -6
- package/dist/cjs/FlowDiagram/index.js +0 -107
- package/dist/cjs/Funnel/index.d.ts +0 -12
- package/dist/cjs/Funnel/index.js +0 -173
- package/dist/cjs/GPTVis/Lite.d.ts +0 -19
- package/dist/cjs/GPTVis/Lite.js +0 -81
- package/dist/cjs/GPTVis/hooks/useContext.d.ts +0 -8
- package/dist/cjs/GPTVis/hooks/useContext.js +0 -49
- package/dist/cjs/GPTVis/hooks/useEvent.d.ts +0 -1
- package/dist/cjs/GPTVis/hooks/useEvent.js +0 -33
- package/dist/cjs/GPTVis/index.d.ts +0 -6
- package/dist/cjs/GPTVis/index.js +0 -42
- package/dist/cjs/HeatMap/index.d.ts +0 -12
- package/dist/cjs/HeatMap/index.js +0 -67
- package/dist/cjs/Histogram/index.d.ts +0 -8
- package/dist/cjs/Histogram/index.js +0 -79
- package/dist/cjs/IndentedTree/index.d.ts +0 -7
- package/dist/cjs/IndentedTree/index.js +0 -78
- package/dist/cjs/Line/index.d.ts +0 -11
- package/dist/cjs/Line/index.js +0 -94
- package/dist/cjs/Liquid/index.d.ts +0 -11
- package/dist/cjs/Liquid/index.js +0 -85
- package/dist/cjs/Map/Component/MapView.d.ts +0 -3
- package/dist/cjs/Map/Component/MapView.js +0 -40
- package/dist/cjs/Map/Component/Marker.d.ts +0 -3
- package/dist/cjs/Map/Component/Marker.js +0 -53
- package/dist/cjs/Map/Component/Polyline.d.ts +0 -3
- package/dist/cjs/Map/Component/Polyline.js +0 -50
- package/dist/cjs/Map/Component/index.d.ts +0 -4
- package/dist/cjs/Map/Component/index.js +0 -45
- package/dist/cjs/Map/data.json +0 -305
- package/dist/cjs/Map/index.d.ts +0 -5
- package/dist/cjs/Map/index.js +0 -61
- package/dist/cjs/MindMap/index.d.ts +0 -7
- package/dist/cjs/MindMap/index.js +0 -75
- package/dist/cjs/NetworkGraph/index.d.ts +0 -6
- package/dist/cjs/NetworkGraph/index.js +0 -75
- package/dist/cjs/OrganizationChart/index.d.ts +0 -6
- package/dist/cjs/OrganizationChart/index.js +0 -95
- package/dist/cjs/PathMap/index.d.ts +0 -6
- package/dist/cjs/PathMap/index.js +0 -58
- package/dist/cjs/Pie/index.d.ts +0 -23
- package/dist/cjs/Pie/index.js +0 -94
- package/dist/cjs/PinMap/index.d.ts +0 -6
- package/dist/cjs/PinMap/index.js +0 -44
- package/dist/cjs/PinMap/maker.svg +0 -1
- package/dist/cjs/Radar/index.d.ts +0 -13
- package/dist/cjs/Radar/index.js +0 -153
- package/dist/cjs/Sankey/index.d.ts +0 -14
- package/dist/cjs/Sankey/index.js +0 -110
- package/dist/cjs/Scatter/index.d.ts +0 -13
- package/dist/cjs/Scatter/index.js +0 -103
- package/dist/cjs/Table/index.d.ts +0 -9
- package/dist/cjs/Table/index.js +0 -91
- package/dist/cjs/Text/VisText.d.ts +0 -4
- package/dist/cjs/Text/VisText.js +0 -82
- package/dist/cjs/Text/config.d.ts +0 -18
- package/dist/cjs/Text/config.js +0 -91
- package/dist/cjs/Text/custom-icons/index.d.ts +0 -3
- package/dist/cjs/Text/custom-icons/index.js +0 -66
- package/dist/cjs/Text/index.d.ts +0 -3
- package/dist/cjs/Text/index.js +0 -42
- package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.d.ts +0 -1
- package/dist/cjs/Text/mini-charts/hooks/getElementFontSize.js +0 -65
- package/dist/cjs/Text/mini-charts/hooks/index.d.ts +0 -1
- package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.d.ts +0 -5
- package/dist/cjs/Text/mini-charts/hooks/useSvgWrapper.js +0 -65
- package/dist/cjs/Text/mini-charts/index.d.ts +0 -2
- package/dist/cjs/Text/mini-charts/index.js +0 -25
- package/dist/cjs/Text/mini-charts/line/SingleLineChart.d.ts +0 -3
- package/dist/cjs/Text/mini-charts/line/SingleLineChart.js +0 -63
- package/dist/cjs/Text/mini-charts/line/index.d.ts +0 -1
- package/dist/cjs/Text/mini-charts/line/index.js +0 -29
- package/dist/cjs/Text/mini-charts/line/scaleLinear.d.ts +0 -4
- package/dist/cjs/Text/mini-charts/line/scaleLinear.js +0 -35
- package/dist/cjs/Text/mini-charts/line/useLineCompute.d.ts +0 -6
- package/dist/cjs/Text/mini-charts/line/useLineCompute.js +0 -103
- package/dist/cjs/Text/mini-charts/proportion/getArcPath.d.ts +0 -1
- package/dist/cjs/Text/mini-charts/proportion/getArcPath.js +0 -51
- package/dist/cjs/Text/mini-charts/proportion/index.d.ts +0 -3
- package/dist/cjs/Text/mini-charts/proportion/index.js +0 -71
- package/dist/cjs/Text/theme.d.ts +0 -24
- package/dist/cjs/Text/theme.js +0 -52
- package/dist/cjs/Text/types.d.ts +0 -20
- package/dist/cjs/Text/types.js +0 -17
- package/dist/cjs/Text/utils/getThemeColor.d.ts +0 -11
- package/dist/cjs/Text/utils/index.d.ts +0 -2
- package/dist/cjs/Text/utils/index.js +0 -25
- package/dist/cjs/Text/utils/useAntdDarkAlgorithm.d.ts +0 -2
- package/dist/cjs/Text/utils/useAntdDarkAlgorithm.js +0 -40
- package/dist/cjs/Treemap/index.d.ts +0 -10
- package/dist/cjs/Treemap/index.js +0 -93
- package/dist/cjs/Venn/index.d.ts +0 -32
- package/dist/cjs/Venn/index.js +0 -87
- package/dist/cjs/Violin/index.d.ts +0 -10
- package/dist/cjs/Violin/index.js +0 -190
- package/dist/cjs/Waterfall/index.d.ts +0 -25
- package/dist/cjs/Waterfall/index.js +0 -184
- package/dist/cjs/WordCloud/index.d.ts +0 -9
- package/dist/cjs/WordCloud/index.js +0 -76
- package/dist/cjs/constants/index.d.ts +0 -2
- package/dist/cjs/constants/index.js +0 -35
- package/dist/cjs/export-map.browser.d.ts +0 -4
- package/dist/cjs/export-map.browser.js +0 -48
- package/dist/cjs/export-map.d.ts +0 -10
- package/dist/cjs/export-map.js +0 -41
- package/dist/cjs/export.d.ts +0 -74
- package/dist/cjs/export.js +0 -156
- package/dist/cjs/render.d.ts +0 -2
- package/dist/cjs/render.js +0 -67
- package/dist/cjs/theme.d.ts +0 -2
- package/dist/cjs/types/chart.d.ts +0 -87
- package/dist/cjs/types/chart.js +0 -60
- package/dist/cjs/types/config.d.ts +0 -25
- package/dist/cjs/types/config.js +0 -17
- package/dist/cjs/types/map.d.ts +0 -242
- package/dist/cjs/types/map.js +0 -17
- package/dist/cjs/utils/config.d.ts +0 -5
- package/dist/cjs/utils/config.js +0 -76
- package/dist/cjs/utils/graph.d.ts +0 -18
- package/dist/cjs/utils/graph.js +0 -64
- package/dist/cjs/utils/index.d.ts +0 -1
- package/dist/cjs/utils/index.js +0 -23
- package/dist/cjs/utils/map/context.d.ts +0 -3
- package/dist/cjs/utils/map/context.js +0 -45
- package/dist/cjs/utils/map/controls.d.ts +0 -0
- package/dist/cjs/utils/map/controls.js +0 -0
- package/dist/cjs/utils/map/index.d.ts +0 -6
- package/dist/cjs/utils/map/index.js +0 -33
- package/dist/cjs/utils/map/markers.d.ts +0 -2
- package/dist/cjs/utils/map/markers.js +0 -88
- package/dist/cjs/utils/map/polyline.d.ts +0 -2
- package/dist/cjs/utils/map/polyline.js +0 -52
- package/dist/cjs/utils/map/style.d.ts +0 -45
- package/dist/cjs/utils/map/style.js +0 -112
- package/dist/cjs/utils/map/util.d.ts +0 -1
- package/dist/cjs/utils/map/util.js +0 -38
- package/dist/cjs/utils/map/view.d.ts +0 -5
- package/dist/cjs/utils/map/view.js +0 -100
- package/dist/cjs/utils/palette.d.ts +0 -2
- package/dist/cjs/utils/palette.js +0 -54
- package/dist/cjs/utils/plot.d.ts +0 -5
- package/dist/cjs/utils/plot.js +0 -90
- package/dist/cjs/version.d.ts +0 -2
- package/dist/cjs/version.js +0 -25
- package/dist/esm/Area/index.d.ts +0 -11
- package/dist/esm/Area/index.js +0 -108
- package/dist/esm/Bar/index.d.ts +0 -14
- package/dist/esm/Bar/index.js +0 -92
- package/dist/esm/Boxplot/index.d.ts +0 -11
- package/dist/esm/Boxplot/index.js +0 -86
- package/dist/esm/ChartCodeRender/Loading.d.ts +0 -6
- package/dist/esm/ChartCodeRender/Loading.js +0 -21
- package/dist/esm/ChartCodeRender/VisChart.d.ts +0 -19
- package/dist/esm/ChartCodeRender/VisChart.js +0 -445
- package/dist/esm/ChartCodeRender/icon.d.ts +0 -10
- package/dist/esm/ChartCodeRender/icon.js +0 -103
- package/dist/esm/ChartCodeRender/index.d.ts +0 -8
- package/dist/esm/ChartCodeRender/index.js +0 -99
- package/dist/esm/ChartCodeRender/styles.d.ts +0 -19
- package/dist/esm/ChartCodeRender/styles.js +0 -61
- package/dist/esm/ChartCodeRender/type.d.ts +0 -176
- package/dist/esm/ChartCodeRender/type.js +0 -1
- package/dist/esm/ChartCodeRender/utils.d.ts +0 -1
- package/dist/esm/ChartCodeRender/utils.js +0 -37
- package/dist/esm/Column/index.d.ts +0 -14
- package/dist/esm/Column/index.js +0 -93
- package/dist/esm/ConfigProvider/context.d.ts +0 -3
- package/dist/esm/ConfigProvider/context.js +0 -3
- package/dist/esm/ConfigProvider/hooks/index.d.ts +0 -1
- package/dist/esm/ConfigProvider/hooks/index.js +0 -1
- package/dist/esm/ConfigProvider/hooks/useConfig.d.ts +0 -13
- package/dist/esm/ConfigProvider/hooks/useConfig.js +0 -71
- package/dist/esm/ConfigProvider/index.d.ts +0 -7
- package/dist/esm/ConfigProvider/index.js +0 -17
- package/dist/esm/DualAxes/index.d.ts +0 -20
- package/dist/esm/DualAxes/index.js +0 -77
- package/dist/esm/DualAxes/util.d.ts +0 -9
- package/dist/esm/DualAxes/util.js +0 -77
- package/dist/esm/FishboneDiagram/index.d.ts +0 -7
- package/dist/esm/FishboneDiagram/index.js +0 -43
- package/dist/esm/FlowDiagram/helper.d.ts +0 -7
- package/dist/esm/FlowDiagram/helper.js +0 -76
- package/dist/esm/FlowDiagram/index.d.ts +0 -6
- package/dist/esm/FlowDiagram/index.js +0 -72
- package/dist/esm/Funnel/index.d.ts +0 -12
- package/dist/esm/Funnel/index.js +0 -171
- package/dist/esm/GPTVis/Lite.d.ts +0 -19
- package/dist/esm/GPTVis/Lite.js +0 -57
- package/dist/esm/GPTVis/hooks/useContext.d.ts +0 -8
- package/dist/esm/GPTVis/hooks/useContext.js +0 -9
- package/dist/esm/GPTVis/hooks/useEvent.d.ts +0 -1
- package/dist/esm/GPTVis/hooks/useEvent.js +0 -6
- package/dist/esm/GPTVis/index.d.ts +0 -6
- package/dist/esm/GPTVis/index.js +0 -25
- package/dist/esm/HeatMap/index.d.ts +0 -12
- package/dist/esm/HeatMap/index.js +0 -45
- package/dist/esm/Histogram/index.d.ts +0 -8
- package/dist/esm/Histogram/index.js +0 -75
- package/dist/esm/IndentedTree/index.d.ts +0 -7
- package/dist/esm/IndentedTree/index.js +0 -68
- package/dist/esm/Line/index.d.ts +0 -11
- package/dist/esm/Line/index.js +0 -92
- package/dist/esm/Liquid/index.d.ts +0 -11
- package/dist/esm/Liquid/index.js +0 -100
- package/dist/esm/Map/Component/MapView.d.ts +0 -3
- package/dist/esm/Map/Component/MapView.js +0 -18
- package/dist/esm/Map/Component/Marker.d.ts +0 -3
- package/dist/esm/Map/Component/Marker.js +0 -40
- package/dist/esm/Map/Component/Polyline.d.ts +0 -3
- package/dist/esm/Map/Component/Polyline.js +0 -35
- package/dist/esm/Map/Component/index.d.ts +0 -4
- package/dist/esm/Map/Component/index.js +0 -4
- package/dist/esm/Map/data.json +0 -305
- package/dist/esm/Map/index.d.ts +0 -5
- package/dist/esm/Map/index.js +0 -50
- package/dist/esm/MindMap/index.d.ts +0 -7
- package/dist/esm/MindMap/index.js +0 -69
- package/dist/esm/NetworkGraph/index.d.ts +0 -6
- package/dist/esm/NetworkGraph/index.js +0 -64
- package/dist/esm/OrganizationChart/index.d.ts +0 -6
- package/dist/esm/OrganizationChart/index.js +0 -75
- package/dist/esm/PathMap/index.d.ts +0 -6
- package/dist/esm/PathMap/index.js +0 -41
- package/dist/esm/Pie/index.d.ts +0 -23
- package/dist/esm/Pie/index.js +0 -96
- package/dist/esm/PinMap/index.d.ts +0 -6
- package/dist/esm/PinMap/index.js +0 -22
- package/dist/esm/PinMap/maker.svg +0 -1
- package/dist/esm/Radar/index.d.ts +0 -13
- package/dist/esm/Radar/index.js +0 -150
- package/dist/esm/Sankey/index.d.ts +0 -14
- package/dist/esm/Sankey/index.js +0 -98
- package/dist/esm/Scatter/index.d.ts +0 -13
- package/dist/esm/Scatter/index.js +0 -95
- package/dist/esm/Table/index.d.ts +0 -9
- package/dist/esm/Table/index.js +0 -30
- package/dist/esm/Text/VisText.d.ts +0 -4
- package/dist/esm/Text/VisText.js +0 -55
- package/dist/esm/Text/config.d.ts +0 -18
- package/dist/esm/Text/config.js +0 -82
- package/dist/esm/Text/custom-icons/index.d.ts +0 -3
- package/dist/esm/Text/custom-icons/index.js +0 -37
- package/dist/esm/Text/index.d.ts +0 -3
- package/dist/esm/Text/index.js +0 -2
- package/dist/esm/Text/mini-charts/hooks/getElementFontSize.d.ts +0 -1
- package/dist/esm/Text/mini-charts/hooks/getElementFontSize.js +0 -32
- package/dist/esm/Text/mini-charts/hooks/index.d.ts +0 -1
- package/dist/esm/Text/mini-charts/hooks/index.js +0 -1
- package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.d.ts +0 -5
- package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.js +0 -37
- package/dist/esm/Text/mini-charts/index.d.ts +0 -2
- package/dist/esm/Text/mini-charts/index.js +0 -2
- package/dist/esm/Text/mini-charts/line/SingleLineChart.d.ts +0 -3
- package/dist/esm/Text/mini-charts/line/SingleLineChart.js +0 -62
- package/dist/esm/Text/mini-charts/line/index.d.ts +0 -1
- package/dist/esm/Text/mini-charts/line/index.js +0 -1
- package/dist/esm/Text/mini-charts/line/scaleLinear.d.ts +0 -4
- package/dist/esm/Text/mini-charts/line/scaleLinear.js +0 -19
- package/dist/esm/Text/mini-charts/line/useLineCompute.d.ts +0 -6
- package/dist/esm/Text/mini-charts/line/useLineCompute.js +0 -118
- package/dist/esm/Text/mini-charts/proportion/getArcPath.d.ts +0 -1
- package/dist/esm/Text/mini-charts/proportion/getArcPath.js +0 -19
- package/dist/esm/Text/mini-charts/proportion/index.d.ts +0 -3
- package/dist/esm/Text/mini-charts/proportion/index.js +0 -64
- package/dist/esm/Text/theme.d.ts +0 -24
- package/dist/esm/Text/theme.js +0 -24
- package/dist/esm/Text/types.d.ts +0 -20
- package/dist/esm/Text/types.js +0 -1
- package/dist/esm/Text/utils/getThemeColor.d.ts +0 -11
- package/dist/esm/Text/utils/getThemeColor.js +0 -29
- package/dist/esm/Text/utils/index.d.ts +0 -2
- package/dist/esm/Text/utils/index.js +0 -2
- package/dist/esm/Text/utils/useAntdDarkAlgorithm.d.ts +0 -2
- package/dist/esm/Text/utils/useAntdDarkAlgorithm.js +0 -14
- package/dist/esm/Treemap/index.d.ts +0 -10
- package/dist/esm/Treemap/index.js +0 -88
- package/dist/esm/Venn/index.d.ts +0 -32
- package/dist/esm/Venn/index.js +0 -69
- package/dist/esm/Violin/index.d.ts +0 -10
- package/dist/esm/Violin/index.js +0 -199
- package/dist/esm/Waterfall/index.d.ts +0 -25
- package/dist/esm/Waterfall/index.js +0 -185
- package/dist/esm/WordCloud/index.d.ts +0 -9
- package/dist/esm/WordCloud/index.js +0 -59
- package/dist/esm/constants/index.d.ts +0 -2
- package/dist/esm/constants/index.js +0 -9
- package/dist/esm/export-map.browser.d.ts +0 -4
- package/dist/esm/export-map.browser.js +0 -5
- package/dist/esm/export-map.d.ts +0 -10
- package/dist/esm/export-map.js +0 -9
- package/dist/esm/export.d.ts +0 -74
- package/dist/esm/export.js +0 -50
- package/dist/esm/render.d.ts +0 -2
- package/dist/esm/render.js +0 -32
- package/dist/esm/theme.d.ts +0 -2
- package/dist/esm/theme.js +0 -103
- package/dist/esm/types/chart.d.ts +0 -87
- package/dist/esm/types/chart.js +0 -32
- package/dist/esm/types/config.d.ts +0 -25
- package/dist/esm/types/config.js +0 -1
- package/dist/esm/types/map.d.ts +0 -242
- package/dist/esm/types/map.js +0 -1
- package/dist/esm/utils/config.d.ts +0 -5
- package/dist/esm/utils/config.js +0 -53
- package/dist/esm/utils/graph.d.ts +0 -18
- package/dist/esm/utils/graph.js +0 -55
- package/dist/esm/utils/index.d.ts +0 -1
- package/dist/esm/utils/index.js +0 -1
- package/dist/esm/utils/map/context.d.ts +0 -3
- package/dist/esm/utils/map/context.js +0 -42
- package/dist/esm/utils/map/controls.d.ts +0 -0
- package/dist/esm/utils/map/controls.js +0 -0
- package/dist/esm/utils/map/index.d.ts +0 -6
- package/dist/esm/utils/map/index.js +0 -6
- package/dist/esm/utils/map/markers.d.ts +0 -2
- package/dist/esm/utils/map/markers.js +0 -69
- package/dist/esm/utils/map/polyline.d.ts +0 -2
- package/dist/esm/utils/map/polyline.js +0 -31
- package/dist/esm/utils/map/style.d.ts +0 -45
- package/dist/esm/utils/map/style.js +0 -80
- package/dist/esm/utils/map/util.d.ts +0 -1
- package/dist/esm/utils/map/util.js +0 -11
- package/dist/esm/utils/map/view.d.ts +0 -5
- package/dist/esm/utils/map/view.js +0 -83
- package/dist/esm/utils/palette.d.ts +0 -2
- package/dist/esm/utils/palette.js +0 -2
- package/dist/esm/utils/plot.d.ts +0 -5
- package/dist/esm/utils/plot.js +0 -86
- package/dist/esm/version.d.ts +0 -2
- package/dist/esm/version.js +0 -1
- package/dist/umd/436.async.js +0 -1
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
import { Scatter as ADCScatter } from '@ant-design/plots';
|
|
8
|
-
import { get } from 'lodash';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { usePlotConfig } from "../ConfigProvider/hooks";
|
|
11
|
-
import { THEME_MAP } from "../theme";
|
|
12
|
-
var defaultConfig = function defaultConfig(props) {
|
|
13
|
-
var _;
|
|
14
|
-
var data = props.data,
|
|
15
|
-
_props$xField = props.xField,
|
|
16
|
-
xField = _props$xField === void 0 ? 'x' : _props$xField,
|
|
17
|
-
_props$yField = props.yField,
|
|
18
|
-
yField = _props$yField === void 0 ? 'y' : _props$yField,
|
|
19
|
-
_props$style = props.style,
|
|
20
|
-
style = _props$style === void 0 ? {} : _props$style;
|
|
21
|
-
var backgroundColor = style.backgroundColor,
|
|
22
|
-
palette = style.palette;
|
|
23
|
-
var axisXTitle = get(props, 'axis.x.title');
|
|
24
|
-
var axisYTitle = get(props, 'axis.y.title');
|
|
25
|
-
var hasGroupField = ((_ = (data || [])[0]) === null || _ === void 0 ? void 0 : _.group) !== undefined;
|
|
26
|
-
var hasPalette = !!(palette !== null && palette !== void 0 && palette[0]);
|
|
27
|
-
var paletteConfig = {
|
|
28
|
-
color: undefined
|
|
29
|
-
};
|
|
30
|
-
var encode = {};
|
|
31
|
-
if (hasPalette) {
|
|
32
|
-
paletteConfig = {
|
|
33
|
-
color: {
|
|
34
|
-
range: palette
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
if (hasGroupField) {
|
|
39
|
-
encode = {
|
|
40
|
-
x: xField,
|
|
41
|
-
y: yField,
|
|
42
|
-
color: 'group'
|
|
43
|
-
};
|
|
44
|
-
} else {
|
|
45
|
-
encode = {
|
|
46
|
-
x: xField,
|
|
47
|
-
y: yField,
|
|
48
|
-
color: function color() {
|
|
49
|
-
return 'all';
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return _objectSpread({
|
|
54
|
-
data: data,
|
|
55
|
-
xField: xField,
|
|
56
|
-
yField: yField,
|
|
57
|
-
tooltip: {
|
|
58
|
-
title: function title(d) {
|
|
59
|
-
return d !== null && d !== void 0 && d.group ? d.group : false;
|
|
60
|
-
},
|
|
61
|
-
items: [{
|
|
62
|
-
channel: 'x',
|
|
63
|
-
name: axisXTitle || 'x'
|
|
64
|
-
}, {
|
|
65
|
-
channel: 'y',
|
|
66
|
-
name: axisYTitle || 'y'
|
|
67
|
-
}]
|
|
68
|
-
},
|
|
69
|
-
legend: hasGroupField ? {} : false,
|
|
70
|
-
encode: encode,
|
|
71
|
-
scale: _objectSpread({
|
|
72
|
-
y: {
|
|
73
|
-
nice: true
|
|
74
|
-
}
|
|
75
|
-
}, paletteConfig),
|
|
76
|
-
style: {
|
|
77
|
-
lineWidth: 1
|
|
78
|
-
}
|
|
79
|
-
}, backgroundColor ? {
|
|
80
|
-
viewStyle: {
|
|
81
|
-
viewFill: backgroundColor
|
|
82
|
-
}
|
|
83
|
-
} : {
|
|
84
|
-
viewStyle: undefined
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
var Scatter = function Scatter(props) {
|
|
88
|
-
var _props$theme;
|
|
89
|
-
var themeConfig = THEME_MAP[(_props$theme = props.theme) !== null && _props$theme !== void 0 ? _props$theme : 'default'];
|
|
90
|
-
var config = usePlotConfig('Scatter', defaultConfig, _objectSpread(_objectSpread({}, props), {}, {
|
|
91
|
-
theme: themeConfig
|
|
92
|
-
}));
|
|
93
|
-
return /*#__PURE__*/React.createElement(ADCScatter, config);
|
|
94
|
-
};
|
|
95
|
-
export default Scatter;
|
package/dist/esm/Table/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
var TableWrapper = styled.div.withConfig({
|
|
4
|
-
displayName: "TableWrapper",
|
|
5
|
-
componentId: "gpt-vis-c7ef__sc-1l8e4lx-0"
|
|
6
|
-
})([".table-title{font-size:16px;font-weight:500;margin-bottom:12px;color:#1d2129;}table{width:100%;border-collapse:separate;border-spacing:0;background:#fff;border-radius:8px;overflow:hidden;th,td{border-bottom:1px solid #f0f0f0;padding:8px;text-align:left;font-size:14px;color:#333;}th{background:#f5f5f5;font-weight:600;color:#000000e0;position:relative;}th:not(:last-child)::after{content:'';position:absolute;top:25%;right:0;width:1px;height:50%;background:#e0e0e0;}tr:{transition:background 0.2s;cursor:pointer;}tr:hover{background:#f5f5f5;}}"]);
|
|
7
|
-
var Table = function Table(props) {
|
|
8
|
-
var data = props.data,
|
|
9
|
-
title = props.title;
|
|
10
|
-
var columns = data.length > 0 ? Object.keys(data[0]).map(function (key) {
|
|
11
|
-
return {
|
|
12
|
-
title: key,
|
|
13
|
-
key: key
|
|
14
|
-
};
|
|
15
|
-
}) : [];
|
|
16
|
-
return /*#__PURE__*/React.createElement(TableWrapper, null, title && /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className: "table-title"
|
|
18
|
-
}, title), /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, columns.map(function (col) {
|
|
19
|
-
return /*#__PURE__*/React.createElement("th", {
|
|
20
|
-
key: col.key
|
|
21
|
-
}, col.title);
|
|
22
|
-
}))), /*#__PURE__*/React.createElement("tbody", null, data.map(function (row, index) {
|
|
23
|
-
return /*#__PURE__*/React.createElement("tr", {
|
|
24
|
-
key: index
|
|
25
|
-
}, columns.map(function (col) {
|
|
26
|
-
return /*#__PURE__*/React.createElement("td", null, row[col.key]);
|
|
27
|
-
}));
|
|
28
|
-
}))));
|
|
29
|
-
};
|
|
30
|
-
export default Table;
|
package/dist/esm/Text/VisText.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
import { Tooltip, Typography } from 'antd';
|
|
8
|
-
import { pick, toString } from 'lodash';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import styled from 'styled-components';
|
|
11
|
-
import { useComponentGlobalConfig } from "../ConfigProvider/hooks";
|
|
12
|
-
import { STATICS_KEY } from "./config";
|
|
13
|
-
import { getThemeColor, useAntdDarkAlgorithm } from "./utils";
|
|
14
|
-
var Text = Typography.Text;
|
|
15
|
-
var StyledText = styled(Text).withConfig({
|
|
16
|
-
displayName: "StyledText",
|
|
17
|
-
componentId: "gpt-vis-c7ef__sc-16yhboy-0"
|
|
18
|
-
})(["margin-left:1px;margin-right:1px;"]);
|
|
19
|
-
function renderPrefixSuffix(symbol, staticsConfig, props) {
|
|
20
|
-
if (!symbol) return null;
|
|
21
|
-
var Component = staticsConfig === null || staticsConfig === void 0 ? void 0 : staticsConfig[symbol];
|
|
22
|
-
if (Component) return /*#__PURE__*/React.createElement(Component, props);
|
|
23
|
-
return symbol;
|
|
24
|
-
}
|
|
25
|
-
var VisText = function VisText(props) {
|
|
26
|
-
var children = props.children,
|
|
27
|
-
className = props.className,
|
|
28
|
-
style = props.style,
|
|
29
|
-
type = props.type,
|
|
30
|
-
origin = props.origin;
|
|
31
|
-
var isDark = useAntdDarkAlgorithm();
|
|
32
|
-
var textConfig = useComponentGlobalConfig('VisText');
|
|
33
|
-
var encoding = type ? textConfig === null || textConfig === void 0 ? void 0 : textConfig[type] : {};
|
|
34
|
-
var staticsConfig = textConfig === null || textConfig === void 0 ? void 0 : textConfig[STATICS_KEY];
|
|
35
|
-
return (
|
|
36
|
-
/*#__PURE__*/
|
|
37
|
-
// TODO @羽熙 暂时简单处理 tooltip 直接显示 origin,后续可以根据 origin 类型分类处理
|
|
38
|
-
React.createElement(Tooltip, {
|
|
39
|
-
title: toString(origin)
|
|
40
|
-
}, /*#__PURE__*/React.createElement(StyledText, {
|
|
41
|
-
className: className,
|
|
42
|
-
style: _objectSpread(_objectSpread({
|
|
43
|
-
// antd Text 组件写死了 14px,在段落定义了 font-size 的情况下,显示很突兀,这里不设置,跟随上级容器字体大小改变。
|
|
44
|
-
// TODO @羽熙 之后看能否通过 antd ConfigProvider 统一配置
|
|
45
|
-
fontSize: 'unset',
|
|
46
|
-
color: getThemeColor({
|
|
47
|
-
type: type,
|
|
48
|
-
color: encoding === null || encoding === void 0 ? void 0 : encoding.color,
|
|
49
|
-
theme: isDark ? 'dark' : 'light'
|
|
50
|
-
})
|
|
51
|
-
}, style), pick(encoding, ['backgroundColor', 'fontWeight']))
|
|
52
|
-
}, renderPrefixSuffix(encoding === null || encoding === void 0 ? void 0 : encoding.prefix, staticsConfig, props), children, renderPrefixSuffix(encoding === null || encoding === void 0 ? void 0 : encoding.suffix, staticsConfig, props)))
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
export default VisText;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
2
|
-
import type { VisTextProps } from './types';
|
|
3
|
-
declare const INNER_ENTITY_TYPES: readonly ["metric_name", "metric_value", "other_metric_value", "time_desc", "dim_value", "trend_desc", "delta_value", "ratio_value", "delta_value_pos", "delta_value_neg", "ratio_value_pos", "ratio_value_neg", "proportion", "contribute_ratio"];
|
|
4
|
-
export type InnerEntityType = (typeof INNER_ENTITY_TYPES)[number];
|
|
5
|
-
export type TextEntityType = InnerEntityType | string;
|
|
6
|
-
export type TextEncoding = Partial<Pick<CSSProperties, 'color' | 'backgroundColor' | 'fontWeight'> & {
|
|
7
|
-
/** 前缀 */
|
|
8
|
-
prefix: string;
|
|
9
|
-
/** 后缀 */
|
|
10
|
-
suffix: string;
|
|
11
|
-
}>;
|
|
12
|
-
export declare const STATICS_KEY: "__statics";
|
|
13
|
-
/** 文本组件配置信息 */
|
|
14
|
-
export type TextConfig = Record<InnerEntityType & string, TextEncoding> & {
|
|
15
|
-
[STATICS_KEY]: Record<string, React.FC<VisTextProps>>;
|
|
16
|
-
};
|
|
17
|
-
export declare const DEFAULT_VIS_TEXT_CONFIG: TextConfig;
|
|
18
|
-
export {};
|
package/dist/esm/Text/config.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
var _DEFAULT_VIS_TEXT_CON;
|
|
2
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
-
import { ArrowDown, ArrowUp } from "./custom-icons";
|
|
7
|
-
import { ProportionChart, SingleLineChart } from "./mini-charts";
|
|
8
|
-
import { TEXT_THEME } from "./theme";
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
var INNER_ENTITY_TYPES = ['metric_name',
|
|
11
|
-
// 指标名
|
|
12
|
-
'metric_value',
|
|
13
|
-
// 主指标值
|
|
14
|
-
'other_metric_value',
|
|
15
|
-
// 其他指标值
|
|
16
|
-
'time_desc',
|
|
17
|
-
// 时间描述
|
|
18
|
-
'dim_value',
|
|
19
|
-
// 维值
|
|
20
|
-
'trend_desc',
|
|
21
|
-
// 趋势描述
|
|
22
|
-
'delta_value',
|
|
23
|
-
// 变化值(非正非负)
|
|
24
|
-
'ratio_value',
|
|
25
|
-
// 变化率(非正非负)
|
|
26
|
-
'delta_value_pos',
|
|
27
|
-
// 变化值正
|
|
28
|
-
'delta_value_neg',
|
|
29
|
-
// 变化值负
|
|
30
|
-
'ratio_value_pos',
|
|
31
|
-
// 变化率正
|
|
32
|
-
'ratio_value_neg',
|
|
33
|
-
// 变化率负
|
|
34
|
-
'proportion',
|
|
35
|
-
// 占比
|
|
36
|
-
'contribute_ratio' // 贡献度
|
|
37
|
-
];
|
|
38
|
-
export var STATICS_KEY = '__statics';
|
|
39
|
-
|
|
40
|
-
/** 文本组件配置信息 */
|
|
41
|
-
|
|
42
|
-
export var DEFAULT_VIS_TEXT_CONFIG = (_DEFAULT_VIS_TEXT_CON = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_DEFAULT_VIS_TEXT_CON, STATICS_KEY, {
|
|
43
|
-
'icon:arrow-up': ArrowUp,
|
|
44
|
-
'icon:arrow-down': ArrowDown,
|
|
45
|
-
'mini-chart:proportion': ProportionChart,
|
|
46
|
-
// TODO @羽熙 当前仅支持单折线图,之后可以考虑支持多折线图,在组件内实现分支判断
|
|
47
|
-
'mini-chart:line': SingleLineChart
|
|
48
|
-
}), "metric_name", {
|
|
49
|
-
color: TEXT_THEME.light.default88Color,
|
|
50
|
-
fontWeight: 500
|
|
51
|
-
}), "metric_value", {
|
|
52
|
-
color: TEXT_THEME.light.primaryColor
|
|
53
|
-
}), "other_metric_value", {
|
|
54
|
-
color: TEXT_THEME.light.default65Color
|
|
55
|
-
}), "delta_value", {
|
|
56
|
-
color: TEXT_THEME.light.default65Color
|
|
57
|
-
}), "ratio_value", {
|
|
58
|
-
color: TEXT_THEME.light.default65Color
|
|
59
|
-
}), "delta_value_pos", {
|
|
60
|
-
color: TEXT_THEME.light.posColor,
|
|
61
|
-
prefix: '+'
|
|
62
|
-
}), "delta_value_neg", {
|
|
63
|
-
color: TEXT_THEME.light.negColor,
|
|
64
|
-
prefix: '-'
|
|
65
|
-
}), "ratio_value_pos", {
|
|
66
|
-
color: TEXT_THEME.light.posColor,
|
|
67
|
-
prefix: 'icon:arrow-up'
|
|
68
|
-
}), "ratio_value_neg", {
|
|
69
|
-
color: TEXT_THEME.light.negColor,
|
|
70
|
-
prefix: 'icon:arrow-down'
|
|
71
|
-
}), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_DEFAULT_VIS_TEXT_CON, "contribute_ratio", {
|
|
72
|
-
color: TEXT_THEME.light.conclusionColor
|
|
73
|
-
}), "trend_desc", {
|
|
74
|
-
color: TEXT_THEME.light.conclusionColor,
|
|
75
|
-
suffix: 'mini-chart:line'
|
|
76
|
-
}), "dim_value", {
|
|
77
|
-
color: TEXT_THEME.light.default88Color
|
|
78
|
-
}), "time_desc", {
|
|
79
|
-
color: TEXT_THEME.light.default88Color
|
|
80
|
-
}), "proportion", {
|
|
81
|
-
suffix: 'mini-chart:proportion'
|
|
82
|
-
}));
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
var MARGIN_RIGHT = 2;
|
|
3
|
-
export var ArrowUp = function ArrowUp() {
|
|
4
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
5
|
-
width: "8px",
|
|
6
|
-
height: "9px",
|
|
7
|
-
style: {
|
|
8
|
-
transform: 'rotate(180deg)',
|
|
9
|
-
marginRight: MARGIN_RIGHT
|
|
10
|
-
},
|
|
11
|
-
viewBox: "0 0 8 9",
|
|
12
|
-
version: "1.1",
|
|
13
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
14
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
15
|
-
transform: "translate(-2.000000, -2.000000)"
|
|
16
|
-
}, /*#__PURE__*/React.createElement("polygon", {
|
|
17
|
-
fill: "currentColor",
|
|
18
|
-
points: "6 11 9.5 2 2.5 2"
|
|
19
|
-
})));
|
|
20
|
-
};
|
|
21
|
-
export var ArrowDown = function ArrowDown() {
|
|
22
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
23
|
-
width: "8px",
|
|
24
|
-
height: "9px",
|
|
25
|
-
viewBox: "0 0 8 9",
|
|
26
|
-
style: {
|
|
27
|
-
marginRight: MARGIN_RIGHT
|
|
28
|
-
},
|
|
29
|
-
version: "1.1",
|
|
30
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
31
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
32
|
-
transform: "translate(-2.000000, -2.000000)"
|
|
33
|
-
}, /*#__PURE__*/React.createElement("polygon", {
|
|
34
|
-
fill: "currentColor",
|
|
35
|
-
points: "6 11 9.5 2 2.5 2"
|
|
36
|
-
})));
|
|
37
|
-
};
|
package/dist/esm/Text/index.d.ts
DELETED
package/dist/esm/Text/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getElementFontSize(ele: Element, defaultSize?: number): number;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { TEXT_THEME } from "../../theme";
|
|
2
|
-
function getStyle(ele, style) {
|
|
3
|
-
var _ele$currentStyle;
|
|
4
|
-
return window.getComputedStyle ?
|
|
5
|
-
// @ts-ignore style as any
|
|
6
|
-
window.getComputedStyle(ele, null)[style] : // @ts-ignore currentStyle for IE
|
|
7
|
-
ele === null || ele === void 0 || (_ele$currentStyle = ele.currentStyle) === null || _ele$currentStyle === void 0 ? void 0 : _ele$currentStyle[style];
|
|
8
|
-
}
|
|
9
|
-
function isAbsoluteUnitPx(str) {
|
|
10
|
-
return str === null || str === void 0 ? void 0 : str.endsWith('px');
|
|
11
|
-
}
|
|
12
|
-
function getPxNumber(str) {
|
|
13
|
-
var removeUnit = str.replace(/px$/, '');
|
|
14
|
-
var resultNumber = Number(removeUnit);
|
|
15
|
-
if (!Number.isNaN(resultNumber)) return resultNumber;
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
export function getElementFontSize(ele) {
|
|
19
|
-
var defaultSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TEXT_THEME.fontSizeBase;
|
|
20
|
-
var FONT_SIZE = 'font-size';
|
|
21
|
-
var eleFontSizeStr = getStyle(ele, FONT_SIZE);
|
|
22
|
-
if (eleFontSizeStr && isAbsoluteUnitPx(eleFontSizeStr)) {
|
|
23
|
-
var px = getPxNumber(eleFontSizeStr);
|
|
24
|
-
if (px) return px;
|
|
25
|
-
}
|
|
26
|
-
var bodyFontSizeStr = getStyle(window.document.body, FONT_SIZE);
|
|
27
|
-
if (bodyFontSizeStr && isAbsoluteUnitPx(bodyFontSizeStr)) {
|
|
28
|
-
var _px = getPxNumber(bodyFontSizeStr);
|
|
29
|
-
if (_px) return _px;
|
|
30
|
-
}
|
|
31
|
-
return defaultSize;
|
|
32
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useSvgWrapper } from './useSvgWrapper';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useSvgWrapper } from "./useSvgWrapper";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type SvgProps = PropsWithChildren<React.SVGProps<SVGSVGElement>>;
|
|
4
|
-
export declare const useSvgWrapper: () => readonly [({ children, ...otherProps }: SvgProps) => React.JSX.Element, number];
|
|
5
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var _excluded = ["children"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
12
|
-
import { TEXT_THEME } from "../../theme";
|
|
13
|
-
import { getElementFontSize } from "./getElementFontSize";
|
|
14
|
-
export var useSvgWrapper = function useSvgWrapper() {
|
|
15
|
-
var ele = useRef(null);
|
|
16
|
-
var _useState = useState(TEXT_THEME.fontSizeBase),
|
|
17
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
-
fontSize = _useState2[0],
|
|
19
|
-
setFontSize = _useState2[1];
|
|
20
|
-
useLayoutEffect(function () {
|
|
21
|
-
if (ele.current) {
|
|
22
|
-
setFontSize(getElementFontSize(ele.current, TEXT_THEME.fontSizeBase));
|
|
23
|
-
}
|
|
24
|
-
}, []);
|
|
25
|
-
var Svg = function Svg(_ref) {
|
|
26
|
-
var children = _ref.children,
|
|
27
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
29
|
-
style: {
|
|
30
|
-
margin: '0px 4px',
|
|
31
|
-
transform: 'translate(0px, 0.125em)'
|
|
32
|
-
},
|
|
33
|
-
ref: ele
|
|
34
|
-
}, otherProps), children);
|
|
35
|
-
};
|
|
36
|
-
return [Svg, fontSize];
|
|
37
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { isArray, isString, size } from 'lodash';
|
|
8
|
-
import React, { useMemo } from 'react';
|
|
9
|
-
import { TEXT_THEME } from "../../theme";
|
|
10
|
-
import { useSvgWrapper } from "../hooks";
|
|
11
|
-
import { useLineCompute } from "./useLineCompute";
|
|
12
|
-
var LINEAR_FILL_COLOR_ID = 'wsc-line-fill';
|
|
13
|
-
function getLineChartData(origin) {
|
|
14
|
-
if (isArray(origin)) return origin;
|
|
15
|
-
if (isString(origin)) {
|
|
16
|
-
try {
|
|
17
|
-
var data = JSON.parse(origin);
|
|
18
|
-
if (isArray(data)) return data;
|
|
19
|
-
} catch (e) {
|
|
20
|
-
console.warn(e, "".concat(origin, " is not a valid json string"));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export var SingleLineChart = function SingleLineChart(_ref) {
|
|
25
|
-
var origin = _ref.origin;
|
|
26
|
-
var _useSvgWrapper = useSvgWrapper(),
|
|
27
|
-
_useSvgWrapper2 = _slicedToArray(_useSvgWrapper, 2),
|
|
28
|
-
Svg = _useSvgWrapper2[0],
|
|
29
|
-
fontSize = _useSvgWrapper2[1];
|
|
30
|
-
var data = useMemo(function () {
|
|
31
|
-
return getLineChartData(origin);
|
|
32
|
-
}, [origin]);
|
|
33
|
-
var _useLineCompute = useLineCompute(fontSize, data),
|
|
34
|
-
width = _useLineCompute.width,
|
|
35
|
-
height = _useLineCompute.height,
|
|
36
|
-
linePath = _useLineCompute.linePath,
|
|
37
|
-
polygonPath = _useLineCompute.polygonPath;
|
|
38
|
-
return size(data) > 0 && /*#__PURE__*/React.createElement(Svg, {
|
|
39
|
-
width: width,
|
|
40
|
-
height: height
|
|
41
|
-
}, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
|
|
42
|
-
x1: "50%",
|
|
43
|
-
y1: "0%",
|
|
44
|
-
x2: "50%",
|
|
45
|
-
y2: "122.389541%",
|
|
46
|
-
id: LINEAR_FILL_COLOR_ID
|
|
47
|
-
}, /*#__PURE__*/React.createElement("stop", {
|
|
48
|
-
stopColor: TEXT_THEME.chart.lineStrokeColor,
|
|
49
|
-
offset: "0%"
|
|
50
|
-
}), /*#__PURE__*/React.createElement("stop", {
|
|
51
|
-
stopColor: "#FFFFFF",
|
|
52
|
-
stopOpacity: "0",
|
|
53
|
-
offset: "100%"
|
|
54
|
-
}))), linePath && /*#__PURE__*/React.createElement("path", {
|
|
55
|
-
d: linePath,
|
|
56
|
-
stroke: TEXT_THEME.chart.lineStrokeColor,
|
|
57
|
-
fill: "transparent"
|
|
58
|
-
}), polygonPath && /*#__PURE__*/React.createElement("polygon", {
|
|
59
|
-
points: polygonPath,
|
|
60
|
-
fill: "url(#".concat(LINEAR_FILL_COLOR_ID, ")")
|
|
61
|
-
}));
|
|
62
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SingleLineChart } from './SingleLineChart';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SingleLineChart } from "./SingleLineChart";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
export var scaleLinear = function scaleLinear(domain, range) {
|
|
8
|
-
return function (n) {
|
|
9
|
-
var _domain = _slicedToArray(domain, 2),
|
|
10
|
-
d1 = _domain[0],
|
|
11
|
-
d2 = _domain[1];
|
|
12
|
-
var _range = _slicedToArray(range, 2),
|
|
13
|
-
r1 = _range[0],
|
|
14
|
-
r2 = _range[1];
|
|
15
|
-
// Returns the intermediate value when the range is zero.
|
|
16
|
-
if (r1 === r2) return (d2 - d1) / 2;
|
|
17
|
-
return n / (r2 - r1) * (d2 - d1);
|
|
18
|
-
};
|
|
19
|
-
};
|