added particles to highlighted edges
This commit is contained in:
parent
3f322eef8e
commit
f734d1e57c
@ -15,7 +15,7 @@ var actionIdCounter = workflow.states ? workflow.actions.length : 0;
|
|||||||
var actors = [];
|
var actors = [];
|
||||||
workflow.actions.forEach(act => act.actionData.actors.forEach(a => {
|
workflow.actions.forEach(act => act.actionData.actors.forEach(a => {
|
||||||
var includes = false;
|
var includes = false;
|
||||||
actors.forEach(actor => includes = includes || equalRoles(a, actor)); // TODO check if contents of 'authorized' also match if applicable
|
actors.forEach(actor => includes = includes || equalRoles(a, actor));
|
||||||
(!includes) && actors.push(a);
|
(!includes) && actors.push(a);
|
||||||
(!act.actionData.actorNames) && (act.actionData.actorNames = []);
|
(!act.actionData.actorNames) && (act.actionData.actorNames = []);
|
||||||
act.actionData.actorNames.push(getActorName(a));
|
act.actionData.actorNames.push(getActorName(a));
|
||||||
@ -300,6 +300,10 @@ const Graph = ForceGraph()
|
|||||||
context.restore();
|
context.restore();
|
||||||
})
|
})
|
||||||
.linkLineDash(edge => edge.actionData.mode == 'automatic' && [2, 3]) //[dash, gap]
|
.linkLineDash(edge => edge.actionData.mode == 'automatic' && [2, 3]) //[dash, gap]
|
||||||
|
.linkWidth(edge => (edge.actionData.mode != 'automatic' && edge.actionData.actorNames.includes(selectedActor.value)) ? 3 : 1)
|
||||||
|
.linkDirectionalParticles(2)
|
||||||
|
.linkDirectionalParticleColor(() => '#00000055')
|
||||||
|
.linkDirectionalParticleWidth(edge => (edge.actionData.mode != 'automatic' && edge.actionData.actorNames.includes(selectedActor.value)) ? 3 : 0)
|
||||||
.nodeCanvasObject((node, ctx) => {
|
.nodeCanvasObject((node, ctx) => {
|
||||||
ctx.fillStyle = getColour(node);
|
ctx.fillStyle = getColour(node);
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@ -334,6 +338,7 @@ const Graph = ForceGraph()
|
|||||||
var coords = Graph.screen2GraphCoords(event.layerX, event.layerY);
|
var coords = Graph.screen2GraphCoords(event.layerX, event.layerY);
|
||||||
var newState = addState(coords.x, coords.y);
|
var newState = addState(coords.x, coords.y);
|
||||||
selection = newState;
|
selection = newState;
|
||||||
});
|
})
|
||||||
|
.autoPauseRedraw(false);
|
||||||
|
|
||||||
updateGraph();
|
updateGraph();
|
||||||
Loading…
Reference in New Issue
Block a user