@antv/gpt-vis 0.5.6 → 0.5.7
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/dist/cjs/Bar/index.d.ts +4 -1
- package/dist/cjs/Bar/index.js +7 -2
- package/dist/cjs/Boxplot/index.d.ts +13 -0
- package/dist/cjs/Boxplot/index.js +88 -0
- package/dist/cjs/Column/index.d.ts +4 -1
- package/dist/cjs/Column/index.js +8 -2
- package/dist/cjs/Funnel/index.d.ts +12 -0
- package/dist/cjs/Funnel/index.js +173 -0
- package/dist/cjs/Liquid/index.d.ts +11 -0
- package/dist/cjs/Liquid/index.js +85 -0
- package/dist/cjs/Sankey/index.d.ts +12 -0
- package/dist/cjs/Sankey/index.js +106 -0
- package/dist/cjs/Scatter/index.js +7 -4
- package/dist/cjs/Treemap/index.js +1 -0
- package/dist/cjs/Venn/index.d.ts +32 -0
- package/dist/cjs/Venn/index.js +87 -0
- package/dist/cjs/Violin/index.d.ts +10 -0
- package/dist/cjs/Violin/index.js +185 -0
- package/dist/cjs/export.d.ts +7 -1
- package/dist/cjs/export.js +38 -8
- package/dist/cjs/types/chart.d.ts +6 -0
- package/dist/cjs/types/chart.js +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Bar/index.d.ts +4 -1
- package/dist/esm/Bar/index.js +12 -2
- package/dist/esm/Boxplot/index.d.ts +13 -0
- package/dist/esm/Boxplot/index.js +83 -0
- package/dist/esm/Column/index.d.ts +4 -1
- package/dist/esm/Column/index.js +13 -2
- package/dist/esm/Funnel/index.d.ts +12 -0
- package/dist/esm/Funnel/index.js +171 -0
- package/dist/esm/Liquid/index.d.ts +11 -0
- package/dist/esm/Liquid/index.js +100 -0
- package/dist/esm/Sankey/index.d.ts +12 -0
- package/dist/esm/Sankey/index.js +88 -0
- package/dist/esm/Scatter/index.js +12 -7
- package/dist/esm/Treemap/index.js +1 -0
- package/dist/esm/Venn/index.d.ts +32 -0
- package/dist/esm/Venn/index.js +69 -0
- package/dist/esm/Violin/index.d.ts +10 -0
- package/dist/esm/Violin/index.js +192 -0
- package/dist/esm/export.d.ts +7 -1
- package/dist/esm/export.js +8 -2
- package/dist/esm/types/chart.d.ts +6 -0
- package/dist/esm/types/chart.js +6 -0
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/373.async.js +1 -0
- package/dist/umd/index.min.js +1 -1
- package/package.json +1 -1
- package/dist/umd/962.async.js +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
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/Venn/index.tsx
|
|
30
|
+
var Venn_exports = {};
|
|
31
|
+
__export(Venn_exports, {
|
|
32
|
+
default: () => Venn_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Venn_exports);
|
|
35
|
+
var import_plots = require("@ant-design/plots");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_hooks = require("../ConfigProvider/hooks");
|
|
38
|
+
var import_theme = require("../theme");
|
|
39
|
+
var defaultConfig = (props) => {
|
|
40
|
+
const { data, style = {} } = props;
|
|
41
|
+
const { backgroundColor, palette } = style;
|
|
42
|
+
let paletteConfig = { color: void 0 };
|
|
43
|
+
const hasPalette = !!(palette == null ? void 0 : palette[0]);
|
|
44
|
+
if (hasPalette) {
|
|
45
|
+
paletteConfig = {
|
|
46
|
+
color: {
|
|
47
|
+
range: palette
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
data,
|
|
53
|
+
sizeField: "value",
|
|
54
|
+
...backgroundColor ? { viewStyle: { viewFill: backgroundColor } } : {},
|
|
55
|
+
labels: [
|
|
56
|
+
{
|
|
57
|
+
position: "inside",
|
|
58
|
+
text: (d) => d.label || "",
|
|
59
|
+
transform: [{ type: "contrastReverse" }],
|
|
60
|
+
fill: "#000",
|
|
61
|
+
fillOpacity: 0.85,
|
|
62
|
+
fontSize: 10
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
scale: {
|
|
66
|
+
...paletteConfig
|
|
67
|
+
},
|
|
68
|
+
tooltip: {
|
|
69
|
+
title: false,
|
|
70
|
+
items: [
|
|
71
|
+
(d) => {
|
|
72
|
+
return { name: d.key, value: d.size };
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
legend: false
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
var Venn = (props) => {
|
|
80
|
+
const themeConfig = import_theme.THEME_MAP[props.theme ?? "default"];
|
|
81
|
+
const config = (0, import_hooks.usePlotConfig)("Venn", defaultConfig, {
|
|
82
|
+
...props,
|
|
83
|
+
theme: themeConfig
|
|
84
|
+
});
|
|
85
|
+
return /* @__PURE__ */ import_react.default.createElement(import_plots.Venn, { ...config });
|
|
86
|
+
};
|
|
87
|
+
var Venn_default = Venn;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BasePlotProps, Style, Theme } from '../types';
|
|
3
|
+
type ViolinDatum = {
|
|
4
|
+
category: string;
|
|
5
|
+
value: number;
|
|
6
|
+
group?: string;
|
|
7
|
+
};
|
|
8
|
+
export type ViolinProps = BasePlotProps<ViolinDatum> & Theme & Style;
|
|
9
|
+
declare const Violin: (props: ViolinProps) => React.JSX.Element;
|
|
10
|
+
export default Violin;
|
|
@@ -0,0 +1,185 @@
|
|
|
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/Violin/index.tsx
|
|
30
|
+
var Violin_exports = {};
|
|
31
|
+
__export(Violin_exports, {
|
|
32
|
+
default: () => Violin_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Violin_exports);
|
|
35
|
+
var import_g2 = require("@antv/g2");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_theme = require("../theme");
|
|
38
|
+
var defaultConfig = (props) => {
|
|
39
|
+
var _a;
|
|
40
|
+
const { data, title, axisYTitle, axisXTitle, theme = "default", style = {} } = props;
|
|
41
|
+
const { backgroundColor, palette } = style;
|
|
42
|
+
const hasGroupField = ((_a = (data || [])[0]) == null ? void 0 : _a.group) !== void 0;
|
|
43
|
+
let encode = {};
|
|
44
|
+
let children = [];
|
|
45
|
+
if (hasGroupField) {
|
|
46
|
+
encode = {
|
|
47
|
+
x: "category",
|
|
48
|
+
y: "y",
|
|
49
|
+
color: "group",
|
|
50
|
+
series: "group",
|
|
51
|
+
size: "size"
|
|
52
|
+
};
|
|
53
|
+
children = [
|
|
54
|
+
{
|
|
55
|
+
type: "density",
|
|
56
|
+
data: {
|
|
57
|
+
transform: [{ type: "kde", field: "value", groupBy: ["category", "group"] }]
|
|
58
|
+
},
|
|
59
|
+
encode,
|
|
60
|
+
scale: {
|
|
61
|
+
y: {
|
|
62
|
+
nice: true
|
|
63
|
+
},
|
|
64
|
+
...(palette == null ? void 0 : palette[0]) ? {
|
|
65
|
+
color: {
|
|
66
|
+
range: palette
|
|
67
|
+
}
|
|
68
|
+
} : {}
|
|
69
|
+
},
|
|
70
|
+
...backgroundColor ? { viewStyle: { viewFill: backgroundColor } } : {}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "boxplot",
|
|
74
|
+
encode: {
|
|
75
|
+
x: "category",
|
|
76
|
+
y: "value",
|
|
77
|
+
series: "group",
|
|
78
|
+
color: "group",
|
|
79
|
+
shape: "violin"
|
|
80
|
+
},
|
|
81
|
+
style: { opacity: 0.5, strokeOpacity: 0.5, point: false },
|
|
82
|
+
...backgroundColor ? { viewStyle: { viewFill: backgroundColor } } : {},
|
|
83
|
+
scale: {
|
|
84
|
+
y: {
|
|
85
|
+
nice: true
|
|
86
|
+
},
|
|
87
|
+
...(palette == null ? void 0 : palette[0]) ? {
|
|
88
|
+
color: {
|
|
89
|
+
range: palette
|
|
90
|
+
}
|
|
91
|
+
} : {}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
];
|
|
95
|
+
} else {
|
|
96
|
+
encode = {
|
|
97
|
+
x: "category",
|
|
98
|
+
y: "y",
|
|
99
|
+
color: "category",
|
|
100
|
+
size: "size"
|
|
101
|
+
};
|
|
102
|
+
children = [
|
|
103
|
+
{
|
|
104
|
+
type: "density",
|
|
105
|
+
data: {
|
|
106
|
+
transform: [{ type: "kde", field: "value", groupBy: ["category"], size: 20 }]
|
|
107
|
+
},
|
|
108
|
+
encode,
|
|
109
|
+
scale: {
|
|
110
|
+
y: {
|
|
111
|
+
nice: true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
...backgroundColor ? { viewStyle: { viewFill: backgroundColor } } : {},
|
|
115
|
+
tooltip: false
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: "boxplot",
|
|
119
|
+
encode: {
|
|
120
|
+
x: "category",
|
|
121
|
+
y: "value",
|
|
122
|
+
color: "category",
|
|
123
|
+
shape: "violin"
|
|
124
|
+
},
|
|
125
|
+
style: { opacity: 0.5, strokeOpacity: 0.5, point: false },
|
|
126
|
+
...backgroundColor ? { viewStyle: { viewFill: backgroundColor } } : {},
|
|
127
|
+
scale: {
|
|
128
|
+
y: {
|
|
129
|
+
nice: true
|
|
130
|
+
},
|
|
131
|
+
...(palette == null ? void 0 : palette[0]) ? {
|
|
132
|
+
color: {
|
|
133
|
+
range: palette
|
|
134
|
+
}
|
|
135
|
+
} : {}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
type: "view",
|
|
142
|
+
theme: import_theme.THEME_MAP[theme],
|
|
143
|
+
title,
|
|
144
|
+
autoFit: true,
|
|
145
|
+
data,
|
|
146
|
+
axis: {
|
|
147
|
+
y: {
|
|
148
|
+
title: axisYTitle || false
|
|
149
|
+
},
|
|
150
|
+
x: {
|
|
151
|
+
title: axisXTitle || false
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
children,
|
|
155
|
+
scale: {
|
|
156
|
+
y: {
|
|
157
|
+
nice: true
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
...backgroundColor ? { viewStyle: { viewFill: backgroundColor } } : {}
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
var Violin = (props) => {
|
|
164
|
+
const containerRef = (0, import_react.useRef)(null);
|
|
165
|
+
const chartRef = (0, import_react.useRef)(null);
|
|
166
|
+
(0, import_react.useEffect)(() => {
|
|
167
|
+
if (!containerRef.current)
|
|
168
|
+
return;
|
|
169
|
+
const chart = new import_g2.Chart({
|
|
170
|
+
container: containerRef.current,
|
|
171
|
+
autoFit: true,
|
|
172
|
+
padding: "auto"
|
|
173
|
+
});
|
|
174
|
+
const config = defaultConfig(props);
|
|
175
|
+
chart.options(config);
|
|
176
|
+
chart.render();
|
|
177
|
+
chartRef.current = chart;
|
|
178
|
+
return () => {
|
|
179
|
+
chart.destroy();
|
|
180
|
+
chartRef.current = null;
|
|
181
|
+
};
|
|
182
|
+
}, [props]);
|
|
183
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { ref: containerRef });
|
|
184
|
+
};
|
|
185
|
+
var Violin_default = Violin;
|
package/dist/cjs/export.d.ts
CHANGED
|
@@ -2,14 +2,20 @@
|
|
|
2
2
|
/********** plot chart **********/
|
|
3
3
|
import { default as Area, type AreaProps } from './Area';
|
|
4
4
|
import { default as Bar, type BarProps } from './Bar';
|
|
5
|
+
import { default as Boxplot, type BoxplotProps } from './Boxplot';
|
|
5
6
|
import { default as Column, type ColumnProps } from './Column';
|
|
6
7
|
import { default as DualAxes, type DualAxesProps } from './DualAxes';
|
|
8
|
+
import { default as Funnel, type FunnelProps } from './Funnel';
|
|
7
9
|
import { default as Histogram, type HistogramProps } from './Histogram';
|
|
8
10
|
import { default as Line, type LineProps } from './Line';
|
|
11
|
+
import { default as Liquid, type LiquidProps } from './Liquid';
|
|
9
12
|
import { default as Pie, type PieProps } from './Pie';
|
|
10
13
|
import { default as Radar, type RadarProps } from './Radar';
|
|
14
|
+
import { default as Sankey, type SankeyProps } from './Sankey';
|
|
11
15
|
import { default as Scatter, type ScatterProps } from './Scatter';
|
|
12
16
|
import { default as Treemap, type TreemapProps } from './Treemap';
|
|
17
|
+
import { default as Venn, type VennProps } from './Venn';
|
|
18
|
+
import { default as Violin, type ViolinProps } from './Violin';
|
|
13
19
|
import { default as WordCloud, type WordCloudProps } from './WordCloud';
|
|
14
20
|
/********** graph chart **********/
|
|
15
21
|
import { default as FishboneDiagram, type FishboneDiagramProps } from './FishboneDiagram';
|
|
@@ -23,5 +29,5 @@ export { Map, type MapProps } from './export-map';
|
|
|
23
29
|
import { PinMap, type PinMapProps, HeatMap, type HeatMapProps, PathMap, type PathMapProps } from './export-map';
|
|
24
30
|
/********** NTV **********/
|
|
25
31
|
export { VisText, type VisTextProps } from './Text';
|
|
26
|
-
export { Area, Bar, Column, DualAxes, FishboneDiagram, FlowDiagram, HeatMap, Histogram, Line, MindMap, NetworkGraph, PathMap, Pie, PinMap, Radar, Scatter, Treemap, WordCloud, type AreaProps, type BarProps, type ColumnProps, type DualAxesProps, type FishboneDiagramProps, type FlowDiagramProps, type HeatMapProps, type HistogramProps, type LineProps, type MindMapProps, type NetworkGraphProps, type PathMapProps, type PieProps, type PinMapProps, type RadarProps, type ScatterProps, type TreemapProps, type WordCloudProps, };
|
|
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, };
|
|
27
33
|
export declare const DEFAULT_CHART_COMPONENTS: Record<string, React.FC<any>>;
|
package/dist/cjs/export.js
CHANGED
|
@@ -31,15 +31,18 @@ var export_exports = {};
|
|
|
31
31
|
__export(export_exports, {
|
|
32
32
|
Area: () => import_Area.default,
|
|
33
33
|
Bar: () => import_Bar.default,
|
|
34
|
+
Boxplot: () => import_Boxplot.default,
|
|
34
35
|
Column: () => import_Column.default,
|
|
35
36
|
DEFAULT_CHART_COMPONENTS: () => DEFAULT_CHART_COMPONENTS,
|
|
36
37
|
DualAxes: () => import_DualAxes.default,
|
|
37
38
|
FishboneDiagram: () => import_FishboneDiagram.default,
|
|
38
39
|
FlowDiagram: () => import_FlowDiagram.default,
|
|
40
|
+
Funnel: () => import_Funnel.default,
|
|
39
41
|
HeatMap: () => import_export_map2.HeatMap,
|
|
40
42
|
Histogram: () => import_Histogram.default,
|
|
41
43
|
IndentedTree: () => import_IndentedTree.default,
|
|
42
44
|
Line: () => import_Line.default,
|
|
45
|
+
Liquid: () => import_Liquid.default,
|
|
43
46
|
Map: () => import_export_map.Map,
|
|
44
47
|
MindMap: () => import_MindMap.default,
|
|
45
48
|
NetworkGraph: () => import_NetworkGraph.default,
|
|
@@ -48,8 +51,11 @@ __export(export_exports, {
|
|
|
48
51
|
Pie: () => import_Pie.default,
|
|
49
52
|
PinMap: () => import_export_map2.PinMap,
|
|
50
53
|
Radar: () => import_Radar.default,
|
|
54
|
+
Sankey: () => import_Sankey.default,
|
|
51
55
|
Scatter: () => import_Scatter.default,
|
|
52
56
|
Treemap: () => import_Treemap.default,
|
|
57
|
+
Venn: () => import_Venn.default,
|
|
58
|
+
Violin: () => import_Violin.default,
|
|
53
59
|
VisText: () => import_Text.VisText,
|
|
54
60
|
WordCloud: () => import_WordCloud.default
|
|
55
61
|
});
|
|
@@ -57,14 +63,20 @@ module.exports = __toCommonJS(export_exports);
|
|
|
57
63
|
var import_types = require("./types");
|
|
58
64
|
var import_Area = __toESM(require("./Area"));
|
|
59
65
|
var import_Bar = __toESM(require("./Bar"));
|
|
66
|
+
var import_Boxplot = __toESM(require("./Boxplot"));
|
|
60
67
|
var import_Column = __toESM(require("./Column"));
|
|
61
68
|
var import_DualAxes = __toESM(require("./DualAxes"));
|
|
69
|
+
var import_Funnel = __toESM(require("./Funnel"));
|
|
62
70
|
var import_Histogram = __toESM(require("./Histogram"));
|
|
63
71
|
var import_Line = __toESM(require("./Line"));
|
|
72
|
+
var import_Liquid = __toESM(require("./Liquid"));
|
|
64
73
|
var import_Pie = __toESM(require("./Pie"));
|
|
65
74
|
var import_Radar = __toESM(require("./Radar"));
|
|
75
|
+
var import_Sankey = __toESM(require("./Sankey"));
|
|
66
76
|
var import_Scatter = __toESM(require("./Scatter"));
|
|
67
77
|
var import_Treemap = __toESM(require("./Treemap"));
|
|
78
|
+
var import_Venn = __toESM(require("./Venn"));
|
|
79
|
+
var import_Violin = __toESM(require("./Violin"));
|
|
68
80
|
var import_WordCloud = __toESM(require("./WordCloud"));
|
|
69
81
|
var import_FishboneDiagram = __toESM(require("./FishboneDiagram"));
|
|
70
82
|
var import_FlowDiagram = __toESM(require("./FlowDiagram"));
|
|
@@ -76,31 +88,46 @@ var import_export_map = require("./export-map");
|
|
|
76
88
|
var import_export_map2 = require("./export-map");
|
|
77
89
|
var import_Text = require("./Text");
|
|
78
90
|
var DEFAULT_CHART_COMPONENTS = {
|
|
79
|
-
[import_types.ChartType.Line]: import_Line.default,
|
|
80
|
-
[import_types.ChartType.Column]: import_Column.default,
|
|
81
|
-
[import_types.ChartType.Pie]: import_Pie.default,
|
|
82
|
-
[import_types.ChartType.Bar]: import_Bar.default,
|
|
83
91
|
[import_types.ChartType.Area]: import_Area.default,
|
|
84
|
-
[import_types.ChartType.
|
|
85
|
-
[import_types.ChartType.
|
|
92
|
+
[import_types.ChartType.Bar]: import_Bar.default,
|
|
93
|
+
[import_types.ChartType.Boxplot]: import_Boxplot.default,
|
|
94
|
+
[import_types.ChartType.Column]: import_Column.default,
|
|
95
|
+
[import_types.ChartType.DualAxes]: import_DualAxes.default,
|
|
96
|
+
[import_types.ChartType.FishboneDiagram]: import_FishboneDiagram.default,
|
|
97
|
+
[import_types.ChartType.FlowDiagram]: import_FlowDiagram.default,
|
|
98
|
+
[import_types.ChartType.Funnel]: import_Funnel.default,
|
|
86
99
|
[import_types.ChartType.HeatMap]: import_export_map2.HeatMap,
|
|
100
|
+
[import_types.ChartType.Histogram]: import_Histogram.default,
|
|
101
|
+
[import_types.ChartType.Line]: import_Line.default,
|
|
102
|
+
[import_types.ChartType.Liquid]: import_Liquid.default,
|
|
87
103
|
[import_types.ChartType.MindMap]: import_MindMap.default,
|
|
88
|
-
[import_types.ChartType.
|
|
89
|
-
[import_types.ChartType.
|
|
104
|
+
[import_types.ChartType.NetworkGraph]: import_NetworkGraph.default,
|
|
105
|
+
[import_types.ChartType.Pie]: import_Pie.default,
|
|
106
|
+
[import_types.ChartType.PinMap]: import_export_map2.PinMap,
|
|
107
|
+
[import_types.ChartType.Radar]: import_Radar.default,
|
|
108
|
+
[import_types.ChartType.Sankey]: import_Sankey.default,
|
|
109
|
+
[import_types.ChartType.Scatter]: import_Scatter.default,
|
|
110
|
+
[import_types.ChartType.Treemap]: import_Treemap.default,
|
|
111
|
+
[import_types.ChartType.Venn]: import_Venn.default,
|
|
112
|
+
[import_types.ChartType.Violin]: import_Violin.default,
|
|
113
|
+
[import_types.ChartType.WordCloud]: import_WordCloud.default
|
|
90
114
|
};
|
|
91
115
|
// Annotate the CommonJS export names for ESM import in node:
|
|
92
116
|
0 && (module.exports = {
|
|
93
117
|
Area,
|
|
94
118
|
Bar,
|
|
119
|
+
Boxplot,
|
|
95
120
|
Column,
|
|
96
121
|
DEFAULT_CHART_COMPONENTS,
|
|
97
122
|
DualAxes,
|
|
98
123
|
FishboneDiagram,
|
|
99
124
|
FlowDiagram,
|
|
125
|
+
Funnel,
|
|
100
126
|
HeatMap,
|
|
101
127
|
Histogram,
|
|
102
128
|
IndentedTree,
|
|
103
129
|
Line,
|
|
130
|
+
Liquid,
|
|
104
131
|
Map,
|
|
105
132
|
MindMap,
|
|
106
133
|
NetworkGraph,
|
|
@@ -109,8 +136,11 @@ var DEFAULT_CHART_COMPONENTS = {
|
|
|
109
136
|
Pie,
|
|
110
137
|
PinMap,
|
|
111
138
|
Radar,
|
|
139
|
+
Sankey,
|
|
112
140
|
Scatter,
|
|
113
141
|
Treemap,
|
|
142
|
+
Venn,
|
|
143
|
+
Violin,
|
|
114
144
|
VisText,
|
|
115
145
|
WordCloud
|
|
116
146
|
});
|
|
@@ -14,6 +14,12 @@ export declare enum ChartType {
|
|
|
14
14
|
WordCloud = "word-cloud",
|
|
15
15
|
DualAxes = "dual-axes",
|
|
16
16
|
Radar = "radar",
|
|
17
|
+
Liquid = "liquid",
|
|
18
|
+
Boxplot = "boxplot",
|
|
19
|
+
Violin = "violin",
|
|
20
|
+
Venn = "venn",
|
|
21
|
+
Funnel = "funnel",
|
|
22
|
+
Sankey = "sankey",
|
|
17
23
|
PinMap = "pin-map",
|
|
18
24
|
PathMap = "path-map",
|
|
19
25
|
HeatMap = "heat-map",
|
package/dist/cjs/types/chart.js
CHANGED
|
@@ -34,6 +34,12 @@ var ChartType = /* @__PURE__ */ ((ChartType2) => {
|
|
|
34
34
|
ChartType2["WordCloud"] = "word-cloud";
|
|
35
35
|
ChartType2["DualAxes"] = "dual-axes";
|
|
36
36
|
ChartType2["Radar"] = "radar";
|
|
37
|
+
ChartType2["Liquid"] = "liquid";
|
|
38
|
+
ChartType2["Boxplot"] = "boxplot";
|
|
39
|
+
ChartType2["Violin"] = "violin";
|
|
40
|
+
ChartType2["Venn"] = "venn";
|
|
41
|
+
ChartType2["Funnel"] = "funnel";
|
|
42
|
+
ChartType2["Sankey"] = "sankey";
|
|
37
43
|
ChartType2["PinMap"] = "pin-map";
|
|
38
44
|
ChartType2["PathMap"] = "path-map";
|
|
39
45
|
ChartType2["HeatMap"] = "heat-map";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.5.
|
|
1
|
+
declare const _default: "0.5.7";
|
|
2
2
|
export default _default;
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Bar/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ type BarDataItem = {
|
|
|
6
6
|
value: number;
|
|
7
7
|
[key: string]: string | number;
|
|
8
8
|
};
|
|
9
|
-
export type BarProps = BasePlotProps<BarDataItem> & Partial<BarConfig> & Theme & Style
|
|
9
|
+
export type BarProps = BasePlotProps<BarDataItem> & Partial<BarConfig> & Theme & Style & {
|
|
10
|
+
group?: boolean;
|
|
11
|
+
stack?: boolean;
|
|
12
|
+
};
|
|
10
13
|
declare const Bar: (props: BarProps) => React.JSX.Element;
|
|
11
14
|
export default Bar;
|
package/dist/esm/Bar/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var defaultConfig = function defaultConfig(props) {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
return _objectSpread({
|
|
47
|
+
return _objectSpread(_objectSpread({
|
|
48
48
|
xField: xField,
|
|
49
49
|
yField: yField,
|
|
50
50
|
colorField: hasGroupField ? 'group' : xField,
|
|
@@ -69,13 +69,23 @@ var defaultConfig = function defaultConfig(props) {
|
|
|
69
69
|
}
|
|
70
70
|
} : {
|
|
71
71
|
viewStyle: undefined
|
|
72
|
+
}), {}, {
|
|
73
|
+
legend: hasGroupField ? {} : false
|
|
72
74
|
});
|
|
73
75
|
};
|
|
74
76
|
var Bar = function Bar(props) {
|
|
75
77
|
var _props$theme2;
|
|
76
78
|
var themeConfig = THEME_MAP[(_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 ? _props$theme2 : 'default'];
|
|
79
|
+
var data = props.data,
|
|
80
|
+
_props$group = props.group,
|
|
81
|
+
group = _props$group === void 0 ? false : _props$group,
|
|
82
|
+
_props$stack = props.stack,
|
|
83
|
+
stack = _props$stack === void 0 ? false : _props$stack;
|
|
84
|
+
var hasGroupField = get(data, '[0].group') !== undefined;
|
|
77
85
|
var config = usePlotConfig('Bar', defaultConfig, _objectSpread(_objectSpread({}, props), {}, {
|
|
78
|
-
theme: themeConfig
|
|
86
|
+
theme: themeConfig,
|
|
87
|
+
group: hasGroupField && group,
|
|
88
|
+
stack: hasGroupField && stack
|
|
79
89
|
}));
|
|
80
90
|
return /*#__PURE__*/React.createElement(ADCBar, config);
|
|
81
91
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BasePlotProps, Style, Theme } from '../types';
|
|
3
|
+
type BoxplotDatum = {
|
|
4
|
+
category: string;
|
|
5
|
+
value: number;
|
|
6
|
+
group?: string;
|
|
7
|
+
};
|
|
8
|
+
export type BoxplotProps = BasePlotProps<BoxplotDatum> & Theme & Style & {
|
|
9
|
+
xField?: string;
|
|
10
|
+
yField?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const Boxplot: (props: BoxplotProps) => React.JSX.Element;
|
|
13
|
+
export default Boxplot;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { Box as ADCBox } from '@ant-design/plots';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { usePlotConfig } from "../ConfigProvider/hooks";
|
|
10
|
+
import { THEME_MAP } from "../theme";
|
|
11
|
+
var defaultConfig = function defaultConfig(props) {
|
|
12
|
+
var _;
|
|
13
|
+
var data = props.data,
|
|
14
|
+
_props$style = props.style,
|
|
15
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
16
|
+
axisYTitle = props.axisYTitle,
|
|
17
|
+
axisXTitle = props.axisXTitle,
|
|
18
|
+
_props$xField = props.xField,
|
|
19
|
+
xField = _props$xField === void 0 ? 'category' : _props$xField,
|
|
20
|
+
_props$yField = props.yField,
|
|
21
|
+
yField = _props$yField === void 0 ? 'value' : _props$yField;
|
|
22
|
+
var backgroundColor = style.backgroundColor,
|
|
23
|
+
palette = style.palette;
|
|
24
|
+
var hasGroupField = ((_ = (data || [])[0]) === null || _ === void 0 ? void 0 : _.group) !== undefined;
|
|
25
|
+
var paletteConfig = {
|
|
26
|
+
color: undefined
|
|
27
|
+
};
|
|
28
|
+
var hasPalette = !!(palette !== null && palette !== void 0 && palette[0]);
|
|
29
|
+
var colorField = hasGroupField ? 'group' : 'category';
|
|
30
|
+
var seriesField = hasGroupField ? 'group' : 'category';
|
|
31
|
+
if (hasPalette) {
|
|
32
|
+
paletteConfig = {
|
|
33
|
+
color: {
|
|
34
|
+
range: palette
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return _objectSpread({
|
|
39
|
+
data: data,
|
|
40
|
+
boxType: 'boxplot',
|
|
41
|
+
xField: xField,
|
|
42
|
+
yField: yField,
|
|
43
|
+
colorField: colorField,
|
|
44
|
+
seriesField: seriesField,
|
|
45
|
+
axis: {
|
|
46
|
+
y: {
|
|
47
|
+
title: axisYTitle || false
|
|
48
|
+
},
|
|
49
|
+
x: {
|
|
50
|
+
title: axisXTitle || false
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
scale: _objectSpread({
|
|
54
|
+
x: {
|
|
55
|
+
paddingInner: 0.6,
|
|
56
|
+
paddingOuter: 0.3
|
|
57
|
+
},
|
|
58
|
+
series: {
|
|
59
|
+
paddingInner: 0.3,
|
|
60
|
+
paddingOuter: 0.1
|
|
61
|
+
},
|
|
62
|
+
y: {
|
|
63
|
+
nice: true
|
|
64
|
+
}
|
|
65
|
+
}, paletteConfig),
|
|
66
|
+
style: {
|
|
67
|
+
stroke: 'black'
|
|
68
|
+
}
|
|
69
|
+
}, backgroundColor ? {
|
|
70
|
+
viewStyle: {
|
|
71
|
+
viewFill: backgroundColor
|
|
72
|
+
}
|
|
73
|
+
} : {});
|
|
74
|
+
};
|
|
75
|
+
var Boxplot = function Boxplot(props) {
|
|
76
|
+
var _props$theme;
|
|
77
|
+
var themeConfig = THEME_MAP[(_props$theme = props.theme) !== null && _props$theme !== void 0 ? _props$theme : 'default'];
|
|
78
|
+
var config = usePlotConfig('Boxplot', defaultConfig, _objectSpread(_objectSpread({}, props), {}, {
|
|
79
|
+
theme: themeConfig
|
|
80
|
+
}));
|
|
81
|
+
return /*#__PURE__*/React.createElement(ADCBox, config);
|
|
82
|
+
};
|
|
83
|
+
export default Boxplot;
|
|
@@ -5,6 +5,9 @@ export type ColumnDataItem = {
|
|
|
5
5
|
value: number;
|
|
6
6
|
[key: string]: string | number;
|
|
7
7
|
};
|
|
8
|
-
export type ColumnProps = BasePlotProps<ColumnDataItem> & Theme & Style
|
|
8
|
+
export type ColumnProps = BasePlotProps<ColumnDataItem> & Theme & Style & {
|
|
9
|
+
group?: boolean;
|
|
10
|
+
stack?: boolean;
|
|
11
|
+
};
|
|
9
12
|
declare const Column: (props: ColumnProps) => React.JSX.Element;
|
|
10
13
|
export default Column;
|
package/dist/esm/Column/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var defaultConfig = function defaultConfig(props) {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
return _objectSpread({
|
|
47
|
+
return _objectSpread(_objectSpread({
|
|
48
48
|
xField: xField,
|
|
49
49
|
yField: yField,
|
|
50
50
|
colorField: hasGroupField ? 'group' : xField,
|
|
@@ -69,13 +69,24 @@ var defaultConfig = function defaultConfig(props) {
|
|
|
69
69
|
}
|
|
70
70
|
} : {
|
|
71
71
|
viewStyle: undefined
|
|
72
|
+
}), {}, {
|
|
73
|
+
legend: hasGroupField ? {} : false,
|
|
74
|
+
group: hasGroupField
|
|
72
75
|
});
|
|
73
76
|
};
|
|
74
77
|
var Column = function Column(props) {
|
|
75
78
|
var _props$theme2;
|
|
76
79
|
var themeConfig = THEME_MAP[(_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 ? _props$theme2 : 'default'];
|
|
80
|
+
var data = props.data,
|
|
81
|
+
_props$group = props.group,
|
|
82
|
+
group = _props$group === void 0 ? false : _props$group,
|
|
83
|
+
_props$stack = props.stack,
|
|
84
|
+
stack = _props$stack === void 0 ? false : _props$stack;
|
|
85
|
+
var hasGroupField = get(data, '[0].group') !== undefined;
|
|
77
86
|
var config = usePlotConfig('Column', defaultConfig, _objectSpread(_objectSpread({}, props), {}, {
|
|
78
|
-
theme: themeConfig
|
|
87
|
+
theme: themeConfig,
|
|
88
|
+
group: hasGroupField && group,
|
|
89
|
+
stack: hasGroupField && stack
|
|
79
90
|
}));
|
|
80
91
|
return /*#__PURE__*/React.createElement(ADCColumn, config);
|
|
81
92
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BasePlotProps, Style, Theme } from '../types';
|
|
3
|
+
type FunnelDatum = {
|
|
4
|
+
category: string;
|
|
5
|
+
value: number;
|
|
6
|
+
};
|
|
7
|
+
export type FunnelProps = BasePlotProps<FunnelDatum> & Theme & Style & {
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
};
|
|
11
|
+
declare const Funnel: (props: FunnelProps) => React.JSX.Element;
|
|
12
|
+
export default Funnel;
|