Browse Source

feat: show ports when entering node and hide ports when leaving

master
smallstonesk 4 years ago
parent
commit
fea66a4da8
  1. 12
      packages/core/src/global.index.less
  2. 1
      packages/core/src/index.tsx
  3. 2
      packages/core/src/mods/flowChart/createFlowChart.ts

12
packages/core/src/global.index.less

@ -0,0 +1,12 @@
.x6-node {
.x6-port {
visibility: hidden;
}
&:hover {
.x6-port {
visibility: visible;
}
}
}

1
packages/core/src/index.tsx

@ -1,5 +1,6 @@
import React, {useState} from 'react'; import React, {useState} from 'react';
import './global.index.less';
import '@antv/x6/dist/x6.css'; import '@antv/x6/dist/x6.css';
import {Graph} from '@antv/x6'; import {Graph} from '@antv/x6';

2
packages/core/src/mods/flowChart/createFlowChart.ts

@ -20,7 +20,7 @@ const registerEvents = (flowChart: Graph): void => {
flowChart.trigger('toolBar:forceUpdate'); flowChart.trigger('toolBar:forceUpdate');
flowChart.trigger('settingBar:forceUpdate'); flowChart.trigger('settingBar:forceUpdate');
}); });
flowChart.on("edge:connected", (args) => { flowChart.on('edge:connected', (args) => {
const edge = args.edge as Edge; const edge = args.edge as Edge;
const sourceNode = edge.getSourceNode() as Node; const sourceNode = edge.getSourceNode() as Node;
if(sourceNode && sourceNode.shape === 'imove-branch') { if(sourceNode && sourceNode.shape === 'imove-branch') {

Loading…
Cancel
Save