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

themes and default styling #217

Closed
chriddyp opened this issue May 21, 2015 · 8 comments
Closed

themes and default styling #217

chriddyp opened this issue May 21, 2015 · 8 comments
Assignees
Milestone

Comments

@chriddyp
Copy link
Member

update is great. it'd be fun if we wrote some helper functions that allowed folks to save skeleton themed figures to their file system and apply them. maybe even update the default styling!

I just wrote up a lil notebook here that demonstrates how this might work: http://nbviewer.ipython.org/gist/chriddyp/f4adabf92a3b517a01f5

would love your feedback @theengineear @etpinard @aneda @cldougl

@theengineear
Copy link
Contributor

is there still any plan to try and integrate themes such that you include a theme in the json to be applied only in the frontend? that way it would be shared amongst all the api-wrapping libraries. thoughts?

@theengineear
Copy link
Contributor

i do like your proposal though, it certainly gets the job done!

@jackparmer jackparmer reopened this Jun 2, 2015
@aneda
Copy link
Contributor

aneda commented Jun 2, 2015

@chriddyp I love it! should we incorporate this in the doc? I think it would be great to do all the galleries this way

@theengineear theengineear added this to the 1.7 Release milestone Jun 15, 2015
@chriddyp
Copy link
Member Author

@theengineear - I really like being able to just update the figure locally, and I think it allows some more flexibility if you want to apply a theme, and then override some its properties. If it was just in the front-end, then the theme would always have precedence.

I think that we could incorporate the front-end themes by making them an endpoint where you could download the ones that you've made in the front-end (at some point).

it might be cool to add a download_theme(url) method that would download the content at the endpoint, json parse it, plotly validate it, and then save it. Then, we could keep a public repo of all of our favorite themes for people to use, and as @aneda mentioned we could include them in the docs so that it's easy for people to remake their gorgeous graphs!

this solution is also cool because it would work with more complicated layouts, like subplots etc.

in fact, maybe it should be rebranded "templates"

@theengineear
Copy link
Contributor

Yup, I'm with you on the ends, but I worry about the means. Applying a theme ended up being a non-trivial task in the frontend. I'm ok with doing this in our libraries, but it does mean lot of duplication.

If we did port this to python, we could always stick it in our backend and then make an api request to have our backend apply the theme and return the result. That could then be used across all our libraries.

Again, if it's worth the effort and we have team members to do it, I'm all for it. However, there's going to be a lot of duplication and then maintainability costs.

@jackparmer
Copy link
Contributor

I'd love to see this done in 2 stages -

First, ship Plotly with a few useful default themes like cufflinks has done and add their usage to the docs:

https://github.com/santosjorge/cufflinks/blob/master/cufflinks/plotlytools.py#L58

This should be super easy. I'd personally love to see ggplot and seaborn themes... the number of lines of styling currently needed to match these themes is crazy.

Second, figure out how to save and reimplement saved themes.

@jackparmer
Copy link
Contributor

Here are the themes that are new in MPL 1.4:
https://youtu.be/PmDUx62cTTs?t=6m12s

@jonmmease
Copy link
Contributor

Closing in favor of #1161. This functionality is going to be built on top of the Plotly.js template mechanism.

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

5 participants