How to use the @antv/g6.Components function in @antv/g6

To help you get started, we’ve selected a few @antv/g6 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 ChrisShen93 / VGEditor / es / components / Minimap / index.js View on Github external
_this.$nextTick(function () {
          var _document$getElementB = document.getElementById(container),
              clientWidth = _document$getElementB.clientWidth,
              clientHeight = _document$getElementB.clientHeight;

          _this.minimap = new G6.Components.Minimap({
            container: container,
            width: width || clientWidth,
            height: height || clientHeight,
            viewportWindowStyle: viewportWindowStyle,
            viewportBackStyle: viewportBackStyle
          });

          var currentPage = _this.getCurrentPage();

          _this.minimap.getGraph = function () {
            return currentPage.getGraph();
          };

          resolve();
        });
      });
github antvis / G6 / plugins / tool.minimap / index.js View on Github external
const minimap = new Minimap({
      getGraph() {
        return graph;
      },
      ...this.options
    });
    minimap.bindGraph(graph);
    this.minimap = minimap;
  }
  destroy() {
    this.minimap.destroy();
  }
}
G6.Plugins['tool.minimap'] = Plugin;

G6.Components.Minimap = Minimap;

module.exports = Plugin;
github alibaba / GGEditor / src / components / Minimap / index.js View on Github external
import React from 'react';
import G6 from '@antv/g6';
import { pick } from '@utils';
import { MINIMAP_CONTAINER } from '@common/constants';
import withGGEditorContext from '@common/context/GGEditorContext/withGGEditorContext';

require('@antv/g6/build/plugin.tool.minimap');

const { Minimap: G6Minimap } = G6.Components;

class Minimap extends React.Component {
  minimap = null;

  get containerId() {
    const { editor } = this.props;

    return `${MINIMAP_CONTAINER}_${editor.id}`;
  }

  get currentPage() {
    const { editor } = this.props;

    return editor.getCurrentPage();
  }