visjs / vis-network

:dizzy: Display dynamic, automatically organised, customizable network views.
https://visjs.github.io/vis-network/
Apache License 2.0
2.99k stars 365 forks source link

Shapes with labels defined inside the shape + Dataview Filter Bug #2169

Open chunisama opened 2 months ago

chunisama commented 2 months ago

Use Case: I am using the vis-network with a DataView filter function, in which I use the filter to isolate specific nodes in the vis-network chart. In certain situations, whenever we use the filter option in the configure object and filter a node cluster by a single item, the chart zooms out, which causes the chart to look very small. The user has to zoom back in on the node clusters to be able to view the chart correctly.

I tried removing my custom code layered on top of vis-network to isolate the issue, but I noticed when I changed the shape config from dot to box, the zoom out issue was gone. I then noticed whenever I used a shape with the label rendered outside its shape, the bug would return. Whenever I used a shape with a label rendered inside the shape, the bug would go away. What is going on here? Happy to give more details on my implementation if needed.

Code snippets

https://visjs.github.io/vis-network/docs/network/configure.html#