Vega Directed Graph Breaks w/ Input Sliders

I'm trying to build a force-directed graph in Kibana (v8.3.3) using Vega.

I've got the graph built out successfully, with the caveat that sometimes it can display quite a large amount of data, thus making it overwhelming and not terribly useful. One solution that I thought would be useful would be to make the link distance/node charge/node radius signals configurable by the user using sliders (e.g., "bind": {"input": "range", "min": 5, "max": 100, "step": 1}).

This seems to work great for node charge and radius, however, when I try to add and use a slider for link distance, the visualization immediately errors out in Kibana with a message of "t is undefined". The other weird thing is that when I change the node charge or radius, the links (edges) in the graph don't get redrawn, so it ends up looking rather wonky.

My spec is pretty much identical to the official Vega directed force graph example: Vega Editor

I do a few things slightly differently, like enforcing a set color palette for the edges, but that shouldn't affect the use of the slider for the linkDistance signal. I'm quite stumped as everything should be working fine as per the Vega editor, but my graph edges aren't being redrawn correctly and anytime I try to modify the linkDistance using the slider the visualization breaks with the above error.

Here's my full spec (I'm graphing netflow data): Vega Netflow Directed Graph · GitHub

Hi @ikiril01

I can suggest to open the Inspect panel in the Kibana Vega editor, then pick Vega debug and select the Spec tab to copy the full Vega spec.
Now you can open the Vega Editor online and paste there the full spec to perform a full investigation.

From my quick inspection it seems that the link-data table gets cleared on visualization update, but I had to tweak a little bit your spec to make it work without the original dataset. Can you verify that as well on your side?

Hi @Marco_Liberati, thanks for the reply!

I found the original snippet that I built my Vega spec off of, and you're right, it looks like the link-data gets cleared away when you change the link distance: Vega Editor

Is there anything I can do to update the link-data so this doesn't happen?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.