How to use the @antv/g2/lib/core.Global function in @antv/g2

To help you get started, we’ve selected a few @antv/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 alibaba / BizCharts / src / index.jsx View on Github external
import G2, { Shape, PathUtil, Animate } from '@antv/g2/lib/core';
import Util from './shared/util';
import Themes from './themes';
import * as components from './components';


G2.Global.trackingInfo = { bizcharts: '3.2.2-beta.4' };

// G2.Global.animate = false;

const BizCharts = Util.mix(components, {
  G2,
  Util,
  Shape,
  Animate,
  PathUtil,
  track(enable = false) {
    // for srs
    G2.track(enable);
  },
  setTheme(theme) {
    let themeObj = theme;
    if (typeof theme === 'string' && Themes[theme]) {
github alibaba / BizCharts / src / index.jsx View on Github external
setTheme(theme) {
    let themeObj = theme;
    if (typeof theme === 'string' && Themes[theme]) {
      themeObj = Themes[theme];
    }

    G2.Global.setTheme(themeObj);
  },
});