Skip to content

Commit

Permalink
Labels on subnodes are always visible #128 #197
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaneg committed May 6, 2022
1 parent 3e05e78 commit b0aa710
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,11 @@ public void markSubNode(SerializableNode node, SerializableNode inner) {
MultiGraph innergraph = new MultiGraph(graphname);
Node n = innergraph.addNode(sub.getId());
sub.attributeKeys().forEach(k -> n.setAttribute(k, sub.getAttribute(k)));

MultiGraph wrappergraph = new MultiGraph(graphname + "_WRAPPER");
Node wrapper = wrappergraph.addNode(graphname + "_WRAPPERNODE");
wrapper.setAttribute(NODE_KIND, KIND_SUBNODE);
wrapper.setAttribute(NODE_CONTENT, innergraph);
n.setAttribute(NODE_KIND, KIND_SUBNODE);

AtomicInteger counter = subnodesCount.computeIfAbsent(nodeName(node.getId()), k -> new AtomicInteger(0));
int idx = counter.getAndIncrement();
outer.setAttribute(NODE_SUBNODE_PREFIX + idx, wrappergraph);
outer.setAttribute(NODE_SUBNODE_PREFIX + idx, innergraph);
}

/**
Expand Down
28 changes: 1 addition & 27 deletions lisa/lisa-sdk/src/main/resources/html-graph/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,38 +138,12 @@ <h3>$$$GRAPH_DESCRIPTION$$$</h3>
'border-width': '0px',
}
},
{
selector: 'node[NODE_KIND = "SUBNODE"]',
css: {
'content': '',
'border-width': '0px',
}
},
{
selector: 'node[NODE_KIND = "SUBNODE"].cy-expand-collapse-collapsed-node',
css: {
'content': '',
'border-width': '1px',
'border-style': 'solid',
'border-color': 'darkgray',
}
},
{
selector: 'node[NODE_KIND = "DESCRIPTION"]',
css: {
'content': '',
'border-width': '0px',
}
},
{
selector: 'node[NODE_KIND = "DESCRIPTION"].cy-expand-collapse-collapsed-node',
css: {
'content': '$$$GRAPH_DESCRIPTION_LABEL$$$',
'border-width': '1px',
'border-style': 'solid',
'border-color': 'darkgray',
}
},
},
{
selector: 'node[NODE_IS_ENTRY = "yes"]',
css: {
Expand Down

0 comments on commit b0aa710

Please sign in to comment.