@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
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/ChartCodeRender/Loading.tsx
|
|
30
|
-
var Loading_exports = {};
|
|
31
|
-
__export(Loading_exports, {
|
|
32
|
-
default: () => Loading_default
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(Loading_exports);
|
|
35
|
-
var import_icons = require("@ant-design/icons");
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
38
|
-
var StyledLoading = import_styled_components.default.div`
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
height: 300px;
|
|
44
|
-
background-image: linear-gradient(135deg, #e3f3ff 0%, #f1eeff 100%);
|
|
45
|
-
color: rgba(0, 0, 0, 88%);
|
|
46
|
-
|
|
47
|
-
&-icon {
|
|
48
|
-
margin-bottom: 6px;
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
var Loading = ({ text }) => {
|
|
52
|
-
return /* @__PURE__ */ import_react.default.createElement(StyledLoading, { className: "gpt-vis-loading" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "gpt-vis-loading-icon" }, /* @__PURE__ */ import_react.default.createElement(import_icons.LoadingOutlined, { style: { fontSize: "24px", color: "rgb(56, 177, 246)" } })), /* @__PURE__ */ import_react.default.createElement("p", null, text));
|
|
53
|
-
};
|
|
54
|
-
var Loading_default = Loading;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ChartComponents, ComponentErrorRender, ErrorRender, TextLabels } from './type';
|
|
3
|
-
type RenderVisChartProps = {
|
|
4
|
-
content: string;
|
|
5
|
-
components: ChartComponents;
|
|
6
|
-
debug?: boolean;
|
|
7
|
-
loadingTimeout: number;
|
|
8
|
-
style?: React.CSSProperties;
|
|
9
|
-
componentErrorRender?: (errorInfo: ComponentErrorRender) => React.ReactElement;
|
|
10
|
-
errorRender?: (errorInfo: ErrorRender) => React.ReactElement;
|
|
11
|
-
showTabs?: boolean;
|
|
12
|
-
showCodeTab?: boolean;
|
|
13
|
-
showChartTab?: boolean;
|
|
14
|
-
defaultTab?: 'chart' | 'code';
|
|
15
|
-
textLabels?: TextLabels;
|
|
16
|
-
locale?: string;
|
|
17
|
-
};
|
|
18
|
-
export declare const RenderVisChart: React.FC<RenderVisChartProps>;
|
|
19
|
-
export {};
|
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/ChartCodeRender/VisChart.tsx
|
|
30
|
-
var VisChart_exports = {};
|
|
31
|
-
__export(VisChart_exports, {
|
|
32
|
-
RenderVisChart: () => RenderVisChart
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(VisChart_exports);
|
|
35
|
-
var import_snapdom = require("@zumer/snapdom");
|
|
36
|
-
var import_lodash = require("lodash");
|
|
37
|
-
var import_rc_resize_observer = __toESM(require("rc-resize-observer"));
|
|
38
|
-
var import_react = __toESM(require("react"));
|
|
39
|
-
var import_react_error_boundary = require("react-error-boundary");
|
|
40
|
-
var import_react_syntax_highlighter = require("react-syntax-highlighter");
|
|
41
|
-
var import_json = __toESM(require("react-syntax-highlighter/dist/esm/languages/hljs/json"));
|
|
42
|
-
var import_hljs = require("react-syntax-highlighter/dist/esm/styles/hljs");
|
|
43
|
-
var import_icon = require("./icon");
|
|
44
|
-
var import_Loading = __toESM(require("./Loading"));
|
|
45
|
-
var import_styles = require("./styles");
|
|
46
|
-
var import_utils = require("./utils");
|
|
47
|
-
import_react_syntax_highlighter.Light.registerLanguage("json", import_json.default);
|
|
48
|
-
var G6List = [
|
|
49
|
-
"mind-map",
|
|
50
|
-
"fishbone-diagram",
|
|
51
|
-
"flow-diagram",
|
|
52
|
-
"organization-chart",
|
|
53
|
-
"network-graph",
|
|
54
|
-
"indented-tree"
|
|
55
|
-
];
|
|
56
|
-
var DEFAULT_LABELS = {
|
|
57
|
-
"zh-CN": {
|
|
58
|
-
chartTab: "图表",
|
|
59
|
-
codeTab: "代码",
|
|
60
|
-
download: "下载",
|
|
61
|
-
copy: "复制",
|
|
62
|
-
copied: "完成",
|
|
63
|
-
renderError: "图表渲染失败",
|
|
64
|
-
parseError: "GPT-Vis parse content error!",
|
|
65
|
-
unsupportedChart: "Chart type not supported",
|
|
66
|
-
loading: "数据生成中"
|
|
67
|
-
},
|
|
68
|
-
"en-US": {
|
|
69
|
-
chartTab: "Chart",
|
|
70
|
-
codeTab: "Code",
|
|
71
|
-
download: "Download",
|
|
72
|
-
copy: "Copy",
|
|
73
|
-
copied: "Copied",
|
|
74
|
-
renderError: "Chart render failed",
|
|
75
|
-
parseError: "Parse content error!",
|
|
76
|
-
unsupportedChart: "Chart type not supported",
|
|
77
|
-
loading: "Generating data"
|
|
78
|
-
},
|
|
79
|
-
"pt-BR": {
|
|
80
|
-
chartTab: "Gráfico",
|
|
81
|
-
codeTab: "Código",
|
|
82
|
-
download: "Baixar",
|
|
83
|
-
copy: "Copiar",
|
|
84
|
-
copied: "Copiado",
|
|
85
|
-
renderError: "Erro ao renderizar gráfico",
|
|
86
|
-
parseError: "Erro ao analisar conteúdo!",
|
|
87
|
-
unsupportedChart: "Tipo de gráfico não suportado",
|
|
88
|
-
loading: "Gerando dados"
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
var RenderVisChart = (0, import_react.memo)(
|
|
92
|
-
({
|
|
93
|
-
style,
|
|
94
|
-
content,
|
|
95
|
-
components,
|
|
96
|
-
debug = false,
|
|
97
|
-
loadingTimeout,
|
|
98
|
-
componentErrorRender,
|
|
99
|
-
errorRender,
|
|
100
|
-
showTabs = true,
|
|
101
|
-
showCodeTab = true,
|
|
102
|
-
showChartTab = true,
|
|
103
|
-
defaultTab = "chart",
|
|
104
|
-
textLabels = {},
|
|
105
|
-
locale = "zh-CN"
|
|
106
|
-
}) => {
|
|
107
|
-
const timeoutRef = (0, import_react.useRef)();
|
|
108
|
-
const copyTimeoutRef = (0, import_react.useRef)();
|
|
109
|
-
const [loading, setLoading] = (0, import_react.useState)(true);
|
|
110
|
-
const [hasRenderError, setHasRenderError] = (0, import_react.useState)(false);
|
|
111
|
-
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
112
|
-
const chartRef = (0, import_react.useRef)(null);
|
|
113
|
-
const chartContainerRef = (0, import_react.useRef)(null);
|
|
114
|
-
const labels = {
|
|
115
|
-
...DEFAULT_LABELS[locale] || DEFAULT_LABELS["en-US"],
|
|
116
|
-
...textLabels
|
|
117
|
-
};
|
|
118
|
-
const getValidDefaultTab = () => {
|
|
119
|
-
if (defaultTab === "chart" && showChartTab)
|
|
120
|
-
return "chart";
|
|
121
|
-
if (defaultTab === "code" && showCodeTab)
|
|
122
|
-
return "code";
|
|
123
|
-
if (showChartTab)
|
|
124
|
-
return "chart";
|
|
125
|
-
if (showCodeTab)
|
|
126
|
-
return "code";
|
|
127
|
-
return "chart";
|
|
128
|
-
};
|
|
129
|
-
const [activeTab, setActiveTab] = (0, import_react.useState)(getValidDefaultTab());
|
|
130
|
-
let chartJson = null;
|
|
131
|
-
let parseError = null;
|
|
132
|
-
let type;
|
|
133
|
-
try {
|
|
134
|
-
chartJson = JSON.parse(content);
|
|
135
|
-
type = chartJson == null ? void 0 : chartJson.type;
|
|
136
|
-
} catch (e) {
|
|
137
|
-
parseError = e;
|
|
138
|
-
}
|
|
139
|
-
const isG6 = type ? G6List.includes(type) : false;
|
|
140
|
-
const handleResize = (0, import_react.useMemo)(() => {
|
|
141
|
-
const debouncedFn = (0, import_lodash.debounce)(() => {
|
|
142
|
-
var _a, _b, _c;
|
|
143
|
-
const chart = chartRef.current;
|
|
144
|
-
const container = chartContainerRef.current;
|
|
145
|
-
if (!chart || !container || !(container instanceof HTMLElement)) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
try {
|
|
149
|
-
if (isG6) {
|
|
150
|
-
(_a = chart.resize) == null ? void 0 : _a.call(chart);
|
|
151
|
-
(_b = chart.autoFit) == null ? void 0 : _b.call(chart);
|
|
152
|
-
} else {
|
|
153
|
-
(_c = chart.changeSize) == null ? void 0 : _c.call(chart);
|
|
154
|
-
}
|
|
155
|
-
} catch (error) {
|
|
156
|
-
console.error("Failed to resize chart:", error);
|
|
157
|
-
}
|
|
158
|
-
}, 150);
|
|
159
|
-
return debouncedFn;
|
|
160
|
-
}, [isG6]);
|
|
161
|
-
if (parseError) {
|
|
162
|
-
if (timeoutRef.current) {
|
|
163
|
-
clearTimeout(timeoutRef.current);
|
|
164
|
-
if (debug) {
|
|
165
|
-
console.warn("GPT-Vis parse content timeout!");
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
timeoutRef.current = setTimeout(() => {
|
|
169
|
-
setLoading(false);
|
|
170
|
-
}, loadingTimeout);
|
|
171
|
-
if (loading) {
|
|
172
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledGPTVis, { className: "gpt-vis", style }, /* @__PURE__ */ import_react.default.createElement(import_Loading.default, { text: labels.loading || "" }));
|
|
173
|
-
}
|
|
174
|
-
if (errorRender) {
|
|
175
|
-
return errorRender({
|
|
176
|
-
error: parseError,
|
|
177
|
-
content
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
return /* @__PURE__ */ import_react.default.createElement("div", null, labels.parseError);
|
|
181
|
-
}
|
|
182
|
-
const { type: chartType, ...chartProps } = chartJson;
|
|
183
|
-
const ChartComponent = components[chartType];
|
|
184
|
-
if (debug) {
|
|
185
|
-
console.log("GPT-Vis withChartCode get chartJson parse from vis-chart code block", chartJson);
|
|
186
|
-
}
|
|
187
|
-
if (!ChartComponent) {
|
|
188
|
-
const message = `${labels.unsupportedChart}: "${chartType}"`;
|
|
189
|
-
if (errorRender) {
|
|
190
|
-
return errorRender({
|
|
191
|
-
error: new Error(message),
|
|
192
|
-
content
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
return /* @__PURE__ */ import_react.default.createElement("div", null, message);
|
|
196
|
-
}
|
|
197
|
-
const FallbackComponent = ({ error }) => {
|
|
198
|
-
if (!hasRenderError) {
|
|
199
|
-
setHasRenderError(true);
|
|
200
|
-
if (showCodeTab && showTabs) {
|
|
201
|
-
setActiveTab("code");
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
if (componentErrorRender) {
|
|
205
|
-
return componentErrorRender({
|
|
206
|
-
error,
|
|
207
|
-
content
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_styles.ErrorMessage, null, labels.renderError));
|
|
211
|
-
};
|
|
212
|
-
const handleCopy = async () => {
|
|
213
|
-
try {
|
|
214
|
-
await (0, import_utils.handleCopyCode)(chartJson);
|
|
215
|
-
setCopied(true);
|
|
216
|
-
if (copyTimeoutRef.current) {
|
|
217
|
-
clearTimeout(copyTimeoutRef.current);
|
|
218
|
-
}
|
|
219
|
-
copyTimeoutRef.current = setTimeout(() => {
|
|
220
|
-
setCopied(false);
|
|
221
|
-
}, 1e3);
|
|
222
|
-
} catch (error) {
|
|
223
|
-
console.error("Copy failed:", error);
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
const handleDownload = async () => {
|
|
227
|
-
try {
|
|
228
|
-
if (chartContainerRef.current) {
|
|
229
|
-
const result = await (0, import_snapdom.snapdom)(chartContainerRef.current, { scale: 2 });
|
|
230
|
-
await result.download({
|
|
231
|
-
format: "png",
|
|
232
|
-
filename: `chart-${chartType}-${Date.now()}`
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
} catch (error) {
|
|
236
|
-
console.error("Download image failed:", error);
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
const handleZoomOut = () => {
|
|
240
|
-
if (chartRef.current && typeof chartRef.current.zoomTo === "function") {
|
|
241
|
-
const currentZoom = chartRef.current.getZoom() || 1;
|
|
242
|
-
const newZoom = Math.min(currentZoom * 1.15, 1.5);
|
|
243
|
-
chartRef.current.zoomTo(newZoom);
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
const handleZoomIn = () => {
|
|
247
|
-
if (chartRef.current && typeof chartRef.current.zoomTo === "function") {
|
|
248
|
-
const currentZoom = chartRef.current.getZoom() || 1;
|
|
249
|
-
const newZoom = Math.max(currentZoom / 1.15, 0.1);
|
|
250
|
-
chartRef.current.zoomTo(newZoom);
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
if (!showTabs) {
|
|
254
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledGPTVis, { className: "gpt-vis", style }, /* @__PURE__ */ import_react.default.createElement(import_styles.GlobalStyles, null), /* @__PURE__ */ import_react.default.createElement(import_rc_resize_observer.default, { onResize: handleResize }, /* @__PURE__ */ import_react.default.createElement(import_styles.ChartWrapper, { ref: chartContainerRef }, /* @__PURE__ */ import_react.default.createElement(
|
|
255
|
-
import_react_error_boundary.ErrorBoundary,
|
|
256
|
-
{
|
|
257
|
-
FallbackComponent,
|
|
258
|
-
onError: (error, errorInfo) => {
|
|
259
|
-
console.error("GPT-Vis Render error:", error);
|
|
260
|
-
if (debug) {
|
|
261
|
-
console.error("GPT-Vis Render error info:", errorInfo);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
266
|
-
ChartComponent,
|
|
267
|
-
{
|
|
268
|
-
...chartProps,
|
|
269
|
-
onReady: (chart) => {
|
|
270
|
-
chartRef.current = chart;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
)
|
|
274
|
-
))));
|
|
275
|
-
}
|
|
276
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styles.TabContainer, { style }, /* @__PURE__ */ import_react.default.createElement(import_styles.TabHeader, null, /* @__PURE__ */ import_react.default.createElement(import_styles.TabLeftGroup, null, showChartTab && /* @__PURE__ */ import_react.default.createElement(import_styles.StyledTabButton, { active: activeTab === "chart", onClick: () => setActiveTab("chart") }, labels.chartTab), showCodeTab && /* @__PURE__ */ import_react.default.createElement(import_styles.StyledTabButton, { active: activeTab === "code", onClick: () => setActiveTab("code") }, labels.codeTab)), /* @__PURE__ */ import_react.default.createElement(import_styles.TabRightGroup, null, activeTab === "chart" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, isG6 && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
277
|
-
import_styles.TextButton,
|
|
278
|
-
{
|
|
279
|
-
onClick: handleZoomIn,
|
|
280
|
-
style: { width: "24px", height: "24px", padding: 0 }
|
|
281
|
-
},
|
|
282
|
-
/* @__PURE__ */ import_react.default.createElement(import_icon.ZoomIn, { size: 18 })
|
|
283
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
284
|
-
import_styles.TextButton,
|
|
285
|
-
{
|
|
286
|
-
onClick: handleZoomOut,
|
|
287
|
-
style: { width: "24px", height: "24px", padding: 0 }
|
|
288
|
-
},
|
|
289
|
-
/* @__PURE__ */ import_react.default.createElement(import_icon.ZoomOut, { size: 18 })
|
|
290
|
-
), /* @__PURE__ */ import_react.default.createElement(import_styles.Divider, null)), /* @__PURE__ */ import_react.default.createElement(import_styles.TextButton, { onClick: handleDownload }, /* @__PURE__ */ import_react.default.createElement(import_icon.DownLoad, { size: 16 }), labels.download)) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_styles.TextButton, { onClick: handleCopy }, copied ? /* @__PURE__ */ import_react.default.createElement(import_icon.Check, null) : /* @__PURE__ */ import_react.default.createElement(import_icon.Copy, null), copied ? labels.copied : labels.copy)))), /* @__PURE__ */ import_react.default.createElement(import_styles.TabContent, null, activeTab === "chart" ? /* @__PURE__ */ import_react.default.createElement(
|
|
291
|
-
import_react_error_boundary.ErrorBoundary,
|
|
292
|
-
{
|
|
293
|
-
FallbackComponent,
|
|
294
|
-
onError: (error, errorInfo) => {
|
|
295
|
-
console.error("GPT-Vis Render error:", error);
|
|
296
|
-
if (!hasRenderError) {
|
|
297
|
-
setHasRenderError(true);
|
|
298
|
-
if (showCodeTab) {
|
|
299
|
-
setActiveTab("code");
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
if (debug) {
|
|
303
|
-
console.error("GPT-Vis Render error info:", errorInfo);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
/* @__PURE__ */ import_react.default.createElement(import_styles.StyledGPTVis, { className: "gpt-vis", type: chartType }, /* @__PURE__ */ import_react.default.createElement(import_styles.GlobalStyles, null), /* @__PURE__ */ import_react.default.createElement(import_rc_resize_observer.default, { onResize: handleResize }, /* @__PURE__ */ import_react.default.createElement(import_styles.ChartWrapper, { ref: chartContainerRef }, /* @__PURE__ */ import_react.default.createElement(
|
|
308
|
-
ChartComponent,
|
|
309
|
-
{
|
|
310
|
-
...chartProps,
|
|
311
|
-
onReady: (chart) => {
|
|
312
|
-
chartRef.current = chart;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
))))
|
|
316
|
-
) : /* @__PURE__ */ import_react.default.createElement("div", { style: { maxHeight: 500, overflow: "auto" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
317
|
-
import_react_syntax_highlighter.Light,
|
|
318
|
-
{
|
|
319
|
-
language: "json",
|
|
320
|
-
style: import_hljs.magula,
|
|
321
|
-
showLineNumbers: false,
|
|
322
|
-
wrapLines: true,
|
|
323
|
-
customStyle: {
|
|
324
|
-
background: "transparent",
|
|
325
|
-
padding: "16px",
|
|
326
|
-
margin: 0,
|
|
327
|
-
fontSize: "12px",
|
|
328
|
-
lineHeight: "1"
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
JSON.stringify(chartJson, null, 2) || content
|
|
332
|
-
))));
|
|
333
|
-
}
|
|
334
|
-
);
|
|
335
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
336
|
-
0 && (module.exports = {
|
|
337
|
-
RenderVisChart
|
|
338
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props extends React.SVGProps<SVGSVGElement> {
|
|
3
|
-
size?: number;
|
|
4
|
-
}
|
|
5
|
-
export declare const Copy: React.FC<Props>;
|
|
6
|
-
export declare const ZoomOut: React.FC<Props>;
|
|
7
|
-
export declare const ZoomIn: React.FC<Props>;
|
|
8
|
-
export declare const Check: React.FC<Props>;
|
|
9
|
-
export declare const DownLoad: React.FC<Props>;
|
|
10
|
-
export {};
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/ChartCodeRender/icon.tsx
|
|
30
|
-
var icon_exports = {};
|
|
31
|
-
__export(icon_exports, {
|
|
32
|
-
Check: () => Check,
|
|
33
|
-
Copy: () => Copy,
|
|
34
|
-
DownLoad: () => DownLoad,
|
|
35
|
-
ZoomIn: () => ZoomIn,
|
|
36
|
-
ZoomOut: () => ZoomOut
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(icon_exports);
|
|
39
|
-
var import_react = __toESM(require("react"));
|
|
40
|
-
var Copy = ({ size = 14, fill = "#707070" }) => /* @__PURE__ */ import_react.default.createElement(
|
|
41
|
-
"svg",
|
|
42
|
-
{
|
|
43
|
-
viewBox: "0 0 1024 1024",
|
|
44
|
-
version: "1.1",
|
|
45
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
-
"p-id": "5503",
|
|
47
|
-
width: size,
|
|
48
|
-
height: size,
|
|
49
|
-
fill
|
|
50
|
-
},
|
|
51
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
52
|
-
"path",
|
|
53
|
-
{
|
|
54
|
-
d: "M768 682.666667V170.666667a85.333333 85.333333 0 0 0-85.333333-85.333334H170.666667a85.333333 85.333333 0 0 0-85.333334 85.333334v512a85.333333 85.333333 0 0 0 85.333334 85.333333h512a85.333333 85.333333 0 0 0 85.333333-85.333333zM170.666667 170.666667h512v512H170.666667z m682.666666 85.333333v512a85.333333 85.333333 0 0 1-85.333333 85.333333H256a85.333333 85.333333 0 0 0 85.333333 85.333334h426.666667a170.666667 170.666667 0 0 0 170.666667-170.666667V341.333333a85.333333 85.333333 0 0 0-85.333334-85.333333z",
|
|
55
|
-
"p-id": "5504"
|
|
56
|
-
}
|
|
57
|
-
)
|
|
58
|
-
);
|
|
59
|
-
var ZoomOut = ({ size = 14, fill = "#707070" }) => /* @__PURE__ */ import_react.default.createElement(
|
|
60
|
-
"svg",
|
|
61
|
-
{
|
|
62
|
-
viewBox: "0 0 1024 1024",
|
|
63
|
-
version: "1.1",
|
|
64
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
65
|
-
"p-id": "5664",
|
|
66
|
-
width: size,
|
|
67
|
-
height: size,
|
|
68
|
-
fill
|
|
69
|
-
},
|
|
70
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
71
|
-
"path",
|
|
72
|
-
{
|
|
73
|
-
d: "M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z",
|
|
74
|
-
fill: "#231815",
|
|
75
|
-
"p-id": "5665"
|
|
76
|
-
}
|
|
77
|
-
),
|
|
78
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
79
|
-
"path",
|
|
80
|
-
{
|
|
81
|
-
d: "M555 418.3h-99.8v-99.8c0-14-11.4-25.4-25.4-25.4s-25.4 11.4-25.4 25.4v99.8h-99.8c-14 0-25.4 11.4-25.4 25.4s11.4 25.4 25.4 25.4h99.8v99.8c0 14 11.4 25.4 25.4 25.4s25.4-11.4 25.4-25.4v-99.8H555c14 0 25.4-11.4 25.4-25.4S569 418.3 555 418.3z",
|
|
82
|
-
fill: "#231815",
|
|
83
|
-
"p-id": "5666"
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
);
|
|
87
|
-
var ZoomIn = ({ size = 14, fill = "#707070" }) => /* @__PURE__ */ import_react.default.createElement(
|
|
88
|
-
"svg",
|
|
89
|
-
{
|
|
90
|
-
viewBox: "0 0 1024 1024",
|
|
91
|
-
version: "1.1",
|
|
92
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
93
|
-
"p-id": "5826",
|
|
94
|
-
width: size,
|
|
95
|
-
height: size,
|
|
96
|
-
fill
|
|
97
|
-
},
|
|
98
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
99
|
-
"path",
|
|
100
|
-
{
|
|
101
|
-
d: "M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z",
|
|
102
|
-
fill: "#231815",
|
|
103
|
-
"p-id": "5827"
|
|
104
|
-
}
|
|
105
|
-
),
|
|
106
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
107
|
-
"path",
|
|
108
|
-
{
|
|
109
|
-
d: "M555 418.3H304.7c-14 0-25.4 11.4-25.4 25.4s11.4 25.4 25.4 25.4H555c14 0 25.4-11.4 25.4-25.4S569 418.3 555 418.3z",
|
|
110
|
-
fill: "#231815",
|
|
111
|
-
"p-id": "5828"
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
);
|
|
115
|
-
var Check = ({ size = 14, fill = "#707070" }) => /* @__PURE__ */ import_react.default.createElement(
|
|
116
|
-
"svg",
|
|
117
|
-
{
|
|
118
|
-
viewBox: "0 0 1024 1024",
|
|
119
|
-
version: "1.1",
|
|
120
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
121
|
-
"p-id": "5988",
|
|
122
|
-
width: size,
|
|
123
|
-
height: size,
|
|
124
|
-
fill
|
|
125
|
-
},
|
|
126
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
127
|
-
"path",
|
|
128
|
-
{
|
|
129
|
-
d: "M380.416 822.144c-10.432 0-20.864-3.968-28.8-11.968L75.968 534.592c-15.936-15.936-15.936-41.664 0-57.6 15.872-15.872 41.664-15.872 57.536 0L380.416 723.84l510.08-510.016c15.872-15.936 41.664-15.936 57.536 0 15.936 15.936 15.936 41.664 0 57.6L409.216 810.24c-7.936 7.936-18.368 11.904-28.8 11.904z",
|
|
130
|
-
fill: "",
|
|
131
|
-
"p-id": "5989"
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
);
|
|
135
|
-
var DownLoad = ({ size = 14, fill = "#707070" }) => /* @__PURE__ */ import_react.default.createElement(
|
|
136
|
-
"svg",
|
|
137
|
-
{
|
|
138
|
-
viewBox: "0 0 1024 1024",
|
|
139
|
-
version: "1.1",
|
|
140
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
141
|
-
"p-id": "5988",
|
|
142
|
-
width: size,
|
|
143
|
-
height: size,
|
|
144
|
-
fill
|
|
145
|
-
},
|
|
146
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
147
|
-
"path",
|
|
148
|
-
{
|
|
149
|
-
d: "M512 165.93q13.645 0 23.31 9.666t9.665 23.31V580.77L653.37 472.103q9.517-9.517 23.434-9.517 14.164 0 23.558 9.394t9.393 23.557q0 13.917-9.517 23.434L535.434 683.774q-9.517 9.517-23.434 9.517t-23.434-9.517L323.763 518.971q-9.517-10.036-9.517-23.434 0-13.645 9.665-23.31t23.31-9.665q13.917 0 23.434 9.516L479.05 580.744V198.881q0-13.645 9.665-23.31t23.31-9.665z m329.582 461.435q13.645 0 23.31 9.665t9.665 23.31v131.828q0 41.207-28.575 69.782-29.095 29.095-69.536 29.095H248.32q-40.416 0-70.03-28.848-28.847-29.613-28.847-70.03V660.34q0-13.645 9.665-23.31t23.31-9.665 23.31 9.665 9.666 23.31v131.828q0 13.645 9.665 23.31t23.31 9.665h528.127q13.398 0 22.791-9.665t9.393-23.31V660.34q0-13.645 9.666-23.31t23.31-9.665z",
|
|
150
|
-
"p-id": "1178",
|
|
151
|
-
fill: "#494949"
|
|
152
|
-
}
|
|
153
|
-
)
|
|
154
|
-
);
|
|
155
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
156
|
-
0 && (module.exports = {
|
|
157
|
-
Check,
|
|
158
|
-
Copy,
|
|
159
|
-
DownLoad,
|
|
160
|
-
ZoomIn,
|
|
161
|
-
ZoomOut
|
|
162
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { CodeBlockComponent, WithChartCodeOptions } from './type';
|
|
2
|
-
export declare const withChartCode: (options: WithChartCodeOptions) => CodeBlockComponent;
|
|
3
|
-
/**
|
|
4
|
-
* Includes built-in chart components such as line charts, pie charts, etc.
|
|
5
|
-
* @param componentsArray
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare const withDefaultChartCode: (options?: Partial<WithChartCodeOptions>) => CodeBlockComponent;
|