Skip to main content

A small package to remove the branding from plotly plots

Project description

# Plotly Unbrand

Dear Plotly-Team,

I love you and your library, but sometimes, I do not openly want to show my love.
Sometimes, when working with a customer or when embedding a plot into a talk, I don't want to have multiple links to your online platform directly next to my data.
Luckily, you seem to be very understanding about this and made it possible for me to remove all traces of your brand (besides the trademark beautiful esthetics, of course) from my plots.
I can just pass this into the config of each plotting call:

```python
from plotly.plotly import plot

UNBRAND_CONFIG = dict(modeBarButtonsToRemove=['sendDataToCloud'], displaylogo=False, showLink=False)
plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])], config=UNBRAND_CONFIG)
```

But sometimes even this is not good enough... I want to be able to do this automatically for all plots in a project (I am so sorry Plotly-Team!).
Therefore, I created this little package.
Now I can do this:

```python
from plotly_unbrand import unbrand
unbrand()

from plotly.plotly import plot

plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])])
plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])])
plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])])
```
... and all my Plots have your logo and links to the cloud platform removed.

## Installation

```
pip install plotly_unbrand
```

### Dependencies

You need to have plotly installed of course...

## Usage

Simple! Import `unbrand` and ran it **before** the first plotly import:
```python
from plotly_unbrand import unbrand
unbrand()

from plotly.plotly import plot

plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])])
plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])])
plot([Scatter(x=[1, 2, 3], y=[3, 1, 6])])
```

This will work with `plot` and `iplot` in their online and offline variant.
It should also work with `cufflings`, though I haven't tested it.

### Wait there is more!

You can use the tools from this package to inject any global configuration you like!

```python
from plotly_unbrand import decorate_all_plot_functions

decorate_all_plot_functions(my_custom_config)

from plotly.plotly import plot
...
```

## But I don't want a separate package just for this?!

Don't worry! The logic is pretty simple and self-explanatory.
You can just copy the decorator from the `__init__.py` and run the decoration logic manually.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotly_unbrand-1.0.1.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file plotly_unbrand-1.0.1.tar.gz.

File metadata

File hashes

Hashes for plotly_unbrand-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3b7b3acaa761ab401e13c55aa92c1bba70baf61416684779e65160f48bee6c00
MD5 16dfe064c0164460db98a8056f42caf0
BLAKE2b-256 18eef767a9a137fc6fcc8a77af2bbe19c91545d41b0a1b9f564a5d89e8ce0f63

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page