@antv/gpt-vis 0.5.7 → 0.5.9
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 +11 -11
- package/README.md +11 -11
- package/README.zh-CN.md +11 -11
- package/dist/cjs/ChartCodeRender/VisChart.js +1 -1
- package/dist/cjs/ChartCodeRender/styles.d.ts +5 -1
- package/dist/cjs/ChartCodeRender/styles.js +8 -1
- package/dist/cjs/DualAxes/util.js +4 -1
- package/dist/cjs/Pie/index.d.ts +3 -1
- package/dist/cjs/Pie/index.js +3 -1
- package/dist/cjs/Sankey/index.js +0 -3
- package/dist/cjs/Table/index.d.ts +9 -0
- package/dist/cjs/Table/index.js +91 -0
- package/dist/cjs/export.d.ts +4 -3
- package/dist/cjs/export.js +8 -2
- package/dist/cjs/types/chart.d.ts +20 -19
- package/dist/cjs/types/chart.js +19 -18
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/ChartCodeRender/VisChart.js +2 -1
- package/dist/esm/ChartCodeRender/styles.d.ts +5 -1
- package/dist/esm/ChartCodeRender/styles.js +5 -2
- package/dist/esm/DualAxes/util.js +4 -1
- package/dist/esm/Pie/index.d.ts +3 -1
- package/dist/esm/Pie/index.js +5 -1
- package/dist/esm/Sankey/index.js +0 -3
- package/dist/esm/Table/index.d.ts +9 -0
- package/dist/esm/Table/index.js +30 -0
- package/dist/esm/export.d.ts +4 -3
- package/dist/esm/export.js +5 -4
- package/dist/esm/types/chart.d.ts +20 -19
- package/dist/esm/types/chart.js +19 -18
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/330.async.js +1 -0
- package/dist/umd/index.min.js +1 -1
- package/package.json +32 -30
- package/dist/umd/373.async.js +0 -1
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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 = {
|
package/dist/cjs/Pie/index.d.ts
CHANGED
|
@@ -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;
|
package/dist/cjs/Pie/index.js
CHANGED
|
@@ -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
|
};
|
package/dist/cjs/Sankey/index.js
CHANGED
|
@@ -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;
|
package/dist/cjs/export.d.ts
CHANGED
|
@@ -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
|
-
|
|
26
|
-
|
|
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>>;
|
package/dist/cjs/export.js
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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 {
|
package/dist/cjs/types/chart.js
CHANGED
|
@@ -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["
|
|
40
|
-
ChartType2["
|
|
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:
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.5.
|
|
1
|
+
declare const _default: "0.5.9";
|
|
2
2
|
export default _default;
|
package/dist/cjs/version.js
CHANGED
|
@@ -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
|
-
|
|
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:
|
|
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.
|
|
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);
|
package/dist/esm/Pie/index.d.ts
CHANGED
|
@@ -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;
|
package/dist/esm/Pie/index.js
CHANGED
|
@@ -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
|
};
|
package/dist/esm/Sankey/index.js
CHANGED