Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_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();
});
});
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;
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();
}