@antv/gpt-vis 0.4.7 → 0.5.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 (65) hide show
  1. package/README.ja-JP.md +3 -2
  2. package/README.md +3 -2
  3. package/README.zh-CN.md +3 -2
  4. package/dist/cjs/ChartCodeRender/VisChart.d.ts +3 -1
  5. package/dist/cjs/ChartCodeRender/VisChart.js +76 -17
  6. package/dist/cjs/ChartCodeRender/index.js +6 -2
  7. package/dist/cjs/ChartCodeRender/styles.d.ts +14 -0
  8. package/dist/cjs/ChartCodeRender/styles.js +205 -0
  9. package/dist/cjs/ChartCodeRender/type.d.ts +23 -0
  10. package/dist/cjs/ChartCodeRender/utils.d.ts +1 -0
  11. package/dist/cjs/ChartCodeRender/utils.js +51 -0
  12. package/dist/cjs/index.d.ts +1 -1
  13. package/dist/cjs/utils/map/style.d.ts +3 -3
  14. package/dist/cjs/version.d.ts +1 -1
  15. package/dist/cjs/version.js +1 -1
  16. package/dist/esm/ChartCodeRender/VisChart.d.ts +3 -1
  17. package/dist/esm/ChartCodeRender/VisChart.js +113 -16
  18. package/dist/esm/ChartCodeRender/index.js +15 -5
  19. package/dist/esm/ChartCodeRender/styles.d.ts +14 -0
  20. package/dist/esm/ChartCodeRender/styles.js +54 -0
  21. package/dist/esm/ChartCodeRender/type.d.ts +23 -0
  22. package/dist/esm/ChartCodeRender/utils.d.ts +1 -0
  23. package/dist/esm/ChartCodeRender/utils.js +37 -0
  24. package/dist/esm/ConfigProvider/hooks/useConfig.js +6 -1
  25. package/dist/esm/ConfigProvider/index.js +2 -1
  26. package/dist/esm/DualAxes/index.js +8 -2
  27. package/dist/esm/DualAxes/util.js +8 -2
  28. package/dist/esm/FishboneDiagram/index.js +3 -2
  29. package/dist/esm/FlowDiagram/index.js +9 -3
  30. package/dist/esm/GPTVis/Lite.js +9 -3
  31. package/dist/esm/GPTVis/index.js +9 -3
  32. package/dist/esm/HeatMap/index.js +3 -2
  33. package/dist/esm/IndentedTree/index.js +15 -4
  34. package/dist/esm/Map/Component/Marker.js +6 -1
  35. package/dist/esm/Map/Component/Polyline.js +6 -1
  36. package/dist/esm/Map/index.js +10 -4
  37. package/dist/esm/MindMap/index.js +15 -4
  38. package/dist/esm/NetworkGraph/index.js +9 -3
  39. package/dist/esm/OrganizationChart/index.js +15 -4
  40. package/dist/esm/PathMap/index.js +9 -3
  41. package/dist/esm/PinMap/index.js +3 -2
  42. package/dist/esm/Text/VisText.js +6 -1
  43. package/dist/esm/Text/config.js +4 -1
  44. package/dist/esm/Text/mini-charts/hooks/useSvgWrapper.js +9 -3
  45. package/dist/esm/Text/mini-charts/line/SingleLineChart.js +6 -1
  46. package/dist/esm/Text/mini-charts/line/scaleLinear.js +6 -1
  47. package/dist/esm/Text/mini-charts/line/useLineCompute.js +17 -5
  48. package/dist/esm/Text/mini-charts/proportion/index.js +6 -1
  49. package/dist/esm/Treemap/index.js +3 -2
  50. package/dist/esm/export.js +4 -1
  51. package/dist/esm/index.d.ts +1 -1
  52. package/dist/esm/utils/config.js +6 -1
  53. package/dist/esm/utils/graph.js +8 -2
  54. package/dist/esm/utils/map/context.js +4 -2
  55. package/dist/esm/utils/map/markers.js +6 -1
  56. package/dist/esm/utils/map/polyline.js +6 -1
  57. package/dist/esm/utils/map/style.d.ts +3 -3
  58. package/dist/esm/utils/map/style.js +8 -2
  59. package/dist/esm/utils/plot.js +9 -2
  60. package/dist/esm/version.d.ts +1 -1
  61. package/dist/esm/version.js +1 -1
  62. package/dist/umd/168.async.js +1 -0
  63. package/dist/umd/index.min.js +1 -1
  64. package/package.json +37 -32
  65. package/dist/umd/100.async.js +0 -1
@@ -1,34 +1,54 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
1
  var _excluded = ["type"];
2
+ 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; }
3
+ 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; }
4
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+ 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); }
7
+ 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; }
8
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
9
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
+ import { CopyOutlined } from '@ant-design/icons';
4
11
  import React, { memo, useRef, useState } from 'react';
5
- import styled, { createGlobalStyle } from 'styled-components';
12
+ import { ErrorBoundary } from 'react-error-boundary';
13
+ import { Light as SyntaxHighlighter } from 'react-syntax-highlighter';
14
+ import json from 'react-syntax-highlighter/dist/cjs/languages/hljs/json';
15
+ import { magula } from 'react-syntax-highlighter/dist/esm/styles/hljs';
6
16
  import Loading from "./Loading";
7
- var StyledGPTVis = styled.div.withConfig({
8
- displayName: "StyledGPTVis",
9
- componentId: "gpt-vis-c7ef__sc-1f5p953-0"
10
- })(["min-width:300px;height:300px;max-width:100%;"]);
11
- var GlobalStyles = createGlobalStyle(["pre:has(.gpt-vis){overflow:hidden;}"]);
17
+ import { ChartWrapper, CopyButton, ErrorMessage, GlobalStyles, StyledGPTVis, StyledTabButton, TabContainer, TabContent, TabHeader, TabLeftGroup, TabRightGroup } from "./styles";
18
+ import { handleCopyCode } from "./utils";
19
+
20
+ // 注册 JSON 语言支持
21
+ SyntaxHighlighter.registerLanguage('json', json);
12
22
  export var RenderVisChart = /*#__PURE__*/memo(function (_ref) {
13
23
  var style = _ref.style,
14
24
  content = _ref.content,
15
25
  components = _ref.components,
16
26
  debug = _ref.debug,
17
- loadingTimeout = _ref.loadingTimeout;
27
+ loadingTimeout = _ref.loadingTimeout,
28
+ componentErrorRender = _ref.componentErrorRender,
29
+ errorRender = _ref.errorRender;
18
30
  var timeoutRef = useRef();
19
31
  var _useState = useState(true),
20
32
  _useState2 = _slicedToArray(_useState, 2),
21
33
  loading = _useState2[0],
22
34
  setLoading = _useState2[1];
35
+ var _useState3 = useState('chart'),
36
+ _useState4 = _slicedToArray(_useState3, 2),
37
+ activeTab = _useState4[0],
38
+ setActiveTab = _useState4[1];
39
+ var _useState5 = useState(false),
40
+ _useState6 = _slicedToArray(_useState5, 2),
41
+ hasRenderError = _useState6[0],
42
+ setHasRenderError = _useState6[1];
23
43
  var chartJson;
24
44
  try {
25
45
  chartJson = JSON.parse(content);
26
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
27
46
  } catch (e) {
47
+ var parseError = e;
28
48
  if (timeoutRef.current) {
29
49
  clearTimeout(timeoutRef.current);
30
50
  if (debug) {
31
- console.warn('GPT-Vis withChartCode parse content timeout');
51
+ console.warn('GPT-Vis parse content timeout!');
32
52
  }
33
53
  }
34
54
  timeoutRef.current = setTimeout(function () {
@@ -40,7 +60,15 @@ export var RenderVisChart = /*#__PURE__*/memo(function (_ref) {
40
60
  style: style
41
61
  }, /*#__PURE__*/React.createElement(Loading, null));
42
62
  }
43
- return /*#__PURE__*/React.createElement("p", null, "Chart generation timeout.");
63
+
64
+ // 使用自定义错误渲染函数
65
+ if (errorRender) {
66
+ return errorRender({
67
+ error: parseError,
68
+ content: content
69
+ });
70
+ }
71
+ return /*#__PURE__*/React.createElement("div", null, " GPT-Vis parse content error! ");
44
72
  }
45
73
  var _chartJson = chartJson,
46
74
  type = _chartJson.type,
@@ -54,12 +82,81 @@ export var RenderVisChart = /*#__PURE__*/memo(function (_ref) {
54
82
 
55
83
  // If the chart type is not supported, display an error message
56
84
  if (!ChartComponent) {
57
- return /*#__PURE__*/React.createElement("p", null, "Chart type \"".concat(type, "\" is not supported."));
85
+ var message = "Chart type \"".concat(type, "\" is not supported.");
86
+ if (errorRender) {
87
+ return errorRender({
88
+ error: new Error(message),
89
+ content: content
90
+ });
91
+ }
92
+ return /*#__PURE__*/React.createElement("div", null, " ", message, " ");
58
93
  }
94
+ var FallbackComponent = function FallbackComponent(fallbackProps) {
95
+ var error = fallbackProps.error;
96
+
97
+ // 设置渲染错误状态并切换到代码 tab
98
+ if (!hasRenderError) {
99
+ setHasRenderError(true);
100
+ setActiveTab('code');
101
+ }
102
+ if (componentErrorRender) {
103
+ return componentErrorRender({
104
+ error: error,
105
+ content: content
106
+ });
107
+ }
108
+
109
+ // 返回一个简单的错误提示
110
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ErrorMessage, null, "\u56FE\u8868\u6E32\u67D3\u5931\u8D25"));
111
+ };
59
112
 
60
113
  // Render the supported chart component with data
61
- return /*#__PURE__*/React.createElement(StyledGPTVis, {
62
- className: "gpt-vis",
114
+ return /*#__PURE__*/React.createElement(TabContainer, {
63
115
  style: style
64
- }, /*#__PURE__*/React.createElement(GlobalStyles, null), /*#__PURE__*/React.createElement(ChartComponent, chartProps));
116
+ }, /*#__PURE__*/React.createElement(TabHeader, null, /*#__PURE__*/React.createElement(TabLeftGroup, null, /*#__PURE__*/React.createElement(StyledTabButton, {
117
+ active: activeTab === 'chart',
118
+ onClick: function onClick() {
119
+ return setActiveTab('chart');
120
+ }
121
+ }, "\u56FE\u8868"), /*#__PURE__*/React.createElement(StyledTabButton, {
122
+ active: activeTab === 'code',
123
+ onClick: function onClick() {
124
+ return setActiveTab('code');
125
+ }
126
+ }, "\u4EE3\u7801")), /*#__PURE__*/React.createElement(TabRightGroup, null, activeTab === 'code' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CopyButton, {
127
+ onClick: function onClick() {
128
+ return handleCopyCode(chartJson);
129
+ }
130
+ }, /*#__PURE__*/React.createElement(CopyOutlined, null), "\u590D\u5236")))), /*#__PURE__*/React.createElement(TabContent, null, activeTab === 'chart' ? /*#__PURE__*/React.createElement(ErrorBoundary, {
131
+ FallbackComponent: FallbackComponent,
132
+ onError: function onError(error, errorInfo) {
133
+ console.error('GPT-Vis Render error:', error);
134
+ if (!hasRenderError) {
135
+ setHasRenderError(true);
136
+ setActiveTab('code');
137
+ }
138
+ if (debug) {
139
+ console.error('GPT-Vis Render error info:', errorInfo);
140
+ }
141
+ }
142
+ }, /*#__PURE__*/React.createElement(StyledGPTVis, {
143
+ className: "gpt-vis"
144
+ }, /*#__PURE__*/React.createElement(GlobalStyles, null), /*#__PURE__*/React.createElement(ChartWrapper, null, /*#__PURE__*/React.createElement(ChartComponent, chartProps)))) : /*#__PURE__*/React.createElement("div", {
145
+ style: {
146
+ maxHeight: 500,
147
+ overflow: 'auto'
148
+ }
149
+ }, /*#__PURE__*/React.createElement(SyntaxHighlighter, {
150
+ language: "json",
151
+ style: magula,
152
+ showLineNumbers: false,
153
+ wrapLines: true,
154
+ customStyle: {
155
+ background: 'transparent',
156
+ padding: '16px',
157
+ margin: 0,
158
+ fontSize: '12px',
159
+ lineHeight: '1'
160
+ }
161
+ }, JSON.stringify(chartJson, null, 2) || content))));
65
162
  });
@@ -1,7 +1,13 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _extends from "@babel/runtime/helpers/esm/extends";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
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); }
4
2
  var _excluded = ["children", "className", "node"];
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
8
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
+ 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; }
10
+ 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; }
5
11
  import { get } from 'lodash';
6
12
  import React from 'react';
7
13
  import { DEFAULT_CHART_COMPONENTS } from "../export";
@@ -32,7 +38,9 @@ var withCodeBlock = function withCodeBlock(options) {
32
38
  debug = options.debug,
33
39
  _options$loadingTimeo = options.loadingTimeout,
34
40
  loadingTimeout = _options$loadingTimeo === void 0 ? 5000 : _options$loadingTimeo,
35
- style = options.style;
41
+ style = options.style,
42
+ errorRender = options.errorRender,
43
+ componentErrorRender = options.componentErrorRender;
36
44
 
37
45
  // If the code block is a VisChart, render the corresponding chart component
38
46
  if (isVisChart) {
@@ -41,7 +49,9 @@ var withCodeBlock = function withCodeBlock(options) {
41
49
  content: content,
42
50
  components: components,
43
51
  debug: debug,
44
- loadingTimeout: loadingTimeout
52
+ loadingTimeout: loadingTimeout,
53
+ errorRender: errorRender,
54
+ componentErrorRender: componentErrorRender
45
55
  });
46
56
  }
47
57
 
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledGPTVis: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const CopyButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
4
+ export declare const ChartWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
+ export declare const TabContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
6
+ export declare const TabHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
+ export declare const TabLeftGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
8
+ export declare const TabRightGroup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
+ export declare const TabContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
+ export declare const ErrorMessage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
11
+ export declare const GlobalStyles: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & object>;
12
+ export declare const StyledTabButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
13
+ active?: boolean | undefined;
14
+ }>> & string;
@@ -0,0 +1,54 @@
1
+ import styled, { createGlobalStyle } from 'styled-components';
2
+ export var StyledGPTVis = styled.div.withConfig({
3
+ displayName: "StyledGPTVis",
4
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-0"
5
+ })(["min-width:300px;height:300px;max-width:100%;overflow:hidden;position:relative;padding:16px;"]);
6
+ export var CopyButton = styled.button.withConfig({
7
+ displayName: "CopyButton",
8
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-1"
9
+ })(["border:none;box-shadow:none;background:transparent;color:#494949;height:26px;padding:0 8px;font-size:12px;transition:all 0.2s cubic-bezier(0.645,0.045,0.355,1);transform:scale(1);border-radius:8px;display:inline-flex;align-items:center;justify-content:center;gap:4px;cursor:pointer;outline:none;font-family:inherit;&:hover,&:focus{color:#666;background:#f5f5f5;transform:scale(1.02);}&:active{background:#e8e8e8;transform:scale(0.98);}.anticon{font-size:12px;}&:disabled{cursor:not-allowed;opacity:0.6;&:hover,&:focus,&:active{background:transparent;transform:scale(1);}}"]);
10
+ export var ChartWrapper = styled.div.withConfig({
11
+ displayName: "ChartWrapper",
12
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-2"
13
+ })(["width:100%;height:100%;& > *{max-width:100%;max-height:100%;}"]);
14
+ export var TabContainer = styled.div.withConfig({
15
+ displayName: "TabContainer",
16
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-3"
17
+ })(["border-radius:8px;overflow:hidden;"]);
18
+ export var TabHeader = styled.div.withConfig({
19
+ displayName: "TabHeader",
20
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-4"
21
+ })(["display:flex;justify-content:space-between;align-items:center;background:#f5f5f5;padding:6px 14px 6px 6px;gap:2px;position:relative;z-index:10;"]);
22
+ export var TabLeftGroup = styled.div.withConfig({
23
+ displayName: "TabLeftGroup",
24
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-5"
25
+ })(["display:flex;gap:2px;"]);
26
+ export var TabRightGroup = styled.div.withConfig({
27
+ displayName: "TabRightGroup",
28
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-6"
29
+ })(["display:flex;gap:4px;align-items:center;"]);
30
+ export var TabContent = styled.div.withConfig({
31
+ displayName: "TabContent",
32
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-7"
33
+ })(["background:#fff;overflow:hidden;position:relative;background:#fafafa;"]);
34
+ export var ErrorMessage = styled.div.withConfig({
35
+ displayName: "ErrorMessage",
36
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-8"
37
+ })(["height:150px;font-size:12px;color:#666;border-radius:4px;display:flex;align-items:center;justify-content:center;"]);
38
+ export var GlobalStyles = createGlobalStyle(["pre:has(.gpt-vis){overflow:hidden;}"]);
39
+ export var StyledTabButton = styled.button.withConfig({
40
+ displayName: "StyledTabButton",
41
+ componentId: "gpt-vis-c7ef__sc-2dc7ka-9"
42
+ })(["border:none;box-shadow:none;background:", ";color:#494949;border-radius:8px;height:26px;width:52px;font-size:12px;transition:all 0.2s cubic-bezier(0.645,0.045,0.355,1);transform:scale(1);cursor:pointer;outline:none;font-family:inherit;display:inline-flex;align-items:center;justify-content:center;", " &:hover,&:focus{background:", ";color:#494949;box-shadow:", ";transform:scale(1.02);}&:active{background:", ";transform:scale(0.96);box-shadow:", ";transition:all 0.1s cubic-bezier(0.645,0.045,0.355,1);}"], function (props) {
43
+ return props.active ? '#fff' : 'transparent';
44
+ }, function (props) {
45
+ return props.active && "\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n ";
46
+ }, function (props) {
47
+ return props.active ? '#fff' : '#f0f0f0';
48
+ }, function (props) {
49
+ return props.active ? '0 2px 6px rgba(0, 0, 0, 0.12)' : '0 1px 3px rgba(0, 0, 0, 0.06)';
50
+ }, function (props) {
51
+ return props.active ? '#fff' : '#e8e8e8';
52
+ }, function (props) {
53
+ return props.active ? '0 1px 2px rgba(0, 0, 0, 0.1)' : '0 1px 2px rgba(0, 0, 0, 0.04)';
54
+ });
@@ -1,5 +1,20 @@
1
1
  import type { FC } from 'react';
2
2
  import type { Components, ExtraProps } from 'react-markdown';
3
+ /**
4
+ * 错误渲染函数类型
5
+ */
6
+ export type ErrorRender = {
7
+ /** 错误对象 */
8
+ error?: Error;
9
+ /** 原始内容 */
10
+ content: string;
11
+ };
12
+ export type ComponentErrorRender = {
13
+ /** 错误对象 */
14
+ error?: Error;
15
+ /** 原始内容 */
16
+ content: string;
17
+ };
3
18
  export type WithChartCodeOptions = {
4
19
  /**
5
20
  * 要额外加载的图表组件
@@ -25,6 +40,14 @@ export type WithChartCodeOptions = {
25
40
  * 图表样式,配置容器样式
26
41
  */
27
42
  style?: React.CSSProperties;
43
+ /**
44
+ * 自定义组件错误渲染函数
45
+ */
46
+ componentErrorRender?: (errorInfo: ComponentErrorRender) => React.ReactElement;
47
+ /**
48
+ * 自定义错误渲染函数
49
+ */
50
+ errorRender?: (errorInfo: ErrorRender) => React.ReactElement;
28
51
  };
29
52
  /**
30
53
  * 图表渲染数据接口,后续拓展,这里只是写个示例
@@ -0,0 +1 @@
1
+ export declare const handleCopyCode: (data: any) => Promise<void>;
@@ -0,0 +1,37 @@
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ import copy from 'copy-text-to-clipboard';
6
+ export var handleCopyCode = /*#__PURE__*/function () {
7
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
8
+ var codeText, success;
9
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10
+ while (1) switch (_context.prev = _context.next) {
11
+ case 0:
12
+ _context.prev = 0;
13
+ codeText = JSON.stringify(data, null, 2);
14
+ success = copy(codeText);
15
+ if (success) {
16
+ _context.next = 5;
17
+ break;
18
+ }
19
+ throw new Error('复制失败');
20
+ case 5:
21
+ _context.next = 11;
22
+ break;
23
+ case 7:
24
+ _context.prev = 7;
25
+ _context.t0 = _context["catch"](0);
26
+ console.error('复制失败:', _context.t0);
27
+ throw _context.t0;
28
+ case 11:
29
+ case "end":
30
+ return _context.stop();
31
+ }
32
+ }, _callee, null, [[0, 7]]);
33
+ }));
34
+ return function handleCopyCode(_x) {
35
+ return _ref.apply(this, arguments);
36
+ };
37
+ }();
@@ -1,4 +1,9 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
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); }
2
7
  import React from 'react';
3
8
  import { mergeGraphOptions } from "../../utils/config";
4
9
  import { transform2ADCProps } from "../../utils/plot";
@@ -1,5 +1,6 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
1
  var _excluded = ["children"];
2
+ 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; }
3
+ 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; }
3
4
  import React, { useMemo } from 'react';
4
5
  import { mergeGlobalConfig } from "../utils/config";
5
6
  import { ConfigContext } from "./context";
@@ -1,6 +1,12 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
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); }
3
2
  var _excluded = ["categories", "series"];
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
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
+ 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; }
4
10
  import { DualAxes as ADCDualAxes } from '@ant-design/plots';
5
11
  import React, { useMemo } from 'react';
6
12
  import { usePlotConfig } from "../ConfigProvider/hooks";
@@ -1,6 +1,12 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
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); }
3
2
  var _excluded = ["type", "axisYTitle"];
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ 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); }
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
+ 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; }
4
10
  import { ChartType } from "../types";
5
11
  export function transform(series, categories) {
6
12
  var newChildren = series.map(function (item, index) {
@@ -1,6 +1,7 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
1
  var _excluded = ["data"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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; }
4
+ 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; }
4
5
  import { Fishbone as ADCFishbone } from '@ant-design/graphs';
5
6
  import React, { useMemo } from 'react';
6
7
  import { useGraphConfig } from "../ConfigProvider/hooks";
@@ -1,7 +1,13 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
4
1
  var _excluded = ["data"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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; }
4
+ 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; }
5
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
+ 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."); }
7
+ 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); }
8
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+ 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; }
5
11
  import { FlowGraph as ADCFlowGraph, RCNode } from '@ant-design/graphs';
6
12
  import React, { useMemo } from 'react';
7
13
  import { useGraphConfig } from "../ConfigProvider/hooks";
@@ -1,7 +1,13 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
1
  var _excluded = ["children", "components", "rehypePlugins", "remarkPlugins", "eventSubs"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ 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."); }
5
+ 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); }
6
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+ 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; }
9
+ 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; }
10
+ 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; }
5
11
  import EventEmitter from '@antv/event-emitter';
6
12
  import React, { memo, useEffect, useMemo } from 'react';
7
13
  import Markdown from 'react-markdown';
@@ -1,7 +1,13 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
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); }
4
2
  var _excluded = ["children", "components"];
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ 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); }
9
+ 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; }
10
+ 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; }
5
11
  import React, { memo } from 'react';
6
12
  import { withDefaultChartCode } from "../ChartCodeRender";
7
13
  import { default as GPTVisLite } from "./Lite";
@@ -1,6 +1,7 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
1
  var _excluded = ["children", "data"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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; }
4
+ 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; }
4
5
  import { HeatmapLayer } from '@antv/larkmap';
5
6
  import React, { useMemo } from 'react';
6
7
  import { useMapConfig } from "../ConfigProvider/hooks";
@@ -1,8 +1,19 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
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); }
5
2
  var _excluded = ["data"];
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ 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; }
8
+ 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; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ 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); }
11
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12
+ 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."); }
13
+ 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); }
14
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
15
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
16
+ 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; }
6
17
  import { IndentedTree as ADCIndentedTree } from '@ant-design/graphs';
7
18
  import React, { useMemo } from 'react';
8
19
  import { useGraphConfig } from "../ConfigProvider/hooks";
@@ -1,4 +1,9 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2
7
  import { useScene } from '@antv/larkmap';
3
8
  import { useEffect, useState } from 'react';
4
9
  import { setMapContext, setMarkers } from "../../utils/map";
@@ -1,4 +1,9 @@
1
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ 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); }
4
+ 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; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2
7
  import { useScene } from '@antv/larkmap';
3
8
  import { useEffect, useState } from 'react';
4
9
  import { setPolyline } from "../../utils/map";