fix(event): fix dom coord. Closes #305

This commit is contained in:
TomHuangCN 2018-06-13 11:15:16 +08:00
parent 0cf3c3b1ea
commit 60293af6c8
6 changed files with 7 additions and 8 deletions

View File

@ -13,8 +13,7 @@
<script src="../build/g6.js"></script>
<script src="../build/templateMaxSpanningForest.js"></script>
<script>
const Plugin = window.TemplateMaxSpanningForest;
const plugin = new Plugin();
const plugin = new G6.Plugins['template.maxSpanningForest']();
const data = {
nodes: [
{

View File

@ -16,8 +16,7 @@
<script src="../build/g6.js"></script>
<script src="../build/toolMinimap.js"></script>
<script>
const Plugin = window.ToolMinimap;
const plugin = new Plugin({
const plugin = new G6.Plugins['tool.minimap']({
container: 'minimap',
width: 180,
height: 120

View File

@ -1,6 +1,6 @@
{
"name": "@antv/g6",
"version": "2.0.1-beta.1",
"version": "2.0.1",
"description": "graph visualization frame work",
"main": "lib/index.js",
"browser": "build/g6.js",

View File

@ -292,13 +292,14 @@ class Controller extends Base {
const point = this._parsePoint(canvasPoint.x, canvasPoint.y);
const shape = canvas.getShape(canvasPoint.x, canvasPoint.y);
const item = graph.getItemByShape(shape);
const pixelRatio = canvas.get('pixelRatio');
return {
item,
shape,
x: point.x,
y: point.y,
domX: ev.offsetX,
domY: ev.offsetY,
domX: canvasPoint.x / pixelRatio,
domY: canvasPoint.y / pixelRatio,
domEvent: ev
};
}

View File

@ -1 +1 @@
module.exports = '2.0.1-beta.1';
module.exports = '2.0.1';