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

Not all bubblesets are rendered #20

Open
johannesmols opened this issue Sep 7, 2023 · 6 comments
Open

Not all bubblesets are rendered #20

johannesmols opened this issue Sep 7, 2023 · 6 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@johannesmols
Copy link

I have a graph where I want to add 4 bubble sets, but only one of them is actually rendered, with no error message whatsoever.

To Reproduce

I am adding the sets with the code below. All 4 sets have several nodes and edges. From #8 I gathered that it shouldn't be an issue if some of the sets are overlapping.

cy.ready(() => {
	const bb = new BubbleSetsPlugin(cy);
	let topLevelNamespaces = new Set<string>(cy.nodes().map(n => n.data('info')?.namespace?.split('.')[0]));
	topLevelNamespaces.forEach(ns => {
		if (ns) {
			let matchingNodes = cy.nodes().filter(n => n.data('info')?.namespace?.split('.')[0] === ns);
			bb.addPath(matchingNodes, matchingNodes.connectedEdges(), null, {
				style: {
					'stroke': 'black',
					'fill': getColor(ns),
					'fillOpacity': '0.25'
				}
			});
		}
	});

	console.log(bb.getPaths());
});

This is the graph and the single set rendered:
image

Logging the paths to the console, I can clearly see that they are added, but the path is empty for the first three, despite having both nodes and edges:
image

Expected behavior

That all 4 sets are rendered.

Context

  • Version: 3.2.0 (Cytoscape 3.23.0)
  • Browser: Firefox 117.0
@sgratzl
Copy link
Member

sgratzl commented Sep 9, 2023

can you provide an example that I can try out, without the specific graph it is almost impossible to reproduce your issue.

@johannesmols
Copy link
Author

Hi @sgratzl, sorry for taking so long to respond. I can't find an easy way to share it unfortunately, as it is part of a larger application and calling cy.data() to just get the data out returns an empty object.

But I think it might be because I'm using a custom layout, i.e. preset, to position and route my edges. I just tried to use the default layouts BFS and Cose and there it seems to work fine. Maybe the library does not support custom layouts then?

@sgratzl
Copy link
Member

sgratzl commented Sep 17, 2023

the library doesn't use the layout in any way, it just uses the final node positions.

in your screenshot from before, can you highlight which nodes and edges would be given in each path?

have you tried running bb.update(true) to force an update of all paths?

@sgratzl sgratzl self-assigned this Sep 17, 2023
@johannesmols
Copy link
Author

Hi @sgratzl, that's strange. I tried to give the nodes the same background color in the screenshot below:
Screen Shot 2023-09-21 at 16 14 38

So you can see the green one is correctly added, but the dark red and blue are not.

I did try to run bb.update(true) but it makes no difference.

In the code above, using matchingNodes.edgesWith(matchingNodes) actually doesn't render any of the bubble sets for som reason, not sure why since only edges connecting nodes in the set directly should be included.

Hope this helps somehow, I realise a reproducible example would be better, but I'm not sure how to reproduce it and I don't have much time.

@ten3roberts
Copy link

@sgratzl did you find any cause or way to mitigate this issue?

I am also experiencing this, and have managed to reduce it to specific nodes (I.e; only one bubble active, which isn't rendered)

@sgratzl
Copy link
Member

sgratzl commented May 26, 2024

@ten3roberts can you provide an example I can play with?

@sgratzl sgratzl added the help wanted Extra attention is needed label Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants