-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
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
Interactive SCCharts #41
Conversation
actual rendering for rel cons is not done yet
moved node and the node the relative constraint would refer to are highlighted red
arrow indicates whether the node will be successor or predecessor of another node
shadow attribute of the moved node must be set while rendering the visualization
adjacent nodes can not have rel cons. THe position markers are therefore not filled when the target of the rel cons is an adjacent node
let curPos = getPositionInLayer(layerNodes, target) | ||
let curPos = getPositionInLayer(layerNodes, target, direction) | ||
|
||
// determine reative constraint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"relative"
@@ -43,26 +44,27 @@ export function renderHierarchyLevel(nodes: KNode[], root: KNode): VNode { | |||
// determines whether only the layer constraint will be set when the node is released | |||
let onlyLC = shouldOnlyLCBeSet(selNode, layers, direction) && selNode.properties.layerId !== currentLayer | |||
|
|||
let curLayer = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Drakae Why do you need curLayer. Why is currentLayer not enough? Since it is null per default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont know, it seems unnecessary to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you need this since the currentLayer might be -1 or one higher than the existing layer and you want to return null instead in these cases.
// cons is undefined if target is an adjacent node. If this is the case, the circle should not be filled | ||
let fill = cons !== undefined ? cons.relCons !== RelCons.UNDEFINED && curPos === i + shift : curPos === i + shift | ||
let node = layerNodes[i] | ||
// at the old position of the selected node should not be a circle | ||
if (!node.selected && !layerNodes[i + 1].selected) { | ||
// coordinates for both inspected nodes | ||
let nodeY = node.position.y | ||
let nodeX = node.position.x | ||
let nextNodeY = layerNodes[i + 1].position.y | ||
let nextNodeX = layerNodes[i + 1].position.x | ||
if (node.selected) { | ||
nodeY = node.shadowY | ||
nodeX = node.shadowX | ||
shift = 0 | ||
fill = cons !== undefined && cons.node.id === layerNodes[i + 1].id && cons.relCons === RelCons.IN_LAYER_PRED_OF | ||
} else if (layerNodes[i + 1].selected) { | ||
nextNodeY = layerNodes[i + 1].shadowY | ||
nextNodeX = layerNodes[i + 1].shadowX | ||
fill = cons !== undefined && cons.node.id === node.id && cons.relCons === RelCons.IN_LAYER_SUCC_OF | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Drakae why is fill even calculated at first? Is will always be overridden by the conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure that always one of the conditions is true?
@@ -43,26 +44,27 @@ export function renderHierarchyLevel(nodes: KNode[], root: KNode): VNode { | |||
// determines whether only the layer constraint will be set when the node is released | |||
let onlyLC = shouldOnlyLCBeSet(selNode, layers, direction) && selNode.properties.layerId !== currentLayer | |||
|
|||
let curLayer = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont know, it seems unnecessary to me
// cons is undefined if target is an adjacent node. If this is the case, the circle should not be filled | ||
let fill = cons !== undefined ? cons.relCons !== RelCons.UNDEFINED && curPos === i + shift : curPos === i + shift | ||
let node = layerNodes[i] | ||
// at the old position of the selected node should not be a circle | ||
if (!node.selected && !layerNodes[i + 1].selected) { | ||
// coordinates for both inspected nodes | ||
let nodeY = node.position.y | ||
let nodeX = node.position.x | ||
let nextNodeY = layerNodes[i + 1].position.y | ||
let nextNodeX = layerNodes[i + 1].position.x | ||
if (node.selected) { | ||
nodeY = node.shadowY | ||
nodeX = node.shadowX | ||
shift = 0 | ||
fill = cons !== undefined && cons.node.id === layerNodes[i + 1].id && cons.relCons === RelCons.IN_LAYER_PRED_OF | ||
} else if (layerNodes[i + 1].selected) { | ||
nextNodeY = layerNodes[i + 1].shadowY | ||
nextNodeX = layerNodes[i + 1].shadowX | ||
fill = cons !== undefined && cons.node.id === node.id && cons.relCons === RelCons.IN_LAYER_SUCC_OF | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure that always one of the conditions is true?
This has been superseded by kieler/klighd-vscode#125 |
No description provided.