mirror of
https://gitee.com/antv/g6.git
synced 2024-12-14 09:30:48 +08:00
fix(event): fix dom coord. Closes #305
This commit is contained in:
parent
0cf3c3b1ea
commit
60293af6c8
@ -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: [
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
|
@ -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",
|
||||||
|
@ -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
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
module.exports = '2.0.1-beta.1';
|
module.exports = '2.0.1';
|
||||||
|
Loading…
Reference in New Issue
Block a user