@antv/gpt-vis 0.5.6 → 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.
Files changed (71) hide show
  1. package/README.ja-JP.md +11 -11
  2. package/README.md +11 -11
  3. package/README.zh-CN.md +11 -11
  4. package/dist/cjs/Bar/index.d.ts +4 -1
  5. package/dist/cjs/Bar/index.js +7 -2
  6. package/dist/cjs/Boxplot/index.d.ts +13 -0
  7. package/dist/cjs/Boxplot/index.js +88 -0
  8. package/dist/cjs/ChartCodeRender/VisChart.js +1 -1
  9. package/dist/cjs/ChartCodeRender/styles.d.ts +5 -1
  10. package/dist/cjs/ChartCodeRender/styles.js +8 -1
  11. package/dist/cjs/Column/index.d.ts +4 -1
  12. package/dist/cjs/Column/index.js +8 -2
  13. package/dist/cjs/DualAxes/util.js +4 -1
  14. package/dist/cjs/Funnel/index.d.ts +12 -0
  15. package/dist/cjs/Funnel/index.js +173 -0
  16. package/dist/cjs/Liquid/index.d.ts +11 -0
  17. package/dist/cjs/Liquid/index.js +85 -0
  18. package/dist/cjs/Pie/index.d.ts +3 -1
  19. package/dist/cjs/Pie/index.js +3 -1
  20. package/dist/cjs/Sankey/index.d.ts +12 -0
  21. package/dist/cjs/Sankey/index.js +103 -0
  22. package/dist/cjs/Scatter/index.js +7 -4
  23. package/dist/cjs/Table/index.d.ts +9 -0
  24. package/dist/cjs/Table/index.js +91 -0
  25. package/dist/cjs/Treemap/index.js +1 -0
  26. package/dist/cjs/Venn/index.d.ts +32 -0
  27. package/dist/cjs/Venn/index.js +87 -0
  28. package/dist/cjs/Violin/index.d.ts +10 -0
  29. package/dist/cjs/Violin/index.js +185 -0
  30. package/dist/cjs/export.d.ts +10 -3
  31. package/dist/cjs/export.js +45 -9
  32. package/dist/cjs/types/chart.d.ts +20 -13
  33. package/dist/cjs/types/chart.js +19 -12
  34. package/dist/cjs/version.d.ts +1 -1
  35. package/dist/cjs/version.js +1 -1
  36. package/dist/esm/Bar/index.d.ts +4 -1
  37. package/dist/esm/Bar/index.js +12 -2
  38. package/dist/esm/Boxplot/index.d.ts +13 -0
  39. package/dist/esm/Boxplot/index.js +83 -0
  40. package/dist/esm/ChartCodeRender/VisChart.js +2 -1
  41. package/dist/esm/ChartCodeRender/styles.d.ts +5 -1
  42. package/dist/esm/ChartCodeRender/styles.js +5 -2
  43. package/dist/esm/Column/index.d.ts +4 -1
  44. package/dist/esm/Column/index.js +13 -2
  45. package/dist/esm/DualAxes/util.js +4 -1
  46. package/dist/esm/Funnel/index.d.ts +12 -0
  47. package/dist/esm/Funnel/index.js +171 -0
  48. package/dist/esm/Liquid/index.d.ts +11 -0
  49. package/dist/esm/Liquid/index.js +100 -0
  50. package/dist/esm/Pie/index.d.ts +3 -1
  51. package/dist/esm/Pie/index.js +5 -1
  52. package/dist/esm/Sankey/index.d.ts +12 -0
  53. package/dist/esm/Sankey/index.js +85 -0
  54. package/dist/esm/Scatter/index.js +12 -7
  55. package/dist/esm/Table/index.d.ts +9 -0
  56. package/dist/esm/Table/index.js +30 -0
  57. package/dist/esm/Treemap/index.js +1 -0
  58. package/dist/esm/Venn/index.d.ts +32 -0
  59. package/dist/esm/Venn/index.js +69 -0
  60. package/dist/esm/Violin/index.d.ts +10 -0
  61. package/dist/esm/Violin/index.js +192 -0
  62. package/dist/esm/export.d.ts +10 -3
  63. package/dist/esm/export.js +11 -4
  64. package/dist/esm/types/chart.d.ts +20 -13
  65. package/dist/esm/types/chart.js +19 -12
  66. package/dist/esm/version.d.ts +1 -1
  67. package/dist/esm/version.js +1 -1
  68. package/dist/umd/922.async.js +1 -0
  69. package/dist/umd/index.min.js +1 -1
  70. package/package.json +32 -30
  71. package/dist/umd/962.async.js +0 -1
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { BasePlotProps, Style, Theme } from '../types';
3
+ type SankeyDatum = {
4
+ source: string;
5
+ target: string;
6
+ value: number;
7
+ };
8
+ export type SankeyProps = BasePlotProps<SankeyDatum> & Theme & Style & {
9
+ nodeAlign?: 'left' | 'center' | 'right' | 'justify';
10
+ };
11
+ declare const Sankey: (props: SankeyProps) => React.JSX.Element;
12
+ export default Sankey;
@@ -0,0 +1,103 @@
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/Sankey/index.tsx
30
+ var Sankey_exports = {};
31
+ __export(Sankey_exports, {
32
+ default: () => Sankey_default
33
+ });
34
+ module.exports = __toCommonJS(Sankey_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
+ const { title, data, theme = "default", nodeAlign = "center", style = {} } = props;
40
+ const { backgroundColor, palette } = style;
41
+ const hasPalette = !!(palette == null ? void 0 : palette[0]);
42
+ let paletteConfig = {};
43
+ if (hasPalette) {
44
+ paletteConfig = {
45
+ color: {
46
+ range: palette
47
+ }
48
+ };
49
+ }
50
+ return {
51
+ title,
52
+ type: "sankey",
53
+ theme: import_theme.THEME_MAP[theme],
54
+ layout: {
55
+ nodeAlign,
56
+ nodePadding: 0.01
57
+ },
58
+ data: {
59
+ type: "inline",
60
+ value: data,
61
+ transform: [
62
+ {
63
+ type: "custom",
64
+ callback: (data2) => ({
65
+ links: data2
66
+ })
67
+ }
68
+ ]
69
+ },
70
+ scale: {
71
+ ...paletteConfig
72
+ },
73
+ style: {
74
+ labelSpacing: 2,
75
+ nodeLineWidth: 1,
76
+ linkFillOpacity: 0.3
77
+ },
78
+ ...backgroundColor ? { viewStyle: { viewFill: backgroundColor } } : {}
79
+ };
80
+ };
81
+ var Sankey = (props) => {
82
+ const containerRef = (0, import_react.useRef)(null);
83
+ const chartRef = (0, import_react.useRef)(null);
84
+ (0, import_react.useEffect)(() => {
85
+ if (!containerRef.current)
86
+ return;
87
+ const chart = new import_g2.Chart({
88
+ container: containerRef.current,
89
+ autoFit: true,
90
+ padding: "auto"
91
+ });
92
+ const config = defaultConfig(props);
93
+ chart.options(config);
94
+ chart.render();
95
+ chartRef.current = chart;
96
+ return () => {
97
+ chart.destroy();
98
+ chartRef.current = null;
99
+ };
100
+ }, [props]);
101
+ return /* @__PURE__ */ import_react.default.createElement("div", { ref: containerRef });
102
+ };
103
+ var Sankey_default = Sankey;
@@ -71,10 +71,13 @@ var defaultConfig = (props) => {
71
71
  data,
72
72
  xField,
73
73
  yField,
74
- tooltip: [
75
- { channel: "x", name: axisXTitle || "x" },
76
- { channel: "y", name: axisYTitle || "y" }
77
- ],
74
+ tooltip: {
75
+ title: (d) => (d == null ? void 0 : d.group) ? d.group : false,
76
+ items: [
77
+ { channel: "x", name: axisXTitle || "x" },
78
+ { channel: "y", name: axisYTitle || "y" }
79
+ ]
80
+ },
78
81
  legend: hasGroupField ? {} : false,
79
82
  encode,
80
83
  scale: {
@@ -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;
@@ -87,6 +87,7 @@ var Treemap = (props) => {
87
87
  });
88
88
  const { data, ...others } = config;
89
89
  const transformData = (0, import_react.useMemo)(() => transform(data), [data]);
90
+ console.log("treemap config:", config, props);
90
91
  return /* @__PURE__ */ import_react.default.createElement(import_plots.Treemap, { ...others, data: transformData });
91
92
  };
92
93
  var Treemap_default = Treemap;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import type { BasePlotProps, Style, Theme } from '../types';
3
+ type VennDatum = {
4
+ /**
5
+ * Label for the venn chart segment.
6
+ * This should be a string that describes the segment.
7
+ * For example, "A", "B", or "A ∩ B" for intersections.
8
+ * It is used to identify the segment in the chart.
9
+ */
10
+ label?: string;
11
+ /**
12
+ * Value for the venn chart segment.
13
+ * This should be a number that represents the size or count of the segment.
14
+ * For example, if the segment represents a set of items, this could be the number of items in that set.
15
+ * It is used to determine the size of the segment in the chart.
16
+ * For intersections, this value should represent the count of items that belong to the intersection of sets.
17
+ * For example, if "A ∩ B" represents the intersection of sets A and B, this value should be the count of items that are in both sets.
18
+ */
19
+ value: number;
20
+ /**
21
+ * Sets that the segment belongs to.
22
+ * This should be an array of strings representing the sets that the segment is part of.
23
+ * For example, if the segment represents items that belong to both set A and set B, this could be ['A', 'B'].
24
+ * It is used to determine how the segment is displayed in the venn chart.
25
+ * For intersections, this array should include the sets that contribute to the intersection.
26
+ * For example, if "A ∩ B" represents the intersection of sets A and B, this array should be ['A', 'B'].
27
+ */
28
+ sets: string[] | number[];
29
+ };
30
+ export type VennProps = BasePlotProps<VennDatum> & Theme & Style;
31
+ declare const Venn: (props: VennProps) => React.JSX.Element;
32
+ export default Venn;
@@ -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;
@@ -2,26 +2,33 @@
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';
16
22
  import { default as FlowDiagram, type FlowDiagramProps } from './FlowDiagram';
17
23
  import { default as MindMap, type MindMapProps } from './MindMap';
18
24
  import { default as NetworkGraph, type NetworkGraphProps } from './NetworkGraph';
19
- export { default as IndentedTree, type IndentedTreeProps } from './IndentedTree';
20
- 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';
21
27
  /********** map chart **********/
22
28
  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 **********/
31
+ import { default as Table, type TableProps } from './Table';
25
32
  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, };
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, };
27
34
  export declare const DEFAULT_CHART_COMPONENTS: Record<string, React.FC<any>>;