where format=None returns a dictionary containing title, defaults, and mappings
where format='cytoscapejs' returns an array suitable for CytoscapeJS' CSS
Adjust the existing create_visual_style() function to accept 'defaults' parameter in existing dictionary format or in list format returned by new get_visual_style().
Therefore, to use create_visual_style() to create an entire format, this round trip would be possible:
While it's possible to fetch all style defaults and mappings, it's hard to fetch or set them all at once.
Create a new function:
def get_visual_style(style_name, format=None, base_url=DEFAULT_BASE_URL):
where format=None returns a dictionary containing title, defaults, and mappings where format='cytoscapejs' returns an array suitable for CytoscapeJS' CSS
Adjust the existing create_visual_style() function to accept 'defaults' parameter in existing dictionary format or in list format returned by new get_visual_style().
Therefore, to use create_visual_style() to create an entire format, this round trip would be possible:
full_style = get_visual_style('myStyle') create_visual_style('newStyle', defaults=full_style['defaults'], mappings=full_style['mappings'])