{"_id":"@albertluo213/chart-render","_rev":"2-2ddfd3844650cc2bc501c93475c40650","name":"@albertluo213/chart-render","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@albertluo213/chart-render","version":"1.0.0","keywords":["chart","render","visualization","vchart","cube"],"author":"","license":"MIT","_id":"@albertluo213/chart-render@1.0.0","maintainers":[{"name":"albertluo213","email":"1204648923@qq.com"}],"homepage":"https://github.com/your-org/cube-chart#readme","bugs":{"url":"https://github.com/your-org/cube-chart/issues"},"dist":{"shasum":"393bc4cc31cf2f9fe417b4da4858849b34db0fb1","tarball":"https://registry.npmjs.org/@albertluo213/chart-render/-/chart-render-1.0.0.tgz","fileCount":10,"integrity":"sha512-KkK3sRw2jTApG7hcyQtccPKumuw3pmf9CwRczmEUSlyhrp0dmO8k7rEZGUqvNM2y41a3iwoBK47F6jr//TfIFQ==","signatures":[{"sig":"MEYCIQDjeNBba5oG90fA/FjfrbYuB7hRZq0eVOHXbd2hfNjuwwIhAKcfxSoMXUwroWOOA+bG4lccLU0eplP92ttGJeItQvVA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72335},"main":"dist/index.cjs.js","types":"dist/types/index.d.ts","module":"dist/index.esm.js","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.cjs.js"},"./react":{"types":"./react/index.d.ts","import":"./react/index.js"},"./style.css":"./dist/style.css"},"gitHead":"931fd971e588202f8bd0aabe1967a90d9d77c959","scripts":{"dev":"vite","lint":"eslint src","test":"vitest","build":"vite build","clean":"rm -rf dist node_modules","prepublishOnly":"npm run build"},"_npmUser":{"name":"albertluo213","email":"1204648923@qq.com"},"repository":{"url":"git+https://github.com/your-org/cube-chart.git","type":"git","directory":"cube-chart-render"},"_npmVersion":"10.9.3","description":"Lightweight chart rendering component for Cube Chart","directories":{},"_nodeVersion":"22.20.0","dependencies":{"lodash-es":"^4.17.21","eventemitter3":"^5.0.1","@visactor/vchart":"^1.11.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.8","vitest":"^1.0.4","@types/react":"^18.2.45","@types/lodash-es":"^4.17.12","@vitejs/plugin-react":"^4.2.1"},"peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/chart-render_1.0.0_1761639019239_0.28860033673185437","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@albertluo213/chart-render","version":"1.0.4","description":"Lightweight chart rendering component for Cube Chart","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/types/index.d.ts","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.cjs.js","types":"./dist/types/index.d.ts"},"./react":{"import":"./react/index.js","types":"./react/index.d.ts"},"./style.css":"./dist/style.css"},"scripts":{"dev":"vite","build":"vite build","test":"vitest","lint":"eslint src","clean":"rm -rf dist node_modules","prepublishOnly":"npm run build"},"peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"dependencies":{"@visactor/vchart":"^1.11.0","eventemitter3":"^5.0.1","lodash-es":"^4.17.21"},"devDependencies":{"@types/lodash-es":"^4.17.12","@types/react":"^18.2.45","@vitejs/plugin-react":"^4.2.1","vite":"^5.0.8","vitest":"^1.0.4"},"keywords":["chart","render","visualization","vchart","cube"],"author":"","license":"MIT","repository":{"type":"git","url":"git+https://github.com/your-org/cube-chart.git","directory":"cube-chart-render"},"_id":"@albertluo213/chart-render@1.0.4","gitHead":"3fe3a7c4c68529f94955a330daebd96c71bf8335","bugs":{"url":"https://github.com/your-org/cube-chart/issues"},"homepage":"https://github.com/your-org/cube-chart#readme","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-PDi7yoDgh9EavdGTVnax8hINLsmzO+iY/A5MTUL2pm0DG2YXDD7vMVeIHYqPMi7sZVemOr7pj5obV3ZlvcE5eg==","shasum":"6217f3ac72826d9b19981762adb2b1060368d11c","tarball":"https://registry.npmjs.org/@albertluo213/chart-render/-/chart-render-1.0.4.tgz","fileCount":10,"unpackedSize":72335,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFsethL5aAdluAsZt1miRZ3sXSfoL6X6jorFf9c/jm+vAiA35KqA41Q+HJN6Z3Zdj8I1TAXh9gF/yfPIfDgXcAgkgw=="}]},"_npmUser":{"name":"albertluo213","email":"1204648923@qq.com"},"directories":{},"maintainers":[{"name":"albertluo213","email":"1204648923@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chart-render_1.0.4_1761907562576_0.8754091438741045"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-28T08:10:19.089Z","modified":"2025-10-31T10:46:03.011Z","1.0.0":"2025-10-28T08:10:19.433Z","1.0.4":"2025-10-31T10:46:02.807Z"},"bugs":{"url":"https://github.com/your-org/cube-chart/issues"},"license":"MIT","homepage":"https://github.com/your-org/cube-chart#readme","keywords":["chart","render","visualization","vchart","cube"],"repository":{"type":"git","url":"git+https://github.com/your-org/cube-chart.git","directory":"cube-chart-render"},"description":"Lightweight chart rendering component for Cube Chart","maintainers":[{"name":"albertluo213","email":"1204648923@qq.com"}],"readme":"# @cube-chart/render\r\n\r\n轻量级图表渲染组件，用于在应用中展示图表。\r\n\r\n## 特性\r\n\r\n- 📦 轻量级，无编辑器依赖\r\n- 🚀 高性能渲染，基于 VChart\r\n- 🎨 支持多种图表类型（折线图、柱状图、饼图等）\r\n- 📱 响应式设计，自适应容器大小\r\n- 🔌 易于集成，支持 Vanilla JS 和 React\r\n\r\n## 安装\r\n\r\n```bash\r\nnpm install @cube-chart/render\r\n```\r\n\r\n## 快速开始\r\n\r\n### Vanilla JavaScript\r\n\r\n```javascript\r\nimport { ChartRenderer } from '@cube-chart/render';\r\nimport '@cube-chart/render/style.css';\r\n\r\nconst renderer = new ChartRenderer({\r\n  container: '#chart-container',\r\n  config: {\r\n    type: 'line',\r\n    data: {\r\n      values: [\r\n        { x: '2024-01', y: 100 },\r\n        { x: '2024-02', y: 150 },\r\n        { x: '2024-03', y: 200 }\r\n      ]\r\n    },\r\n    xField: 'x',\r\n    yField: 'y'\r\n  }\r\n});\r\n\r\n// 渲染图表\r\nrenderer.render();\r\n\r\n// 更新数据\r\nrenderer.updateData(newData);\r\n\r\n// 销毁\r\nrenderer.destroy();\r\n```\r\n\r\n### React\r\n\r\n```jsx\r\nimport { ChartRenderer } from '@cube-chart/render/react';\r\nimport '@cube-chart/render/style.css';\r\n\r\nfunction App() {\r\n  const config = {\r\n    type: 'line',\r\n    data: {\r\n      values: [\r\n        { x: '2024-01', y: 100 },\r\n        { x: '2024-02', y: 150 }\r\n      ]\r\n    },\r\n    xField: 'x',\r\n    yField: 'y'\r\n  };\r\n\r\n  return (\r\n    <ChartRenderer \r\n      config={config}\r\n      style={{ width: '100%', height: '400px' }}\r\n    />\r\n  );\r\n}\r\n```\r\n\r\n## API 文档\r\n\r\n### ChartRenderer\r\n\r\n#### 构造函数选项\r\n\r\n```typescript\r\ninterface ChartRendererOptions {\r\n  container: string | HTMLElement;  // 容器元素或选择器\r\n  config: ChartConfig;               // 图表配置\r\n  theme?: string;                    // 主题名称\r\n  responsive?: boolean;              // 是否响应式，默认 true\r\n}\r\n```\r\n\r\n#### 方法\r\n\r\n- `render()`: 渲染图表\r\n- `updateConfig(config)`: 更新图表配置\r\n- `updateData(data)`: 更新图表数据\r\n- `resize()`: 手动触发图表大小调整\r\n- `destroy()`: 销毁图表实例\r\n\r\n#### 事件\r\n\r\n```javascript\r\nrenderer.on('rendered', () => {\r\n  console.log('图表渲染完成');\r\n});\r\n\r\nrenderer.on('dataUpdated', (data) => {\r\n  console.log('数据已更新', data);\r\n});\r\n\r\nrenderer.on('error', (error) => {\r\n  console.error('渲染错误', error);\r\n});\r\n```\r\n\r\n## 支持的图表类型\r\n\r\n- `line` - 折线图\r\n- `bar` - 柱状图\r\n- `pie` - 饼图\r\n- `area` - 面积图\r\n- `scatter` - 散点图\r\n- `gauge` - 仪表盘\r\n- `funnel` - 漏斗图\r\n- `radar` - 雷达图\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}