Skip to content
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

Closed
wants to merge 45 commits into from
Closed

Interactive SCCharts #41

wants to merge 45 commits into from

Conversation

soerendomroes
Copy link
Member

No description provided.

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
let curPos = getPositionInLayer(layerNodes, target)
let curPos = getPositionInLayer(layerNodes, target, direction)

// determine reative constraint
Copy link
Contributor

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
Copy link
Member Author

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?

Copy link
Contributor

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

Copy link
Member Author

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.

Comment on lines +125 to +142
// 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
}
Copy link
Member Author

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.

Copy link
Contributor

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
Copy link
Contributor

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

Comment on lines +125 to +142
// 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
}
Copy link
Contributor

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?

@soerendomroes
Copy link
Member Author

This has been superseded by kieler/klighd-vscode#125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants