@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,115 @@
|
|
|
1
|
+
import type { VisualizationOptions } from '../types';
|
|
2
|
+
import type { AreaConfig } from '../vis/area';
|
|
3
|
+
import type { BarConfig } from '../vis/bar';
|
|
4
|
+
import type { BoxplotConfig } from '../vis/boxplot';
|
|
5
|
+
import type { ColumnConfig } from '../vis/column';
|
|
6
|
+
import type { DualAxesConfig } from '../vis/dual-axes';
|
|
7
|
+
import type { FishboneDiagramConfig } from '../vis/fishbone-diagram';
|
|
8
|
+
import type { FlowDiagramConfig } from '../vis/flow-diagram';
|
|
9
|
+
import type { FunnelConfig } from '../vis/funnel';
|
|
10
|
+
import type { HistogramConfig } from '../vis/histogram';
|
|
11
|
+
import type { IndentedTreeConfig } from '../vis/indented-tree';
|
|
12
|
+
import type { LineConfig } from '../vis/line';
|
|
13
|
+
import type { LiquidConfig } from '../vis/liquid';
|
|
14
|
+
import type { MindmapConfig } from '../vis/mindmap';
|
|
15
|
+
import type { NetworkGraphConfig } from '../vis/network-graph';
|
|
16
|
+
import type { OrganizationChartConfig } from '../vis/organization-chart';
|
|
17
|
+
import type { PieConfig } from '../vis/pie';
|
|
18
|
+
import type { RadarConfig } from '../vis/radar';
|
|
19
|
+
import type { SankeyConfig } from '../vis/sankey';
|
|
20
|
+
import type { ScatterConfig } from '../vis/scatter';
|
|
21
|
+
import type { SummaryConfig } from '../vis/summary';
|
|
22
|
+
import type { TableConfig } from '../vis/table';
|
|
23
|
+
import type { TreemapConfig } from '../vis/treemap';
|
|
24
|
+
import type { VennConfig } from '../vis/venn';
|
|
25
|
+
import type { ViolinConfig } from '../vis/violin';
|
|
26
|
+
import type { WaterfallConfig } from '../vis/waterfall';
|
|
27
|
+
import type { WordCloudConfig } from '../vis/word-cloud';
|
|
28
|
+
/**
|
|
29
|
+
* Union type for all supported chart configurations
|
|
30
|
+
*/
|
|
31
|
+
export type GPTVisConfig = AreaConfig | BarConfig | BoxplotConfig | ColumnConfig | DualAxesConfig | FlowDiagramConfig | FunnelConfig | HistogramConfig | IndentedTreeConfig | LineConfig | LiquidConfig | MindmapConfig | NetworkGraphConfig | OrganizationChartConfig | PieConfig | RadarConfig | SankeyConfig | ScatterConfig | SummaryConfig | TableConfig | TreemapConfig | VennConfig | ViolinConfig | WaterfallConfig | WordCloudConfig | FishboneDiagramConfig;
|
|
32
|
+
/**
|
|
33
|
+
* GPTVis is the unified API for all chart types.
|
|
34
|
+
* It provides a simple interface to render different types of visualizations.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { GPTVis } from '@antv/gpt-vis';
|
|
39
|
+
*
|
|
40
|
+
* const g = new GPTVis({
|
|
41
|
+
* container: '#container',
|
|
42
|
+
* width: 600,
|
|
43
|
+
* height: 400,
|
|
44
|
+
* theme: 'academy', // Optional theme
|
|
45
|
+
* wrapper: true, // Enable wrapper with tabs and controls (default: false)
|
|
46
|
+
* });
|
|
47
|
+
*
|
|
48
|
+
* // Render with config object
|
|
49
|
+
* g.render({
|
|
50
|
+
* type: 'pie',
|
|
51
|
+
* data: [
|
|
52
|
+
* { category: '分类一', value: 27 },
|
|
53
|
+
* { category: '分类二', value: 25 },
|
|
54
|
+
* ],
|
|
55
|
+
* innerRadius: 0.6,
|
|
56
|
+
* });
|
|
57
|
+
*
|
|
58
|
+
* // Or render with syntax string
|
|
59
|
+
* g.render(`
|
|
60
|
+
* vis pie
|
|
61
|
+
* data
|
|
62
|
+
* - category 分类一
|
|
63
|
+
* value 27
|
|
64
|
+
* - category 分类二
|
|
65
|
+
* value 25
|
|
66
|
+
* innerRadius: 0.6
|
|
67
|
+
* `);
|
|
68
|
+
*
|
|
69
|
+
* g.destroy();
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare class GPTVis {
|
|
73
|
+
private options;
|
|
74
|
+
private currentChart;
|
|
75
|
+
private currentChartType;
|
|
76
|
+
private wrapperInstance;
|
|
77
|
+
/**
|
|
78
|
+
* Chart type registry mapping type strings to factory functions
|
|
79
|
+
*/
|
|
80
|
+
private static readonly chartRegistry;
|
|
81
|
+
/**
|
|
82
|
+
* Constructor
|
|
83
|
+
* @param options - Visualization options containing container, dimensions, and optional theme
|
|
84
|
+
*/
|
|
85
|
+
constructor(options: VisualizationOptions);
|
|
86
|
+
/**
|
|
87
|
+
* Render a chart based on the provided configuration or syntax string.
|
|
88
|
+
*
|
|
89
|
+
* @param config - Chart configuration object (with type field) or syntax string (starting with 'vis [type]')
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* // With config object
|
|
94
|
+
* g.render({
|
|
95
|
+
* type: 'pie',
|
|
96
|
+
* data: [{ category: 'A', value: 30 }, { category: 'B', value: 70 }]
|
|
97
|
+
* });
|
|
98
|
+
*
|
|
99
|
+
* // With syntax string
|
|
100
|
+
* g.render(`
|
|
101
|
+
* vis pie
|
|
102
|
+
* data
|
|
103
|
+
* - category A
|
|
104
|
+
* value 30
|
|
105
|
+
* - category B
|
|
106
|
+
* value 70
|
|
107
|
+
* `);
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
render(config: string | Record<string, unknown>): void;
|
|
111
|
+
/**
|
|
112
|
+
* Destroy the current chart instance and clean up resources
|
|
113
|
+
*/
|
|
114
|
+
destroy(): void;
|
|
115
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
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); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
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); }
|
|
10
|
+
import { isVisSyntax, parse } from "../syntax/parser";
|
|
11
|
+
import { resolveContainer } from "../util/container";
|
|
12
|
+
import { createVisWrapper } from "../vis-wrapper";
|
|
13
|
+
import { Area } from "../vis/area";
|
|
14
|
+
import { Bar } from "../vis/bar";
|
|
15
|
+
import { Boxplot } from "../vis/boxplot";
|
|
16
|
+
import { Column } from "../vis/column";
|
|
17
|
+
import { DualAxes } from "../vis/dual-axes";
|
|
18
|
+
import { FishboneDiagram } from "../vis/fishbone-diagram";
|
|
19
|
+
import { FlowDiagram } from "../vis/flow-diagram";
|
|
20
|
+
import { Funnel } from "../vis/funnel";
|
|
21
|
+
import { Histogram } from "../vis/histogram";
|
|
22
|
+
import { IndentedTree } from "../vis/indented-tree";
|
|
23
|
+
import { Line } from "../vis/line";
|
|
24
|
+
import { Liquid } from "../vis/liquid";
|
|
25
|
+
import { Mindmap } from "../vis/mindmap";
|
|
26
|
+
import { NetworkGraph } from "../vis/network-graph";
|
|
27
|
+
import { OrganizationChart } from "../vis/organization-chart";
|
|
28
|
+
import { Pie } from "../vis/pie";
|
|
29
|
+
import { Radar } from "../vis/radar";
|
|
30
|
+
import { Sankey } from "../vis/sankey";
|
|
31
|
+
import { Scatter } from "../vis/scatter";
|
|
32
|
+
import { Summary } from "../vis/summary";
|
|
33
|
+
import { Table } from "../vis/table";
|
|
34
|
+
import { Treemap } from "../vis/treemap";
|
|
35
|
+
import { Venn } from "../vis/venn";
|
|
36
|
+
import { Violin } from "../vis/violin";
|
|
37
|
+
import { Waterfall } from "../vis/waterfall";
|
|
38
|
+
import { WordCloud } from "../vis/word-cloud";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Union type for all supported chart configurations
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Union type for all chart instances
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* GPTVis is the unified API for all chart types.
|
|
50
|
+
* It provides a simple interface to render different types of visualizations.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* import { GPTVis } from '@antv/gpt-vis';
|
|
55
|
+
*
|
|
56
|
+
* const g = new GPTVis({
|
|
57
|
+
* container: '#container',
|
|
58
|
+
* width: 600,
|
|
59
|
+
* height: 400,
|
|
60
|
+
* theme: 'academy', // Optional theme
|
|
61
|
+
* wrapper: true, // Enable wrapper with tabs and controls (default: false)
|
|
62
|
+
* });
|
|
63
|
+
*
|
|
64
|
+
* // Render with config object
|
|
65
|
+
* g.render({
|
|
66
|
+
* type: 'pie',
|
|
67
|
+
* data: [
|
|
68
|
+
* { category: '分类一', value: 27 },
|
|
69
|
+
* { category: '分类二', value: 25 },
|
|
70
|
+
* ],
|
|
71
|
+
* innerRadius: 0.6,
|
|
72
|
+
* });
|
|
73
|
+
*
|
|
74
|
+
* // Or render with syntax string
|
|
75
|
+
* g.render(`
|
|
76
|
+
* vis pie
|
|
77
|
+
* data
|
|
78
|
+
* - category 分类一
|
|
79
|
+
* value 27
|
|
80
|
+
* - category 分类二
|
|
81
|
+
* value 25
|
|
82
|
+
* innerRadius: 0.6
|
|
83
|
+
* `);
|
|
84
|
+
*
|
|
85
|
+
* g.destroy();
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export var GPTVis = /*#__PURE__*/function () {
|
|
89
|
+
/**
|
|
90
|
+
* Constructor
|
|
91
|
+
* @param options - Visualization options containing container, dimensions, and optional theme
|
|
92
|
+
*/
|
|
93
|
+
function GPTVis(options) {
|
|
94
|
+
_classCallCheck(this, GPTVis);
|
|
95
|
+
_defineProperty(this, "options", void 0);
|
|
96
|
+
_defineProperty(this, "currentChart", null);
|
|
97
|
+
_defineProperty(this, "currentChartType", '');
|
|
98
|
+
_defineProperty(this, "wrapperInstance", null);
|
|
99
|
+
this.options = _objectSpread(_objectSpread({}, options), {}, {
|
|
100
|
+
container: resolveContainer(options.container)
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Render a chart based on the provided configuration or syntax string.
|
|
106
|
+
*
|
|
107
|
+
* @param config - Chart configuration object (with type field) or syntax string (starting with 'vis [type]')
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* // With config object
|
|
112
|
+
* g.render({
|
|
113
|
+
* type: 'pie',
|
|
114
|
+
* data: [{ category: 'A', value: 30 }, { category: 'B', value: 70 }]
|
|
115
|
+
* });
|
|
116
|
+
*
|
|
117
|
+
* // With syntax string
|
|
118
|
+
* g.render(`
|
|
119
|
+
* vis pie
|
|
120
|
+
* data
|
|
121
|
+
* - category A
|
|
122
|
+
* value 30
|
|
123
|
+
* - category B
|
|
124
|
+
* value 70
|
|
125
|
+
* `);
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
_createClass(GPTVis, [{
|
|
129
|
+
key: "render",
|
|
130
|
+
value: function render(config) {
|
|
131
|
+
var type = '';
|
|
132
|
+
var chartConfig;
|
|
133
|
+
// If config is a string, parse it as syntax
|
|
134
|
+
if (!isVisSyntax(config) && typeof config === 'string') {
|
|
135
|
+
// Parse the syntax string by `Summary` component directly
|
|
136
|
+
type = 'summary';
|
|
137
|
+
chartConfig = config;
|
|
138
|
+
} else {
|
|
139
|
+
// Otherwise, parse the config object or syntax string
|
|
140
|
+
chartConfig = typeof config === 'string' ? parse(config) : config;
|
|
141
|
+
type = chartConfig.type;
|
|
142
|
+
}
|
|
143
|
+
if (!type) {
|
|
144
|
+
throw new Error('Chart type is required. Please provide a "type" field in the config object or use syntax string starting with "vis [type]".');
|
|
145
|
+
}
|
|
146
|
+
if (!type) {
|
|
147
|
+
throw new Error('Chart type is required');
|
|
148
|
+
}
|
|
149
|
+
var chartFactory = GPTVis.chartRegistry[type];
|
|
150
|
+
if (!chartFactory) {
|
|
151
|
+
var availableTypes = Object.keys(GPTVis.chartRegistry).join(', ');
|
|
152
|
+
throw new Error("Unsupported chart type: \"".concat(type, "\". Available types: ").concat(availableTypes));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Create or reuse wrapper
|
|
156
|
+
var chartContainer = this.options.container;
|
|
157
|
+
if (this.options.wrapper) {
|
|
158
|
+
if (!this.wrapperInstance) {
|
|
159
|
+
this.wrapperInstance = createVisWrapper(this.options.container, {
|
|
160
|
+
chartType: type,
|
|
161
|
+
syntax: config,
|
|
162
|
+
locale: this.options.locale || 'zh-CN'
|
|
163
|
+
});
|
|
164
|
+
} else {
|
|
165
|
+
this.wrapperInstance.update(config);
|
|
166
|
+
}
|
|
167
|
+
chartContainer = this.wrapperInstance.chartContainer;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Reuse existing chart instance if the chart type hasn't changed
|
|
171
|
+
if (this.currentChart && this.currentChartType === type) {
|
|
172
|
+
this.currentChart.render(chartConfig);
|
|
173
|
+
} else {
|
|
174
|
+
// Destroy previous chart if type changed
|
|
175
|
+
if (this.currentChart) {
|
|
176
|
+
this.currentChart.destroy();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Create chart options with the appropriate container and theme
|
|
180
|
+
var chartOptions = _objectSpread(_objectSpread({}, this.options), {}, {
|
|
181
|
+
container: chartContainer
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
// Create new chart instance and render
|
|
185
|
+
this.currentChart = chartFactory(chartOptions);
|
|
186
|
+
this.currentChartType = type;
|
|
187
|
+
this.currentChart.render(chartConfig);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Set chart reference in wrapper if wrapper is enabled
|
|
191
|
+
if (this.wrapperInstance) {
|
|
192
|
+
this.wrapperInstance.setChartRef(this.currentChart);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Destroy the current chart instance and clean up resources
|
|
198
|
+
*/
|
|
199
|
+
}, {
|
|
200
|
+
key: "destroy",
|
|
201
|
+
value: function destroy() {
|
|
202
|
+
if (this.currentChart) {
|
|
203
|
+
this.currentChart.destroy();
|
|
204
|
+
this.currentChart = null;
|
|
205
|
+
this.currentChartType = '';
|
|
206
|
+
}
|
|
207
|
+
if (this.wrapperInstance) {
|
|
208
|
+
this.wrapperInstance.destroy();
|
|
209
|
+
this.wrapperInstance = null;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}]);
|
|
213
|
+
return GPTVis;
|
|
214
|
+
}();
|
|
215
|
+
/**
|
|
216
|
+
* Chart type registry mapping type strings to factory functions
|
|
217
|
+
*/
|
|
218
|
+
_defineProperty(GPTVis, "chartRegistry", {
|
|
219
|
+
area: Area,
|
|
220
|
+
bar: Bar,
|
|
221
|
+
boxplot: Boxplot,
|
|
222
|
+
column: Column,
|
|
223
|
+
'dual-axes': DualAxes,
|
|
224
|
+
'flow-diagram': FlowDiagram,
|
|
225
|
+
funnel: Funnel,
|
|
226
|
+
histogram: Histogram,
|
|
227
|
+
'indented-tree': IndentedTree,
|
|
228
|
+
line: Line,
|
|
229
|
+
liquid: Liquid,
|
|
230
|
+
mindmap: Mindmap,
|
|
231
|
+
'network-graph': NetworkGraph,
|
|
232
|
+
'organization-chart': OrganizationChart,
|
|
233
|
+
pie: Pie,
|
|
234
|
+
radar: Radar,
|
|
235
|
+
sankey: Sankey,
|
|
236
|
+
scatter: Scatter,
|
|
237
|
+
summary: Summary,
|
|
238
|
+
table: Table,
|
|
239
|
+
treemap: Treemap,
|
|
240
|
+
venn: Venn,
|
|
241
|
+
violin: Violin,
|
|
242
|
+
waterfall: Waterfall,
|
|
243
|
+
'word-cloud': WordCloud,
|
|
244
|
+
'fishbone-diagram': FishboneDiagram
|
|
245
|
+
});
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,13 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
export type {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
1
|
+
export { GPTVis } from './gpt-vis';
|
|
2
|
+
export type { GPTVisConfig } from './gpt-vis';
|
|
3
|
+
export { isVisSyntax, parse } from './syntax';
|
|
4
|
+
export type { ParsedConfig } from './syntax';
|
|
5
|
+
export type { VisualizationOptions } from './types';
|
|
6
|
+
export { Area } from './vis/area';
|
|
7
|
+
export type { AreaConfig, AreaDataItem } from './vis/area';
|
|
8
|
+
export { Bar } from './vis/bar';
|
|
9
|
+
export type { BarConfig, BarDataItem } from './vis/bar';
|
|
10
|
+
export { Boxplot } from './vis/boxplot';
|
|
11
|
+
export type { BoxplotConfig, BoxplotDataItem } from './vis/boxplot';
|
|
12
|
+
export { Column } from './vis/column';
|
|
13
|
+
export type { ColumnConfig, ColumnDataItem } from './vis/column';
|
|
14
|
+
export { DualAxes } from './vis/dual-axes';
|
|
15
|
+
export type { DualAxesConfig, DualAxesSeriesItem } from './vis/dual-axes';
|
|
16
|
+
export { FishboneDiagram } from './vis/fishbone-diagram';
|
|
17
|
+
export type { FishboneDiagramConfig, FishboneDiagramInstance, FishboneNode, } from './vis/fishbone-diagram';
|
|
18
|
+
export { FlowDiagram } from './vis/flow-diagram';
|
|
19
|
+
export type { FlowDiagramConfig } from './vis/flow-diagram';
|
|
20
|
+
export { Funnel } from './vis/funnel';
|
|
21
|
+
export type { FunnelConfig, FunnelDataItem } from './vis/funnel';
|
|
22
|
+
export { Histogram } from './vis/histogram';
|
|
23
|
+
export type { HistogramConfig } from './vis/histogram';
|
|
24
|
+
export { IndentedTree } from './vis/indented-tree';
|
|
25
|
+
export type { IndentedTreeConfig, IndentedTreeData, IndentedTreeInstance, } from './vis/indented-tree';
|
|
26
|
+
export { Line } from './vis/line';
|
|
27
|
+
export type { LineConfig, LineDataItem } from './vis/line';
|
|
28
|
+
export { Liquid } from './vis/liquid';
|
|
29
|
+
export type { LiquidConfig } from './vis/liquid';
|
|
30
|
+
export { Mindmap } from './vis/mindmap';
|
|
31
|
+
export type { MindMapProps, MindmapConfig, MindmapData } from './vis/mindmap';
|
|
32
|
+
export { NetworkGraph } from './vis/network-graph';
|
|
33
|
+
export type { NetworkGraphConfig, NetworkGraphData, NetworkGraphEdge, NetworkGraphNode, } from './vis/network-graph';
|
|
34
|
+
export { OrganizationChart } from './vis/organization-chart';
|
|
35
|
+
export type { OrganizationChartConfig, OrganizationChartData } from './vis/organization-chart';
|
|
36
|
+
export { Pie } from './vis/pie';
|
|
37
|
+
export type { PieConfig } from './vis/pie';
|
|
38
|
+
export { Radar } from './vis/radar';
|
|
39
|
+
export type { RadarConfig, RadarDataItem } from './vis/radar';
|
|
40
|
+
export { Sankey } from './vis/sankey';
|
|
41
|
+
export type { SankeyConfig, SankeyDataItem } from './vis/sankey';
|
|
42
|
+
export { Scatter } from './vis/scatter';
|
|
43
|
+
export type { ScatterConfig, ScatterDataItem } from './vis/scatter';
|
|
44
|
+
export { Summary } from './vis/summary';
|
|
45
|
+
export type { SummaryConfig } from './vis/summary';
|
|
46
|
+
export { Table } from './vis/table';
|
|
47
|
+
export type { TableConfig } from './vis/table';
|
|
48
|
+
export { Treemap } from './vis/treemap';
|
|
49
|
+
export type { TreemapConfig, TreemapDataItem } from './vis/treemap';
|
|
50
|
+
export { Venn } from './vis/venn';
|
|
51
|
+
export type { VennConfig, VennDataItem } from './vis/venn';
|
|
52
|
+
export { Violin } from './vis/violin';
|
|
53
|
+
export type { ViolinConfig, ViolinDataItem } from './vis/violin';
|
|
54
|
+
export { Waterfall } from './vis/waterfall';
|
|
55
|
+
export type { WaterfallConfig, WaterfallDataItem } from './vis/waterfall';
|
|
56
|
+
export { WordCloud } from './vis/word-cloud';
|
|
57
|
+
export type { WordCloudConfig, WordCloudDataItem } from './vis/word-cloud';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
1
|
+
export { GPTVis } from "./gpt-vis";
|
|
2
|
+
export { isVisSyntax, parse } from "./syntax";
|
|
3
|
+
export { Area } from "./vis/area";
|
|
4
|
+
export { Bar } from "./vis/bar";
|
|
5
|
+
export { Boxplot } from "./vis/boxplot";
|
|
6
|
+
export { Column } from "./vis/column";
|
|
7
|
+
export { DualAxes } from "./vis/dual-axes";
|
|
8
|
+
export { FishboneDiagram } from "./vis/fishbone-diagram";
|
|
9
|
+
export { FlowDiagram } from "./vis/flow-diagram";
|
|
10
|
+
export { Funnel } from "./vis/funnel";
|
|
11
|
+
export { Histogram } from "./vis/histogram";
|
|
12
|
+
export { IndentedTree } from "./vis/indented-tree";
|
|
13
|
+
export { Line } from "./vis/line";
|
|
14
|
+
export { Liquid } from "./vis/liquid";
|
|
15
|
+
export { Mindmap } from "./vis/mindmap";
|
|
16
|
+
export { NetworkGraph } from "./vis/network-graph";
|
|
17
|
+
export { OrganizationChart } from "./vis/organization-chart";
|
|
18
|
+
export { Pie } from "./vis/pie";
|
|
19
|
+
export { Radar } from "./vis/radar";
|
|
20
|
+
export { Sankey } from "./vis/sankey";
|
|
21
|
+
export { Scatter } from "./vis/scatter";
|
|
22
|
+
export { Summary } from "./vis/summary";
|
|
23
|
+
export { Table } from "./vis/table";
|
|
24
|
+
export { Treemap } from "./vis/treemap";
|
|
25
|
+
export { Venn } from "./vis/venn";
|
|
26
|
+
export { Violin } from "./vis/violin";
|
|
27
|
+
export { Waterfall } from "./vis/waterfall";
|
|
28
|
+
export { WordCloud } from "./vis/word-cloud";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isVisSyntax, parse } from "./parser";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GPT-Vis Syntax Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses a markdown-like syntax for visualization configurations.
|
|
5
|
+
*
|
|
6
|
+
* Syntax rules:
|
|
7
|
+
* - `vis [chartType]` - Defines the chart type (required first line)
|
|
8
|
+
* - `data` - Starts a data array section
|
|
9
|
+
* - ` - key value` - Array item with key-value pairs
|
|
10
|
+
* - ` - value` - Simple array item (for flat arrays like histogram data)
|
|
11
|
+
* - ` - "value with spaces"` - Quoted string item; single or double quotes both supported.
|
|
12
|
+
* Quotes are required when the value contains spaces; optional otherwise.
|
|
13
|
+
* Quoted values are never coerced to numbers or booleans.
|
|
14
|
+
* - `key: value` or `key value` - Top-level key-value pair
|
|
15
|
+
* - `style` - Starts a style object section
|
|
16
|
+
* - `palette` inside `style` uses array syntax with dash-prefixed items
|
|
17
|
+
* - `children` - Nested array for hierarchical data (mind-map, treemap, etc.)
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```
|
|
21
|
+
* vis pie
|
|
22
|
+
* data
|
|
23
|
+
* - category 分类一
|
|
24
|
+
* value 27
|
|
25
|
+
* - category 分类二
|
|
26
|
+
* value 25
|
|
27
|
+
* innerRadius: 0.6
|
|
28
|
+
* style
|
|
29
|
+
* backgroundColor #333
|
|
30
|
+
* palette
|
|
31
|
+
* - #ff5a5f
|
|
32
|
+
* - #1fb6ff
|
|
33
|
+
* - #13ce66
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example Simple array (histogram)
|
|
37
|
+
* ```
|
|
38
|
+
* vis histogram
|
|
39
|
+
* data
|
|
40
|
+
* - 78
|
|
41
|
+
* - 88
|
|
42
|
+
* - 60
|
|
43
|
+
* binNumber 5
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example Quoted string values (values containing spaces)
|
|
47
|
+
* ```
|
|
48
|
+
* vis dual-axes
|
|
49
|
+
* categories
|
|
50
|
+
* - "North America"
|
|
51
|
+
* - '东南 亚'
|
|
52
|
+
* - 欧洲
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example Hierarchical data (mind-map)
|
|
56
|
+
* ```
|
|
57
|
+
* vis mind-map
|
|
58
|
+
* data
|
|
59
|
+
* - name 项目计划
|
|
60
|
+
* children
|
|
61
|
+
* - name 研究阶段
|
|
62
|
+
* children
|
|
63
|
+
* - name 市场调研
|
|
64
|
+
* - name 技术可行性分析
|
|
65
|
+
* - name 开发阶段
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
/**
|
|
69
|
+
* Parsed chart configuration result
|
|
70
|
+
*/
|
|
71
|
+
export interface ParsedConfig {
|
|
72
|
+
type: string;
|
|
73
|
+
[key: string]: unknown;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Parse the visualization syntax string into a configuration object
|
|
77
|
+
*/
|
|
78
|
+
export declare function parse(syntax: string): ParsedConfig;
|
|
79
|
+
/**
|
|
80
|
+
* Check if a val is a valid visualization syntax
|
|
81
|
+
*/
|
|
82
|
+
export declare function isVisSyntax(input: any): boolean;
|