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

Introducing Templates/Themes #425

Closed
tarzzz opened this issue Mar 21, 2016 · 5 comments
Closed

Introducing Templates/Themes #425

tarzzz opened this issue Mar 21, 2016 · 5 comments

Comments

@tarzzz
Copy link
Contributor

tarzzz commented Mar 21, 2016

Going through the discussion in this thread: #217

We can add template functionality to the API Libraries. Some pointers:

  • py.plot(fig, template='ggplot'). Template can be a keyword ( 'ggplot', 'seaborn' etc.) or a Figure instance. This way a user can copy the theme from an existing chart the user has access to (which many people have been asking about, in support queries).
  • Copying the template from an existing Plotly chart will only work in online mode (inbuilt template can be used offline as well).
  • saving user's custom templates as JSON in .plotly/user_templates directory, and built-in templates in .plotly/plotly_templates directory.
  • Adding new built-in templates will require a valid template.json and a reference in a templates.py file.
  • A Template Parser, which will load template files, and convert them to Figure or Layout objects (basically deserialize them).
  • A deep update method, which can work on Plotly's Graph Objects (as a utility method).

@cldougl @jackparmer @theengineear : please provide comments/suggestions ..

@theengineear
Copy link
Contributor

@tarzzz here's some docs on how themes are stored in Plotly. Note that the themes need an update to follow our PlotSchema.

We settled on having theme objects mimic the format of an actual plot. This allows us to treat it as if it were a plot. The downside of this is that applying a theme to a plot with 1000 traces would need 1000 objects.

It'd be cool if the format of themes created Python matched what we're trying to store in the backend. That way they could be sharable.

Also, unless there's a good reason to break from calling things themes, we should probably stick with that word over template.

@1beb
Copy link

1beb commented Jan 28, 2017

Please note, both links above are dead.

@galpin
Copy link

galpin commented Feb 28, 2017

Has there been any progress on this?

@jackparmer
Copy link
Contributor

Please note, both links above are dead.

They actually link to a private repo that we can't open-source ATM unfortunately

@jackparmer jackparmer mentioned this issue Jan 25, 2018
3 tasks
@chriddyp
Copy link
Member

chriddyp commented Sep 6, 2018

this has been added in plotly.js: plotly/plotly.js#2761

@chriddyp chriddyp closed this as completed Sep 6, 2018
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

6 participants