We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当点击运行Transition的动画时,点击segments工具后,无法自动释放。此时节点和边都无法选中。
https://x6.antv.antgroup.com/zh/examples/edge/edge/#custom-click-event
import { Graph, Timing } from '@antv/x6'
const graph = new Graph({ container: document.getElementById('container'), grid: true, })
graph.on('edge:customevent', ({ name, e, edge }) => { if (name === 'click:circle' || name === 'click:rect') { e.stopPropagation() const t = edge.attr('c1/atConnectionRatio') > 0 ? 0 : 1 const options = { delay: 0, duration: 8000, timing: Timing.linear, } edge.transition('attrs/c1/atConnectionRatio', t, options) edge.transition('attrs/c2/atConnectionRatio', t, options) } })
graph.addEdge({ source: { x: 320, y: 60 }, target: { x: 380, y: 300 }, vertices: [{ x: 320, y: 200 }], connector: { name: 'rounded' }, tools: [ { name: 'segments', args: { stopPropagation: false } } ], markup: [ { tagName: 'path', selector: 'p1', }, { tagName: 'path', selector: 'p2', }, { tagName: 'rect', selector: 'sign', }, { tagName: 'circle', selector: 'c1', }, { tagName: 'circle', selector: 'c2', }, { tagName: 'text', selector: 'signText', }, ], attrs: { p1: { connection: true, fill: 'none', stroke: '#237804', strokeWidth: 6, strokeLinejoin: 'round', }, p2: { connection: true, fill: 'none', stroke: '#73d13d', strokeWidth: 4, pointerEvents: 'none', strokeLinejoin: 'round', targetMarker: { tagName: 'path', fill: '#73d13d', stroke: '#237804', strokeWidth: 1, d: 'M 10 -3 10 -10 -2 0 10 10 10 3', }, }, sign: { x: -20, y: -10, width: 50, height: 20, stroke: '#237804', fill: '#73d13d', atConnectionLength: 30, strokeWidth: 1, event: 'click:rect', cursor: 'pointer', }, signText: { atConnectionLength: 34, textAnchor: 'middle', textVerticalAnchor: 'middle', text: 'Token', event: 'click:rect', cursor: 'pointer', }, c1: { r: 10, stroke: '#f5222d', fill: '#fe854f', atConnectionRatio: 0.68, strokeWidth: 1, event: 'click:circle', cursor: 'pointer', }, c2: { r: 5, stroke: '#f5222d', fill: 'white', atConnectionRatio: 0.68, strokeWidth: 1, pointerEvents: 'none', }, }, })
动画运行时可操作segments工具,同vertices
"@antv/x6": "^2.11.1", "@antv/x6-plugin-clipboard": "^2.1.6", "@antv/x6-plugin-dnd": "^2.0.5", "@antv/x6-plugin-export": "^2.1.6", "@antv/x6-plugin-history": "^2.2.3", "@antv/x6-plugin-keyboard": "^2.2.1", "@antv/x6-plugin-scroller": "^2.0.9", "@antv/x6-plugin-selection": "^2.1.7", "@antv/x6-plugin-snapline": "^2.1.7", "@antv/x6-plugin-transform": "^2.1.7", "@antv/x6-vue-shape": "^2.0.11",
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题描述
当点击运行Transition的动画时,点击segments工具后,无法自动释放。此时节点和边都无法选中。
重现链接
https://x6.antv.antgroup.com/zh/examples/edge/edge/#custom-click-event
重现步骤
import { Graph, Timing } from '@antv/x6'
const graph = new Graph({
container: document.getElementById('container'),
grid: true,
})
graph.on('edge:customevent', ({ name, e, edge }) => {
if (name === 'click:circle' || name === 'click:rect') {
e.stopPropagation()
const t = edge.attr('c1/atConnectionRatio') > 0 ? 0 : 1
const options = {
delay: 0,
duration: 8000,
timing: Timing.linear,
}
edge.transition('attrs/c1/atConnectionRatio', t, options)
edge.transition('attrs/c2/atConnectionRatio', t, options)
}
})
graph.addEdge({
source: { x: 320, y: 60 },
target: { x: 380, y: 300 },
vertices: [{ x: 320, y: 200 }],
connector: { name: 'rounded' },
tools: [
{
name: 'segments',
args: {
stopPropagation: false
}
}
],
markup: [
{
tagName: 'path',
selector: 'p1',
},
{
tagName: 'path',
selector: 'p2',
},
{
tagName: 'rect',
selector: 'sign',
},
{
tagName: 'circle',
selector: 'c1',
},
{
tagName: 'circle',
selector: 'c2',
},
{
tagName: 'text',
selector: 'signText',
},
],
attrs: {
p1: {
connection: true,
fill: 'none',
stroke: '#237804',
strokeWidth: 6,
strokeLinejoin: 'round',
},
p2: {
connection: true,
fill: 'none',
stroke: '#73d13d',
strokeWidth: 4,
pointerEvents: 'none',
strokeLinejoin: 'round',
targetMarker: {
tagName: 'path',
fill: '#73d13d',
stroke: '#237804',
strokeWidth: 1,
d: 'M 10 -3 10 -10 -2 0 10 10 10 3',
},
},
sign: {
x: -20,
y: -10,
width: 50,
height: 20,
stroke: '#237804',
fill: '#73d13d',
atConnectionLength: 30,
strokeWidth: 1,
event: 'click:rect',
cursor: 'pointer',
},
signText: {
atConnectionLength: 34,
textAnchor: 'middle',
textVerticalAnchor: 'middle',
text: 'Token',
event: 'click:rect',
cursor: 'pointer',
},
c1: {
r: 10,
stroke: '#f5222d',
fill: '#fe854f',
atConnectionRatio: 0.68,
strokeWidth: 1,
event: 'click:circle',
cursor: 'pointer',
},
c2: {
r: 5,
stroke: '#f5222d',
fill: 'white',
atConnectionRatio: 0.68,
strokeWidth: 1,
pointerEvents: 'none',
},
},
})
预期行为
动画运行时可操作segments工具,同vertices
平台
屏幕截图或视频(可选)
20241114_163928.mp4
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: