Gathering detailed insights and metrics for echarts-for-react-gsop
Gathering detailed insights and metrics for echarts-for-react-gsop
Gathering detailed insights and metrics for echarts-for-react-gsop
Gathering detailed insights and metrics for echarts-for-react-gsop
npm install echarts-for-react-gsop
Typescript
Module System
Node Version
NPM Version
52.9
Supply Chain
95.3
Quality
74.7
Maintenance
50
Vulnerability
99.6
License
TypeScript (92.58%)
JavaScript (7.42%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
562
Last Day
1
Last Week
4
Last Month
14
Last Year
89
MIT License
4,621 Stars
22 Commits
638 Forks
64 Watchers
5 Branches
15 Contributors
Updated on Feb 14, 2025
Minified
Minified + Gzipped
Latest Version
2.0.15
Package Id
echarts-for-react-gsop@2.0.15
Unpacked Size
37.04 kB
Size
8.88 kB
File Count
11
NPM Version
6.10.1
Node Version
10.16.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-20%
4
Compared to previous week
Last Month
100%
14
Compared to previous month
Last Year
-31.5%
89
Compared to previous year
2
3
44
A very simple echarts(v3.0 & v4.0) wrapper for react.
1npm install --save echarts-for-react 2 3# `echarts` is the peerDependence of `echarts-for-react`, you can install echarts with your own version. 4npm install --save echarts
Then use it.
1import ReactEcharts from 'echarts-for-react'; 2 3// render echarts option. 4<ReactEcharts option={this.getOption()} />
You can run demo by:
1git clone git@github.com:hustcc/echarts-for-react.git 2 3npm install 4 5npm start
then open http://127.0.0.1:8080/ in your browser. or see http://git.hust.cc/echarts-for-react/
Code of a simple demo code showed below. For more example can see: http://git.hust.cc/echarts-for-react/
1import React from 'react'; 2import ReactEcharts from 'echarts-for-react'; // or var ReactEcharts = require('echarts-for-react'); 3 4<ReactEcharts 5 option={this.getOption()} 6 notMerge={true} 7 lazyUpdate={true} 8 theme={"theme_name"} 9 onChartReady={this.onChartReadyCallback} 10 onEvents={EventsDict} 11 opts={} />
1import * as React from "react"; 2import ReactEcharts from "echarts-for-react"; 3 4<ReactEcharts 5 option={this.getOption()} 6 notMerge={true} 7 lazyUpdate={true} 8 theme={"theme_name"} 9 onChartReady={this.onChartReadyCallback} 10 onEvents={EventsDict} 11 opts={} />
Import ECharts.js modules manually to reduce bundle size
1import React from 'react'; 2// import the core library. 3import ReactEchartsCore from 'echarts-for-react/lib/core'; 4 5// then import echarts modules those you have used manually. 6import echarts from 'echarts/lib/echarts'; 7// import 'echarts/lib/chart/line'; 8import 'echarts/lib/chart/bar'; 9// import 'echarts/lib/chart/pie'; 10// import 'echarts/lib/chart/scatter'; 11// import 'echarts/lib/chart/radar'; 12 13// import 'echarts/lib/chart/map'; 14// import 'echarts/lib/chart/treemap'; 15// import 'echarts/lib/chart/graph'; 16// import 'echarts/lib/chart/gauge'; 17// import 'echarts/lib/chart/funnel'; 18// import 'echarts/lib/chart/parallel'; 19// import 'echarts/lib/chart/sankey'; 20// import 'echarts/lib/chart/boxplot'; 21// import 'echarts/lib/chart/candlestick'; 22// import 'echarts/lib/chart/effectScatter'; 23// import 'echarts/lib/chart/lines'; 24// import 'echarts/lib/chart/heatmap'; 25 26// import 'echarts/lib/component/graphic'; 27// import 'echarts/lib/component/grid'; 28// import 'echarts/lib/component/legend'; 29import 'echarts/lib/component/tooltip'; 30// import 'echarts/lib/component/polar'; 31// import 'echarts/lib/component/geo'; 32// import 'echarts/lib/component/parallel'; 33// import 'echarts/lib/component/singleAxis'; 34// import 'echarts/lib/component/brush'; 35 36import 'echarts/lib/component/title'; 37 38// import 'echarts/lib/component/dataZoom'; 39// import 'echarts/lib/component/visualMap'; 40 41// import 'echarts/lib/component/markPoint'; 42// import 'echarts/lib/component/markLine'; 43// import 'echarts/lib/component/markArea'; 44 45// import 'echarts/lib/component/timeline'; 46// import 'echarts/lib/component/toolbox'; 47 48// import 'zrender/lib/vml/vml'; 49 50// The usage of ReactEchartsCore are same with above. 51<ReactEchartsCore 52 echarts={echarts} 53 option={this.getOption()} 54 notMerge={true} 55 lazyUpdate={true} 56 theme={"theme_name"} 57 onChartReady={this.onChartReadyCallback} 58 onEvents={EventsDict} 59 opts={} />
option
(required, object)the echarts option config, can see http://echarts.baidu.com/option.html#title.
notMerge
(optional, object)when setOption
, not merge the data, default is false
. See http://echarts.baidu.com/api.html#echartsInstance.setOption.
lazyUpdate
(optional, object)when setOption
, lazy update the data, default is false
. See http://echarts.baidu.com/api.html#echartsInstance.setOption.
style
(optional, object)the style
of echarts div. object
, default is {height: '300px'}.
className
(optional, string)the class
of echarts div. you can setting the css style of charts by class name.
theme
(optional, string)the theme
of echarts. string
, should registerTheme
before use it (theme object format: https://github.com/ecomfe/echarts/blob/master/theme/dark.js). e.g.
1// import echarts 2import echarts from 'echarts'; 3... 4// register theme object 5echarts.registerTheme('my_theme', { 6 backgroundColor: '#f4cccc' 7}); 8... 9// render the echarts use option `theme` 10<ReactEcharts 11 option={this.getOption()} 12 style={{height: '300px', width: '100%'}} 13 className='echarts-for-echarts' 14 theme='my_theme' />
onChartReady
(optional, function)when the chart is ready, will callback the function with the echarts object
as it's paramter.
loadingOption
(optional, object)the echarts loading option config, can see http://echarts.baidu.com/api.html#echartsInstance.showLoading.
showLoading
(optional, bool, default: false)bool
, when the chart is rendering, show the loading mask.
onEvents
(optional, array(string=>function) )binding the echarts event, will callback with the echarts event object
, and the echart object
as it's paramters. e.g:
1let onEvents = { 2 'click': this.onChartClick, 3 'legendselectchanged': this.onChartLegendselectchanged 4} 5... 6<ReactEcharts 7 option={this.getOption()} 8 style={{height: '300px', width: '100%'}} 9 onEvents={onEvents} />
for more event key name, see: http://echarts.baidu.com/api.html#events
opts
(optional, object)the opts
of echarts. object
, will be used when initial echarts instance by echarts.init
. Document here.
1<ReactEcharts 2 option={this.getOption()} 3 style={{height: '300px'}} 4 opts={{renderer: 'svg'}} // use svg to render the chart. 5/>
the Component only has one API
named getEchartsInstance
.
getEchartsInstance()
: get the echarts instance object, then you can use any API of echarts
.for example:
1// render the echarts component below with rel 2<ReactEcharts ref={(e) => { this.echarts_react = e; }} 3 option={this.getOption()} /> 4 5// then get the `ReactEcharts` use this.echarts_react 6 7let echarts_instance = this.echarts_react.getEchartsInstance(); 8// then you can use any API of echarts. 9let base64 = echarts_instance.getDataURL();
About API of echarts, can see http://echarts.baidu.com/api.html#echartsInstance.
You can use the API to do:
binding / unbinding
event.dynamic charts
with dynamic data.release
the charts.Use the props opts
of component with renderer = 'svg'
. For example:
1<ReactEcharts 2 option={this.getOption()} 3 style={{height: '300px'}} 4 opts={{renderer: 'svg'}} // use svg to render the chart. 5/>
MIT@hustcc.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 13/22 approved changesets -- score normalized to 5
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More