@advt-gpt-chart/package 3.1.4 → 3.1.6
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 +55 -55
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.gz +0 -0
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.gz +0 -0
- package/dist/version.d.ts +1 -1
- package/package.json +45 -45
package/README.md
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
# advt-gpt-chart 可视化组件库
|
|
2
|
-
|
|
3
|
-
## 特性
|
|
4
|
-
|
|
5
|
-
- 📊 支持13+图表类型(折线图/柱状图/饼图/雷达图等)
|
|
6
|
-
- 🎨 内置Light/Dark双主题体系
|
|
7
|
-
- 📝 Markdown协议直接渲染图表
|
|
8
|
-
<!-- - 🌐 国际化多语言支持 -->
|
|
9
|
-
- 🛠 完善的TypeScript类型定义
|
|
10
|
-
|
|
11
|
-
# 安装依赖
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install @advt-gpt-chart/package
|
|
15
|
-
pnpm install @advt-gpt-chart/package
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
# 使用
|
|
19
|
-
```tsx
|
|
20
|
-
import { ConfigProvider, Line, GPTVis } from '@advt-gpt-chart/package';
|
|
21
|
-
|
|
22
|
-
function App() {
|
|
23
|
-
|
|
24
|
-
const markdownContent = `
|
|
25
|
-
以下是为你绘制的一个饼图
|
|
26
|
-
\`\`\`vis-chart
|
|
27
|
-
{
|
|
28
|
-
"type": "pie",
|
|
29
|
-
"data": [
|
|
30
|
-
{ "category": "分类一", "value": 27 },
|
|
31
|
-
{ "category": "分类二", "value": 25 },
|
|
32
|
-
{ "category": "分类三", "value": 18 },
|
|
33
|
-
{ "category": "分类四", "value": 15 },
|
|
34
|
-
{ "category": "分类五", "value": 10 },
|
|
35
|
-
{ "category": "其他", "value": 5 }
|
|
36
|
-
],
|
|
37
|
-
"nameField": "category",
|
|
38
|
-
"valField": "value"
|
|
39
|
-
}
|
|
40
|
-
\`\`\`
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<ConfigProvider theme="dark">
|
|
45
|
-
{/* 直接使用图表组件 */}
|
|
46
|
-
<Line data={[...]} />
|
|
47
|
-
|
|
48
|
-
{/* 通过Markdown渲染 */}
|
|
49
|
-
<GPTVis>
|
|
50
|
-
{markdownContent}
|
|
51
|
-
</GPTVis>
|
|
52
|
-
</ConfigProvider>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
```
|
|
1
|
+
# advt-gpt-chart 可视化组件库
|
|
2
|
+
|
|
3
|
+
## 特性
|
|
4
|
+
|
|
5
|
+
- 📊 支持13+图表类型(折线图/柱状图/饼图/雷达图等)
|
|
6
|
+
- 🎨 内置Light/Dark双主题体系
|
|
7
|
+
- 📝 Markdown协议直接渲染图表
|
|
8
|
+
<!-- - 🌐 国际化多语言支持 -->
|
|
9
|
+
- 🛠 完善的TypeScript类型定义
|
|
10
|
+
|
|
11
|
+
# 安装依赖
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @advt-gpt-chart/package
|
|
15
|
+
pnpm install @advt-gpt-chart/package
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
# 使用
|
|
19
|
+
```tsx
|
|
20
|
+
import { ConfigProvider, Line, GPTVis } from '@advt-gpt-chart/package';
|
|
21
|
+
|
|
22
|
+
function App() {
|
|
23
|
+
|
|
24
|
+
const markdownContent = `
|
|
25
|
+
以下是为你绘制的一个饼图
|
|
26
|
+
\`\`\`vis-chart
|
|
27
|
+
{
|
|
28
|
+
"type": "pie",
|
|
29
|
+
"data": [
|
|
30
|
+
{ "category": "分类一", "value": 27 },
|
|
31
|
+
{ "category": "分类二", "value": 25 },
|
|
32
|
+
{ "category": "分类三", "value": 18 },
|
|
33
|
+
{ "category": "分类四", "value": 15 },
|
|
34
|
+
{ "category": "分类五", "value": 10 },
|
|
35
|
+
{ "category": "其他", "value": 5 }
|
|
36
|
+
],
|
|
37
|
+
"nameField": "category",
|
|
38
|
+
"valField": "value"
|
|
39
|
+
}
|
|
40
|
+
\`\`\`
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<ConfigProvider theme="dark">
|
|
45
|
+
{/* 直接使用图表组件 */}
|
|
46
|
+
<Line data={[...]} />
|
|
47
|
+
|
|
48
|
+
{/* 通过Markdown渲染 */}
|
|
49
|
+
<GPTVis>
|
|
50
|
+
{markdownContent}
|
|
51
|
+
</GPTVis>
|
|
52
|
+
</ConfigProvider>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
package/dist/index.es.js
CHANGED
|
@@ -179502,7 +179502,7 @@ function eKe() {
|
|
|
179502
179502
|
throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");
|
|
179503
179503
|
return n;
|
|
179504
179504
|
}
|
|
179505
|
-
const nvi = "3.1.
|
|
179505
|
+
const nvi = "3.1.6", rvi = (n) => /* @__PURE__ */ yi.createElement("svg", be({ width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n), /* @__PURE__ */ yi.createElement("path", { d: "M11.667 10.9998V18.3337H8.33398V10.9998L1.66699 1.66675H18.334L11.667 10.9998ZM10 10.4656L15.0947 3.33374H4.90527L10 10.4656Z", fill: "#89898A" })), svi = (n) => /* @__PURE__ */ yi.createElement("svg", be({ width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n), /* @__PURE__ */ yi.createElement("path", { d: "M6.66699 18.3327H5.00033V8.74935H1.66699L5.83366 1.66602L10.0003 8.74935H6.66699V18.3327Z", fill: "#89898A" }), /* @__PURE__ */ yi.createElement("path", { d: "M15.0003 1.66602H13.3337V11.2493H10.0003L14.167 18.3327L18.3337 11.2493H15.0003V1.66602Z", fill: "#89898A" })), ed = (n) => (n == null ? void 0 : n.map((e) => si(be({}, e), {
|
|
179506
179506
|
label: /* @__PURE__ */ ve(ls, { id: e.key })
|
|
179507
179507
|
}))) || [], ovi = {
|
|
179508
179508
|
components: {
|
package/dist/index.es.js.gz
CHANGED
|
Binary file
|
package/dist/index.umd.js
CHANGED
|
@@ -10855,7 +10855,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
10855
10855
|
*/var gUe;function O1i(){return gUe||(gUe=1,(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=r(s,i(a)))}return s}function i(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)e.call(s,a)&&s[a]&&(o=r(o,a));return o}function r(s,o){return o?s?s+" "+o:s+o:s}n.exports?(t.default=t,n.exports=t):window.classNames=t})()})(doe)),doe.exports}var L1i=O1i();const foe=Ia(L1i);var goe=new Map,vB=new WeakMap,pUe=0,B1i;function F1i(n){return n?(vB.has(n)||(pUe+=1,vB.set(n,pUe.toString())),vB.get(n)):"0"}function N1i(n){return Object.keys(n).sort().filter(e=>n[e]!==void 0).map(e=>`${e}_${e==="root"?F1i(n.root):n[e]}`).toString()}function H1i(n){const e=N1i(n);let t=goe.get(e);if(!t){const i=new Map;let r;const s=new IntersectionObserver(o=>{o.forEach(a=>{var l;const u=a.isIntersecting&&r.some(h=>a.intersectionRatio>=h);n.trackVisibility&&typeof a.isVisible=="undefined"&&(a.isVisible=u),(l=i.get(a.target))==null||l.forEach(h=>{h(u,a)})})},n);r=s.thresholds||(Array.isArray(n.threshold)?n.threshold:[n.threshold||0]),t={id:e,observer:s,elements:i},goe.set(e,t)}return t}function z1i(n,e,t={},i=B1i){if(typeof window.IntersectionObserver=="undefined"&&i!==void 0){const l=n.getBoundingClientRect();return e(i,{isIntersecting:i,target:n,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:r,observer:s,elements:o}=H1i(t),a=o.get(n)||[];return o.has(n)||o.set(n,a),a.push(e),s.observe(n),function(){a.splice(a.indexOf(e),1),a.length===0&&(o.delete(n),s.unobserve(n)),o.size===0&&(s.disconnect(),goe.delete(r))}}function $1i({threshold:n,delay:e,trackVisibility:t,rootMargin:i,root:r,triggerOnce:s,skip:o,initialInView:a,fallbackInView:l,onChange:u}={}){var h;const[c,d]=pe.useState(null),f=pe.useRef(u),g=pe.useRef(a),[p,m]=pe.useState({inView:!!a,entry:void 0});f.current=u,pe.useEffect(()=>{if(g.current===void 0&&(g.current=a),o||!c)return;let y;return y=z1i(c,(x,C)=>{const w=g.current;g.current=x,!(w===void 0&&!x)&&(m({inView:x,entry:C}),f.current&&f.current(x,C),C.isIntersecting&&s&&y&&(y(),y=void 0))},{root:r,rootMargin:i,threshold:n,trackVisibility:t,delay:e},l),()=>{y&&y()}},[Array.isArray(n)?n.toString():n,c,r,i,s,o,t,l,e]);const v=(h=p.entry)==null?void 0:h.target,b=pe.useRef(void 0);!c&&v&&!s&&!o&&b.current!==v&&(b.current=v,m({inView:!!a,entry:void 0}),g.current=a);const _=[d,p.inView,p.entry];return _.ref=_[0],_.inView=_[1],_.entry=_[2],_}const W1i=Zs.div`
|
|
10856
10856
|
height: 100%;
|
|
10857
10857
|
width: 100%;
|
|
10858
|
-
`,bB=({visible:n,title:e,message:t})=>n?le.jsx(W1i,{className:"error-container",children:le.jsx(Gt.Result,{status:"error",title:e,subTitle:t})}):null,mUe=pe.default.createContext(null);function vUe(){const n=pe.default.useContext(mUe);if(n===void 0||Object.keys(n).length===0)throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");return n}const bUe="3.1.
|
|
10858
|
+
`,bB=({visible:n,title:e,message:t})=>n?le.jsx(W1i,{className:"error-container",children:le.jsx(Gt.Result,{status:"error",title:e,subTitle:t})}):null,mUe=pe.default.createContext(null);function vUe(){const n=pe.default.useContext(mUe);if(n===void 0||Object.keys(n).length===0)throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");return n}const bUe="3.1.6",U1i=n=>pe.createElement("svg",_e({width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),pe.createElement("path",{d:"M11.667 10.9998V18.3337H8.33398V10.9998L1.66699 1.66675H18.334L11.667 10.9998ZM10 10.4656L15.0947 3.33374H4.90527L10 10.4656Z",fill:"#89898A"})),V1i=n=>pe.createElement("svg",_e({width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),pe.createElement("path",{d:"M6.66699 18.3327H5.00033V8.74935H1.66699L5.83366 1.66602L10.0003 8.74935H6.66699V18.3327Z",fill:"#89898A"}),pe.createElement("path",{d:"M15.0003 1.66602H13.3337V11.2493H10.0003L14.167 18.3327L18.3337 11.2493H15.0003V1.66602Z",fill:"#89898A"})),Fh=n=>(n==null?void 0:n.map(e=>ai(_e({},e),{label:le.jsx(ns,{id:e.key})})))||[],G1i={components:{Select:{activeBorderColor:"#008CD6",hoverBorderColor:"#008CD6",optionHeight:32,optionLineHeight:"32px",optionPadding:"8px 12px 8px 8px"}}},j1i=Zs.div`
|
|
10859
10859
|
${()=>_a`
|
|
10860
10860
|
height: 36px;
|
|
10861
10861
|
width: 100%;
|
package/dist/index.umd.js.gz
CHANGED
|
Binary file
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const version = "3.1.
|
|
1
|
+
declare const version = "3.1.6";
|
|
2
2
|
export default version;
|
package/package.json
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@advt-gpt-chart/package",
|
|
3
|
-
"version": "3.1.
|
|
4
|
-
"description": "ADVT GPT Chart - A React chart component library for GPT visualization",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.umd.js",
|
|
7
|
-
"module": "./dist/index.es.js",
|
|
8
|
-
"typings": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"default": "./dist/index.es.js"
|
|
14
|
-
},
|
|
15
|
-
"require": {
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
|
-
"default": "./dist/index.umd.js"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"./package.json": "./package.json"
|
|
21
|
-
},
|
|
22
|
-
"files": [
|
|
23
|
-
"dist"
|
|
24
|
-
],
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "cd .. && pnpm run build:chart",
|
|
27
|
-
"publish-local": "cd .. && pnpm run publish-local",
|
|
28
|
-
"publish-local-update": "cd .. && pnpm run publish-local-update",
|
|
29
|
-
"publish-npm": "npm publish --registry https://registry.npmjs.org/ --access public"
|
|
30
|
-
},
|
|
31
|
-
"keywords": [
|
|
32
|
-
"react",
|
|
33
|
-
"chart",
|
|
34
|
-
"gpt",
|
|
35
|
-
"visualization",
|
|
36
|
-
"antd",
|
|
37
|
-
"vchart"
|
|
38
|
-
],
|
|
39
|
-
"author": "",
|
|
40
|
-
"license": "MIT",
|
|
41
|
-
"peerDependencies": {
|
|
42
|
-
"antd": ">=4.0.0",
|
|
43
|
-
"react": ">=17.0.0 <19.0.0",
|
|
44
|
-
"react-dom": ">=17.0.0 <19.0.0"
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@advt-gpt-chart/package",
|
|
3
|
+
"version": "3.1.6",
|
|
4
|
+
"description": "ADVT GPT Chart - A React chart component library for GPT visualization",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.umd.js",
|
|
7
|
+
"module": "./dist/index.es.js",
|
|
8
|
+
"typings": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.es.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.umd.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "cd .. && pnpm run build:chart",
|
|
27
|
+
"publish-local": "cd .. && pnpm run publish-local",
|
|
28
|
+
"publish-local-update": "cd .. && pnpm run publish-local-update",
|
|
29
|
+
"publish-npm": "npm publish --registry https://registry.npmjs.org/ --access public"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"react",
|
|
33
|
+
"chart",
|
|
34
|
+
"gpt",
|
|
35
|
+
"visualization",
|
|
36
|
+
"antd",
|
|
37
|
+
"vchart"
|
|
38
|
+
],
|
|
39
|
+
"author": "",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"antd": ">=4.0.0",
|
|
43
|
+
"react": ">=17.0.0 <19.0.0",
|
|
44
|
+
"react-dom": ">=17.0.0 <19.0.0"
|
|
45
|
+
}
|
|
46
46
|
}
|