Hello everybody,

I was wondering if there is some way to speed up embedding in specific cases or hope you could suggest a good alternative. Here’s the scenario I am dealing with.

(As I still have some trouble modifying graphs after their creation, see https://discourse.holoviz.org/t/change-node-color-of-a-graph/4176, I’ll provide a working example to the explanation below as soon as possible.)

Using interactive parameters I want to make ‘cosmetic’ changes to a graph, e.g. changing node size/color, highlighting nodes/edges etc. (with `pn.interact(embed = True)`

)

However, as I understand it, the embedding process assumes that for any combination of interactive parameters an entirely different graph could be displayed, so it brute forces all possible combinations. Suppose for instance you had three parameters, one that highlights a given node, one that highlights a given edge and one that specifies the node size (from a restricted set of values obviously). Then the amount of possible combinations of these three parameters would be enormous (number of nodes * number of edges * number of node sizes to choose from) though the changes are minor.

Furthermore, these changes can be applied sequentially: You have the main graph. Then you highlight one node, then one edge and lasty change the node size (any other order would work too). This is in contrast to a programm in which the combination of these three parameters are linked e.g. used in one formular that determines a parameter or the structure of a graph.

So to summerize my question: How do I speed up the embedding process for changes that can be applied seperately (and sequentially in any order) rather than being related to each other? (and where each parameter specifies one value for a small ‘cosmetic’ change)

Intuitively this should be much more efficient in the embedding process, but isn’t.

I think this is a scenario others could run into e.g. when applying ‘cosmetic’ to any other constructs like curves, heatmaps etc. I hope you can help. Thanks in advance!