@antv/gpt-vis 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ChartCodeRender/index.d.ts +0 -1
- package/dist/cjs/ChartCodeRender/index.js +21 -3
- package/dist/esm/ChartCodeRender/index.d.ts +0 -1
- package/dist/esm/ChartCodeRender/index.js +11 -3
- package/package.json +1 -1
- package/dist/cjs/ChartCodeRender/index.css +0 -19
- package/dist/esm/ChartCodeRender/index.css +0 -19
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import './index.css';
|
|
3
2
|
import { WithChartCodeOptions } from './type';
|
|
4
3
|
export declare const withChartCode: (options: WithChartCodeOptions) => keyof JSX.IntrinsicElements | import("hast-util-to-jsx-runtime/lib/components").Component<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & import("hast-util-to-jsx-runtime/lib/components").ExtraProps> | undefined;
|
|
5
4
|
/**
|
|
@@ -36,10 +36,28 @@ module.exports = __toCommonJS(ChartCodeRender_exports);
|
|
|
36
36
|
var import_icons = require("@ant-design/icons");
|
|
37
37
|
var import_lodash = require("lodash");
|
|
38
38
|
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
39
40
|
var import_constants = require("../constants");
|
|
40
|
-
var
|
|
41
|
+
var StyledGPTVis = import_styled_components.default.div`
|
|
42
|
+
min-width: 600px;
|
|
43
|
+
max-width: 100%;
|
|
44
|
+
`;
|
|
45
|
+
var StyledLoading = import_styled_components.default.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
width: 400px;
|
|
51
|
+
height: 400px;
|
|
52
|
+
background-image: linear-gradient(135deg, #e3f3ff 0%, #f1eeff 100%);
|
|
53
|
+
color: rgba(0, 0, 0, 88%);
|
|
54
|
+
|
|
55
|
+
&-icon {
|
|
56
|
+
margin-bottom: 6px;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
41
59
|
var Loading = () => {
|
|
42
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
60
|
+
return /* @__PURE__ */ import_react.default.createElement(StyledLoading, { className: "gpt-vis-loading" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "gpt-vis-loading-icon" }, /* @__PURE__ */ import_react.default.createElement(
|
|
43
61
|
import_icons.LoadingOutlined,
|
|
44
62
|
{
|
|
45
63
|
style: { fontSize: "24px", color: "rgb(56, 177, 246)" }
|
|
@@ -89,7 +107,7 @@ var withCodeBlock = (options) => {
|
|
|
89
107
|
if (!ChartComponent) {
|
|
90
108
|
return /* @__PURE__ */ import_react.default.createElement("code", null, `Chart type "${type}" is not supported.`);
|
|
91
109
|
}
|
|
92
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
110
|
+
return /* @__PURE__ */ import_react.default.createElement(StyledGPTVis, { className: "gpt-vis" }, /* @__PURE__ */ import_react.default.createElement(ChartComponent, { ...chartJson }));
|
|
93
111
|
}
|
|
94
112
|
const languageName = ((_a = className.match(/language-(.*)/)) == null ? void 0 : _a[1]) || "";
|
|
95
113
|
const extraLanguageRenderers = extraRenderers || languageRenderers;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import './index.css';
|
|
3
2
|
import { WithChartCodeOptions } from './type';
|
|
4
3
|
export declare const withChartCode: (options: WithChartCodeOptions) => keyof JSX.IntrinsicElements | import("hast-util-to-jsx-runtime/lib/components").Component<React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement> & import("hast-util-to-jsx-runtime/lib/components").ExtraProps> | undefined;
|
|
5
4
|
/**
|
|
@@ -7,10 +7,18 @@ var _excluded = ["children", "className", "node"];
|
|
|
7
7
|
import { LoadingOutlined } from '@ant-design/icons';
|
|
8
8
|
import { get } from 'lodash';
|
|
9
9
|
import React, { useRef, useState } from 'react';
|
|
10
|
+
import styled from 'styled-components';
|
|
10
11
|
import { DEFAULT_CHART_COMPONENTS } from "../constants";
|
|
11
|
-
|
|
12
|
+
var StyledGPTVis = styled.div.withConfig({
|
|
13
|
+
displayName: "StyledGPTVis",
|
|
14
|
+
componentId: "gpt-vis-ed04__sc-1osp6pj-0"
|
|
15
|
+
})(["min-width:600px;max-width:100%;"]);
|
|
16
|
+
var StyledLoading = styled.div.withConfig({
|
|
17
|
+
displayName: "StyledLoading",
|
|
18
|
+
componentId: "gpt-vis-ed04__sc-1osp6pj-1"
|
|
19
|
+
})(["display:flex;align-items:center;justify-content:center;flex-direction:column;width:400px;height:400px;background-image:linear-gradient(135deg,#e3f3ff 0%,#f1eeff 100%);color:rgba(0,0,0,88%);&-icon{margin-bottom:6px;}"]);
|
|
12
20
|
var Loading = function Loading() {
|
|
13
|
-
return /*#__PURE__*/React.createElement(
|
|
21
|
+
return /*#__PURE__*/React.createElement(StyledLoading, {
|
|
14
22
|
className: "gpt-vis-loading"
|
|
15
23
|
}, /*#__PURE__*/React.createElement("div", {
|
|
16
24
|
className: "gpt-vis-loading-icon"
|
|
@@ -79,7 +87,7 @@ var withCodeBlock = function withCodeBlock(options) {
|
|
|
79
87
|
|
|
80
88
|
// Render the supported chart component with data
|
|
81
89
|
|
|
82
|
-
return /*#__PURE__*/React.createElement(
|
|
90
|
+
return /*#__PURE__*/React.createElement(StyledGPTVis, {
|
|
83
91
|
className: "gpt-vis"
|
|
84
92
|
}, /*#__PURE__*/React.createElement(ChartComponent, chartJson));
|
|
85
93
|
}
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
.gpt-vis {
|
|
2
|
-
min-width: 600px;
|
|
3
|
-
max-width: 100%;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.gpt-vis-loading {
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
width: 400px;
|
|
12
|
-
height: 400px;
|
|
13
|
-
background-image: linear-gradient(135deg, #e3f3ff 0%, #f1eeff 100%);
|
|
14
|
-
color: rgba(0, 0, 0, 88%);
|
|
15
|
-
|
|
16
|
-
&-icon {
|
|
17
|
-
margin-bottom: 6px;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
.gpt-vis {
|
|
2
|
-
min-width: 600px;
|
|
3
|
-
max-width: 100%;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.gpt-vis-loading {
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
width: 400px;
|
|
12
|
-
height: 400px;
|
|
13
|
-
background-image: linear-gradient(135deg, #e3f3ff 0%, #f1eeff 100%);
|
|
14
|
-
color: rgba(0, 0, 0, 88%);
|
|
15
|
-
|
|
16
|
-
&-icon {
|
|
17
|
-
margin-bottom: 6px;
|
|
18
|
-
}
|
|
19
|
-
}
|