@antv/gpt-vis 0.6.1 → 1.0.0-beta.2
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 +185 -114
- package/README.zh-CN.md +187 -112
- package/dist/cjs/gpt-vis/index.d.ts +115 -0
- package/dist/cjs/gpt-vis/index.js +196 -0
- package/dist/cjs/index.d.ts +57 -13
- package/dist/cjs/index.js +85 -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 +82 -0
- package/dist/cjs/syntax/parser.js +348 -0
- package/dist/cjs/types/index.d.ts +33 -2
- package/dist/cjs/types/index.js +0 -6
- package/dist/cjs/util/container.d.ts +5 -0
- package/dist/cjs/{utils/map/util.js → util/container.js} +18 -13
- package/dist/cjs/util/theme.d.ts +26 -0
- package/dist/cjs/{theme.js → util/theme.js} +70 -14
- package/dist/cjs/vis/area/index.d.ts +60 -0
- package/dist/cjs/vis/area/index.js +152 -0
- package/dist/cjs/vis/bar/index.d.ts +60 -0
- package/dist/cjs/vis/bar/index.js +123 -0
- package/dist/cjs/vis/boxplot/index.d.ts +59 -0
- package/dist/cjs/vis/boxplot/index.js +111 -0
- package/dist/cjs/vis/column/index.d.ts +60 -0
- package/dist/cjs/vis/column/index.js +122 -0
- package/dist/cjs/vis/dual-axes/index.d.ts +64 -0
- package/dist/cjs/vis/dual-axes/index.js +148 -0
- package/dist/cjs/vis/fishbone-diagram/index.d.ts +35 -0
- package/dist/cjs/vis/fishbone-diagram/index.js +183 -0
- package/dist/cjs/vis/flow-diagram/index.d.ts +27 -0
- package/dist/cjs/vis/flow-diagram/index.js +271 -0
- package/dist/cjs/vis/funnel/index.d.ts +54 -0
- package/dist/cjs/vis/funnel/index.js +190 -0
- package/dist/cjs/vis/histogram/index.d.ts +47 -0
- package/dist/cjs/vis/histogram/index.js +108 -0
- package/dist/cjs/vis/indented-tree/index.d.ts +40 -0
- package/dist/cjs/vis/indented-tree/index.js +375 -0
- package/dist/cjs/vis/line/index.d.ts +59 -0
- package/dist/cjs/vis/line/index.js +105 -0
- package/dist/cjs/vis/liquid/index.d.ts +44 -0
- package/dist/cjs/vis/liquid/index.js +88 -0
- package/dist/cjs/vis/mindmap/index.d.ts +32 -0
- package/dist/cjs/vis/mindmap/index.js +214 -0
- package/dist/cjs/vis/network-graph/index.d.ts +59 -0
- package/dist/cjs/vis/network-graph/index.js +166 -0
- package/dist/cjs/vis/organization-chart/index.d.ts +64 -0
- package/dist/cjs/vis/organization-chart/index.js +191 -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 +58 -0
- package/dist/cjs/vis/radar/index.js +153 -0
- package/dist/cjs/vis/sankey/index.d.ts +56 -0
- package/dist/cjs/vis/sankey/index.js +94 -0
- package/dist/cjs/vis/scatter/index.d.ts +54 -0
- package/dist/cjs/vis/scatter/index.js +95 -0
- package/dist/cjs/vis/summary/index.d.ts +41 -0
- package/dist/cjs/vis/summary/index.js +71 -0
- package/dist/cjs/vis/table/index.d.ts +50 -0
- package/dist/cjs/vis/table/index.js +209 -0
- package/dist/cjs/vis/treemap/index.d.ts +68 -0
- package/dist/cjs/vis/treemap/index.js +106 -0
- package/dist/cjs/vis/venn/index.d.ts +55 -0
- package/dist/cjs/vis/venn/index.js +115 -0
- package/dist/cjs/vis/violin/index.d.ts +59 -0
- package/dist/cjs/vis/violin/index.js +156 -0
- package/dist/cjs/vis/waterfall/index.d.ts +64 -0
- package/dist/cjs/vis/waterfall/index.js +195 -0
- package/dist/cjs/vis/word-cloud/index.d.ts +53 -0
- package/dist/cjs/vis/word-cloud/index.js +90 -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 +25 -0
- package/dist/cjs/vis-wrapper/index.js +242 -0
- package/dist/cjs/vis-wrapper/styles.d.ts +8 -0
- package/dist/cjs/vis-wrapper/styles.js +221 -0
- package/dist/esm/gpt-vis/index.d.ts +115 -0
- package/dist/esm/gpt-vis/index.js +245 -0
- package/dist/esm/index.d.ts +57 -13
- package/dist/esm/index.js +28 -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 +82 -0
- package/dist/esm/syntax/parser.js +559 -0
- package/dist/esm/types/index.d.ts +33 -2
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/util/container.d.ts +5 -0
- package/dist/esm/util/container.js +20 -0
- package/dist/esm/util/theme.d.ts +26 -0
- package/dist/esm/util/theme.js +150 -0
- package/dist/esm/vis/area/index.d.ts +60 -0
- package/dist/esm/vis/area/index.js +231 -0
- package/dist/esm/vis/bar/index.d.ts +60 -0
- package/dist/esm/vis/bar/index.js +204 -0
- package/dist/esm/vis/boxplot/index.d.ts +59 -0
- package/dist/esm/vis/boxplot/index.js +177 -0
- package/dist/esm/vis/column/index.d.ts +60 -0
- package/dist/esm/vis/column/index.js +199 -0
- package/dist/esm/vis/dual-axes/index.d.ts +64 -0
- package/dist/esm/vis/dual-axes/index.js +235 -0
- package/dist/esm/vis/fishbone-diagram/index.d.ts +35 -0
- package/dist/esm/vis/fishbone-diagram/index.js +218 -0
- package/dist/esm/vis/flow-diagram/index.d.ts +27 -0
- package/dist/esm/vis/flow-diagram/index.js +342 -0
- package/dist/esm/vis/funnel/index.d.ts +54 -0
- package/dist/esm/vis/funnel/index.js +247 -0
- package/dist/esm/vis/histogram/index.d.ts +47 -0
- package/dist/esm/vis/histogram/index.js +147 -0
- package/dist/esm/vis/indented-tree/index.d.ts +40 -0
- package/dist/esm/vis/indented-tree/index.js +564 -0
- package/dist/esm/vis/line/index.d.ts +59 -0
- package/dist/esm/vis/line/index.js +173 -0
- package/dist/esm/vis/liquid/index.d.ts +44 -0
- package/dist/esm/vis/liquid/index.js +131 -0
- package/dist/esm/vis/mindmap/index.d.ts +32 -0
- package/dist/esm/vis/mindmap/index.js +315 -0
- package/dist/esm/vis/network-graph/index.d.ts +59 -0
- package/dist/esm/vis/network-graph/index.js +240 -0
- package/dist/esm/vis/organization-chart/index.d.ts +64 -0
- package/dist/esm/vis/organization-chart/index.js +269 -0
- package/dist/esm/vis/pie/index.d.ts +55 -0
- package/dist/esm/vis/pie/index.js +164 -0
- package/dist/esm/vis/radar/index.d.ts +58 -0
- package/dist/esm/vis/radar/index.js +238 -0
- package/dist/esm/vis/sankey/index.d.ts +56 -0
- package/dist/esm/vis/sankey/index.js +136 -0
- package/dist/esm/vis/scatter/index.d.ts +54 -0
- package/dist/esm/vis/scatter/index.js +159 -0
- package/dist/esm/vis/summary/index.d.ts +41 -0
- package/dist/esm/vis/summary/index.js +101 -0
- package/dist/esm/vis/table/index.d.ts +50 -0
- package/dist/esm/vis/table/index.js +167 -0
- package/dist/esm/vis/treemap/index.d.ts +68 -0
- package/dist/esm/vis/treemap/index.js +159 -0
- package/dist/esm/vis/venn/index.d.ts +55 -0
- package/dist/esm/vis/venn/index.js +167 -0
- package/dist/esm/vis/violin/index.d.ts +59 -0
- package/dist/esm/vis/violin/index.js +246 -0
- package/dist/esm/vis/waterfall/index.d.ts +64 -0
- package/dist/esm/vis/waterfall/index.js +263 -0
- package/dist/esm/vis/word-cloud/index.d.ts +53 -0
- package/dist/esm/vis/word-cloud/index.js +129 -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 +25 -0
- package/dist/esm/vis-wrapper/index.js +242 -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 +18 -59
- 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 -338
- 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/Spreadsheet/index.d.ts +0 -28
- package/dist/cjs/Spreadsheet/index.js +0 -113
- 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/getThemeColor.js +0 -46
- 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 -76
- package/dist/cjs/export.js +0 -159
- 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 -88
- package/dist/cjs/types/chart.js +0 -61
- 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/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 -450
- 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/Spreadsheet/index.d.ts +0 -28
- package/dist/esm/Spreadsheet/index.js +0 -129
- 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 -76
- package/dist/esm/export.js +0 -51
- 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 -88
- package/dist/esm/types/chart.js +0 -33
- 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/376.async.js +0 -1
- package/dist/umd/index.min.css +0 -1
|
@@ -0,0 +1,564 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
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
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
15
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
16
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
19
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
+
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; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
25
|
+
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); }
|
|
26
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
27
|
+
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); }
|
|
28
|
+
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; }
|
|
29
|
+
import { Badge, BaseBehavior, BaseNode, CommonEvent, ExtensionCategory, Graph, NodeEvent, Polyline, iconfont, register, subStyleProps, treeToGraphData } from '@antv/g6';
|
|
30
|
+
import { getBackgroundColor, normalizePalette } from "../../util/theme";
|
|
31
|
+
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
// Official G6 indented-tree implementation (adapted for GPT-Vis)
|
|
34
|
+
// https://g6.antv.antgroup.com/examples/scene-case/tree-graph/#indented-tree
|
|
35
|
+
// Edge/node accent colors follow the same theme palettes as other GPT-Vis charts
|
|
36
|
+
// (see getThemeColors); optional style.palette overrides per render.
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
var TreeEvent = {
|
|
40
|
+
COLLAPSE_EXPAND: 'collapse-expand',
|
|
41
|
+
ADD_CHILD: 'add-child'
|
|
42
|
+
};
|
|
43
|
+
var _iconfontInjected = false;
|
|
44
|
+
function ensureIconfontInjected() {
|
|
45
|
+
if (_iconfontInjected) return;
|
|
46
|
+
if (typeof document === 'undefined') return;
|
|
47
|
+
var style = document.createElement('style');
|
|
48
|
+
style.innerHTML = "@import url('".concat(iconfont.css, "');");
|
|
49
|
+
document.head.appendChild(style);
|
|
50
|
+
_iconfontInjected = true;
|
|
51
|
+
}
|
|
52
|
+
var _measureCanvas = null;
|
|
53
|
+
var _measureCtx = null;
|
|
54
|
+
function measureTextWidth(text) {
|
|
55
|
+
var fontSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 12;
|
|
56
|
+
if (!text) return 0;
|
|
57
|
+
if (typeof document === 'undefined' || typeof HTMLCanvasElement === 'undefined') {
|
|
58
|
+
var w = 0;
|
|
59
|
+
var _iterator = _createForOfIteratorHelper(text),
|
|
60
|
+
_step;
|
|
61
|
+
try {
|
|
62
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
63
|
+
var ch = _step.value;
|
|
64
|
+
w += ch.charCodeAt(0) > 0x4e00 ? fontSize : fontSize * 0.6;
|
|
65
|
+
}
|
|
66
|
+
} catch (err) {
|
|
67
|
+
_iterator.e(err);
|
|
68
|
+
} finally {
|
|
69
|
+
_iterator.f();
|
|
70
|
+
}
|
|
71
|
+
return w;
|
|
72
|
+
}
|
|
73
|
+
if (!_measureCanvas) {
|
|
74
|
+
_measureCanvas = document.createElement('canvas');
|
|
75
|
+
_measureCtx = _measureCanvas.getContext('2d');
|
|
76
|
+
}
|
|
77
|
+
if (!_measureCtx) return text.length * fontSize * 0.6;
|
|
78
|
+
_measureCtx.font = "".concat(fontSize, "px system-ui,-apple-system,BlinkMacSystemFont,sans-serif");
|
|
79
|
+
return _measureCtx.measureText(text).width;
|
|
80
|
+
}
|
|
81
|
+
var IndentedNode = /*#__PURE__*/function (_ref) {
|
|
82
|
+
_inherits(IndentedNode, _ref);
|
|
83
|
+
var _super = _createSuper(IndentedNode);
|
|
84
|
+
function IndentedNode(options) {
|
|
85
|
+
_classCallCheck(this, IndentedNode);
|
|
86
|
+
Object.assign(options.style, IndentedNode.defaultStyleProps);
|
|
87
|
+
return _super.call(this, options);
|
|
88
|
+
}
|
|
89
|
+
_createClass(IndentedNode, [{
|
|
90
|
+
key: "childrenData",
|
|
91
|
+
get: function get() {
|
|
92
|
+
return this.context.model.getChildrenData(this.id);
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "getKeyStyle",
|
|
96
|
+
value: function getKeyStyle(attributes) {
|
|
97
|
+
var _this$getSize = this.getSize(attributes),
|
|
98
|
+
_this$getSize2 = _slicedToArray(_this$getSize, 2),
|
|
99
|
+
width = _this$getSize2[0],
|
|
100
|
+
height = _this$getSize2[1];
|
|
101
|
+
var keyStyle = _get(_getPrototypeOf(IndentedNode.prototype), "getKeyStyle", this).call(this, attributes);
|
|
102
|
+
return _objectSpread(_objectSpread({
|
|
103
|
+
width: width,
|
|
104
|
+
height: height
|
|
105
|
+
}, keyStyle), {}, {
|
|
106
|
+
fill: 'transparent'
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}, {
|
|
110
|
+
key: "drawKeyShape",
|
|
111
|
+
value: function drawKeyShape(attributes, container) {
|
|
112
|
+
var keyStyle = this.getKeyStyle(attributes);
|
|
113
|
+
return this.upsert('key', 'rect', keyStyle, container);
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
key: "getLabelStyle",
|
|
117
|
+
value: function getLabelStyle(attributes) {
|
|
118
|
+
if (attributes.label === false || !attributes.labelText) return false;
|
|
119
|
+
return subStyleProps(this.getGraphicStyle(attributes), 'label');
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "drawIconArea",
|
|
123
|
+
value: function drawIconArea(attributes, container) {
|
|
124
|
+
var _this$getSize3 = this.getSize(attributes),
|
|
125
|
+
_this$getSize4 = _slicedToArray(_this$getSize3, 2),
|
|
126
|
+
h = _this$getSize4[1];
|
|
127
|
+
var iconAreaStyle = {
|
|
128
|
+
fill: 'transparent',
|
|
129
|
+
height: 30,
|
|
130
|
+
width: 12,
|
|
131
|
+
x: -6,
|
|
132
|
+
y: h,
|
|
133
|
+
zIndex: -1
|
|
134
|
+
};
|
|
135
|
+
this.upsert('icon-area', 'rect', iconAreaStyle, container);
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
key: "forwardEvent",
|
|
139
|
+
value: function forwardEvent(target, type, listener) {
|
|
140
|
+
if (target && !Reflect.has(target, '__bind__')) {
|
|
141
|
+
Reflect.set(target, '__bind__', true);
|
|
142
|
+
target.addEventListener(type, listener);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "getCountStyle",
|
|
147
|
+
value: function getCountStyle(attributes) {
|
|
148
|
+
var collapsed = attributes.collapsed,
|
|
149
|
+
color = attributes.color;
|
|
150
|
+
if (collapsed) {
|
|
151
|
+
var _this$getSize5 = this.getSize(attributes),
|
|
152
|
+
_this$getSize6 = _slicedToArray(_this$getSize5, 2),
|
|
153
|
+
height = _this$getSize6[1];
|
|
154
|
+
return {
|
|
155
|
+
backgroundFill: color,
|
|
156
|
+
cursor: 'pointer',
|
|
157
|
+
fill: '#fff',
|
|
158
|
+
fontSize: 8,
|
|
159
|
+
padding: [0, 10],
|
|
160
|
+
text: "".concat(this.childrenData.length),
|
|
161
|
+
textAlign: 'center',
|
|
162
|
+
y: height + 8
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
key: "drawCountShape",
|
|
169
|
+
value: function drawCountShape(attributes, container) {
|
|
170
|
+
var _this = this;
|
|
171
|
+
var countStyle = this.getCountStyle(attributes);
|
|
172
|
+
var btn = this.upsert('count', Badge, countStyle, container);
|
|
173
|
+
this.forwardEvent(btn, CommonEvent.CLICK, function (event) {
|
|
174
|
+
event.stopPropagation();
|
|
175
|
+
_this.context.graph.emit(TreeEvent.COLLAPSE_EXPAND, {
|
|
176
|
+
id: _this.id,
|
|
177
|
+
collapsed: false
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
key: "isShowCollapse",
|
|
183
|
+
value: function isShowCollapse(attributes) {
|
|
184
|
+
return !attributes.collapsed && this.childrenData.length > 0;
|
|
185
|
+
}
|
|
186
|
+
}, {
|
|
187
|
+
key: "getCollapseStyle",
|
|
188
|
+
value: function getCollapseStyle(attributes) {
|
|
189
|
+
var showIcon = attributes.showIcon,
|
|
190
|
+
color = attributes.color;
|
|
191
|
+
if (!this.isShowCollapse(attributes)) return false;
|
|
192
|
+
var _this$getSize7 = this.getSize(attributes),
|
|
193
|
+
_this$getSize8 = _slicedToArray(_this$getSize7, 2),
|
|
194
|
+
height = _this$getSize8[1];
|
|
195
|
+
return {
|
|
196
|
+
visibility: showIcon ? 'visible' : 'hidden',
|
|
197
|
+
backgroundFill: color,
|
|
198
|
+
backgroundHeight: 12,
|
|
199
|
+
backgroundWidth: 12,
|
|
200
|
+
cursor: 'pointer',
|
|
201
|
+
fill: '#fff',
|
|
202
|
+
fontFamily: 'iconfont',
|
|
203
|
+
fontSize: 8,
|
|
204
|
+
text: "\uE6E4",
|
|
205
|
+
textAlign: 'center',
|
|
206
|
+
x: -1,
|
|
207
|
+
y: height + 8
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}, {
|
|
211
|
+
key: "drawCollapseShape",
|
|
212
|
+
value: function drawCollapseShape(attributes, container) {
|
|
213
|
+
var _this2 = this;
|
|
214
|
+
var iconStyle = this.getCollapseStyle(attributes);
|
|
215
|
+
var btn = this.upsert('collapse-expand', Badge, iconStyle, container);
|
|
216
|
+
this.forwardEvent(btn, CommonEvent.CLICK, function (event) {
|
|
217
|
+
event.stopPropagation();
|
|
218
|
+
_this2.context.graph.emit(TreeEvent.COLLAPSE_EXPAND, {
|
|
219
|
+
id: _this2.id,
|
|
220
|
+
collapsed: !attributes.collapsed
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}, {
|
|
225
|
+
key: "render",
|
|
226
|
+
value: function render() {
|
|
227
|
+
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.parsedAttributes;
|
|
228
|
+
var container = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
|
|
229
|
+
_get(_getPrototypeOf(IndentedNode.prototype), "render", this).call(this, attributes, container);
|
|
230
|
+
this.drawCountShape(attributes, container);
|
|
231
|
+
this.drawIconArea(attributes, container);
|
|
232
|
+
this.drawCollapseShape(attributes, container);
|
|
233
|
+
}
|
|
234
|
+
}]);
|
|
235
|
+
return IndentedNode;
|
|
236
|
+
}(BaseNode);
|
|
237
|
+
_defineProperty(IndentedNode, "defaultStyleProps", {
|
|
238
|
+
ports: [{
|
|
239
|
+
key: 'in',
|
|
240
|
+
placement: 'right-bottom'
|
|
241
|
+
}, {
|
|
242
|
+
key: 'out',
|
|
243
|
+
placement: 'left-bottom'
|
|
244
|
+
}]
|
|
245
|
+
});
|
|
246
|
+
var IndentedEdge = /*#__PURE__*/function (_ref2) {
|
|
247
|
+
_inherits(IndentedEdge, _ref2);
|
|
248
|
+
var _super2 = _createSuper(IndentedEdge);
|
|
249
|
+
function IndentedEdge() {
|
|
250
|
+
_classCallCheck(this, IndentedEdge);
|
|
251
|
+
return _super2.apply(this, arguments);
|
|
252
|
+
}
|
|
253
|
+
_createClass(IndentedEdge, [{
|
|
254
|
+
key: "getControlPoints",
|
|
255
|
+
value: function getControlPoints(attributes) {
|
|
256
|
+
var _this$getEndpoints = this.getEndpoints(attributes, false),
|
|
257
|
+
_this$getEndpoints2 = _slicedToArray(_this$getEndpoints, 2),
|
|
258
|
+
sourcePoint = _this$getEndpoints2[0],
|
|
259
|
+
targetPoint = _this$getEndpoints2[1];
|
|
260
|
+
var _sourcePoint = _slicedToArray(sourcePoint, 1),
|
|
261
|
+
sx = _sourcePoint[0];
|
|
262
|
+
var _targetPoint = _slicedToArray(targetPoint, 2),
|
|
263
|
+
ty = _targetPoint[1];
|
|
264
|
+
return [[sx, ty]];
|
|
265
|
+
}
|
|
266
|
+
}]);
|
|
267
|
+
return IndentedEdge;
|
|
268
|
+
}(Polyline);
|
|
269
|
+
var CollapseExpandTree = /*#__PURE__*/function (_BaseBehavior) {
|
|
270
|
+
_inherits(CollapseExpandTree, _BaseBehavior);
|
|
271
|
+
var _super3 = _createSuper(CollapseExpandTree);
|
|
272
|
+
function CollapseExpandTree(context, options) {
|
|
273
|
+
var _this3;
|
|
274
|
+
_classCallCheck(this, CollapseExpandTree);
|
|
275
|
+
_this3 = _super3.call(this, context, options);
|
|
276
|
+
_defineProperty(_assertThisInitialized(_this3), "status", 'idle');
|
|
277
|
+
_defineProperty(_assertThisInitialized(_this3), "showIcon", function (event) {
|
|
278
|
+
_this3.setIcon(event, true);
|
|
279
|
+
});
|
|
280
|
+
_defineProperty(_assertThisInitialized(_this3), "hideIcon", function (event) {
|
|
281
|
+
_this3.setIcon(event, false);
|
|
282
|
+
});
|
|
283
|
+
_defineProperty(_assertThisInitialized(_this3), "setIcon", function (event, show) {
|
|
284
|
+
var _element$draw;
|
|
285
|
+
if (_this3.status !== 'idle') return;
|
|
286
|
+
var target = event.target;
|
|
287
|
+
var id = target.id;
|
|
288
|
+
var _ref3 = _this3.context,
|
|
289
|
+
graph = _ref3.graph,
|
|
290
|
+
element = _ref3.element;
|
|
291
|
+
graph.updateNodeData([{
|
|
292
|
+
id: id,
|
|
293
|
+
style: {
|
|
294
|
+
showIcon: show
|
|
295
|
+
}
|
|
296
|
+
}]);
|
|
297
|
+
element === null || element === void 0 || (_element$draw = element.draw) === null || _element$draw === void 0 || _element$draw.call(element, {
|
|
298
|
+
animation: false,
|
|
299
|
+
silence: true
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
_defineProperty(_assertThisInitialized(_this3), "onCollapseExpand", /*#__PURE__*/function () {
|
|
303
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
304
|
+
var id, collapsed, graph;
|
|
305
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
306
|
+
while (1) switch (_context.prev = _context.next) {
|
|
307
|
+
case 0:
|
|
308
|
+
_this3.status = 'busy';
|
|
309
|
+
id = event.id, collapsed = event.collapsed;
|
|
310
|
+
graph = _this3.context.graph;
|
|
311
|
+
if (!collapsed) {
|
|
312
|
+
_context.next = 8;
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
_context.next = 6;
|
|
316
|
+
return graph.collapseElement(id);
|
|
317
|
+
case 6:
|
|
318
|
+
_context.next = 10;
|
|
319
|
+
break;
|
|
320
|
+
case 8:
|
|
321
|
+
_context.next = 10;
|
|
322
|
+
return graph.expandElement(id);
|
|
323
|
+
case 10:
|
|
324
|
+
_this3.status = 'idle';
|
|
325
|
+
case 11:
|
|
326
|
+
case "end":
|
|
327
|
+
return _context.stop();
|
|
328
|
+
}
|
|
329
|
+
}, _callee);
|
|
330
|
+
}));
|
|
331
|
+
return function (_x) {
|
|
332
|
+
return _ref4.apply(this, arguments);
|
|
333
|
+
};
|
|
334
|
+
}());
|
|
335
|
+
// GPT-Vis 版本只保留官方的折叠/展开交互;新增子节点会引入额外数据模型管理,暂不启用。
|
|
336
|
+
_defineProperty(_assertThisInitialized(_this3), "addChild", function () {});
|
|
337
|
+
_this3.bindEvents();
|
|
338
|
+
return _this3;
|
|
339
|
+
}
|
|
340
|
+
_createClass(CollapseExpandTree, [{
|
|
341
|
+
key: "update",
|
|
342
|
+
value: function update(options) {
|
|
343
|
+
this.unbindEvents();
|
|
344
|
+
_get(_getPrototypeOf(CollapseExpandTree.prototype), "update", this).call(this, options);
|
|
345
|
+
this.bindEvents();
|
|
346
|
+
}
|
|
347
|
+
}, {
|
|
348
|
+
key: "bindEvents",
|
|
349
|
+
value: function bindEvents() {
|
|
350
|
+
var graph = this.context.graph;
|
|
351
|
+
graph.on(NodeEvent.POINTER_ENTER, this.showIcon);
|
|
352
|
+
graph.on(NodeEvent.POINTER_LEAVE, this.hideIcon);
|
|
353
|
+
graph.on(TreeEvent.COLLAPSE_EXPAND, this.onCollapseExpand);
|
|
354
|
+
graph.on(TreeEvent.ADD_CHILD, this.addChild);
|
|
355
|
+
}
|
|
356
|
+
}, {
|
|
357
|
+
key: "unbindEvents",
|
|
358
|
+
value: function unbindEvents() {
|
|
359
|
+
var graph = this.context.graph;
|
|
360
|
+
graph.off(NodeEvent.POINTER_ENTER, this.showIcon);
|
|
361
|
+
graph.off(NodeEvent.POINTER_LEAVE, this.hideIcon);
|
|
362
|
+
graph.off(TreeEvent.COLLAPSE_EXPAND, this.onCollapseExpand);
|
|
363
|
+
graph.off(TreeEvent.ADD_CHILD, this.addChild);
|
|
364
|
+
}
|
|
365
|
+
}]);
|
|
366
|
+
return CollapseExpandTree;
|
|
367
|
+
}(BaseBehavior);
|
|
368
|
+
var GPT_VIS_INDENTED_NODE = 'gpt-vis-indented';
|
|
369
|
+
var GPT_VIS_INDENTED_EDGE = 'gpt-vis-indented-edge';
|
|
370
|
+
var GPT_VIS_COLLAPSE_BEHAVIOR = 'gpt-vis-collapse-expand-tree';
|
|
371
|
+
var _extensionsRegistered = false;
|
|
372
|
+
function ensureExtensionsRegistered() {
|
|
373
|
+
if (_extensionsRegistered) return;
|
|
374
|
+
register(ExtensionCategory.NODE, GPT_VIS_INDENTED_NODE, IndentedNode);
|
|
375
|
+
register(ExtensionCategory.EDGE, GPT_VIS_INDENTED_EDGE, IndentedEdge);
|
|
376
|
+
register(ExtensionCategory.BEHAVIOR, GPT_VIS_COLLAPSE_BEHAVIOR, CollapseExpandTree);
|
|
377
|
+
_extensionsRegistered = true;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Indented tree node data — only name + optional children, no description.
|
|
382
|
+
* Aligns with the official G6 indented tree example data structure.
|
|
383
|
+
*/
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* IndentedTreeConfig defines the configuration for rendering the indented tree.
|
|
387
|
+
*/
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* IndentedTreeInstance represents a chart instance with render and destroy methods.
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
var NODE_HEIGHT = 20;
|
|
394
|
+
function toG6TreeData(node) {
|
|
395
|
+
return {
|
|
396
|
+
id: node.name,
|
|
397
|
+
children: (node.children || []).map(toG6TreeData)
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* IndentedTree — G6 5 indented layout for static DSL trees (no collapse/add UI).
|
|
403
|
+
* Uses built-in `rect` nodes and `line` edges. Tree edges must have explicit ids (see render) to avoid
|
|
404
|
+
* colliding with path-based node ids under G6's default `${source}-${target}` edge id rule.
|
|
405
|
+
* Based on: https://g6.antv.antgroup.com/examples/scene-case/tree-graph#indented-tree
|
|
406
|
+
*/
|
|
407
|
+
export var IndentedTree = function IndentedTree(options) {
|
|
408
|
+
var container = options.container,
|
|
409
|
+
width = options.width,
|
|
410
|
+
height = options.height,
|
|
411
|
+
_options$theme = options.theme,
|
|
412
|
+
chartTheme = _options$theme === void 0 ? 'default' : _options$theme;
|
|
413
|
+
var graph = null;
|
|
414
|
+
var render = function render(config) {
|
|
415
|
+
var _palette$;
|
|
416
|
+
var data = config.data,
|
|
417
|
+
_config$theme = config.theme,
|
|
418
|
+
theme = _config$theme === void 0 ? chartTheme : _config$theme,
|
|
419
|
+
title = config.title,
|
|
420
|
+
_config$style = config.style,
|
|
421
|
+
style = _config$style === void 0 ? {} : _config$style,
|
|
422
|
+
_config$direction = config.direction,
|
|
423
|
+
direction = _config$direction === void 0 ? 'LR' : _config$direction;
|
|
424
|
+
if (!(data !== null && data !== void 0 && data.name)) {
|
|
425
|
+
throw new Error('IndentedTree: data with a name field is required');
|
|
426
|
+
}
|
|
427
|
+
if (graph) {
|
|
428
|
+
graph.destroy();
|
|
429
|
+
graph = null;
|
|
430
|
+
}
|
|
431
|
+
var containerEl = typeof container === 'string' ? document.querySelector(container) : container;
|
|
432
|
+
if (!containerEl) throw new Error('IndentedTree: container element not found');
|
|
433
|
+
containerEl.innerHTML = '';
|
|
434
|
+
var backgroundColor = style.backgroundColor || getBackgroundColor(theme);
|
|
435
|
+
var isDark = theme === 'dark';
|
|
436
|
+
var palette = normalizePalette(style.palette, theme);
|
|
437
|
+
containerEl.style.background = backgroundColor;
|
|
438
|
+
containerEl.style.borderRadius = '4px';
|
|
439
|
+
containerEl.style.overflow = 'hidden';
|
|
440
|
+
ensureIconfontInjected();
|
|
441
|
+
ensureExtensionsRegistered();
|
|
442
|
+
var rootId = data.name;
|
|
443
|
+
var graphData = treeToGraphData(toG6TreeData(data));
|
|
444
|
+
graph = new Graph({
|
|
445
|
+
animation: false,
|
|
446
|
+
container: containerEl,
|
|
447
|
+
x: 60,
|
|
448
|
+
width: width,
|
|
449
|
+
height: height,
|
|
450
|
+
autoFit: 'view',
|
|
451
|
+
autoResize: true,
|
|
452
|
+
padding: 20,
|
|
453
|
+
data: graphData,
|
|
454
|
+
node: {
|
|
455
|
+
type: GPT_VIS_INDENTED_NODE,
|
|
456
|
+
style: {
|
|
457
|
+
size: function size(d) {
|
|
458
|
+
var _d$id;
|
|
459
|
+
return [measureTextWidth(String((_d$id = d.id) !== null && _d$id !== void 0 ? _d$id : ''), 12) + 6, NODE_HEIGHT];
|
|
460
|
+
},
|
|
461
|
+
labelBackground: function labelBackground(datum) {
|
|
462
|
+
return datum.id === rootId;
|
|
463
|
+
},
|
|
464
|
+
labelBackgroundRadius: 0,
|
|
465
|
+
labelBackgroundFill: (_palette$ = palette[0]) !== null && _palette$ !== void 0 ? _palette$ : '#1783FF',
|
|
466
|
+
labelFill: function labelFill(datum) {
|
|
467
|
+
return datum.id === rootId ? '#fff' : isDark ? '#d0d0d0' : '#666';
|
|
468
|
+
},
|
|
469
|
+
labelText: function labelText(d) {
|
|
470
|
+
var _d$style;
|
|
471
|
+
return ((_d$style = d.style) === null || _d$style === void 0 ? void 0 : _d$style.labelText) || d.id;
|
|
472
|
+
},
|
|
473
|
+
labelTextAlign: function labelTextAlign(datum) {
|
|
474
|
+
return datum.id === rootId ? 'center' : 'left';
|
|
475
|
+
},
|
|
476
|
+
labelTextBaseline: 'top',
|
|
477
|
+
color: function color(datum) {
|
|
478
|
+
try {
|
|
479
|
+
var _ref5, _palette;
|
|
480
|
+
var depth = graph.getAncestorsData(datum.id, 'tree').length - 1;
|
|
481
|
+
return (_ref5 = (_palette = palette[depth % palette.length]) !== null && _palette !== void 0 ? _palette : palette[0]) !== null && _ref5 !== void 0 ? _ref5 : '#1783FF';
|
|
482
|
+
} catch (_unused) {
|
|
483
|
+
var _palette$2;
|
|
484
|
+
return (_palette$2 = palette[0]) !== null && _palette$2 !== void 0 ? _palette$2 : '#1783FF';
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
state: {
|
|
489
|
+
selected: {
|
|
490
|
+
lineWidth: 0,
|
|
491
|
+
labelFill: '#40A8FF',
|
|
492
|
+
labelBackground: true,
|
|
493
|
+
labelFontWeight: 'normal',
|
|
494
|
+
labelBackgroundFill: '#e8f7ff',
|
|
495
|
+
labelBackgroundRadius: 10
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
edge: {
|
|
500
|
+
type: GPT_VIS_INDENTED_EDGE,
|
|
501
|
+
style: {
|
|
502
|
+
radius: 16,
|
|
503
|
+
lineWidth: 2,
|
|
504
|
+
sourcePort: 'out',
|
|
505
|
+
targetPort: 'in',
|
|
506
|
+
stroke: function stroke(datum) {
|
|
507
|
+
try {
|
|
508
|
+
var _palette$3, _ref6, _palette2;
|
|
509
|
+
if ((datum === null || datum === void 0 ? void 0 : datum.source) == null) return (_palette$3 = palette[0]) !== null && _palette$3 !== void 0 ? _palette$3 : '#1783FF';
|
|
510
|
+
var depth = graph.getAncestorsData(datum.source, 'tree').length;
|
|
511
|
+
return (_ref6 = (_palette2 = palette[depth % palette.length]) !== null && _palette2 !== void 0 ? _palette2 : palette[0]) !== null && _ref6 !== void 0 ? _ref6 : '#1783FF';
|
|
512
|
+
} catch (_unused2) {
|
|
513
|
+
var _palette$4;
|
|
514
|
+
return (_palette$4 = palette[0]) !== null && _palette$4 !== void 0 ? _palette$4 : '#1783FF';
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
layout: {
|
|
520
|
+
type: 'indented',
|
|
521
|
+
direction: direction,
|
|
522
|
+
isHorizontal: true,
|
|
523
|
+
indent: 40,
|
|
524
|
+
getHeight: function getHeight() {
|
|
525
|
+
return NODE_HEIGHT;
|
|
526
|
+
},
|
|
527
|
+
getVGap: function getVGap() {
|
|
528
|
+
return 10;
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
behaviors: ['drag-canvas', GPT_VIS_COLLAPSE_BEHAVIOR, {
|
|
532
|
+
type: 'click-select',
|
|
533
|
+
enable: function enable(event) {
|
|
534
|
+
return event.targetType === 'node' && event.target.id !== rootId;
|
|
535
|
+
}
|
|
536
|
+
}],
|
|
537
|
+
plugins: title ? [{
|
|
538
|
+
key: 'title',
|
|
539
|
+
type: 'title',
|
|
540
|
+
title: title,
|
|
541
|
+
titleFill: isDark ? '#e0e6ed' : '#1a1a2e'
|
|
542
|
+
}] : []
|
|
543
|
+
});
|
|
544
|
+
graph.render();
|
|
545
|
+
};
|
|
546
|
+
var destroy = function destroy() {
|
|
547
|
+
if (graph) {
|
|
548
|
+
graph.destroy();
|
|
549
|
+
graph = null;
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
return {
|
|
553
|
+
render: render,
|
|
554
|
+
destroy: destroy,
|
|
555
|
+
zoomTo: function zoomTo(zoom) {
|
|
556
|
+
var _graph;
|
|
557
|
+
return (_graph = graph) === null || _graph === void 0 ? void 0 : _graph.zoomTo(zoom);
|
|
558
|
+
},
|
|
559
|
+
getZoom: function getZoom() {
|
|
560
|
+
var _graph2;
|
|
561
|
+
return (_graph2 = graph) === null || _graph2 === void 0 ? void 0 : _graph2.getZoom();
|
|
562
|
+
}
|
|
563
|
+
};
|
|
564
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { VisualizationOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* LineDataItem is the type for each data item in the line chart.
|
|
4
|
+
*/
|
|
5
|
+
export type LineDataItem = {
|
|
6
|
+
time: string | number;
|
|
7
|
+
value: number;
|
|
8
|
+
group?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* LineConfig defines the configuration for rendering the line chart.
|
|
12
|
+
*/
|
|
13
|
+
export interface LineConfig {
|
|
14
|
+
type?: 'line';
|
|
15
|
+
data: LineDataItem[];
|
|
16
|
+
title?: string;
|
|
17
|
+
axisXTitle?: string;
|
|
18
|
+
axisYTitle?: string;
|
|
19
|
+
theme?: 'default' | 'academy' | 'dark';
|
|
20
|
+
style?: {
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
palette?: string[];
|
|
23
|
+
lineWidth?: number;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* LineInstance represents a line chart instance with render and destroy methods.
|
|
28
|
+
*/
|
|
29
|
+
export interface LineInstance {
|
|
30
|
+
render: (config: LineConfig) => void;
|
|
31
|
+
destroy: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Line chart component using G2 5.0.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const line = Line({
|
|
39
|
+
* container: '#container',
|
|
40
|
+
* width: 600,
|
|
41
|
+
* height: 400,
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* line.render({
|
|
45
|
+
* type: 'line',
|
|
46
|
+
* data: [
|
|
47
|
+
* { time: '2015 年', value: 1700 },
|
|
48
|
+
* { time: '2016 年', value: 1500 },
|
|
49
|
+
* { time: '2017 年', value: 1200 },
|
|
50
|
+
* ],
|
|
51
|
+
* title: '出生人口变化',
|
|
52
|
+
* axisXTitle: '年份',
|
|
53
|
+
* axisYTitle: '出生人口(万人)',
|
|
54
|
+
* });
|
|
55
|
+
*
|
|
56
|
+
* line.destroy();
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare const Line: (options: VisualizationOptions) => LineInstance;
|