diff --git a/examples/x6-example-features/src/pages/minimap/index.tsx b/examples/x6-example-features/src/pages/minimap/index.tsx index 8d65106023..c3f528141e 100644 --- a/examples/x6-example-features/src/pages/minimap/index.tsx +++ b/examples/x6-example-features/src/pages/minimap/index.tsx @@ -39,7 +39,6 @@ export default class Example extends React.Component { // pannable: false, // }), // ) - this.graph.addNode({ x: 200, @@ -102,20 +101,28 @@ export default class Example extends React.Component { }, }) + // this.graph.use( + // new MiniMap({ + // container: this.minimapContainer, + // width: 400, + // height: 400, + // padding: 1, + // preserveAspectRatio: false, + // graphOptions: { + // width: 400, + // height: 400, + // }, + // }), + // ) - this.graph.use( - new MiniMap({ - container: this.minimapContainer, - width: 400, - height: 400, - padding: 1, - preserveAspectRatio:false, - graphOptions:{ - width:400, - height:400 - } - }), - ) + + this.graph.on('cell:click', ({ e, x, y, cell, view }) => { + console.log('graph cell:click') + }) + + this.graph.on('node:click',()=>{ + console.log('graph node:click') + }) } diff --git a/packages/x6/src/graph/graph.ts b/packages/x6/src/graph/graph.ts index e170d43c04..1f2b45161b 100644 --- a/packages/x6/src/graph/graph.ts +++ b/packages/x6/src/graph/graph.ts @@ -827,7 +827,7 @@ export class Graph extends Basecoat { // #region coord /** - * 捕捉到栅格?(是否捕捉到栅格上的元素) + * 当前事件在栅格中的坐标 * @param x * @param y * @returns