Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pure-js-chart

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pure-js-chart

pure js line-chart render to png ,no canvas or any browser apis, all in javascript

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

pure-js-chart

pure js line-chart render to png ,no canvas or any browser apis, all in javascript

纯粹使用js实现的一个线形图表,可以直接输出png,不使用canvas或者其他浏览器接口,只有js

demo chat

usage

const chart = require('./chart').create({width: 500, height: 200});
let datas = [24, 57, 70, 100, 130, 120, 110, 170, 160, 110];
let pngArrayBuffer = chart.draw(datas);

//save to file
require('fs').writeFileSync('output.png', Buffer.from(png));
//or covert to dataurl
let dataURL = 'data:image/png;base64,' + Buffer.from(pngArrayBuffer).toString('base64');

thanks to

  • Xiaolin Wu's line algorithm
  • Dr. Dobb's Journal.Bresenham's algorithm
  • UPNG
  • pako

author

https://github.com/play175/pure-js-chart

Keywords

FAQs

Package last updated on 20 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc