Response plots with D3
D3js based plotting for Angular. This module focuses on easy usage and responsiveness. It provides plots in a custom or default 4:3 aspect ratio, at a dynamic width of 100% parents width. On window resize the plots scale, and after resize (200ms) they redraw.
Installation
npm i ng-d3plot#or yarn add ng-d3plot
Usage
In your root (or whatever) module import the needed modules.
;
In the modules component templates use the tags as follows
Where the @Input()
s are of type.
data |
config |
|
---|---|---|
Histogram | Array<number> |
Config & { ticks?: number } |
Line Chart | Array<{x: number, y: number}> |
Config |
Pie Chart | Array<{label: string, value: number}> |
Config & { color?: string[] } |
Time Series | Array<{date: Date, value: number}> |
Config |
the basic Config
interface looks like
TBD
It is planned to add simple map (country: value).
Get in contact
- Check the authors website
- Get in touch via twitter or facebook