How to use the g2.Frame function in g2

To help you get started, we’ve selected a few g2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / g2-react / src / index.js View on Github external
export default function createG2(__operation) {
  class Component extends React.Component {

    static propTypes = {
      data: PropTypes.oneOfType([
        PropTypes.arrayOf(PropTypes.object),
        PropTypes.instanceOf(G2.Frame),
      ]).isRequired,
      width: PropTypes.number.isRequired,
      height: PropTypes.number.isRequired,
      plotCfg: PropTypes.object,
      forceFit: PropTypes.bool,
      configs: PropTypes.object,
    };

    constructor(props, context) {
      super(props, context);
      this.chart = null;
      this.chartId = generateUniqueId();
    }

    componentDidMount() {
      this.initChart(this.props);

g2

An implementation of the Grammar of Graphics in javascript

MIT
Latest version published 7 years ago

Package Health Score

70 / 100
Full package analysis