@politico/graphics-kit

    1.0.3 • Public • Published

    @politico/graphics-kit

    npm version

    Install

    $ yarn add @politico/graphics-kit
    

    Use

    import { BaseChart, d3 } from '@politico/graphics-kit';
    
    class MyChart extends BaseChart {
      defaultProps = {
        stroke: '#ccc',
      }
    
      defaultData = [60, 40, 20]
    
      draw() {
        const data = this.data();
        const props = this.props();
        const node = this.selection().node();
    
        d3.select(node).appendSelect('svg');
        // ...
      }
    }

    Snippets

    Includes Atom snippets to shortcut building your chart.

    • Chart component demonstrates how to use the base chart component.
    • Chart container imports your chart component into a React container component, with resize and higher-level state hooks.

    Keywords

    none

    Install

    npm i @politico/graphics-kit

    DownloadsWeekly Downloads

    83

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    148 kB

    Total Files

    19

    Last publish

    Collaborators

    • mshushan-politico
    • kherbert
    • pfriedr
    • arm5077
    • wickidd
    • stilessl
    • guirreri
    • mazet
    • brizandrew
    • bzjin