项目作者: TCharts

项目描述 :
Divide an area by the percentage.
高级语言: JavaScript
项目地址: git://github.com/TCharts/area-divide.git
创建时间: 2017-06-28T06:15:55Z
项目社区:https://github.com/TCharts/area-divide

开源协议:

下载


area-divide

Divide an area by the percentage.

Build Status Coverage Status

Usage

npm i —save area-divide

  1. var areaDivide = require('area-divide');
  2. var data = [0.4, 0.3, 0.3];
  3. areaDivide(100, 50, data);
  4. // will get array like below:
  5. [{
  6. x1: 0,
  7. y1: 0,
  8. x2: 40,
  9. y2: 50,
  10. }, {
  11. x1: 40,
  12. y1: 0,
  13. x2: 100,
  14. y2: 25,
  15. }, {
  16. x1: 40,
  17. y1: 25,
  18. x2: 100,
  19. y2: 50,
  20. }]

License

ISC@ProtoTeam.