covid-charts

0.1.3 • Public • Published

covid-charts

Interactive charts with the number of Coronavirus confirmed cases, deaths, and recovered cases for your country.

example

Data from pomber/covid19

install

with npm

npm i covid-charts
import createChart from "covid-charts";

const chart = createChart(document.body, {
  country: "France",
  width: 400,
  height: 300
});

with CDN via unpkg

<script src="https://unpkg.com/covid-charts/index.js"></script>
<script>
  const chart = createChart(document.body, {
    country: "France",
    width: 400,
    height: 300
  });
</script>

api

createChart params:

  • dom element: chart will be added to this place to DOM
  • options:
    • width (default: 400)
    • height (default: 300)
    • country (default: 'China')

createChart return object with next methods:

  • remove: destroy and remove chart from DOM
  • countries: return a promise with available countries
  • changeCountry: change country to the specified

acknowledgements

Thanks @pomber for the data.

Special thanks to tradingview for supa-dupa charts.

Readme

Keywords

none

Package Sidebar

Install

npm i covid-charts

Weekly Downloads

8

Version

0.1.3

License

ISC

Unpacked Size

226 kB

Total Files

5

Last publish

Collaborators

  • jeetiss