@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,375 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/vis/indented-tree/index.ts
|
|
20
|
+
var indented_tree_exports = {};
|
|
21
|
+
__export(indented_tree_exports, {
|
|
22
|
+
IndentedTree: () => IndentedTree
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(indented_tree_exports);
|
|
25
|
+
var import_g6 = require("@antv/g6");
|
|
26
|
+
var import_theme = require("../../util/theme");
|
|
27
|
+
var TreeEvent = {
|
|
28
|
+
COLLAPSE_EXPAND: "collapse-expand",
|
|
29
|
+
ADD_CHILD: "add-child"
|
|
30
|
+
};
|
|
31
|
+
var _iconfontInjected = false;
|
|
32
|
+
function ensureIconfontInjected() {
|
|
33
|
+
if (_iconfontInjected)
|
|
34
|
+
return;
|
|
35
|
+
if (typeof document === "undefined")
|
|
36
|
+
return;
|
|
37
|
+
const style = document.createElement("style");
|
|
38
|
+
style.innerHTML = `@import url('${import_g6.iconfont.css}');`;
|
|
39
|
+
document.head.appendChild(style);
|
|
40
|
+
_iconfontInjected = true;
|
|
41
|
+
}
|
|
42
|
+
var _measureCanvas = null;
|
|
43
|
+
var _measureCtx = null;
|
|
44
|
+
function measureTextWidth(text, fontSize = 12) {
|
|
45
|
+
if (!text)
|
|
46
|
+
return 0;
|
|
47
|
+
if (typeof document === "undefined" || typeof HTMLCanvasElement === "undefined") {
|
|
48
|
+
let w = 0;
|
|
49
|
+
for (const ch of text)
|
|
50
|
+
w += ch.charCodeAt(0) > 19968 ? fontSize : fontSize * 0.6;
|
|
51
|
+
return w;
|
|
52
|
+
}
|
|
53
|
+
if (!_measureCanvas) {
|
|
54
|
+
_measureCanvas = document.createElement("canvas");
|
|
55
|
+
_measureCtx = _measureCanvas.getContext("2d");
|
|
56
|
+
}
|
|
57
|
+
if (!_measureCtx)
|
|
58
|
+
return text.length * fontSize * 0.6;
|
|
59
|
+
_measureCtx.font = `${fontSize}px system-ui,-apple-system,BlinkMacSystemFont,sans-serif`;
|
|
60
|
+
return _measureCtx.measureText(text).width;
|
|
61
|
+
}
|
|
62
|
+
var _IndentedNode = class extends import_g6.BaseNode {
|
|
63
|
+
constructor(options) {
|
|
64
|
+
Object.assign(options.style, _IndentedNode.defaultStyleProps);
|
|
65
|
+
super(options);
|
|
66
|
+
}
|
|
67
|
+
get childrenData() {
|
|
68
|
+
return this.context.model.getChildrenData(this.id);
|
|
69
|
+
}
|
|
70
|
+
getKeyStyle(attributes) {
|
|
71
|
+
const [width, height] = this.getSize(attributes);
|
|
72
|
+
const keyStyle = super.getKeyStyle(attributes);
|
|
73
|
+
return { width, height, ...keyStyle, fill: "transparent" };
|
|
74
|
+
}
|
|
75
|
+
drawKeyShape(attributes, container) {
|
|
76
|
+
const keyStyle = this.getKeyStyle(attributes);
|
|
77
|
+
return this.upsert("key", "rect", keyStyle, container);
|
|
78
|
+
}
|
|
79
|
+
getLabelStyle(attributes) {
|
|
80
|
+
if (attributes.label === false || !attributes.labelText)
|
|
81
|
+
return false;
|
|
82
|
+
return (0, import_g6.subStyleProps)(this.getGraphicStyle(attributes), "label");
|
|
83
|
+
}
|
|
84
|
+
drawIconArea(attributes, container) {
|
|
85
|
+
const [, h] = this.getSize(attributes);
|
|
86
|
+
const iconAreaStyle = { fill: "transparent", height: 30, width: 12, x: -6, y: h, zIndex: -1 };
|
|
87
|
+
this.upsert("icon-area", "rect", iconAreaStyle, container);
|
|
88
|
+
}
|
|
89
|
+
forwardEvent(target, type, listener) {
|
|
90
|
+
if (target && !Reflect.has(target, "__bind__")) {
|
|
91
|
+
Reflect.set(target, "__bind__", true);
|
|
92
|
+
target.addEventListener(type, listener);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
getCountStyle(attributes) {
|
|
96
|
+
const { collapsed, color } = attributes;
|
|
97
|
+
if (collapsed) {
|
|
98
|
+
const [, height] = this.getSize(attributes);
|
|
99
|
+
return {
|
|
100
|
+
backgroundFill: color,
|
|
101
|
+
cursor: "pointer",
|
|
102
|
+
fill: "#fff",
|
|
103
|
+
fontSize: 8,
|
|
104
|
+
padding: [0, 10],
|
|
105
|
+
text: `${this.childrenData.length}`,
|
|
106
|
+
textAlign: "center",
|
|
107
|
+
y: height + 8
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
drawCountShape(attributes, container) {
|
|
113
|
+
const countStyle = this.getCountStyle(attributes);
|
|
114
|
+
const btn = this.upsert("count", import_g6.Badge, countStyle, container);
|
|
115
|
+
this.forwardEvent(btn, import_g6.CommonEvent.CLICK, (event) => {
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
this.context.graph.emit(TreeEvent.COLLAPSE_EXPAND, { id: this.id, collapsed: false });
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
isShowCollapse(attributes) {
|
|
121
|
+
return !attributes.collapsed && this.childrenData.length > 0;
|
|
122
|
+
}
|
|
123
|
+
getCollapseStyle(attributes) {
|
|
124
|
+
const { showIcon, color } = attributes;
|
|
125
|
+
if (!this.isShowCollapse(attributes))
|
|
126
|
+
return false;
|
|
127
|
+
const [, height] = this.getSize(attributes);
|
|
128
|
+
return {
|
|
129
|
+
visibility: showIcon ? "visible" : "hidden",
|
|
130
|
+
backgroundFill: color,
|
|
131
|
+
backgroundHeight: 12,
|
|
132
|
+
backgroundWidth: 12,
|
|
133
|
+
cursor: "pointer",
|
|
134
|
+
fill: "#fff",
|
|
135
|
+
fontFamily: "iconfont",
|
|
136
|
+
fontSize: 8,
|
|
137
|
+
text: "",
|
|
138
|
+
textAlign: "center",
|
|
139
|
+
x: -1,
|
|
140
|
+
y: height + 8
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
drawCollapseShape(attributes, container) {
|
|
144
|
+
const iconStyle = this.getCollapseStyle(attributes);
|
|
145
|
+
const btn = this.upsert("collapse-expand", import_g6.Badge, iconStyle, container);
|
|
146
|
+
this.forwardEvent(btn, import_g6.CommonEvent.CLICK, (event) => {
|
|
147
|
+
event.stopPropagation();
|
|
148
|
+
this.context.graph.emit(TreeEvent.COLLAPSE_EXPAND, {
|
|
149
|
+
id: this.id,
|
|
150
|
+
collapsed: !attributes.collapsed
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
render(attributes = this.parsedAttributes, container = this) {
|
|
155
|
+
super.render(attributes, container);
|
|
156
|
+
this.drawCountShape(attributes, container);
|
|
157
|
+
this.drawIconArea(attributes, container);
|
|
158
|
+
this.drawCollapseShape(attributes, container);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
var IndentedNode = _IndentedNode;
|
|
162
|
+
IndentedNode.defaultStyleProps = {
|
|
163
|
+
ports: [
|
|
164
|
+
{ key: "in", placement: "right-bottom" },
|
|
165
|
+
{ key: "out", placement: "left-bottom" }
|
|
166
|
+
]
|
|
167
|
+
};
|
|
168
|
+
var IndentedEdge = class extends import_g6.Polyline {
|
|
169
|
+
getControlPoints(attributes) {
|
|
170
|
+
const [sourcePoint, targetPoint] = this.getEndpoints(attributes, false);
|
|
171
|
+
const [sx] = sourcePoint;
|
|
172
|
+
const [, ty] = targetPoint;
|
|
173
|
+
return [[sx, ty]];
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var CollapseExpandTree = class extends import_g6.BaseBehavior {
|
|
177
|
+
constructor(context, options) {
|
|
178
|
+
super(context, options);
|
|
179
|
+
this.status = "idle";
|
|
180
|
+
this.showIcon = (event) => {
|
|
181
|
+
this.setIcon(event, true);
|
|
182
|
+
};
|
|
183
|
+
this.hideIcon = (event) => {
|
|
184
|
+
this.setIcon(event, false);
|
|
185
|
+
};
|
|
186
|
+
this.setIcon = (event, show) => {
|
|
187
|
+
var _a;
|
|
188
|
+
if (this.status !== "idle")
|
|
189
|
+
return;
|
|
190
|
+
const { target } = event;
|
|
191
|
+
const id = target.id;
|
|
192
|
+
const { graph, element } = this.context;
|
|
193
|
+
graph.updateNodeData([{ id, style: { showIcon: show } }]);
|
|
194
|
+
(_a = element == null ? void 0 : element.draw) == null ? void 0 : _a.call(element, { animation: false, silence: true });
|
|
195
|
+
};
|
|
196
|
+
this.onCollapseExpand = async (event) => {
|
|
197
|
+
this.status = "busy";
|
|
198
|
+
const { id, collapsed } = event;
|
|
199
|
+
const { graph } = this.context;
|
|
200
|
+
if (collapsed)
|
|
201
|
+
await graph.collapseElement(id);
|
|
202
|
+
else
|
|
203
|
+
await graph.expandElement(id);
|
|
204
|
+
this.status = "idle";
|
|
205
|
+
};
|
|
206
|
+
// GPT-Vis 版本只保留官方的折叠/展开交互;新增子节点会引入额外数据模型管理,暂不启用。
|
|
207
|
+
this.addChild = () => {
|
|
208
|
+
};
|
|
209
|
+
this.bindEvents();
|
|
210
|
+
}
|
|
211
|
+
update(options) {
|
|
212
|
+
this.unbindEvents();
|
|
213
|
+
super.update(options);
|
|
214
|
+
this.bindEvents();
|
|
215
|
+
}
|
|
216
|
+
bindEvents() {
|
|
217
|
+
const { graph } = this.context;
|
|
218
|
+
graph.on(import_g6.NodeEvent.POINTER_ENTER, this.showIcon);
|
|
219
|
+
graph.on(import_g6.NodeEvent.POINTER_LEAVE, this.hideIcon);
|
|
220
|
+
graph.on(TreeEvent.COLLAPSE_EXPAND, this.onCollapseExpand);
|
|
221
|
+
graph.on(TreeEvent.ADD_CHILD, this.addChild);
|
|
222
|
+
}
|
|
223
|
+
unbindEvents() {
|
|
224
|
+
const { graph } = this.context;
|
|
225
|
+
graph.off(import_g6.NodeEvent.POINTER_ENTER, this.showIcon);
|
|
226
|
+
graph.off(import_g6.NodeEvent.POINTER_LEAVE, this.hideIcon);
|
|
227
|
+
graph.off(TreeEvent.COLLAPSE_EXPAND, this.onCollapseExpand);
|
|
228
|
+
graph.off(TreeEvent.ADD_CHILD, this.addChild);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
var GPT_VIS_INDENTED_NODE = "gpt-vis-indented";
|
|
232
|
+
var GPT_VIS_INDENTED_EDGE = "gpt-vis-indented-edge";
|
|
233
|
+
var GPT_VIS_COLLAPSE_BEHAVIOR = "gpt-vis-collapse-expand-tree";
|
|
234
|
+
var _extensionsRegistered = false;
|
|
235
|
+
function ensureExtensionsRegistered() {
|
|
236
|
+
if (_extensionsRegistered)
|
|
237
|
+
return;
|
|
238
|
+
(0, import_g6.register)(import_g6.ExtensionCategory.NODE, GPT_VIS_INDENTED_NODE, IndentedNode);
|
|
239
|
+
(0, import_g6.register)(import_g6.ExtensionCategory.EDGE, GPT_VIS_INDENTED_EDGE, IndentedEdge);
|
|
240
|
+
(0, import_g6.register)(import_g6.ExtensionCategory.BEHAVIOR, GPT_VIS_COLLAPSE_BEHAVIOR, CollapseExpandTree);
|
|
241
|
+
_extensionsRegistered = true;
|
|
242
|
+
}
|
|
243
|
+
var NODE_HEIGHT = 20;
|
|
244
|
+
function toG6TreeData(node) {
|
|
245
|
+
return {
|
|
246
|
+
id: node.name,
|
|
247
|
+
children: (node.children || []).map(toG6TreeData)
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
var IndentedTree = (options) => {
|
|
251
|
+
const { container, width, height, theme: chartTheme = "default" } = options;
|
|
252
|
+
let graph = null;
|
|
253
|
+
const render = (config) => {
|
|
254
|
+
const { data, theme = chartTheme, title, style = {}, direction = "LR" } = config;
|
|
255
|
+
if (!(data == null ? void 0 : data.name)) {
|
|
256
|
+
throw new Error("IndentedTree: data with a name field is required");
|
|
257
|
+
}
|
|
258
|
+
if (graph) {
|
|
259
|
+
graph.destroy();
|
|
260
|
+
graph = null;
|
|
261
|
+
}
|
|
262
|
+
const containerEl = typeof container === "string" ? document.querySelector(container) : container;
|
|
263
|
+
if (!containerEl)
|
|
264
|
+
throw new Error("IndentedTree: container element not found");
|
|
265
|
+
containerEl.innerHTML = "";
|
|
266
|
+
const backgroundColor = style.backgroundColor || (0, import_theme.getBackgroundColor)(theme);
|
|
267
|
+
const isDark = theme === "dark";
|
|
268
|
+
const palette = (0, import_theme.normalizePalette)(style.palette, theme);
|
|
269
|
+
containerEl.style.background = backgroundColor;
|
|
270
|
+
containerEl.style.borderRadius = "4px";
|
|
271
|
+
containerEl.style.overflow = "hidden";
|
|
272
|
+
ensureIconfontInjected();
|
|
273
|
+
ensureExtensionsRegistered();
|
|
274
|
+
const rootId = data.name;
|
|
275
|
+
const graphData = (0, import_g6.treeToGraphData)(toG6TreeData(data));
|
|
276
|
+
graph = new import_g6.Graph({
|
|
277
|
+
animation: false,
|
|
278
|
+
container: containerEl,
|
|
279
|
+
x: 60,
|
|
280
|
+
width,
|
|
281
|
+
height,
|
|
282
|
+
autoFit: "view",
|
|
283
|
+
autoResize: true,
|
|
284
|
+
padding: 20,
|
|
285
|
+
data: graphData,
|
|
286
|
+
node: {
|
|
287
|
+
type: GPT_VIS_INDENTED_NODE,
|
|
288
|
+
style: {
|
|
289
|
+
size: (d) => [measureTextWidth(String(d.id ?? ""), 12) + 6, NODE_HEIGHT],
|
|
290
|
+
labelBackground: (datum) => datum.id === rootId,
|
|
291
|
+
labelBackgroundRadius: 0,
|
|
292
|
+
labelBackgroundFill: palette[0] ?? "#1783FF",
|
|
293
|
+
labelFill: (datum) => datum.id === rootId ? "#fff" : isDark ? "#d0d0d0" : "#666",
|
|
294
|
+
labelText: (d) => {
|
|
295
|
+
var _a;
|
|
296
|
+
return ((_a = d.style) == null ? void 0 : _a.labelText) || d.id;
|
|
297
|
+
},
|
|
298
|
+
labelTextAlign: (datum) => datum.id === rootId ? "center" : "left",
|
|
299
|
+
labelTextBaseline: "top",
|
|
300
|
+
color: (datum) => {
|
|
301
|
+
try {
|
|
302
|
+
const depth = graph.getAncestorsData(datum.id, "tree").length - 1;
|
|
303
|
+
return palette[depth % palette.length] ?? palette[0] ?? "#1783FF";
|
|
304
|
+
} catch {
|
|
305
|
+
return palette[0] ?? "#1783FF";
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
state: {
|
|
310
|
+
selected: {
|
|
311
|
+
lineWidth: 0,
|
|
312
|
+
labelFill: "#40A8FF",
|
|
313
|
+
labelBackground: true,
|
|
314
|
+
labelFontWeight: "normal",
|
|
315
|
+
labelBackgroundFill: "#e8f7ff",
|
|
316
|
+
labelBackgroundRadius: 10
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
edge: {
|
|
321
|
+
type: GPT_VIS_INDENTED_EDGE,
|
|
322
|
+
style: {
|
|
323
|
+
radius: 16,
|
|
324
|
+
lineWidth: 2,
|
|
325
|
+
sourcePort: "out",
|
|
326
|
+
targetPort: "in",
|
|
327
|
+
stroke: (datum) => {
|
|
328
|
+
try {
|
|
329
|
+
if ((datum == null ? void 0 : datum.source) == null)
|
|
330
|
+
return palette[0] ?? "#1783FF";
|
|
331
|
+
const depth = graph.getAncestorsData(datum.source, "tree").length;
|
|
332
|
+
return palette[depth % palette.length] ?? palette[0] ?? "#1783FF";
|
|
333
|
+
} catch {
|
|
334
|
+
return palette[0] ?? "#1783FF";
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
layout: {
|
|
340
|
+
type: "indented",
|
|
341
|
+
direction,
|
|
342
|
+
isHorizontal: true,
|
|
343
|
+
indent: 40,
|
|
344
|
+
getHeight: () => NODE_HEIGHT,
|
|
345
|
+
getVGap: () => 10
|
|
346
|
+
},
|
|
347
|
+
behaviors: [
|
|
348
|
+
"drag-canvas",
|
|
349
|
+
GPT_VIS_COLLAPSE_BEHAVIOR,
|
|
350
|
+
{
|
|
351
|
+
type: "click-select",
|
|
352
|
+
enable: (event) => event.targetType === "node" && event.target.id !== rootId
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
plugins: title ? [{ key: "title", type: "title", title, titleFill: isDark ? "#e0e6ed" : "#1a1a2e" }] : []
|
|
356
|
+
});
|
|
357
|
+
graph.render();
|
|
358
|
+
};
|
|
359
|
+
const destroy = () => {
|
|
360
|
+
if (graph) {
|
|
361
|
+
graph.destroy();
|
|
362
|
+
graph = null;
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
return {
|
|
366
|
+
render,
|
|
367
|
+
destroy,
|
|
368
|
+
zoomTo: (zoom) => graph == null ? void 0 : graph.zoomTo(zoom),
|
|
369
|
+
getZoom: () => graph == null ? void 0 : graph.getZoom()
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
373
|
+
0 && (module.exports = {
|
|
374
|
+
IndentedTree
|
|
375
|
+
});
|
|
@@ -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;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/vis/line/index.ts
|
|
20
|
+
var line_exports = {};
|
|
21
|
+
__export(line_exports, {
|
|
22
|
+
Line: () => Line
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(line_exports);
|
|
25
|
+
var import_g2 = require("@antv/g2");
|
|
26
|
+
var import_theme = require("../../util/theme");
|
|
27
|
+
var Line = (options) => {
|
|
28
|
+
const { container, width, height, theme: chartTheme = "default" } = options;
|
|
29
|
+
let chart = null;
|
|
30
|
+
const render = (config) => {
|
|
31
|
+
var _a;
|
|
32
|
+
const { data = [], theme = chartTheme, title, axisXTitle, axisYTitle, style = {} } = config;
|
|
33
|
+
if (chart) {
|
|
34
|
+
chart.destroy();
|
|
35
|
+
}
|
|
36
|
+
const { lineWidth = 2 } = style;
|
|
37
|
+
const hasGroupField = data.length > 0 && ((_a = data[0]) == null ? void 0 : _a.group) !== void 0;
|
|
38
|
+
const colors = (0, import_theme.normalizePalette)(style.palette, theme);
|
|
39
|
+
const backgroundColor = style.backgroundColor || (0, import_theme.getBackgroundColor)(theme);
|
|
40
|
+
chart = new import_g2.Chart({
|
|
41
|
+
container,
|
|
42
|
+
width,
|
|
43
|
+
height,
|
|
44
|
+
autoFit: true
|
|
45
|
+
});
|
|
46
|
+
let encode = {};
|
|
47
|
+
const scaleConfig = { y: { nice: true } };
|
|
48
|
+
if (hasGroupField) {
|
|
49
|
+
encode = { x: "time", y: "value", color: "group" };
|
|
50
|
+
scaleConfig.color = { range: colors };
|
|
51
|
+
} else {
|
|
52
|
+
encode = { x: "time", y: "value" };
|
|
53
|
+
}
|
|
54
|
+
const chartOptions = {
|
|
55
|
+
animate: false,
|
|
56
|
+
type: "view",
|
|
57
|
+
data,
|
|
58
|
+
title: title ?? "",
|
|
59
|
+
encode,
|
|
60
|
+
children: [
|
|
61
|
+
{
|
|
62
|
+
type: "line",
|
|
63
|
+
style: {
|
|
64
|
+
lineWidth,
|
|
65
|
+
...!hasGroupField && style.palette ? { stroke: colors[0] } : {}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
scale: scaleConfig,
|
|
70
|
+
axis: {
|
|
71
|
+
x: { title: axisXTitle || false },
|
|
72
|
+
y: { title: axisYTitle || false }
|
|
73
|
+
},
|
|
74
|
+
legend: hasGroupField ? { color: { position: "top" } } : false,
|
|
75
|
+
tooltip: {
|
|
76
|
+
items: [
|
|
77
|
+
(d) => ({
|
|
78
|
+
name: axisYTitle || d.time,
|
|
79
|
+
value: d.value
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
viewStyle: {
|
|
84
|
+
viewFill: backgroundColor
|
|
85
|
+
},
|
|
86
|
+
theme: (0, import_theme.getThemeObject)(theme)
|
|
87
|
+
};
|
|
88
|
+
chart.options(chartOptions);
|
|
89
|
+
chart.render();
|
|
90
|
+
};
|
|
91
|
+
const destroy = () => {
|
|
92
|
+
if (chart) {
|
|
93
|
+
chart.destroy();
|
|
94
|
+
chart = null;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
return {
|
|
98
|
+
render,
|
|
99
|
+
destroy
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
+
0 && (module.exports = {
|
|
104
|
+
Line
|
|
105
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { VisualizationOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* LiquidConfig defines the configuration for rendering the liquid chart.
|
|
4
|
+
*/
|
|
5
|
+
export interface LiquidConfig {
|
|
6
|
+
type?: 'liquid';
|
|
7
|
+
percent: number;
|
|
8
|
+
shape?: 'rect' | 'circle' | 'pin' | 'triangle';
|
|
9
|
+
theme?: 'default' | 'academy' | 'dark';
|
|
10
|
+
title?: string;
|
|
11
|
+
style?: {
|
|
12
|
+
backgroundColor?: string;
|
|
13
|
+
palette?: string[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* LiquidInstance represents a liquid chart instance with render and destroy methods.
|
|
18
|
+
*/
|
|
19
|
+
export interface LiquidInstance {
|
|
20
|
+
render: (config: LiquidConfig) => void;
|
|
21
|
+
destroy: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Liquid chart component using G2 5.0.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const liquid = Liquid({
|
|
29
|
+
* container: '#container',
|
|
30
|
+
* width: 600,
|
|
31
|
+
* height: 400,
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* liquid.render({
|
|
35
|
+
* type: 'liquid',
|
|
36
|
+
* percent: 0.75,
|
|
37
|
+
* shape: 'circle',
|
|
38
|
+
* theme: 'academy'
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* liquid.destroy();
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const Liquid: (options: VisualizationOptions) => LiquidInstance;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/vis/liquid/index.ts
|
|
20
|
+
var liquid_exports = {};
|
|
21
|
+
__export(liquid_exports, {
|
|
22
|
+
Liquid: () => Liquid
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(liquid_exports);
|
|
25
|
+
var import_g2 = require("@antv/g2");
|
|
26
|
+
var import_theme = require("../../util/theme");
|
|
27
|
+
var DEFAULT_WIDTH = 640;
|
|
28
|
+
var DEFAULT_HEIGHT = 480;
|
|
29
|
+
var Liquid = (options) => {
|
|
30
|
+
const { container, width, height, theme: chartTheme = "default" } = options;
|
|
31
|
+
let chart = null;
|
|
32
|
+
const render = (config) => {
|
|
33
|
+
const { percent, shape = "circle", theme = chartTheme, title, style = {} } = config;
|
|
34
|
+
if (chart) {
|
|
35
|
+
chart.destroy();
|
|
36
|
+
}
|
|
37
|
+
const colors = (0, import_theme.normalizePalette)(style.palette, theme);
|
|
38
|
+
const backgroundColor = style.backgroundColor || (0, import_theme.getBackgroundColor)(theme);
|
|
39
|
+
const inferFontSize = Math.min(width ?? DEFAULT_WIDTH, height ?? DEFAULT_HEIGHT) / 10;
|
|
40
|
+
const fontSize = Math.min(Math.max(inferFontSize, 24), 64);
|
|
41
|
+
chart = new import_g2.Chart({
|
|
42
|
+
container,
|
|
43
|
+
width,
|
|
44
|
+
height,
|
|
45
|
+
autoFit: true
|
|
46
|
+
});
|
|
47
|
+
const chartOptions = {
|
|
48
|
+
animate: false,
|
|
49
|
+
type: "liquid",
|
|
50
|
+
data: percent,
|
|
51
|
+
title: title ?? "",
|
|
52
|
+
style: {
|
|
53
|
+
shape,
|
|
54
|
+
contentFontSize: fontSize,
|
|
55
|
+
contentFill: "#000",
|
|
56
|
+
contentStroke: "#fff",
|
|
57
|
+
contentLineWidth: 2,
|
|
58
|
+
outlineBorder: 4,
|
|
59
|
+
outlineDistance: 4,
|
|
60
|
+
waveLength: 128,
|
|
61
|
+
contentPointerEvents: "none",
|
|
62
|
+
// Use palette color if provided
|
|
63
|
+
...colors[0] ? { fill: colors[0], outlineStroke: colors[0] } : {}
|
|
64
|
+
},
|
|
65
|
+
viewStyle: {
|
|
66
|
+
viewFill: backgroundColor
|
|
67
|
+
},
|
|
68
|
+
theme: (0, import_theme.getThemeObject)(theme),
|
|
69
|
+
tooltip: false
|
|
70
|
+
};
|
|
71
|
+
chart.options(chartOptions);
|
|
72
|
+
chart.render();
|
|
73
|
+
};
|
|
74
|
+
const destroy = () => {
|
|
75
|
+
if (chart) {
|
|
76
|
+
chart.destroy();
|
|
77
|
+
chart = null;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
return {
|
|
81
|
+
render,
|
|
82
|
+
destroy
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
+
0 && (module.exports = {
|
|
87
|
+
Liquid
|
|
88
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TreeGraphData, VisualizationOptions } from '../../types';
|
|
2
|
+
export type MindmapData = TreeGraphData;
|
|
3
|
+
/**
|
|
4
|
+
* MindmapConfig defines the configuration for rendering the mindmap.
|
|
5
|
+
*/
|
|
6
|
+
export interface MindmapConfig {
|
|
7
|
+
type?: 'mindmap';
|
|
8
|
+
data: MindmapData;
|
|
9
|
+
direction?: 'H' | 'LR' | 'RL';
|
|
10
|
+
theme?: 'default' | 'academy' | 'dark';
|
|
11
|
+
title?: string;
|
|
12
|
+
style?: {
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
palette?: string[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* MindmapInstance represents a mindmap instance with render and destroy methods.
|
|
19
|
+
*/
|
|
20
|
+
export interface MindmapInstance {
|
|
21
|
+
render: (config: MindmapConfig) => void;
|
|
22
|
+
destroy: () => void;
|
|
23
|
+
zoomTo: (zoom: number) => void;
|
|
24
|
+
getZoom: () => number | undefined;
|
|
25
|
+
}
|
|
26
|
+
/** Props type for SSR package to import */
|
|
27
|
+
export type MindMapProps = Pick<MindmapConfig, 'data' | 'direction'>;
|
|
28
|
+
/**
|
|
29
|
+
* Mindmap component using G6 5.0 with mindmap layout.
|
|
30
|
+
* Follows the "boxed" type style from 0.x @ant-design/graphs MindMap.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Mindmap: (options: VisualizationOptions) => MindmapInstance;
|