{"id":13793413,"url":"https://github.com/dawiwt/react-component-echarts","last_synced_at":"2025-09-21T22:57:23.708Z","repository":{"id":34306508,"uuid":"166385314","full_name":"dawiwt/react-component-echarts","owner":"dawiwt","description":"React component echarts. 组件式百度图表。","archived":false,"fork":false,"pushed_at":"2023-02-28T08:33:49.000Z","size":4980,"stargazers_count":171,"open_issues_count":10,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-01T10:43:20.002Z","etag":null,"topics":["chart","component","echarts","javascript","jsx","react","react-component","react-component-echarts"],"latest_commit_sha":null,"homepage":"https://dawiwt.com/react-component-echarts","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dawiwt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-18T10:09:04.000Z","updated_at":"2024-10-25T07:58:02.000Z","dependencies_parsed_at":"2024-01-20T23:44:22.253Z","dependency_job_id":null,"html_url":"https://github.com/dawiwt/react-component-echarts","commit_stats":{"total_commits":92,"total_committers":2,"mean_commits":46.0,"dds":"0.17391304347826086","last_synced_commit":"b83e5525798cda81e98d2650fa5dbef632b1fc78"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dawiwt/react-component-echarts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawiwt%2Freact-component-echarts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawiwt%2Freact-component-echarts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawiwt%2Freact-component-echarts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawiwt%2Freact-component-echarts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dawiwt","download_url":"https://codeload.github.com/dawiwt/react-component-echarts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawiwt%2Freact-component-echarts/sbom","scorecard":{"id":328162,"data":{"date":"2025-08-11","repo":{"name":"github.com/dawiwt/react-component-echarts","commit":"b83e5525798cda81e98d2650fa5dbef632b1fc78"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":-1,"reason":"Found no human activity in the last 16 changesets","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"84 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-vvj3-85vf-fgmw","Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-c9g6-9335-x697","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp","Warn: Project is vulnerable to: GHSA-fhv8-fx5f-7fxf"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T02:57:54.883Z","repository_id":34306508,"created_at":"2025-08-18T02:57:54.883Z","updated_at":"2025-08-18T02:57:54.883Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276318989,"owners_count":25621651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chart","component","echarts","javascript","jsx","react","react-component","react-component-echarts"],"created_at":"2024-08-03T23:00:20.834Z","updated_at":"2025-09-21T22:57:23.690Z","avatar_url":"https://github.com/dawiwt.png","language":"JavaScript","funding_links":[],"categories":["目录"],"sub_categories":["\u003ca id=\"ui\"\u003eui\u003c/a\u003e"],"readme":"\n![Example](https://github.com/dawiwt/react-component-echarts/blob/master/example.png)\n\n# React Component Echarts\n\n组件式百度图表，示例 https://dawiwt.com/react-component-echarts\n\n[![Build Status](https://api.travis-ci.org/dawiwt/react-component-echarts.svg?branch=master)](https://travis-ci.org/dawiwt/react-component-echarts) [![npm](https://img.shields.io/npm/v/react-component-echarts.svg)](https://www.npmjs.com/package/react-component-echarts) [![npm](https://img.shields.io/npm/l/react-component-echarts.svg)](https://www.npmjs.com/package/react-component-echarts)\n\n## Feature\n\n-   组件式开发\n-   图表自适应\n-   功能完全兼容`echarts`本身功能\n-   通过`Props`配置，学习、维护成本更低\n-   支持[辅助工具](https://dawiwt.com/react-component-echarts/tools.html)从配置到组件的快速转换，高效开发\n\n![Tools](https://github.com/dawiwt/react-component-echarts/blob/master/tools.gif)\n\n## Install\n\n```sh\n#安装包\nnpm install react-component-echarts --save\n\n#自主安装echarts\nnpm install echarts --save\n```\n\n## Quick Start\n\n1. 复制你的 option\n2. 点击[辅助工具](https://dawiwt.com/react-component-echarts/tools.html)\n3. 粘贴 option 到文本框\n4. 复制依赖组件与图表代码到你的业务逻辑中\n5. 导入图表依赖 echarts 模块\n6. 完成\n\n## Usage\n\n由于全部的图表和组件 ECharts 包体积会比较大，所以`react-component-echarts`只引入`ECharts`主模块，对于依赖的图表和组件，需要自己手动引入，这样可以有效减小打包后的体积，下面是一个简单示例，更多示例看[这里](https://dawiwt.com/react-component-echarts)；\n\n```js\n\n//导入组件\nimport { Recharts, Components } from 'react-component-echarts'\n\n//导入 line 图表\nimport 'echarts/lib/component/line'\n\nconst { XAxis, YAxis, Series } = Components\n\n//图表代码\n\u003cRecharts\u003e\n    \u003cYAxis type=\"value\" /\u003e\n    \u003cXAxis type=\"category\" data={[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"]} /\u003e\n    \u003cSeries data={[820,932,901,934,1290,1330,1320]} type=\"line\" smooth={true} /\u003e\n\u003c/Recharts\u003e\n\n```\n\n可以按需引入的模块列表见[这里](https://github.com/ecomfe/echarts/blob/master/index.js)。\n\n当然，如果不关心打包体积，为方便开发，可直接在入口文件通过`import 'echarts'`或`require('echarts')`引入全部图表组件。\n\n## Components\n\n-   Recharts 图表根组件\n-   others 图表子组件，详见[列表](https://github.com/dawiwt/react-component-echarts/blob/master/tags.js)\n\n除`Recharts`外，其它组件均为`options`中的对象存在; 例如，`options.title`作为图表标题的配置项，其值为对象，可以详细配置文本内容、位置、颜色、背景等复杂的样式结构，所以`title`会以组件的形式存在，即`\u003cTitle /\u003e`; 而`options.animation`控制图表动画，其值为`boolean`等单一类型，所以`animation`以`Prop`的形式存在，即`\u003cRecharts animation={false}/\u003e`; 另外，`options`配置项中对象的层级关系即对应着组件间的父子关系;\n\n```js\n//例如\n\u003cXAxis type=\"category\" /\u003e\n\n//相当于\noption = { xAxis: { type: 'category' } }\n```\n\n节点间的父子关系相当于对象间层级关系；\n\n```js\n//例如\n\u003cTooltip trigger=\"axis\"\u003e\n    \u003cAxisPointer type=\"cross\"\u003e\n        \u003cLabel backgroundColor=\"#6a7985\" /\u003e\n    \u003c/AxisPointer\u003e\n\u003c/Tooltip\u003e\n\n//相当于\noption = {\n    tooltip: {\n        trigger: 'axis',\n        axisPointer: {\n            type: 'cross',\n            label: {\n                backgroundColor: '#6a7985'\n            }\n        }\n    }\n}\n```\n\n## Props\n\n以下属性为`Recharts`节点仅有的几个`echarts`之外的属性，其它配置均为透传，无学习成本；\n\n-   `className` (optional, string) 图表容器 `class` 名\n-   `style` (optional, object) 图表容器样式\n-   `onEvents` (optional, array) 绑定图表事件\n-   `onLoad` (optional, function(Instance)) 图表首次加载完毕会执行 `onLoad`，`Instance` 为图表实例，可供调用百度图表 `API`\n\n```js\n\u003cRecharts\n    onEvents={[['click', params =\u003e console.log('click', params)], ['legendselectchanged', params =\u003e console.log('legendselectchanged', params)]]}\u003e\n    ...\n\u003c/Recharts\u003e\n```\n\n除此以外，图表`init`事件与`setOption`事件的参数可以通过`Recharts`透传，均非必传，不传为`echarts`默认值；\n\n```js\n// init\n\u003cRecharts\n    theme=\"custom-theme\"\n    devicePixelRatio={window.devicePixelRatio}\n    renderer=\"canvas\"\n    width={500}\n    height={500}\u003e\n    ...\n\u003c/Recharts\u003e\n\n// setOption\n\u003cRecharts notMerge={true} lazyUpdate={false} silent={true}\u003e...\u003c/Recharts\u003e\n```\n\n**特别说明：** 除`width`与`height`属性，其余的`init`与`setOption`属性会导致图表重绘。\n\n更多属性查看 https://www.echartsjs.com/option.html\n\n## Correlations\n\n[戏说组件式百度图表的由来及简单逻辑](https://juejin.im/post/5ca59d00e51d4514f965c88e)\n\n喜欢请给个 Star ，谢谢！\n\n## LICENSE\n\nMIT@[dawiwt](https://github.com/dawiwt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawiwt%2Freact-component-echarts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdawiwt%2Freact-component-echarts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawiwt%2Freact-component-echarts/lists"}