{"_id":"@albertluo213/chart-editor","_rev":"6-743027b15d1fd418409e5acb456f05a1","name":"@albertluo213/chart-editor","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.1":{"name":"@albertluo213/chart-editor","version":"1.0.1","keywords":["chart","editor","designer","visualization","cube"],"author":"","license":"MIT","_id":"@albertluo213/chart-editor@1.0.1","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":"bae549a24c111bba3f3cfe586395c6d4c831f993","tarball":"https://registry.npmjs.org/@albertluo213/chart-editor/-/chart-editor-1.0.1.tgz","fileCount":10,"integrity":"sha512-E1yW80Tx4xQnxCop8AYcNdD2ezYX83nqUFnZ0ojzAOUcAXyIyJzqYVdKVQMviHX/qHH6TSRk2qITdyJ7NK6nJg==","signatures":[{"sig":"MEUCIQCpRdYQYDialn+dMLOGqvS1khveovEFb+EsCjQSMDnCSgIgcb4+dXTX2flM9H0btekyEqZDHOoqP7NSQbIG2dHQAd0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71462},"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-editor"},"_npmVersion":"10.9.3","description":"Professional chart editor component for Cube Chart","directories":{},"_nodeVersion":"22.20.0","dependencies":{"lodash-es":"^4.17.21","eventemitter3":"^5.0.1","@albertluo213/chart-render":"^1.0.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":{"antd":">=5.0.0","react":">=16.8.0","react-dom":">=16.8.0"},"peerDependenciesMeta":{"antd":{"optional":true},"react":{"optional":true},"react-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/chart-editor_1.0.1_1761639930017_0.5448037836321293","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@albertluo213/chart-editor","version":"1.0.2","keywords":["chart","editor","designer","visualization","cube"],"author":"","license":"MIT","_id":"@albertluo213/chart-editor@1.0.2","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":"2c903b8fe14cc464eea2bba83ec2ea1cda81f224","tarball":"https://registry.npmjs.org/@albertluo213/chart-editor/-/chart-editor-1.0.2.tgz","fileCount":10,"integrity":"sha512-ABYyQN/bmD829K9D0f48h+Fi7bpRa6HtdQxFCffUZLJ3veOtmD9E4bgsTf2NrH0jsO4QNnK9ikEvkhNoJWQUUA==","signatures":[{"sig":"MEYCIQCA8bA2YGY8FyeGCx4E+rgeq3uu8S/FQsE+1PJEY+7D+wIhAKPKHJhNXssrC7kkiOCb9qxZ3jj0hEKOFH+vDtNljMpN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71402},"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-editor"},"_npmVersion":"10.9.3","description":"Professional chart editor component for Cube Chart","directories":{},"_nodeVersion":"22.20.0","dependencies":{"lodash-es":"^4.17.21","eventemitter3":"^5.0.1","@albertluo213/chart-render":"^1.0.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":{"antd":">=5.0.0","react":">=16.8.0","react-dom":">=16.8.0"},"peerDependenciesMeta":{"antd":{"optional":true},"react":{"optional":true},"react-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/chart-editor_1.0.2_1761640278171_0.3172662675933957","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@albertluo213/chart-editor","version":"1.0.4","description":"Professional chart editor 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","antd":">=5.0.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true},"antd":{"optional":true}},"dependencies":{"@albertluo213/chart-render":"^1.0.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","editor","designer","visualization","cube"],"author":"","license":"MIT","repository":{"type":"git","url":"git+https://github.com/your-org/cube-chart.git","directory":"cube-chart-editor"},"_id":"@albertluo213/chart-editor@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-rcQvXIoxzHhomNT/6T48/ssQxgUSrf+vrth7IEqOYdRTsAp+VzezZA2g5rnVuQEZFWaEcOLbdiU33x70DBo/jA==","shasum":"0eb0d38c1a5e4ff2fa6982860fb84370f232a2f0","tarball":"https://registry.npmjs.org/@albertluo213/chart-editor/-/chart-editor-1.0.4.tgz","fileCount":10,"unpackedSize":71402,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCZ2W1DxNhb4OeDTVd6d59llT1hqJtnZstCx9T+iHpFTwIgHVlh+y5M5/ntHGEBIzmUxHSt2f2L9RPpWPRr01RssZ4="}]},"_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-editor_1.0.4_1761907523082_0.17668076785748954"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-28T08:25:29.877Z","modified":"2025-10-31T10:45:23.495Z","1.0.0":"2025-10-28T08:10:42.284Z","1.0.1":"2025-10-28T08:25:30.202Z","1.0.2":"2025-10-28T08:31:18.344Z","1.0.4":"2025-10-31T10:45:23.291Z"},"bugs":{"url":"https://github.com/your-org/cube-chart/issues"},"license":"MIT","homepage":"https://github.com/your-org/cube-chart#readme","keywords":["chart","editor","designer","visualization","cube"],"repository":{"type":"git","url":"git+https://github.com/your-org/cube-chart.git","directory":"cube-chart-editor"},"description":"Professional chart editor component for Cube Chart","maintainers":[{"name":"albertluo213","email":"1204648923@qq.com"}],"readme":"# @cube-chart/editor\r\n\r\n完整的图表编辑器组件，提供可视化图表配置能力。\r\n\r\n## 特性\r\n\r\n- ✏️ 可视化编辑界面\r\n- 🔧 丰富的配置选项（数据源、样式、交互等）\r\n- 💾 配置导入导出\r\n- 🔌 易于集成，支持 Vanilla JS 和 React\r\n- 📊 实时预览\r\n- 🎨 主题定制\r\n\r\n## 安装\r\n\r\n```bash\r\nnpm install @cube-chart/editor\r\n```\r\n\r\n## 快速开始\r\n\r\n### Vanilla JavaScript\r\n\r\n```javascript\r\nimport { ChartEditor } from '@cube-chart/editor';\r\nimport '@cube-chart/editor/style.css';\r\n\r\nconst editor = new ChartEditor({\r\n  container: '#editor-container',\r\n  mode: 'full', // 'full' | 'simple'\r\n  config: {\r\n    type: 'line',\r\n    data: {\r\n      values: []\r\n    }\r\n  },\r\n  apiConfig: {\r\n    baseURL: 'https://api.example.com',\r\n    endpoints: {\r\n      dataSources: '/api/datasources',\r\n      save: '/api/charts'\r\n    }\r\n  }\r\n});\r\n\r\n// 监听配置变化\r\neditor.on('configChanged', (config) => {\r\n  console.log('配置已更新', config);\r\n});\r\n\r\n// 保存配置\r\neditor.on('save', async (config) => {\r\n  await saveChart(config);\r\n});\r\n\r\n// 获取当前配置\r\nconst config = editor.getConfig();\r\n\r\n// 销毁\r\neditor.destroy();\r\n```\r\n\r\n### React\r\n\r\n```jsx\r\nimport { ChartEditor } from '@cube-chart/editor/react';\r\nimport '@cube-chart/editor/style.css';\r\n\r\nfunction App() {\r\n  const handleConfigChange = (config) => {\r\n    console.log('配置变化', config);\r\n  };\r\n\r\n  const handleSave = async (config) => {\r\n    await saveChart(config);\r\n  };\r\n\r\n  return (\r\n    <ChartEditor\r\n      mode=\"full\"\r\n      config={{\r\n        type: 'line',\r\n        data: { values: [] }\r\n      }}\r\n      apiConfig={{\r\n        baseURL: 'https://api.example.com'\r\n      }}\r\n      onConfigChange={handleConfigChange}\r\n      onSave={handleSave}\r\n    />\r\n  );\r\n}\r\n```\r\n\r\n## API 文档\r\n\r\n### ChartEditor\r\n\r\n#### 构造函数选项\r\n\r\n```typescript\r\ninterface ChartEditorOptions {\r\n  container: string | HTMLElement;  // 容器元素或选择器\r\n  mode?: 'full' | 'simple';         // 编辑器模式\r\n  config?: ChartConfig;              // 初始图表配置\r\n  apiConfig?: APIConfig;             // API 配置\r\n  theme?: string;                    // 主题\r\n  locale?: string;                   // 语言\r\n}\r\n```\r\n\r\n#### 方法\r\n\r\n- `getConfig()`: 获取当前配置\r\n- `setConfig(config)`: 设置配置\r\n- `validate()`: 验证配置\r\n- `reset()`: 重置配置\r\n- `destroy()`: 销毁编辑器\r\n\r\n#### 事件\r\n\r\n```javascript\r\neditor.on('configChanged', (config) => {});\r\neditor.on('save', (config) => {});\r\neditor.on('cancel', () => {});\r\neditor.on('error', (error) => {});\r\n```\r\n\r\n## 编辑器模式\r\n\r\n### Full Mode (完整模式)\r\n\r\n提供完整的编辑功能：\r\n- 数据源配置\r\n- 图表类型选择\r\n- 样式定制\r\n- 交互配置\r\n- 高级选项\r\n\r\n### Simple Mode (简单模式)\r\n\r\n提供简化的编辑界面：\r\n- 基础图表类型\r\n- 简单数据配置\r\n- 预设样式\r\n\r\n## 配置示例\r\n\r\n```javascript\r\nconst config = {\r\n  type: 'line',\r\n  data: {\r\n    values: [\r\n      { date: '2024-01', sales: 100 },\r\n      { date: '2024-02', sales: 150 }\r\n    ]\r\n  },\r\n  xField: 'date',\r\n  yField: 'sales',\r\n  title: '销售趋势',\r\n  theme: 'light',\r\n  legend: {\r\n    visible: true,\r\n    position: 'right'\r\n  },\r\n  tooltip: {\r\n    visible: true\r\n  }\r\n};\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}