@antv/gpt-vis 0.4.7 → 0.5.0-beta.0

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 (76) hide show
  1. package/dist/cjs/ssr/area.d.ts +6 -0
  2. package/dist/cjs/ssr/area.js +64 -0
  3. package/dist/cjs/ssr/bar.d.ts +6 -0
  4. package/dist/cjs/ssr/bar.js +79 -0
  5. package/dist/cjs/ssr/column.d.ts +6 -0
  6. package/dist/cjs/ssr/column.js +77 -0
  7. package/dist/cjs/ssr/dual-axes.d.ts +6 -0
  8. package/dist/cjs/ssr/dual-axes.js +98 -0
  9. package/dist/cjs/ssr/fishbone-diagram.d.ts +6 -0
  10. package/dist/cjs/ssr/fishbone-diagram.js +189 -0
  11. package/dist/cjs/ssr/flow-diagram.d.ts +6 -0
  12. package/dist/cjs/ssr/flow-diagram.js +82 -0
  13. package/dist/cjs/ssr/histogram.d.ts +6 -0
  14. package/dist/cjs/ssr/histogram.js +50 -0
  15. package/dist/cjs/ssr/index.d.ts +2 -0
  16. package/dist/cjs/ssr/index.js +79 -0
  17. package/dist/cjs/ssr/line.d.ts +6 -0
  18. package/dist/cjs/ssr/line.js +62 -0
  19. package/dist/cjs/ssr/mind-map.d.ts +6 -0
  20. package/dist/cjs/ssr/mind-map.js +326 -0
  21. package/dist/cjs/ssr/network-graph.d.ts +6 -0
  22. package/dist/cjs/ssr/network-graph.js +72 -0
  23. package/dist/cjs/ssr/pie.d.ts +6 -0
  24. package/dist/cjs/ssr/pie.js +64 -0
  25. package/dist/cjs/ssr/radar.d.ts +6 -0
  26. package/dist/cjs/ssr/radar.js +92 -0
  27. package/dist/cjs/ssr/scatter.d.ts +6 -0
  28. package/dist/cjs/ssr/scatter.js +56 -0
  29. package/dist/cjs/ssr/treemap.d.ts +6 -0
  30. package/dist/cjs/ssr/treemap.js +57 -0
  31. package/dist/cjs/ssr/type.d.ts +30 -0
  32. package/dist/cjs/ssr/type.js +17 -0
  33. package/dist/cjs/ssr/word-cloud.d.ts +6 -0
  34. package/dist/cjs/ssr/word-cloud.js +48 -0
  35. package/dist/cjs/version.d.ts +1 -1
  36. package/dist/cjs/version.js +1 -1
  37. package/dist/esm/ssr/area.d.ts +6 -0
  38. package/dist/esm/ssr/area.js +67 -0
  39. package/dist/esm/ssr/bar.d.ts +6 -0
  40. package/dist/esm/ssr/bar.js +71 -0
  41. package/dist/esm/ssr/column.d.ts +6 -0
  42. package/dist/esm/ssr/column.js +65 -0
  43. package/dist/esm/ssr/dual-axes.d.ts +6 -0
  44. package/dist/esm/ssr/dual-axes.js +122 -0
  45. package/dist/esm/ssr/fishbone-diagram.d.ts +6 -0
  46. package/dist/esm/ssr/fishbone-diagram.js +195 -0
  47. package/dist/esm/ssr/flow-diagram.d.ts +6 -0
  48. package/dist/esm/ssr/flow-diagram.js +89 -0
  49. package/dist/esm/ssr/histogram.d.ts +6 -0
  50. package/dist/esm/ssr/histogram.js +56 -0
  51. package/dist/esm/ssr/index.d.ts +2 -0
  52. package/dist/esm/ssr/index.js +68 -0
  53. package/dist/esm/ssr/line.d.ts +6 -0
  54. package/dist/esm/ssr/line.js +61 -0
  55. package/dist/esm/ssr/mind-map.d.ts +6 -0
  56. package/dist/esm/ssr/mind-map.js +416 -0
  57. package/dist/esm/ssr/network-graph.d.ts +6 -0
  58. package/dist/esm/ssr/network-graph.js +79 -0
  59. package/dist/esm/ssr/pie.d.ts +6 -0
  60. package/dist/esm/ssr/pie.js +66 -0
  61. package/dist/esm/ssr/radar.d.ts +6 -0
  62. package/dist/esm/ssr/radar.js +88 -0
  63. package/dist/esm/ssr/scatter.d.ts +6 -0
  64. package/dist/esm/ssr/scatter.js +52 -0
  65. package/dist/esm/ssr/treemap.d.ts +6 -0
  66. package/dist/esm/ssr/treemap.js +51 -0
  67. package/dist/esm/ssr/type.d.ts +30 -0
  68. package/dist/esm/ssr/type.js +1 -0
  69. package/dist/esm/ssr/word-cloud.d.ts +6 -0
  70. package/dist/esm/ssr/word-cloud.js +40 -0
  71. package/dist/esm/version.d.ts +1 -1
  72. package/dist/esm/version.js +1 -1
  73. package/dist/umd/424.async.js +1 -0
  74. package/dist/umd/index.min.js +1 -1
  75. package/package.json +58 -31
  76. package/dist/umd/100.async.js +0 -1
@@ -0,0 +1,92 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/ssr/radar.ts
20
+ var radar_exports = {};
21
+ __export(radar_exports, {
22
+ Radar: () => Radar
23
+ });
24
+ module.exports = __toCommonJS(radar_exports);
25
+ var import_g2_ssr = require("@antv/g2-ssr");
26
+ async function Radar(options) {
27
+ var _a;
28
+ const { data, title, width, height } = options;
29
+ const hasGroupField = ((_a = (data || [])[0]) == null ? void 0 : _a.group) !== void 0;
30
+ let encode = {};
31
+ if (hasGroupField) {
32
+ encode = { x: "name", y: "value", color: "group" };
33
+ } else {
34
+ encode = { x: "name", y: "value" };
35
+ }
36
+ return await (0, import_g2_ssr.createChart)({
37
+ title,
38
+ type: "view",
39
+ width,
40
+ data,
41
+ height,
42
+ children: [
43
+ {
44
+ axis: {
45
+ x: {
46
+ grid: true,
47
+ line: true
48
+ },
49
+ y: {
50
+ zIndex: 1,
51
+ title: false,
52
+ line: true,
53
+ nice: true
54
+ }
55
+ },
56
+ // @ts-ignore
57
+ coordinateType: "polar",
58
+ scale: {
59
+ x: {
60
+ padding: 0.5,
61
+ align: 0
62
+ },
63
+ y: {
64
+ nice: true
65
+ }
66
+ },
67
+ coordinate: {
68
+ type: "polar"
69
+ },
70
+ encode,
71
+ type: "line"
72
+ },
73
+ {
74
+ style: {
75
+ fillOpacity: 0.5
76
+ },
77
+ encode,
78
+ scale: {
79
+ x: {
80
+ padding: 0.5,
81
+ align: 0
82
+ }
83
+ },
84
+ type: "area"
85
+ }
86
+ ]
87
+ });
88
+ }
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ Radar
92
+ });
@@ -0,0 +1,6 @@
1
+ import { type ScatterProps } from '../export';
2
+ import { type BaseChartConfig } from './type';
3
+ export type ScatterOptions = BaseChartConfig & {
4
+ type: 'scatter';
5
+ } & ScatterProps;
6
+ export declare function Scatter(options: ScatterOptions): Promise<import("@antv/g2-ssr").Chart>;
@@ -0,0 +1,56 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/ssr/scatter.ts
20
+ var scatter_exports = {};
21
+ __export(scatter_exports, {
22
+ Scatter: () => Scatter
23
+ });
24
+ module.exports = __toCommonJS(scatter_exports);
25
+ var import_g2_ssr = require("@antv/g2-ssr");
26
+ async function Scatter(options) {
27
+ const { data, title, width, height, axisYTitle, axisXTitle } = options;
28
+ return await (0, import_g2_ssr.createChart)({
29
+ type: "point",
30
+ data,
31
+ width,
32
+ height,
33
+ title,
34
+ encode: {
35
+ x: "x",
36
+ y: "y"
37
+ // shape: 'point',
38
+ },
39
+ axis: {
40
+ x: {
41
+ title: axisXTitle
42
+ },
43
+ y: {
44
+ title: axisYTitle
45
+ }
46
+ },
47
+ style: { lineWidth: 1 },
48
+ legend: { size: false },
49
+ animate: false,
50
+ tooltip: false
51
+ });
52
+ }
53
+ // Annotate the CommonJS export names for ESM import in node:
54
+ 0 && (module.exports = {
55
+ Scatter
56
+ });
@@ -0,0 +1,6 @@
1
+ import { type TreemapProps } from '../export';
2
+ import { type BaseChartConfig } from './type';
3
+ export type TreemapOptions = BaseChartConfig & {
4
+ type: 'treemap';
5
+ } & TreemapProps;
6
+ export declare function Treemap(options: TreemapOptions): Promise<import("@antv/g2-ssr").Chart>;
@@ -0,0 +1,57 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/ssr/treemap.ts
20
+ var treemap_exports = {};
21
+ __export(treemap_exports, {
22
+ Treemap: () => Treemap
23
+ });
24
+ module.exports = __toCommonJS(treemap_exports);
25
+ var import_g2_ssr = require("@antv/g2-ssr");
26
+ async function Treemap(options) {
27
+ const { data, title, width, height } = options;
28
+ return await (0, import_g2_ssr.createChart)({
29
+ type: "treemap",
30
+ width,
31
+ height,
32
+ title,
33
+ data: {
34
+ type: "inline",
35
+ value: {
36
+ name: "root",
37
+ children: data
38
+ }
39
+ },
40
+ layout: {
41
+ tile: "treemapBinary",
42
+ paddingInner: 2
43
+ },
44
+ encode: { value: "value" },
45
+ style: {
46
+ fillOpacity: 0.8,
47
+ labelFontSize: 10
48
+ },
49
+ tooltip: false,
50
+ legend: false,
51
+ animate: false
52
+ });
53
+ }
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ Treemap
57
+ });
@@ -0,0 +1,30 @@
1
+ import { type AreaProps, type BarProps, type ColumnProps, type DualAxesProps, type FishboneDiagramProps, type FlowDiagramProps, type HistogramProps, type LineProps, type MindMapProps, type NetworkGraphProps, type PieProps, type RadarProps, type ScatterProps, type TreemapProps, type WordCloudProps } from '../export';
2
+ type ChartConfigMap = {
3
+ line: LineProps;
4
+ column: ColumnProps;
5
+ pie: PieProps;
6
+ area: AreaProps;
7
+ bar: BarProps;
8
+ histogram: HistogramProps;
9
+ scatter: ScatterProps;
10
+ treemap: TreemapProps;
11
+ radar: RadarProps;
12
+ 'dual-axes': DualAxesProps;
13
+ 'word-cloud': WordCloudProps;
14
+ 'mind-map': MindMapProps;
15
+ 'network-graph': NetworkGraphProps;
16
+ 'flow-diagram': FlowDiagramProps;
17
+ 'fishbone-diagram': FishboneDiagramProps;
18
+ };
19
+ export type ChartType = keyof ChartConfigMap;
20
+ export interface BaseChartConfig {
21
+ type: ChartType;
22
+ width: number;
23
+ height: number;
24
+ }
25
+ export type Options = {
26
+ [K in ChartType]: BaseChartConfig & {
27
+ type: K;
28
+ } & ChartConfigMap[K];
29
+ }[ChartType];
30
+ export {};
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/ssr/type.ts
16
+ var type_exports = {};
17
+ module.exports = __toCommonJS(type_exports);
@@ -0,0 +1,6 @@
1
+ import { type WordCloudProps } from '../export';
2
+ import { type BaseChartConfig } from './type';
3
+ export type WordCloudOptions = BaseChartConfig & {
4
+ type: 'word-cloud';
5
+ } & WordCloudProps;
6
+ export declare function WordCloud(options: WordCloudOptions): Promise<import("@antv/g2-ssr").Chart>;
@@ -0,0 +1,48 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/ssr/word-cloud.ts
20
+ var word_cloud_exports = {};
21
+ __export(word_cloud_exports, {
22
+ WordCloud: () => WordCloud
23
+ });
24
+ module.exports = __toCommonJS(word_cloud_exports);
25
+ var import_g2_ssr = require("@antv/g2-ssr");
26
+ async function WordCloud(options) {
27
+ const { data, title, width, height } = options;
28
+ return await (0, import_g2_ssr.createChart)({
29
+ type: "wordCloud",
30
+ layout: {
31
+ fontSize: [8, 42]
32
+ },
33
+ title,
34
+ data,
35
+ width,
36
+ height,
37
+ encode: {
38
+ text: "text",
39
+ color: "text",
40
+ value: "value"
41
+ },
42
+ legend: false
43
+ });
44
+ }
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ WordCloud
48
+ });
@@ -1,2 +1,2 @@
1
- declare const _default: "0.4.7";
1
+ declare const _default: "0.5.0-beta.0";
2
2
  export default _default;
@@ -22,4 +22,4 @@ __export(version_exports, {
22
22
  default: () => version_default
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- var version_default = "0.4.7";
25
+ var version_default = "0.5.0-beta.0";
@@ -0,0 +1,6 @@
1
+ import { type AreaProps } from '../export';
2
+ import { type BaseChartConfig } from './type';
3
+ export type AreaOptions = BaseChartConfig & {
4
+ type: 'area';
5
+ } & AreaProps;
6
+ export declare function Area(options: AreaOptions): Promise<import("@antv/g2-ssr").Chart>;
@@ -0,0 +1,67 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import { createChart } from '@antv/g2-ssr';
4
+ export function Area(_x) {
5
+ return _Area.apply(this, arguments);
6
+ }
7
+ function _Area() {
8
+ _Area = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
9
+ var data, title, width, height, stack, axisYTitle, axisXTitle, encode, transform;
10
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11
+ while (1) switch (_context.prev = _context.next) {
12
+ case 0:
13
+ data = options.data, title = options.title, width = options.width, height = options.height, stack = options.stack, axisYTitle = options.axisYTitle, axisXTitle = options.axisXTitle;
14
+ encode = {};
15
+ transform = [];
16
+ if (stack) {
17
+ encode = {
18
+ x: 'time',
19
+ y: 'value',
20
+ color: 'group'
21
+ };
22
+ transform = [{
23
+ type: 'stackY'
24
+ }];
25
+ } else {
26
+ encode = {
27
+ x: 'time',
28
+ y: 'value'
29
+ };
30
+ }
31
+ _context.next = 6;
32
+ return createChart({
33
+ type: 'view',
34
+ title: title,
35
+ data: data,
36
+ width: width,
37
+ height: height,
38
+ encode: encode,
39
+ transform: transform,
40
+ style: {
41
+ minHeight: 1
42
+ },
43
+ axis: {
44
+ y: {
45
+ title: axisYTitle || false
46
+ },
47
+ x: {
48
+ title: axisXTitle || false
49
+ }
50
+ },
51
+ children: [{
52
+ type: 'area',
53
+ style: {
54
+ opacity: 0.7
55
+ }
56
+ }]
57
+ });
58
+ case 6:
59
+ return _context.abrupt("return", _context.sent);
60
+ case 7:
61
+ case "end":
62
+ return _context.stop();
63
+ }
64
+ }, _callee);
65
+ }));
66
+ return _Area.apply(this, arguments);
67
+ }
@@ -0,0 +1,6 @@
1
+ import { type BarProps } from '../export';
2
+ import { type BaseChartConfig } from './type';
3
+ export type BarOptions = BaseChartConfig & {
4
+ type: 'bar';
5
+ } & BarProps;
6
+ export declare function Bar(options: BarOptions): Promise<import("@antv/g2-ssr").Chart>;
@@ -0,0 +1,71 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import { createChart } from '@antv/g2-ssr';
4
+ export function Bar(_x) {
5
+ return _Bar.apply(this, arguments);
6
+ }
7
+ function _Bar() {
8
+ _Bar = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
9
+ var _;
10
+ var data, title, width, height, stack, group, axisYTitle, axisXTitle, hasGroupField, transforms;
11
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12
+ while (1) switch (_context.prev = _context.next) {
13
+ case 0:
14
+ data = options.data, title = options.title, width = options.width, height = options.height, stack = options.stack, group = options.group, axisYTitle = options.axisYTitle, axisXTitle = options.axisXTitle;
15
+ hasGroupField = ((_ = (data || [])[0]) === null || _ === void 0 ? void 0 : _.group) !== undefined;
16
+ transforms = [];
17
+ if (group) {
18
+ transforms = [{
19
+ type: 'dodgeX'
20
+ }];
21
+ }
22
+ if (stack) {
23
+ transforms = [{
24
+ type: 'stackY'
25
+ }];
26
+ }
27
+ _context.next = 7;
28
+ return createChart({
29
+ width: width,
30
+ height: height,
31
+ title: title,
32
+ type: 'interval',
33
+ data: data,
34
+ encode: hasGroupField ? {
35
+ x: 'category',
36
+ y: 'value',
37
+ color: 'group'
38
+ } : {
39
+ x: 'category',
40
+ y: 'value'
41
+ },
42
+ transform: transforms,
43
+ coordinate: {
44
+ transform: [{
45
+ type: 'transpose'
46
+ }]
47
+ },
48
+ style: {
49
+ // 圆角样式
50
+ radiusTopLeft: 10,
51
+ radiusTopRight: 10
52
+ },
53
+ axis: {
54
+ x: {
55
+ title: axisXTitle
56
+ },
57
+ y: {
58
+ title: axisYTitle
59
+ }
60
+ }
61
+ });
62
+ case 7:
63
+ return _context.abrupt("return", _context.sent);
64
+ case 8:
65
+ case "end":
66
+ return _context.stop();
67
+ }
68
+ }, _callee);
69
+ }));
70
+ return _Bar.apply(this, arguments);
71
+ }
@@ -0,0 +1,6 @@
1
+ import { type ColumnProps } from '../export';
2
+ import { type BaseChartConfig } from './type';
3
+ export type ColumnOptions = BaseChartConfig & {
4
+ type: 'column';
5
+ } & ColumnProps;
6
+ export declare function Column(options: ColumnOptions): Promise<import("@antv/g2-ssr").Chart>;
@@ -0,0 +1,65 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import { createChart } from '@antv/g2-ssr';
4
+ export function Column(_x) {
5
+ return _Column.apply(this, arguments);
6
+ }
7
+ function _Column() {
8
+ _Column = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
9
+ var _;
10
+ var data, title, width, height, axisYTitle, axisXTitle, group, stack, hasGroupField, transforms;
11
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12
+ while (1) switch (_context.prev = _context.next) {
13
+ case 0:
14
+ data = options.data, title = options.title, width = options.width, height = options.height, axisYTitle = options.axisYTitle, axisXTitle = options.axisXTitle, group = options.group, stack = options.stack;
15
+ hasGroupField = ((_ = (data || [])[0]) === null || _ === void 0 ? void 0 : _.group) !== undefined;
16
+ transforms = [];
17
+ if (group) {
18
+ transforms = [{
19
+ type: 'dodgeX'
20
+ }];
21
+ }
22
+ if (stack) {
23
+ transforms = [{
24
+ type: 'stackY'
25
+ }];
26
+ }
27
+ _context.next = 7;
28
+ return createChart({
29
+ width: width,
30
+ height: height,
31
+ title: title,
32
+ data: data,
33
+ type: 'interval',
34
+ encode: hasGroupField ? {
35
+ x: 'category',
36
+ y: 'value',
37
+ color: 'group'
38
+ } : {
39
+ x: 'category',
40
+ y: 'value'
41
+ },
42
+ transform: transforms,
43
+ style: {
44
+ radiusTopLeft: 10,
45
+ radiusTopRight: 10
46
+ },
47
+ axis: {
48
+ x: {
49
+ title: axisXTitle
50
+ },
51
+ y: {
52
+ title: axisYTitle
53
+ }
54
+ }
55
+ });
56
+ case 7:
57
+ return _context.abrupt("return", _context.sent);
58
+ case 8:
59
+ case "end":
60
+ return _context.stop();
61
+ }
62
+ }, _callee);
63
+ }));
64
+ return _Column.apply(this, arguments);
65
+ }
@@ -0,0 +1,6 @@
1
+ import { type DualAxesProps } from '../export';
2
+ import { type BaseChartConfig } from './type';
3
+ export type DualAxespOptions = BaseChartConfig & {
4
+ type: 'dual-axes';
5
+ } & DualAxesProps;
6
+ export declare function DualAxes(options: DualAxespOptions): Promise<import("@antv/g2-ssr").Chart>;