@advt-gpt-chart/package 3.1.0 → 3.1.1
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
|
@@ -179258,7 +179258,7 @@ function ZXe() {
|
|
|
179258
179258
|
throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");
|
|
179259
179259
|
return n;
|
|
179260
179260
|
}
|
|
179261
|
-
const Kmi = "3.1.
|
|
179261
|
+
const Kmi = "3.1.1", Zmi = (n) => /* @__PURE__ */ yi.createElement("svg", Ce({ 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" })), Qmi = (n) => /* @__PURE__ */ yi.createElement("svg", Ce({ 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) => oi(Ce({}, e), {
|
|
179262
179262
|
label: /* @__PURE__ */ ve(as, { id: e.key })
|
|
179263
179263
|
}))) || [], Jmi = {
|
|
179264
179264
|
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 cUe;function E1i(){return cUe||(cUe=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})()})(loe)),loe.exports}var R1i=E1i();const uoe=Da(R1i);var hoe=new Map,pL=new WeakMap,dUe=0,M1i;function k1i(n){return n?(pL.has(n)||(dUe+=1,pL.set(n,dUe.toString())),pL.get(n)):"0"}function P1i(n){return Object.keys(n).sort().filter(e=>n[e]!==void 0).map(e=>`${e}_${e==="root"?k1i(n.root):n[e]}`).toString()}function I1i(n){const e=P1i(n);let t=hoe.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},hoe.set(e,t)}return t}function D1i(n,e,t={},i=M1i){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}=I1i(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(),hoe.delete(r))}}function O1i({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]=me.useState(null),f=me.useRef(u),g=me.useRef(a),[p,m]=me.useState({inView:!!a,entry:void 0});f.current=u,me.useEffect(()=>{if(g.current===void 0&&(g.current=a),o||!c)return;let y;return y=D1i(c,(S,C)=>{const w=g.current;g.current=S,!(w===void 0&&!S)&&(m({inView:S,entry:C}),f.current&&f.current(S,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=me.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 B1i=Zs.div`
|
|
10856
10856
|
height: 100%;
|
|
10857
10857
|
width: 100%;
|
|
10858
|
-
`,mL=({visible:n,title:e,message:t})=>n?le.jsx(B1i,{className:"error-container",children:le.jsx(Gt.Result,{status:"error",title:e,subTitle:t})}):null,fUe=me.default.createContext(null);function gUe(){const n=me.default.useContext(fUe);if(n===void 0||Object.keys(n).length===0)throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");return n}const pUe="3.1.
|
|
10858
|
+
`,mL=({visible:n,title:e,message:t})=>n?le.jsx(B1i,{className:"error-container",children:le.jsx(Gt.Result,{status:"error",title:e,subTitle:t})}):null,fUe=me.default.createContext(null);function gUe(){const n=me.default.useContext(fUe);if(n===void 0||Object.keys(n).length===0)throw new Error("useGPTVisContext must be used within a GPTVisContext.Provider");return n}const pUe="3.1.1",L1i=n=>me.createElement("svg",xe({width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),me.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"})),F1i=n=>me.createElement("svg",xe({width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),me.createElement("path",{d:"M6.66699 18.3327H5.00033V8.74935H1.66699L5.83366 1.66602L10.0003 8.74935H6.66699V18.3327Z",fill:"#89898A"}),me.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=>hi(xe({},e),{label:le.jsx(is,{id:e.key})})))||[],N1i={components:{Select:{activeBorderColor:"#008CD6",hoverBorderColor:"#008CD6",optionHeight:32,optionLineHeight:"32px",optionPadding:"8px 12px 8px 8px"}}},H1i=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.1";
|
|
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.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
|
+
}
|
|
46
46
|
}
|