Skip to content

About

Link-based sharing of `plotly` plots with a private web app

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

PlotlyShare v2 (🚀 -> 🌥)

Downloads

The purpose of this package is to provide a seamless way to share interactive plotly plots, providing a similar experience to google docs/etc.

The idea is to preserve the interactivity and responsiveness of plotly plots with the ease of link-based sharing and without all the hassle of sending an html file, or worse, a static image/document. Two examples:

Tip

If you used plotlyshare v1, go here for migration instructions

Installation

uv add "plotlyshare>=2"
pip install "plotlyshare>=2"

First Time Setup

To use this, run uv run -m plotlyshare setup/python -m plotlyshare setup and set your ==CLI Token== as follows:

Log in to https://plotlyshare.pages.dev

Note

This requires you to have a google account, as the storage (drive) is private to you. I'm working on adding a similar workflow for github as well.

Click on your profile icon, here you will see a ==CLI Token== section. Click on that to reveal it and copy the token with the copy button.

Enter that value for the CLI_TOKEN in the setup prompt, then it will test the connection and report back.

Usage

And then whenever making a plot, simply import plotlyshare (import order doesn't matter) and set renderer='plotlyshare' when calling fig.show() like below:

With plotly.express

With plotly.graph_objects

import plotly.express as px
import plotlyshare
...
fig = px.line(...)
...
fig.show(renderer='plotlyshare')
import plotly.graph_objects as go
import plotlyshare
...
fig = go.Figure(...)
...
fig.show(renderer='plotlyshare')

And that's it, the package will upload your plot to plotlyshare and assign it a randomly generated name with a date like mushy pancake 24th Jul. It will display the name and the direct link to the plot, ready to share with anyone. Additionally, it also tells you how big the plot was so you can keep track of storage (unlikely to be a problem).

Plots are private by default and you can change the privacy for each plot from the dashboard.

Misc

Change your plot's name:

To add a title to your plot (instead of the default randomly generated one), you can edit it from

  1. your online dashboard
  2. the plot's page
  3. or even set it directly when uploading:
fig.show(renderer='plotlyshare', plot_name='this plot has a fancy name')

Screenshots:

image

About

Link-based sharing of `plotly` plots with a private web app

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages