2.0.0 • Published 4 years ago

emvio-chart-util-ui v2.0.0

Weekly downloads
-
License
-
Repository
bitbucket
Last release
4 years ago

emvio-chart-util-ui

Utility for generic D3 chart components

Install dependencies

npm install

Run development

This will run webpack watch and automatically rebuild

npm run dev

Run Example App

This will build an example app for testing the component

npm run example

Install

npm install --save git+ssh://git@bitbucket.org/emvio/emvio-chart-util-ui.git#<tag-version>

General Usage

import { EmvioLineChart, EmvioBarChart, emvioCurrencyFormatter, emvioNumberFormatter } from 'emvio-chart-util-ui';

Use this as an element in the jsx

<div style="display:block; width:400px; height:100px;">
   <EmvioBarChart
       dateRange={this.state.dateRange}
       data={barChartData}
       dataFormatter={emvioNumberFormatter}
       dataField="amount"
   />
<div/>

Data Format

see ./src/mocks for data formats

Adding a component

  1. Add the component file in src under naming convention:
src/ComponentName/ComponentName.js
  1. Add the export line to index.js
module.exports.ComponentName = require('./src/ComponentName/ComponentName').default;
  1. Run npm run dev

  2. Tick version number in package.json

  3. Tag the commit git tag <version>

  4. Push code & push tags git push origin <tag>

2.0.0

4 years ago