Skip to content

Output files should be single JSON directly for Plotly go.Figure objects #43

@tedinburgh

Description

@tedinburgh

There have been a few challenges with Plotly outputs/figures:

  • We need to maintain some IsaricDraw figures that are flexible enough for multiple contexts.
  • It is difficult to know whether to create a new IsaricDraw figure or extend an existing one.
  • This has previously led to multiple IsaricDraw figures called "fig_bar_chart" or similar (it took some work to harmonise these), and this is really confusing when trying to find the correct one to use.
  • The outputs (either as the final function output of IsaricAnalytics or as the outputs files themselves) need to be dataframes in specific structures, and it can be difficult to understand why or to directly modify these files as needed (e.g. for formatting).

I am proposing a solution to this where the saved outputs are JSON objects with keys "data" and "layout", which are directly piped to an Plotly go.Figure object. This will mean several things:

  • The VERTEX dashboard can display custom figure types without these being added to IsaricDraw (IsaricDraw can still contain templates for useful figures, but not everything has to be added to this). The user can adapt existing IsaricDraw figures (e.g. subplots, additional lines, legends) or create new figure types directly, within the insight panels.
  • All figures must be instances of Plotly.graph_objects.Figure class (not Plotly.express).
  • Currently IsaricDraw figure inputs are saved to file (if the config file specifies this). Instead, I suggest that there is a FigureRegistry class (defined somewhere in vertex/) that takes a list of Plotly.graph_objects.Figure instances and has an attribute "save_to_file", and an instance of this class is created within and returned by "create_visuals" in an insight panel.
  • IsaricDraw is a key step in reusable analytical pipelines (RAPs) but the VERTEX dashboard does not need to use this module.

This is a suggestion, I imagine it would involve quite extensive refactoring but I think it would be an very valuable step forward for how transparent VERTEX is for users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions