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/g6.js"></script>
<script src="../build/templateMaxSpanningForest.js"></script> <script src="../build/templateMaxSpanningForest.js"></script>
<script> <script>
const Plugin = window.TemplateMaxSpanningForest; const plugin = new G6.Plugins['template.maxSpanningForest']();
const plugin = new Plugin();
const data = { const data = {
nodes: [ nodes: [
{ {

View File

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

View File

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

View File

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

View File

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