@antv/gpt-vis 1.0.0-beta.2 → 1.0.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.
- package/README.md +217 -43
- package/README.zh-CN.md +221 -47
- package/dist/cjs/gpt-vis/index.js +1 -1
- package/dist/cjs/vis/dual-axes/index.js +1 -2
- package/dist/cjs/vis/fishbone-diagram/index.js +12 -4
- package/dist/cjs/vis/flow-diagram/index.js +27 -11
- package/dist/cjs/vis/indented-tree/index.js +13 -3
- package/dist/cjs/vis/mindmap/index.js +12 -4
- package/dist/cjs/vis/network-graph/index.js +11 -2
- package/dist/cjs/vis/organization-chart/index.js +12 -3
- package/dist/cjs/vis/scatter/index.d.ts +2 -0
- package/dist/cjs/vis/scatter/index.js +7 -3
- package/dist/cjs/vis/waterfall/index.js +1 -1
- package/dist/esm/gpt-vis/index.js +1 -1
- package/dist/esm/vis/dual-axes/index.js +10 -3
- package/dist/esm/vis/fishbone-diagram/index.js +6 -5
- package/dist/esm/vis/flow-diagram/index.js +17 -10
- package/dist/esm/vis/indented-tree/index.js +9 -4
- package/dist/esm/vis/mindmap/index.js +6 -5
- package/dist/esm/vis/network-graph/index.js +5 -3
- package/dist/esm/vis/organization-chart/index.js +6 -4
- package/dist/esm/vis/scatter/index.d.ts +2 -0
- package/dist/esm/vis/scatter/index.js +12 -2
- package/dist/esm/vis/waterfall/index.js +6 -4
- package/dist/umd/index.min.js +1 -1
- package/package.json +2 -6
|
@@ -29,7 +29,7 @@ var Scatter = (options) => {
|
|
|
29
29
|
let chart = null;
|
|
30
30
|
const render = (config) => {
|
|
31
31
|
var _a;
|
|
32
|
-
const { data = [], theme = chartTheme, title, style = {} } = config;
|
|
32
|
+
const { data = [], theme = chartTheme, title, axisXTitle, axisYTitle, style = {} } = config;
|
|
33
33
|
if (chart) {
|
|
34
34
|
chart.destroy();
|
|
35
35
|
}
|
|
@@ -60,14 +60,18 @@ var Scatter = (options) => {
|
|
|
60
60
|
encode,
|
|
61
61
|
legend: hasGroupField ? { color: { position: "top" } } : false,
|
|
62
62
|
scale: scaleConfig,
|
|
63
|
+
axis: {
|
|
64
|
+
x: { title: axisXTitle ?? "x" },
|
|
65
|
+
y: { title: axisYTitle ?? "y" }
|
|
66
|
+
},
|
|
63
67
|
style: {
|
|
64
68
|
lineWidth: 1
|
|
65
69
|
},
|
|
66
70
|
tooltip: {
|
|
67
71
|
title: (d) => (d == null ? void 0 : d.group) ? d.group : false,
|
|
68
72
|
items: [
|
|
69
|
-
{ channel: "x", name: "x" },
|
|
70
|
-
{ channel: "y", name: "y" }
|
|
73
|
+
{ channel: "x", name: axisXTitle ?? "x" },
|
|
74
|
+
{ channel: "y", name: axisYTitle ?? "y" }
|
|
71
75
|
]
|
|
72
76
|
},
|
|
73
77
|
viewStyle: {
|
|
@@ -116,7 +116,7 @@ var Waterfall = (options) => {
|
|
|
116
116
|
style: {
|
|
117
117
|
maxWidth: 60,
|
|
118
118
|
stroke: "#666",
|
|
119
|
-
radius: 4,
|
|
119
|
+
...theme !== "academy" ? { radius: 4 } : {},
|
|
120
120
|
fill: (d) => {
|
|
121
121
|
return d.isTotal || d.isIntermediateTotal ? totalColor : d.__value__ > 0 ? positiveColor : negativeColor;
|
|
122
122
|
}
|
|
@@ -159,7 +159,7 @@ export var GPTVis = /*#__PURE__*/function () {
|
|
|
159
159
|
this.wrapperInstance = createVisWrapper(this.options.container, {
|
|
160
160
|
chartType: type,
|
|
161
161
|
syntax: config,
|
|
162
|
-
locale: this.options.locale || '
|
|
162
|
+
locale: this.options.locale || 'en-US'
|
|
163
163
|
});
|
|
164
164
|
} else {
|
|
165
165
|
this.wrapperInstance.update(config);
|
|
@@ -1,3 +1,9 @@
|
|
|
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); }
|
|
1
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
8
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -142,11 +148,12 @@ export var DualAxes = function DualAxes(options) {
|
|
|
142
148
|
title: item.axisYTitle || ''
|
|
143
149
|
}
|
|
144
150
|
},
|
|
145
|
-
style: {
|
|
146
|
-
columnWidthRatio: 0.8
|
|
151
|
+
style: _objectSpread({
|
|
152
|
+
columnWidthRatio: 0.8
|
|
153
|
+
}, theme !== 'academy' ? {
|
|
147
154
|
radiusTopLeft: 4,
|
|
148
155
|
radiusTopRight: 4
|
|
149
|
-
}
|
|
156
|
+
} : {})
|
|
150
157
|
};
|
|
151
158
|
} else {
|
|
152
159
|
// line type
|
|
@@ -8,7 +8,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
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 { Graph, treeToGraphData } from '@antv/g6';
|
|
11
|
-
import { getBackgroundColor, normalizePalette } from "../../util/theme";
|
|
11
|
+
import { getBackgroundColor, getTheme, normalizePalette } from "../../util/theme";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* FishboneDiagramConfig defines the configuration for rendering the fishbone diagram.
|
|
@@ -126,13 +126,14 @@ export var FishboneDiagram = function FishboneDiagram(options) {
|
|
|
126
126
|
height: height,
|
|
127
127
|
autoFit: 'view',
|
|
128
128
|
autoResize: true,
|
|
129
|
-
padding: 20,
|
|
130
|
-
theme:
|
|
129
|
+
padding: title ? [46, 20, 20, 20] : 20,
|
|
130
|
+
theme: getTheme(theme),
|
|
131
131
|
plugins: title ? [{
|
|
132
132
|
key: 'title',
|
|
133
133
|
type: 'title',
|
|
134
134
|
title: title,
|
|
135
|
-
titleFill: isDark ? '#e0e6ed' : '#
|
|
135
|
+
titleFill: isDark ? '#e0e6ed' : '#000',
|
|
136
|
+
titleFontFamily: 'sans-serif'
|
|
136
137
|
}] : [],
|
|
137
138
|
data: graphData,
|
|
138
139
|
node: {
|
|
@@ -141,7 +142,7 @@ export var FishboneDiagram = function FishboneDiagram(options) {
|
|
|
141
142
|
var _d$depth;
|
|
142
143
|
var depth = (_d$depth = d.depth) !== null && _d$depth !== void 0 ? _d$depth : 0;
|
|
143
144
|
var nodeStyle = {
|
|
144
|
-
radius: 8,
|
|
145
|
+
radius: theme === 'academy' ? 0 : 8,
|
|
145
146
|
size: getNodeSize(String(d.id), depth),
|
|
146
147
|
labelText: String(d.id),
|
|
147
148
|
labelPlacement: 'left',
|
|
@@ -19,7 +19,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
19
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
20
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
21
|
import { ExtensionCategory, Graph, HoverActivate, idOf, register } from '@antv/g6';
|
|
22
|
-
import { getBackgroundColor, normalizePalette } from "../../util/theme";
|
|
22
|
+
import { getBackgroundColor, getTheme, normalizePalette } from "../../util/theme";
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* FlowDiagramConfig defines the configuration for rendering the flow diagram.
|
|
@@ -75,13 +75,16 @@ function escapeHtml() {
|
|
|
75
75
|
function createNodeHTML(d, color) {
|
|
76
76
|
var _d$data, _d$states, _d$states2;
|
|
77
77
|
var selectedBorderColor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '#000';
|
|
78
|
+
var theme = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'default';
|
|
78
79
|
var text = escapeHtml(((_d$data = d.data) === null || _d$data === void 0 ? void 0 : _d$data.text) || '');
|
|
79
80
|
var isHovered = (_d$states = d.states) === null || _d$states === void 0 ? void 0 : _d$states.includes('active');
|
|
80
81
|
var isSelected = (_d$states2 = d.states) === null || _d$states2 === void 0 ? void 0 : _d$states2.includes('selected');
|
|
81
82
|
var nodeColor = isHovered ? ACTIVE_COLOR : color;
|
|
82
|
-
|
|
83
|
+
var borderRadius = theme === 'academy' ? '0px' : '8px';
|
|
84
|
+
return "\n <div\n data-node-key=\"".concat(escapeHtml(String(d.id)), "\"\n style=\"\n box-sizing: border-box;\n width: ").concat(DEFAULT_NODE_WIDTH, "px;\n min-height: ").concat(DEFAULT_NODE_HEIGHT, "px;\n padding: 16px;\n background: ").concat(nodeColor, ";\n border: 3px solid ").concat(isSelected ? selectedBorderColor : nodeColor, ";\n border-radius: ").concat(borderRadius, ";\n color: #fff;\n font-size: 16px;\n font-weight: 600;\n line-height: 22px;\n text-align: center;\n white-space: normal;\n word-break: break-word;\n overflow-wrap: anywhere;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n \"\n >\n <div style=\"width: 100%;\">\n ").concat(text, "\n </div>\n </div>\n ");
|
|
83
85
|
}
|
|
84
86
|
function measureAndUpdateNodeSizes(graph, container, nodeColorMap, selectedBorderColor) {
|
|
87
|
+
var theme = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'default';
|
|
85
88
|
var nodes = graph.getNodeData();
|
|
86
89
|
var updatedNodes = nodes.map(function (node) {
|
|
87
90
|
var dom = container.querySelector("[data-node-key=\"".concat(CSS.escape(String(node.id)), "\"]"));
|
|
@@ -95,7 +98,7 @@ function measureAndUpdateNodeSizes(graph, container, nodeColorMap, selectedBorde
|
|
|
95
98
|
size: [DEFAULT_NODE_WIDTH, height],
|
|
96
99
|
dx: -DEFAULT_NODE_WIDTH / 2,
|
|
97
100
|
dy: -height / 2,
|
|
98
|
-
innerHTML: createNodeHTML(node, nodeColorMap.get(String(node.id)) || '#1783FF', selectedBorderColor)
|
|
101
|
+
innerHTML: createNodeHTML(node, nodeColorMap.get(String(node.id)) || '#1783FF', selectedBorderColor, theme)
|
|
99
102
|
}
|
|
100
103
|
};
|
|
101
104
|
});
|
|
@@ -235,29 +238,33 @@ export var FlowDiagram = function FlowDiagram(options) {
|
|
|
235
238
|
container: containerEl,
|
|
236
239
|
width: width,
|
|
237
240
|
height: height,
|
|
238
|
-
theme: theme,
|
|
241
|
+
theme: getTheme(theme),
|
|
239
242
|
data: {
|
|
240
243
|
nodes: g6Nodes,
|
|
241
244
|
edges: g6Edges
|
|
242
245
|
},
|
|
243
246
|
autoFit: 'view',
|
|
244
247
|
autoResize: true,
|
|
245
|
-
padding: 20,
|
|
248
|
+
padding: title ? [46, 20, 20, 20] : 20,
|
|
246
249
|
plugins: title ? [{
|
|
247
250
|
key: 'title',
|
|
248
251
|
type: 'title',
|
|
249
252
|
title: title,
|
|
250
|
-
titleFill: isDark ? '#e0e6ed' : '#
|
|
253
|
+
titleFill: isDark ? '#e0e6ed' : '#000',
|
|
254
|
+
titleFontFamily: 'sans-serif'
|
|
251
255
|
}] : [],
|
|
252
256
|
node: {
|
|
253
257
|
type: 'html',
|
|
254
258
|
style: function style(d) {
|
|
259
|
+
var _d$style;
|
|
255
260
|
var color = nodeColorMap.get(String(d.id)) || colors[0];
|
|
261
|
+
var size = ((_d$style = d.style) === null || _d$style === void 0 ? void 0 : _d$style.size) || [DEFAULT_NODE_WIDTH, DEFAULT_NODE_HEIGHT];
|
|
262
|
+
var height = size[1];
|
|
256
263
|
return {
|
|
257
|
-
size:
|
|
264
|
+
size: size,
|
|
258
265
|
dx: -DEFAULT_NODE_WIDTH / 2,
|
|
259
|
-
dy: -
|
|
260
|
-
innerHTML: createNodeHTML(d, color, selectedBorder),
|
|
266
|
+
dy: -height / 2,
|
|
267
|
+
innerHTML: createNodeHTML(d, color, selectedBorder, theme),
|
|
261
268
|
ports: [{
|
|
262
269
|
placement: 'top'
|
|
263
270
|
}, {
|
|
@@ -317,7 +324,7 @@ export var FlowDiagram = function FlowDiagram(options) {
|
|
|
317
324
|
// Measure real node heights after initial render
|
|
318
325
|
graph.once('afterrender', function () {
|
|
319
326
|
if (graph) {
|
|
320
|
-
measureAndUpdateNodeSizes(graph, containerEl, nodeColorMap, selectedBorder);
|
|
327
|
+
measureAndUpdateNodeSizes(graph, containerEl, nodeColorMap, selectedBorder, theme);
|
|
321
328
|
}
|
|
322
329
|
});
|
|
323
330
|
};
|
|
@@ -27,7 +27,7 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
|
|
|
27
27
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
28
28
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
29
29
|
import { Badge, BaseBehavior, BaseNode, CommonEvent, ExtensionCategory, Graph, NodeEvent, Polyline, iconfont, register, subStyleProps, treeToGraphData } from '@antv/g6';
|
|
30
|
-
import { getBackgroundColor, normalizePalette } from "../../util/theme";
|
|
30
|
+
import { getBackgroundColor, getTheme, normalizePalette } from "../../util/theme";
|
|
31
31
|
|
|
32
32
|
// ---------------------------------------------------------------------------
|
|
33
33
|
// Official G6 indented-tree implementation (adapted for GPT-Vis)
|
|
@@ -449,7 +449,8 @@ export var IndentedTree = function IndentedTree(options) {
|
|
|
449
449
|
height: height,
|
|
450
450
|
autoFit: 'view',
|
|
451
451
|
autoResize: true,
|
|
452
|
-
|
|
452
|
+
theme: getTheme(theme),
|
|
453
|
+
padding: title ? [46, 20, 20, 20] : 20,
|
|
453
454
|
data: graphData,
|
|
454
455
|
node: {
|
|
455
456
|
type: GPT_VIS_INDENTED_NODE,
|
|
@@ -461,8 +462,11 @@ export var IndentedTree = function IndentedTree(options) {
|
|
|
461
462
|
labelBackground: function labelBackground(datum) {
|
|
462
463
|
return datum.id === rootId;
|
|
463
464
|
},
|
|
464
|
-
labelBackgroundRadius: 0,
|
|
465
|
+
labelBackgroundRadius: theme === 'academy' ? 0 : 4,
|
|
465
466
|
labelBackgroundFill: (_palette$ = palette[0]) !== null && _palette$ !== void 0 ? _palette$ : '#1783FF',
|
|
467
|
+
labelPadding: function labelPadding(datum) {
|
|
468
|
+
return datum.id === rootId ? [2, 8] : 0;
|
|
469
|
+
},
|
|
466
470
|
labelFill: function labelFill(datum) {
|
|
467
471
|
return datum.id === rootId ? '#fff' : isDark ? '#d0d0d0' : '#666';
|
|
468
472
|
},
|
|
@@ -538,7 +542,8 @@ export var IndentedTree = function IndentedTree(options) {
|
|
|
538
542
|
key: 'title',
|
|
539
543
|
type: 'title',
|
|
540
544
|
title: title,
|
|
541
|
-
titleFill: isDark ? '#e0e6ed' : '#
|
|
545
|
+
titleFill: isDark ? '#e0e6ed' : '#000',
|
|
546
|
+
titleFontFamily: 'sans-serif'
|
|
542
547
|
}] : []
|
|
543
548
|
});
|
|
544
549
|
graph.render();
|
|
@@ -15,7 +15,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
15
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
16
|
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; }
|
|
17
17
|
import { Graph, idOf, positionOf, treeToGraphData } from '@antv/g6';
|
|
18
|
-
import { getBackgroundColor, normalizePalette } from "../../util/theme";
|
|
18
|
+
import { getBackgroundColor, getTheme, normalizePalette } from "../../util/theme";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* MindmapConfig defines the configuration for rendering the mindmap.
|
|
@@ -179,16 +179,17 @@ export var Mindmap = function Mindmap(options) {
|
|
|
179
179
|
height: height,
|
|
180
180
|
autoFit: 'view',
|
|
181
181
|
autoResize: true,
|
|
182
|
-
padding: 20,
|
|
182
|
+
padding: title ? [46, 20, 20, 20] : 20,
|
|
183
183
|
zoomRange: [0.1, 5],
|
|
184
184
|
zoom: 1,
|
|
185
|
-
theme:
|
|
185
|
+
theme: getTheme(theme),
|
|
186
186
|
data: graphData,
|
|
187
187
|
plugins: title ? [{
|
|
188
188
|
key: 'title',
|
|
189
189
|
type: 'title',
|
|
190
190
|
title: title,
|
|
191
|
-
titleFill: isDark ? '#e0e6ed' : '#
|
|
191
|
+
titleFill: isDark ? '#e0e6ed' : '#000',
|
|
192
|
+
titleFontFamily: 'sans-serif'
|
|
192
193
|
}] : [],
|
|
193
194
|
node: {
|
|
194
195
|
type: 'rect',
|
|
@@ -219,7 +220,7 @@ export var Mindmap = function Mindmap(options) {
|
|
|
219
220
|
var base = {
|
|
220
221
|
size: [nodeWidth, nodeHeight],
|
|
221
222
|
dx: dx,
|
|
222
|
-
radius: 8,
|
|
223
|
+
radius: theme === 'academy' ? 0 : 8,
|
|
223
224
|
labelText: label,
|
|
224
225
|
labelPlacement: 'center',
|
|
225
226
|
labelFontSize: fontSize,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Graph } from '@antv/g6';
|
|
2
|
-
import { getBackgroundColor, normalizePalette } from "../../util/theme";
|
|
2
|
+
import { getBackgroundColor, getTheme, normalizePalette } from "../../util/theme";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* NetworkGraphConfig defines the configuration for rendering the network graph.
|
|
@@ -180,7 +180,8 @@ export var NetworkGraph = function NetworkGraph(options) {
|
|
|
180
180
|
height: height,
|
|
181
181
|
autoFit: 'view',
|
|
182
182
|
autoResize: true,
|
|
183
|
-
|
|
183
|
+
theme: getTheme(theme),
|
|
184
|
+
padding: title ? [46, 20, 20, 20] : 20,
|
|
184
185
|
data: {
|
|
185
186
|
nodes: nodeData,
|
|
186
187
|
edges: edgeData
|
|
@@ -197,7 +198,8 @@ export var NetworkGraph = function NetworkGraph(options) {
|
|
|
197
198
|
key: 'title',
|
|
198
199
|
type: 'title',
|
|
199
200
|
title: title,
|
|
200
|
-
titleFill: isDark ? '#e0e6ed' : '#
|
|
201
|
+
titleFill: isDark ? '#e0e6ed' : '#000',
|
|
202
|
+
titleFontFamily: 'sans-serif'
|
|
201
203
|
}] : []
|
|
202
204
|
});
|
|
203
205
|
graph.render();
|
|
@@ -5,7 +5,7 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
5
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
6
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
7
|
import { Graph } from '@antv/g6';
|
|
8
|
-
import { getBackgroundColor, normalizePalette } from "../../util/theme";
|
|
8
|
+
import { getBackgroundColor, getTheme, normalizePalette } from "../../util/theme";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* OrganizationChartConfig defines the configuration for rendering the organization chart.
|
|
@@ -153,7 +153,8 @@ export var OrganizationChart = function OrganizationChart(options) {
|
|
|
153
153
|
height: height,
|
|
154
154
|
autoFit: 'view',
|
|
155
155
|
autoResize: true,
|
|
156
|
-
|
|
156
|
+
theme: getTheme(theme),
|
|
157
|
+
padding: title ? [46, 20, 20, 20] : 20,
|
|
157
158
|
data: {
|
|
158
159
|
nodes: nodeData,
|
|
159
160
|
edges: edgeData
|
|
@@ -189,7 +190,8 @@ export var OrganizationChart = function OrganizationChart(options) {
|
|
|
189
190
|
key: 'title',
|
|
190
191
|
type: 'title',
|
|
191
192
|
title: title,
|
|
192
|
-
titleFill: isDark ? '#e0e6ed' : '#
|
|
193
|
+
titleFill: isDark ? '#e0e6ed' : '#000',
|
|
194
|
+
titleFontFamily: 'sans-serif'
|
|
193
195
|
}] : [])),
|
|
194
196
|
node: {
|
|
195
197
|
type: 'rect',
|
|
@@ -203,7 +205,7 @@ export var OrganizationChart = function OrganizationChart(options) {
|
|
|
203
205
|
},
|
|
204
206
|
stroke: isDark ? '#555' : '#e8ebf0',
|
|
205
207
|
lineWidth: 1,
|
|
206
|
-
radius: 8,
|
|
208
|
+
radius: theme === 'academy' ? 0 : 8,
|
|
207
209
|
// Use official label wrapping/ellipsis for BOTH name & description.
|
|
208
210
|
// 1 line name + up to 2 lines description => total maxLines = 3.
|
|
209
211
|
labelText: function labelText(d) {
|
|
@@ -55,6 +55,8 @@ export var Scatter = function Scatter(options) {
|
|
|
55
55
|
_config$theme = config.theme,
|
|
56
56
|
theme = _config$theme === void 0 ? chartTheme : _config$theme,
|
|
57
57
|
title = config.title,
|
|
58
|
+
axisXTitle = config.axisXTitle,
|
|
59
|
+
axisYTitle = config.axisYTitle,
|
|
58
60
|
_config$style = config.style,
|
|
59
61
|
style = _config$style === void 0 ? {} : _config$style;
|
|
60
62
|
|
|
@@ -119,6 +121,14 @@ export var Scatter = function Scatter(options) {
|
|
|
119
121
|
}
|
|
120
122
|
} : false,
|
|
121
123
|
scale: scaleConfig,
|
|
124
|
+
axis: {
|
|
125
|
+
x: {
|
|
126
|
+
title: axisXTitle !== null && axisXTitle !== void 0 ? axisXTitle : 'x'
|
|
127
|
+
},
|
|
128
|
+
y: {
|
|
129
|
+
title: axisYTitle !== null && axisYTitle !== void 0 ? axisYTitle : 'y'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
122
132
|
style: {
|
|
123
133
|
lineWidth: 1
|
|
124
134
|
},
|
|
@@ -128,10 +138,10 @@ export var Scatter = function Scatter(options) {
|
|
|
128
138
|
},
|
|
129
139
|
items: [{
|
|
130
140
|
channel: 'x',
|
|
131
|
-
name: 'x'
|
|
141
|
+
name: axisXTitle !== null && axisXTitle !== void 0 ? axisXTitle : 'x'
|
|
132
142
|
}, {
|
|
133
143
|
channel: 'y',
|
|
134
|
-
name: 'y'
|
|
144
|
+
name: axisYTitle !== null && axisYTitle !== void 0 ? axisYTitle : 'y'
|
|
135
145
|
}]
|
|
136
146
|
},
|
|
137
147
|
viewStyle: {
|
|
@@ -181,14 +181,16 @@ export var Waterfall = function Waterfall(options) {
|
|
|
181
181
|
y: ['__start__', '__end__'],
|
|
182
182
|
color: 'category'
|
|
183
183
|
},
|
|
184
|
-
style: {
|
|
184
|
+
style: _objectSpread(_objectSpread({
|
|
185
185
|
maxWidth: 60,
|
|
186
|
-
stroke: '#666'
|
|
187
|
-
|
|
186
|
+
stroke: '#666'
|
|
187
|
+
}, theme !== 'academy' ? {
|
|
188
|
+
radius: 4
|
|
189
|
+
} : {}), {}, {
|
|
188
190
|
fill: function fill(d) {
|
|
189
191
|
return d.isTotal || d.isIntermediateTotal ? totalColor : d.__value__ > 0 ? positiveColor : negativeColor;
|
|
190
192
|
}
|
|
191
|
-
},
|
|
193
|
+
}),
|
|
192
194
|
labels: [{
|
|
193
195
|
text: '__value__',
|
|
194
196
|
position: 'inside',
|