1.3.0 • Published 6 years ago

environmental-health-viz v1.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

environmental-health-viz

A sample project to get started with publishing a library. The library will map the average annual number of cases of Breast Cancer over 2019-2013, data is from CDC's National Environmental Health Tracking Network

Dependencies

Installation

Install the npm package with either yarn add environmental-health-viz or npm install --save environmental-health-viz

If you don't use npm, first include Leaflet:

<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css"
  integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ=="
  crossorigin=""/>

 <!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"
  integrity="sha512-lInM/apFSqyy1o6s89K4iQUKg6ppXEgsVxT35HbzUupEVRh2Eu9Wdl4tHj7dZO0s1uvplcYGmt3498TtHq+log=="
  crossorigin=""></script>

Then you can add the library using for example unpkg:

<script https://unpkg.com/environmental-health-viz@1.3.0/build/environmentalHealthViz.min.js></script>

Usage

Define a container for the visualization and call the libary.

<div id="environmental-health-viz" />
<script>
  environmentalHealthViz.mapEnvHealthData();
</script>

You can change the size of the visualization by defining the height of the container:

#environmental-health-viz {
  height: 200px;
}

Example

https://codepen.io/anon/pen/gXeoab

License

MIT