/g2-wrapper

A higher G2 wrapper for React.

Primary LanguageJavaScriptMIT LicenseMIT

g2-wrapper

NPM version npm download

A higher G2 wrapper for React.

Usage

import G2Wrapper from 'g2-wrapper';
import React, { Component } from 'react';

class MyComponent extends Component {
  state = {
    data: [],
    width: 500,
    height: 250,
    plotCfg: {},
    cfgFun: chart => {
      chart.line().position('time*price').color('name').shape('spline').size(2);
    }
  }

  render() {
    return (
      <div>
        <G2Wrapper { ...this.state } />
      </div>
    );
  }
}

License

MIT