Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive plots with Plotly #162

Open
javierbg opened this issue Nov 25, 2022 · 0 comments
Open

Interactive plots with Plotly #162

javierbg opened this issue Nov 25, 2022 · 0 comments

Comments

@javierbg
Copy link

Feature description

I was in the need of showing a couple of quite complex plots and thought that something like Plotly, which I have used in the past, could work.

Proposed solution

I have managed to include a Plot Viewer module to the dashboard. First, the minified Plotly code is added as a module asset. Then, when building the view, a card is added with the data and layout arguments for the plot as HTML attributes (serialized as JSON and escaped). Finally, a script deserializes this data and populates the plot.

Additional context

When I implemented this I had not seen #38. I might have gone that route if I had, but now that it's implemented I thought you might want to at least give it a look.

I initially introduced the Plotly code as a global asset, but given that it's quite large (about 3.5 MB) I moved it to a module asset to avoid loading it if it isn't needed. Even so, this is still a heavy addition to the repo as a whole, so I totally understand if you don't want to go this route. On the flip side, this avoids adding a new package as a dependency.

Plotly can be licensed under an MIT license (the notice is included at the beginning of the file), which I believe is compatible with signac's BSD license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant