Wondering what’s next for npm?Check out our public roadmap! »

apicharts

0.3.4 • Public • Published

apicharts (warning: preproduction = API changing constantly, stay tuned)

Displaying charts from an API feed should be easy. Now it is.

npm version node version support Build Status via Travis CI Coverage Status NPM downloads

Why?

Because sometimes we just need to visualize our data quickly and can't be bothered to wire up the fetching/data-loading process. ApiChart handles it for you.

Example Usage 1 (local API, no data transforms needed)

<ApiChart
  type="spline"
  url="/api/snapshot/NEOBTC"
  dataPath="history"
  series={[
    { name: 'high', yPath: 'high' },
    { name: 'low', yPath: 'low' },
    { name: 'open', yPath: 'open' },
    { name: 'close', yPath: 'close' },
  ]}
  zerobased={false}
  timeseries
  autodetect
/>

Example Usage 2 (remote API, some data transforms needed)

<ApiChart
  title="ETH/BTC Spline"
  type="area"
  url="https://api.binance.com/api/v1/klines?symbol=NEOBTC&interval=1h&limit=240"
  formatter={
    (v) => ({
      date: v[0],
      close: v[4],
    })
  }
  series={[
    { name: 'close', yPath: 'close' },
  ]}
  autodetect
  timeseries
/>

Disclaimer: NOT production ready. Implementation docs/API to follow...

Install

npm i apicharts

DownloadsWeekly Downloads

1

Version

0.3.4

License

MIT

Unpacked Size

208 kB

Total Files

23

Last publish

Collaborators

  • avatar