@antv/gpt-vis 0.5.7 → 0.5.8

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.ja-JP.md CHANGED
@@ -13,7 +13,7 @@ GPTs、生成AI、およびLLMプロジェクトのためのコンポーネン
13
13
  <p align="center">
14
14
  <a href="https://gpt-vis.antv.vision" target="_blank">ドキュメント</a> •
15
15
  <a href="/knowledges" target="_blank">知識</a> •
16
- <a href="https://tbox.alipay.com/experience/202410APr1n200110168?id=20241122F8eB00104644" target="_blank">エージェントデモ</a> •
16
+ <a href="https://www.tbox.cn/share/202504APmv6c00373739?platform=WebService" target="_blank">エージェントデモ</a> •
17
17
  <a href="https://github.com/antvis/mcp-server-chart" target="_blank">MCP Server</a>
18
18
  </p>
19
19
  </div>
@@ -48,16 +48,16 @@ const markdownContent = `
48
48
  {
49
49
  "type": "line",
50
50
  "data": [
51
- { "time":2013,"value":59.3 },
52
- { "time":2014,"value":64.4 },
53
- { "time":2015,"value":68.9 },
54
- { "time":2016,"value":74.4 },
55
- { "time":2017,"value":82.7 },
56
- { "time":2018,"value":91.9 },
57
- { "time":2019,"value":99.1 },
58
- { "time":2020,"value":101.6 },
59
- { "time":2021,"value":114.4 },
60
- { "time":2022,"value":121 }
51
+ { "time": "2013", "value": 59.3 },
52
+ { "time": "2014", "value": 64.4 },
53
+ { "time": "2015", "value": 68.9 },
54
+ { "time": "2016", "value": 74.4 },
55
+ { "time": "2017", "value": 82.7 },
56
+ { "time": "2018", "value": 91.9 },
57
+ { "time": "2019", "value": 99.1 },
58
+ { "time": "2020", "value": 101.6 },
59
+ { "time": "2021", "value": 114.4 },
60
+ { "time": "2022", "value": 121 }
61
61
  ]
62
62
  }
63
63
  \`\`\`
package/README.md CHANGED
@@ -13,7 +13,7 @@ Components for GPTs, generative AI, and LLM projects. **Not only UI Components**
13
13
  <p align="center">
14
14
  <a href="https://gpt-vis.antv.vision" target="_blank">Document</a> •
15
15
  <a href="/knowledges" target="_blank">Knowledge</a> •
16
- <a href="https://tbox.alipay.com/experience/202410APr1n200110168?id=20241122F8eB00104644" target="_blank">Agent Demo</a> •
16
+ <a href="https://www.tbox.cn/share/202504APmv6c00373739?platform=WebService" target="_blank">Agent Demo</a> •
17
17
  <a href="https://github.com/antvis/mcp-server-chart" target="_blank">MCP Server</a>
18
18
  </p>
19
19
  </div>
@@ -50,16 +50,16 @@ Here’s a visualization of Haidilao's food delivery revenue from 2013 to 2022.
50
50
  {
51
51
  "type": "line",
52
52
  "data": [
53
- { "time":2013,"value":59.3 },
54
- { "time":2014,"value":64.4 },
55
- { "time":2015,"value":68.9 },
56
- { "time":2016,"value":74.4 },
57
- { "time":2017,"value":82.7 },
58
- { "time":2018,"value":91.9 },
59
- { "time":2019,"value":99.1 },
60
- { "time":2020,"value":101.6 },
61
- { "time":2021,"value":114.4 },
62
- { "time":2022,"value":121 }
53
+ { "time": "2013", "value": 59.3 },
54
+ { "time": "2014", "value": 64.4 },
55
+ { "time": "2015", "value": 68.9 },
56
+ { "time": "2016", "value": 74.4 },
57
+ { "time": "2017", "value": 82.7 },
58
+ { "time": "2018", "value": 91.9 },
59
+ { "time": "2019", "value": 99.1 },
60
+ { "time": "2020", "value": 101.6 },
61
+ { "time": "2021", "value": 114.4 },
62
+ { "time": "2022", "value": 121 }
63
63
  ]
64
64
  }
65
65
  \`\`\`
package/README.zh-CN.md CHANGED
@@ -13,7 +13,7 @@ Components for GPTs, generative AI, and LLM projects. **Not only UI Components**
13
13
  <p align="center">
14
14
  <a href="https://gpt-vis.antv.vision" target="_blank">文档</a> •
15
15
  <a href="/knowledges" target="_blank">知识库</a> •
16
- <a href="https://tbox.alipay.com/experience/202410APr1n200110168?id=20241122F8eB00104644" target="_blank">体验 Agent</a> •
16
+ <a href="https://www.tbox.cn/share/202504APmv6c00373739?platform=WebService" target="_blank">体验 Agent</a> •
17
17
  <a href="https://github.com/antvis/mcp-server-chart" target="_blank">MCP Server</a>
18
18
  </p>
19
19
  </div>
@@ -48,16 +48,16 @@ Here’s a visualization of Haidilao's food delivery revenue from 2013 to 2022.
48
48
  {
49
49
  "type": "line",
50
50
  "data": [
51
- { "time":2013,"value":59.3 },
52
- { "time":2014,"value":64.4 },
53
- { "time":2015,"value":68.9 },
54
- { "time":2016,"value":74.4 },
55
- { "time":2017,"value":82.7 },
56
- { "time":2018,"value":91.9 },
57
- { "time":2019,"value":99.1 },
58
- { "time":2020,"value":101.6 },
59
- { "time":2021,"value":114.4 },
60
- { "time":2022,"value":121 }
51
+ { "time": "2013", "value": 59.3 },
52
+ { "time": "2014", "value": 64.4 },
53
+ { "time": "2015", "value": 68.9 },
54
+ { "time": "2016", "value": 74.4 },
55
+ { "time": "2017", "value": 82.7 },
56
+ { "time": "2018", "value": 91.9 },
57
+ { "time": "2019", "value": 99.1 },
58
+ { "time": "2020", "value": 101.6 },
59
+ { "time": "2021", "value": 114.4 },
60
+ { "time": "2022", "value": 121 }
61
61
  ]
62
62
  }
63
63
  \`\`\`
@@ -274,7 +274,7 @@ var RenderVisChart = (0, import_react.memo)(
274
274
  }
275
275
  }
276
276
  },
277
- /* @__PURE__ */ import_react.default.createElement(import_styles.StyledGPTVis, { className: "gpt-vis" }, /* @__PURE__ */ import_react.default.createElement(import_styles.GlobalStyles, null), /* @__PURE__ */ import_react.default.createElement(import_styles.ChartWrapper, { ref: chartContainerRef }, /* @__PURE__ */ import_react.default.createElement(
277
+ /* @__PURE__ */ import_react.default.createElement(import_styles.StyledGPTVis, { className: "gpt-vis", type }, /* @__PURE__ */ import_react.default.createElement(import_styles.GlobalStyles, null), /* @__PURE__ */ import_react.default.createElement(import_styles.ChartWrapper, { ref: chartContainerRef }, /* @__PURE__ */ import_react.default.createElement(
278
278
  ChartComponent,
279
279
  {
280
280
  ...chartProps,
@@ -1,5 +1,8 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledGPTVis: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ interface StyledGPTVisProps {
3
+ type?: string;
4
+ }
5
+ export declare const StyledGPTVis: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledGPTVisProps>> & string;
3
6
  export declare const TextButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
4
7
  export declare const ChartWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
8
  export declare const TabContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -13,3 +16,4 @@ export declare const StyledTabButton: import("styled-components/dist/types").ISt
13
16
  active?: boolean | undefined;
14
17
  }>> & string;
15
18
  export declare const Divider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
19
+ export {};
@@ -47,7 +47,8 @@ var import_styled_components = __toESM(require("styled-components"));
47
47
  var StyledGPTVis = import_styled_components.default.div`
48
48
  min-width: 300px;
49
49
  max-width: 100%;
50
- height: 300px;
50
+ height: ${({ type }) => type === "table" ? "auto" : "300px"};
51
+ /* height: 300px; */
51
52
  overflow: hidden;
52
53
  position: relative;
53
54
  padding: 16px;
@@ -103,6 +104,12 @@ var TextButton = import_styled_components.default.button`
103
104
  var ChartWrapper = import_styled_components.default.div`
104
105
  width: 100%;
105
106
  height: 100%;
107
+ overflow: scroll;
108
+ scrollbar-width: none;
109
+ -ms-overflow-style: none;
110
+ &::-webkit-scrollbar {
111
+ display: none;
112
+ }
106
113
 
107
114
  h5 {
108
115
  font-size: 12px;
@@ -24,7 +24,10 @@ __export(util_exports, {
24
24
  module.exports = __toCommonJS(util_exports);
25
25
  var import_types = require("../types");
26
26
  function transform(series, categories) {
27
- const newChildren = series.map((item, index) => {
27
+ const newChildren = series.sort((a, b) => {
28
+ const ORDER = ["column", "line"];
29
+ return ORDER.indexOf(a.type) - ORDER.indexOf(b.type);
30
+ }).map((item, index) => {
28
31
  const { type, axisYTitle, ...others } = item;
29
32
  const defaultYField = axisYTitle || `value_${index + 1}`;
30
33
  const baseConfig = {
@@ -16,6 +16,8 @@ type PieDataItem = {
16
16
  * the props for the Pie
17
17
  * @param data pie data
18
18
  */
19
- export type PieProps = BasePlotProps<PieDataItem> & Partial<PieConfig> & Theme;
19
+ export type PieProps = BasePlotProps<PieDataItem> & Partial<PieConfig> & Theme & {
20
+ innerRadius?: number;
21
+ };
20
22
  declare const Pie: (props: PieProps) => React.JSX.Element;
21
23
  export default Pie;
@@ -62,6 +62,7 @@ var defaultConfig = (props) => {
62
62
  label: {
63
63
  position: "outside",
64
64
  // text: angleField,
65
+ transform: [{ type: "overlapHide" }],
65
66
  text: (d) => `${d[colorField]}: ${(0, import_lodash.round)(d[angleField] / sumValue * 100, 1)}%`
66
67
  },
67
68
  legend: {
@@ -85,7 +86,8 @@ var Pie = (props) => {
85
86
  const themeConfig = import_theme.THEME_MAP[props.theme ?? "default"];
86
87
  const config = (0, import_hooks.usePlotConfig)("Pie", defaultConfig, {
87
88
  ...props,
88
- theme: themeConfig
89
+ theme: themeConfig,
90
+ innerRadius: Math.max(0, Math.min(1, props.innerRadius || 0))
89
91
  });
90
92
  return /* @__PURE__ */ import_react.default.createElement(import_plots.Pie, { ...config });
91
93
  };
@@ -75,9 +75,6 @@ var defaultConfig = (props) => {
75
75
  nodeLineWidth: 1,
76
76
  linkFillOpacity: 0.3
77
77
  },
78
- viewStyle: {
79
- viewFill: "red"
80
- },
81
78
  ...backgroundColor ? { viewStyle: { viewFill: backgroundColor } } : {}
82
79
  };
83
80
  };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export type TableProps = {
3
+ data: {
4
+ [key: string]: any;
5
+ }[];
6
+ title?: string;
7
+ };
8
+ declare const Table: (props: TableProps) => React.JSX.Element;
9
+ export default Table;
@@ -0,0 +1,91 @@
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/Table/index.tsx
30
+ var Table_exports = {};
31
+ __export(Table_exports, {
32
+ default: () => Table_default
33
+ });
34
+ module.exports = __toCommonJS(Table_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_styled_components = __toESM(require("styled-components"));
37
+ var TableWrapper = import_styled_components.default.div`
38
+ .table-title {
39
+ font-size: 16px;
40
+ font-weight: 500;
41
+ margin-bottom: 12px;
42
+ color: #1d2129;
43
+ }
44
+ table {
45
+ width: 100%;
46
+ border-collapse: separate;
47
+ border-spacing: 0;
48
+ background: #fff;
49
+ border-radius: 8px;
50
+ overflow: hidden;
51
+ th,
52
+ td {
53
+ border-bottom: 1px solid #f0f0f0;
54
+ padding: 8px;
55
+ text-align: left;
56
+ font-size: 14px;
57
+ color: #333;
58
+ }
59
+ th {
60
+ background: #f5f5f5;
61
+ font-weight: 600;
62
+ color: #000000e0;
63
+ position: relative;
64
+ }
65
+ th:not(:last-child)::after {
66
+ content: '';
67
+ position: absolute;
68
+ top: 25%;
69
+ right: 0;
70
+ width: 1px;
71
+ height: 50%;
72
+ background: #e0e0e0;
73
+ }
74
+ tr: {
75
+ transition: background 0.2s;
76
+ cursor: pointer;
77
+ }
78
+ tr:hover {
79
+ background: #f5f5f5;
80
+ }
81
+ }
82
+ `;
83
+ var Table = (props) => {
84
+ const { data, title } = props;
85
+ const columns = data.length > 0 ? Object.keys(data[0]).map((key) => ({
86
+ title: key,
87
+ key
88
+ })) : [];
89
+ return /* @__PURE__ */ import_react.default.createElement(TableWrapper, null, title && /* @__PURE__ */ import_react.default.createElement("div", { className: "table-title" }, title), /* @__PURE__ */ import_react.default.createElement("table", null, /* @__PURE__ */ import_react.default.createElement("thead", null, /* @__PURE__ */ import_react.default.createElement("tr", null, columns.map((col) => /* @__PURE__ */ import_react.default.createElement("th", { key: col.key }, col.title)))), /* @__PURE__ */ import_react.default.createElement("tbody", null, data.map((row, index) => /* @__PURE__ */ import_react.default.createElement("tr", { key: index }, columns.map((col) => /* @__PURE__ */ import_react.default.createElement("td", null, row[col.key])))))));
90
+ };
91
+ var Table_default = Table;
@@ -22,12 +22,13 @@ import { default as FishboneDiagram, type FishboneDiagramProps } from './Fishbon
22
22
  import { default as FlowDiagram, type FlowDiagramProps } from './FlowDiagram';
23
23
  import { default as MindMap, type MindMapProps } from './MindMap';
24
24
  import { default as NetworkGraph, type NetworkGraphProps } from './NetworkGraph';
25
- export { default as IndentedTree, type IndentedTreeProps } from './IndentedTree';
26
- export { default as OrganizationChart, type OrganizationChartProps } from './OrganizationChart';
25
+ import { default as OrganizationChart, type OrganizationChartProps } from './OrganizationChart';
26
+ import { default as IndentedTree, type IndentedTreeProps } from './IndentedTree';
27
27
  /********** map chart **********/
28
28
  export { Map, type MapProps } from './export-map';
29
29
  import { PinMap, type PinMapProps, HeatMap, type HeatMapProps, PathMap, type PathMapProps } from './export-map';
30
30
  /********** NTV **********/
31
+ import { default as Table, type TableProps } from './Table';
31
32
  export { VisText, type VisTextProps } from './Text';
32
- export { Area, Bar, Boxplot, Column, DualAxes, FishboneDiagram, FlowDiagram, Funnel, HeatMap, Histogram, Line, Liquid, MindMap, NetworkGraph, PathMap, Pie, PinMap, Radar, Sankey, Scatter, Treemap, Venn, Violin, WordCloud, type AreaProps, type BarProps, type BoxplotProps, type ColumnProps, type DualAxesProps, type FishboneDiagramProps, type FlowDiagramProps, type FunnelProps, type HeatMapProps, type HistogramProps, type LineProps, type LiquidProps, type MindMapProps, type NetworkGraphProps, type PathMapProps, type PieProps, type PinMapProps, type RadarProps, type SankeyProps, type ScatterProps, type TreemapProps, type VennProps, type ViolinProps, type WordCloudProps, };
33
+ export { Area, Bar, Boxplot, Column, DualAxes, FishboneDiagram, FlowDiagram, Funnel, HeatMap, Histogram, IndentedTree, Line, Liquid, MindMap, NetworkGraph, OrganizationChart, PathMap, Pie, PinMap, Radar, Sankey, Scatter, Treemap, Venn, Violin, Table, WordCloud, type AreaProps, type BarProps, type BoxplotProps, type ColumnProps, type DualAxesProps, type FishboneDiagramProps, type FlowDiagramProps, type FunnelProps, type HeatMapProps, type HistogramProps, type IndentedTreeProps, type LineProps, type LiquidProps, type MindMapProps, type NetworkGraphProps, type OrganizationChartProps, type PathMapProps, type PieProps, type PinMapProps, type RadarProps, type SankeyProps, type ScatterProps, type TreemapProps, type VennProps, type ViolinProps, type TableProps, type WordCloudProps, };
33
34
  export declare const DEFAULT_CHART_COMPONENTS: Record<string, React.FC<any>>;
@@ -53,6 +53,7 @@ __export(export_exports, {
53
53
  Radar: () => import_Radar.default,
54
54
  Sankey: () => import_Sankey.default,
55
55
  Scatter: () => import_Scatter.default,
56
+ Table: () => import_Table.default,
56
57
  Treemap: () => import_Treemap.default,
57
58
  Venn: () => import_Venn.default,
58
59
  Violin: () => import_Violin.default,
@@ -82,10 +83,11 @@ var import_FishboneDiagram = __toESM(require("./FishboneDiagram"));
82
83
  var import_FlowDiagram = __toESM(require("./FlowDiagram"));
83
84
  var import_MindMap = __toESM(require("./MindMap"));
84
85
  var import_NetworkGraph = __toESM(require("./NetworkGraph"));
85
- var import_IndentedTree = __toESM(require("./IndentedTree"));
86
86
  var import_OrganizationChart = __toESM(require("./OrganizationChart"));
87
+ var import_IndentedTree = __toESM(require("./IndentedTree"));
87
88
  var import_export_map = require("./export-map");
88
89
  var import_export_map2 = require("./export-map");
90
+ var import_Table = __toESM(require("./Table"));
89
91
  var import_Text = require("./Text");
90
92
  var DEFAULT_CHART_COMPONENTS = {
91
93
  [import_types.ChartType.Area]: import_Area.default,
@@ -98,6 +100,7 @@ var DEFAULT_CHART_COMPONENTS = {
98
100
  [import_types.ChartType.Funnel]: import_Funnel.default,
99
101
  [import_types.ChartType.HeatMap]: import_export_map2.HeatMap,
100
102
  [import_types.ChartType.Histogram]: import_Histogram.default,
103
+ [import_types.ChartType.IndentedTree]: import_IndentedTree.default,
101
104
  [import_types.ChartType.Line]: import_Line.default,
102
105
  [import_types.ChartType.Liquid]: import_Liquid.default,
103
106
  [import_types.ChartType.MindMap]: import_MindMap.default,
@@ -110,7 +113,9 @@ var DEFAULT_CHART_COMPONENTS = {
110
113
  [import_types.ChartType.Treemap]: import_Treemap.default,
111
114
  [import_types.ChartType.Venn]: import_Venn.default,
112
115
  [import_types.ChartType.Violin]: import_Violin.default,
113
- [import_types.ChartType.WordCloud]: import_WordCloud.default
116
+ [import_types.ChartType.Table]: import_Table.default,
117
+ [import_types.ChartType.WordCloud]: import_WordCloud.default,
118
+ [import_types.ChartType.OrganizationChart]: import_OrganizationChart.default
114
119
  };
115
120
  // Annotate the CommonJS export names for ESM import in node:
116
121
  0 && (module.exports = {
@@ -138,6 +143,7 @@ var DEFAULT_CHART_COMPONENTS = {
138
143
  Radar,
139
144
  Sankey,
140
145
  Scatter,
146
+ Table,
141
147
  Treemap,
142
148
  Venn,
143
149
  Violin,
@@ -3,33 +3,34 @@ import type { CSSProperties, ReactNode } from 'react';
3
3
  import type { Map } from './map';
4
4
  export type { LarkMapProps };
5
5
  export declare enum ChartType {
6
- Pie = "pie",
7
- Column = "column",
8
- Line = "line",
9
6
  Area = "area",
10
- Scatter = "scatter",
11
- Histogram = "histogram",
12
- Treemap = "treemap",
13
7
  Bar = "bar",
14
- WordCloud = "word-cloud",
15
- DualAxes = "dual-axes",
16
- Radar = "radar",
17
- Liquid = "liquid",
18
8
  Boxplot = "boxplot",
19
- Violin = "violin",
20
- Venn = "venn",
21
- Funnel = "funnel",
22
- Sankey = "sankey",
23
- PinMap = "pin-map",
24
- PathMap = "path-map",
25
- HeatMap = "heat-map",
26
- MindMap = "mind-map",
9
+ Column = "column",
10
+ DualAxes = "dual-axes",
27
11
  FishboneDiagram = "fishbone-diagram",
28
12
  FlowDiagram = "flow-diagram",
13
+ Funnel = "funnel",
14
+ HeatMap = "heat-map",
15
+ Histogram = "histogram",
29
16
  IndentedTree = "indented-tree",
17
+ Line = "line",
18
+ Liquid = "liquid",
19
+ MindMap = "mind-map",
30
20
  NetworkGraph = "network-graph",
31
21
  OrganizationChart = "organization-chart",
32
- VisText = "vis-text"
22
+ PathMap = "path-map",
23
+ Pie = "pie",
24
+ PinMap = "pin-map",
25
+ Radar = "radar",
26
+ Sankey = "sankey",
27
+ Scatter = "scatter",
28
+ Treemap = "treemap",
29
+ Venn = "venn",
30
+ Violin = "violin",
31
+ Table = "table",
32
+ VisText = "vis-text",
33
+ WordCloud = "word-cloud"
33
34
  }
34
35
  export type Charts = keyof typeof ChartType;
35
36
  export interface BaseChartProps {
@@ -23,33 +23,34 @@ __export(chart_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(chart_exports);
25
25
  var ChartType = /* @__PURE__ */ ((ChartType2) => {
26
- ChartType2["Pie"] = "pie";
27
- ChartType2["Column"] = "column";
28
- ChartType2["Line"] = "line";
29
26
  ChartType2["Area"] = "area";
30
- ChartType2["Scatter"] = "scatter";
31
- ChartType2["Histogram"] = "histogram";
32
- ChartType2["Treemap"] = "treemap";
33
27
  ChartType2["Bar"] = "bar";
34
- ChartType2["WordCloud"] = "word-cloud";
35
- ChartType2["DualAxes"] = "dual-axes";
36
- ChartType2["Radar"] = "radar";
37
- ChartType2["Liquid"] = "liquid";
38
28
  ChartType2["Boxplot"] = "boxplot";
39
- ChartType2["Violin"] = "violin";
40
- ChartType2["Venn"] = "venn";
41
- ChartType2["Funnel"] = "funnel";
42
- ChartType2["Sankey"] = "sankey";
43
- ChartType2["PinMap"] = "pin-map";
44
- ChartType2["PathMap"] = "path-map";
45
- ChartType2["HeatMap"] = "heat-map";
46
- ChartType2["MindMap"] = "mind-map";
29
+ ChartType2["Column"] = "column";
30
+ ChartType2["DualAxes"] = "dual-axes";
47
31
  ChartType2["FishboneDiagram"] = "fishbone-diagram";
48
32
  ChartType2["FlowDiagram"] = "flow-diagram";
33
+ ChartType2["Funnel"] = "funnel";
34
+ ChartType2["HeatMap"] = "heat-map";
35
+ ChartType2["Histogram"] = "histogram";
49
36
  ChartType2["IndentedTree"] = "indented-tree";
37
+ ChartType2["Line"] = "line";
38
+ ChartType2["Liquid"] = "liquid";
39
+ ChartType2["MindMap"] = "mind-map";
50
40
  ChartType2["NetworkGraph"] = "network-graph";
51
41
  ChartType2["OrganizationChart"] = "organization-chart";
42
+ ChartType2["PathMap"] = "path-map";
43
+ ChartType2["Pie"] = "pie";
44
+ ChartType2["PinMap"] = "pin-map";
45
+ ChartType2["Radar"] = "radar";
46
+ ChartType2["Sankey"] = "sankey";
47
+ ChartType2["Scatter"] = "scatter";
48
+ ChartType2["Treemap"] = "treemap";
49
+ ChartType2["Venn"] = "venn";
50
+ ChartType2["Violin"] = "violin";
51
+ ChartType2["Table"] = "table";
52
52
  ChartType2["VisText"] = "vis-text";
53
+ ChartType2["WordCloud"] = "word-cloud";
53
54
  return ChartType2;
54
55
  })(ChartType || {});
55
56
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,2 +1,2 @@
1
- declare const _default: "0.5.7";
1
+ declare const _default: "0.5.8";
2
2
  export default _default;
@@ -22,4 +22,4 @@ __export(version_exports, {
22
22
  default: () => version_default
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- var version_default = "0.5.7";
25
+ var version_default = "0.5.8";
@@ -376,7 +376,8 @@ export var RenderVisChart = /*#__PURE__*/memo(function (_ref) {
376
376
  }
377
377
  }
378
378
  }, /*#__PURE__*/React.createElement(StyledGPTVis, {
379
- className: "gpt-vis"
379
+ className: "gpt-vis",
380
+ type: type
380
381
  }, /*#__PURE__*/React.createElement(GlobalStyles, null), /*#__PURE__*/React.createElement(ChartWrapper, {
381
382
  ref: chartContainerRef
382
383
  }, /*#__PURE__*/React.createElement(ChartComponent, _extends({}, chartProps, {
@@ -1,5 +1,8 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledGPTVis: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
+ interface StyledGPTVisProps {
3
+ type?: string;
4
+ }
5
+ export declare const StyledGPTVis: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledGPTVisProps>> & string;
3
6
  export declare const TextButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
4
7
  export declare const ChartWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
8
  export declare const TabContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -13,3 +16,4 @@ export declare const StyledTabButton: import("styled-components/dist/types").ISt
13
16
  active?: boolean | undefined;
14
17
  }>> & string;
15
18
  export declare const Divider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
19
+ export {};
@@ -2,7 +2,10 @@ import styled, { createGlobalStyle } from 'styled-components';
2
2
  export var StyledGPTVis = styled.div.withConfig({
3
3
  displayName: "StyledGPTVis",
4
4
  componentId: "gpt-vis-c7ef__sc-2dc7ka-0"
5
- })(["min-width:300px;max-width:100%;height:300px;overflow:hidden;position:relative;padding:16px;"]);
5
+ })(["min-width:300px;max-width:100%;height:", ";overflow:hidden;position:relative;padding:16px;"], function (_ref) {
6
+ var type = _ref.type;
7
+ return type === 'table' ? 'auto' : '300px';
8
+ });
6
9
  export var TextButton = styled.button.withConfig({
7
10
  displayName: "TextButton",
8
11
  componentId: "gpt-vis-c7ef__sc-2dc7ka-1"
@@ -10,7 +13,7 @@ export var TextButton = styled.button.withConfig({
10
13
  export var ChartWrapper = styled.div.withConfig({
11
14
  displayName: "ChartWrapper",
12
15
  componentId: "gpt-vis-c7ef__sc-2dc7ka-2"
13
- })(["width:100%;height:100%;h5{font-size:12px;font-weight:400;color:#666;height:150px;display:flex;align-items:center;justify-content:center;}& > *{max-width:100%;max-height:100%;}"]);
16
+ })(["width:100%;height:100%;overflow:scroll;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}h5{font-size:12px;font-weight:400;color:#666;height:150px;display:flex;align-items:center;justify-content:center;}& > *{max-width:100%;max-height:100%;}"]);
14
17
  export var TabContainer = styled.div.withConfig({
15
18
  displayName: "TabContainer",
16
19
  componentId: "gpt-vis-c7ef__sc-2dc7ka-3"
@@ -9,7 +9,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
9
9
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
10
  import { ChartType } from "../types";
11
11
  export function transform(series, categories) {
12
- var newChildren = series.map(function (item, index) {
12
+ var newChildren = series.sort(function (a, b) {
13
+ var ORDER = ['column', 'line'];
14
+ return ORDER.indexOf(a.type) - ORDER.indexOf(b.type);
15
+ }).map(function (item, index) {
13
16
  var type = item.type,
14
17
  axisYTitle = item.axisYTitle,
15
18
  others = _objectWithoutProperties(item, _excluded);
@@ -16,6 +16,8 @@ type PieDataItem = {
16
16
  * the props for the Pie
17
17
  * @param data pie data
18
18
  */
19
- export type PieProps = BasePlotProps<PieDataItem> & Partial<PieConfig> & Theme;
19
+ export type PieProps = BasePlotProps<PieDataItem> & Partial<PieConfig> & Theme & {
20
+ innerRadius?: number;
21
+ };
20
22
  declare const Pie: (props: PieProps) => React.JSX.Element;
21
23
  export default Pie;
@@ -57,6 +57,9 @@ var defaultConfig = function defaultConfig(props) {
57
57
  label: {
58
58
  position: 'outside',
59
59
  // text: angleField,
60
+ transform: [{
61
+ type: 'overlapHide'
62
+ }],
60
63
  text: function text(d) {
61
64
  return "".concat(d[colorField], ": ").concat(round(d[angleField] / sumValue * 100, 1), "%");
62
65
  }
@@ -85,7 +88,8 @@ var Pie = function Pie(props) {
85
88
  var _props$theme;
86
89
  var themeConfig = THEME_MAP[(_props$theme = props.theme) !== null && _props$theme !== void 0 ? _props$theme : 'default'];
87
90
  var config = usePlotConfig('Pie', defaultConfig, _objectSpread(_objectSpread({}, props), {}, {
88
- theme: themeConfig
91
+ theme: themeConfig,
92
+ innerRadius: Math.max(0, Math.min(1, props.innerRadius || 0))
89
93
  }));
90
94
  return /*#__PURE__*/React.createElement(ADCPie, config);
91
95
  };
@@ -52,9 +52,6 @@ var defaultConfig = function defaultConfig(props) {
52
52
  labelSpacing: 2,
53
53
  nodeLineWidth: 1,
54
54
  linkFillOpacity: 0.3
55
- },
56
- viewStyle: {
57
- viewFill: 'red'
58
55
  }
59
56
  }, backgroundColor ? {
60
57
  viewStyle: {
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export type TableProps = {
3
+ data: {
4
+ [key: string]: any;
5
+ }[];
6
+ title?: string;
7
+ };
8
+ declare const Table: (props: TableProps) => React.JSX.Element;
9
+ export default Table;