Gathering detailed insights and metrics for @antv/g2-brush
Gathering detailed insights and metrics for @antv/g2-brush
npm install @antv/g2-brush
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
1,647,226
Last Day
575
Last Week
3,256
Last Month
12,804
Last Year
145,691
MIT License
24 Stars
19 Commits
7 Forks
36 Watchers
2 Branches
48 Contributors
Updated on Jan 28, 2023
Minified
Minified + Gzipped
Latest Version
0.0.2
Package Id
@antv/g2-brush@0.0.2
Size
2.07 MB
NPM Version
5.5.1
Node Version
8.2.1
Cumulative downloads
Total Downloads
Last Day
0.7%
575
Compared to previous day
Last Week
5.7%
3,256
Compared to previous week
Last Month
79.4%
12,804
Compared to previous month
Last Year
-24%
145,691
Compared to previous year
28
1$ npm install @antv/g2-brush
or use cdn:
1<script src="https://gw.alipayobjects.com/os/antv/assets/g2-brush/0.0.1/g2-brush.js"></script>
First of all, the brush instance must be created after the chart be rendered.
1import Brush from '@antv/g2-brush'; 2// ... 3chart.render(); 4 5new Brush({ 6 canvas: chart.get('canvas'), // must be set 7 chart, // if you want to filter data by default, please set the chart 8 type: 'X', // set the brush type, default value is 'XY' 9});
online demos: https://antvis.github.io/g2-brush/demos/#
1$.getJSON('./data/top2000.json', data => { 2 const ds = new DataSet(); 3 const dv = ds.createView('test') 4 .source(data) 5 .transform({ 6 as: [ 'count' ], 7 groupBy: [ 'release' ], 8 operations: [ 'count' ], 9 type: 'aggregate' 10 }); 11 12 const chart = new G2.Chart({ 13 container: 'canvas', 14 forceFit: true, 15 height: window.innerHeight 16 }); 17 chart.source(dv); 18 chart.scale({ 19 count: { 20 alias: 'top2000 唱片总量' 21 }, 22 release: { 23 tickInterval: 5, 24 alias: '唱片发行年份' 25 } 26 }); 27 chart.interval() 28 .position('release*count') 29 .color('#e50000'); 30 31 chart.render(); 32 33 new Brush({ 34 canvas: chart.get('canvas'), 35 chart, 36 type: 'X', 37 onBrushstart() { 38 chart.hideTooltip(); 39 }, 40 onBrushmove() { 41 chart.hideTooltip(); 42 } 43 }); 44 chart.on('plotdblclick', () => { 45 chart.get('options').filters = {}; 46 chart.repaint(); 47 }); 48});
1$ npm install 2 3$ npm run dev
Please let us know how can we help. Do check out issues for bug reports or suggestions first.
To become a contributor, please follow our contributing guide.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/18 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-03-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