cytoscape / cyjShiny

An R/shiny widget for cytoscape.js
Other
92 stars 28 forks source link

Persistent graph style #14

Closed CosteaPaul closed 5 years ago

CosteaPaul commented 5 years ago

Under my use-case, the user can select which nodes they want to see (so they're not always looking at 1000 things), so the graph is redrawn quite often (with a call to cyjShiny()). This call ends up resetting the style of the graph (cyjShiny.js line 49), so it has to be set again (i'm doing it using the loadStyleFile() function). This is rather annoying.

Would be great if a style specification could be passed to the cyjShiny() or if the factory would not reset to a default style every time.

paul-shannon commented 5 years ago

@CosteaPaul Adding a style specification to the constructor is a good idea.

I propose that I add a parameter to the constructor, default NA, which is a json style filename, as seen now in loadStyleFile. Rather than, for instance, supporting an R object which jsonlite can convert to a proper json representation.

Your thoughts?

CosteaPaul commented 5 years ago

Sounds great! :) I could also do it and create a merge request...