-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
adding a JavaScript/Jinja example to dropdowns.md #4886
base: doc-prod
Are you sure you want to change the base?
Conversation
@LiamConnors Is there anything I can do to assist the Plotly team in reviewing this PR? I think most of the build failures are not in my new code, since I have two pretty different documentation PRs open (this one and #4873) and the builds both fail in similar ways -- often complaining about facets like heatmaps that are in the existing page, but not in my PR. I'm honored to be a member of the productive and supportive Plotly community and appreciate the way you make my contributions better. Thanks! |
Thanks very much for this PR @rl-utility-man! and sorry for the delay on this. Just looking at the build failures now, but yeah, I don't think they're related to this PR in any way. |
doc/python/dropdowns.md
Outdated
@@ -444,5 +444,101 @@ fig.update_layout(title_text="Yahoo") | |||
fig.show() | |||
``` | |||
|
|||
### Creating several independent graphs and using Jinja to insert them into a JavaScript enabled webpage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Creating several independent graphs and using Jinja to insert them into a JavaScript enabled webpage | |
### Embedding Multiple Graphs in a Webpage using Jinja |
We can shorten this if possible, so it takes up less space on the left sidebar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. What would you think of "Using a Dropdown to Select a Graph Using Jinja" as a short title?
doc/python/dropdowns.md
Outdated
|
||
``` | ||
import plotly.express as px | ||
from jinja2 import Template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably actually needs the same <!-- #region -->
blocks as well as being marked as Python, as in:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in commit 5; there's something funky with the preview screen -- neither the example -- which demonstrably renders correctly when live -- nor my new commit convert e.g. > to > in preview mode. I hope I've done everything right, but it's difficult to tell.
doc/python/dropdowns.md
Outdated
#### Jinja HTML Template | ||
|
||
``` | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
|
||
</head> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all these good edits. I edited the .md directly. There's an example of embedding HTML into the .md here: https://plotly.com/python/interactive-html-export/
The gist of it is to use e.g. lt; rather than <:
<!-- #region -->
[three backticks]
<!DOCTYPE html>
<html>
<head>
I can make the requisite edits in the next day or two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just committed changes that resolve this problem. The preview now looks good to me. Thank you for flagging this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good @rl-utility-man. I tried it out the code with a template and it's working well for me.
Co-authored-by: Liam Connors <[email protected]>
Co-authored-by: Liam Connors <[email protected]>
Co-authored-by: Liam Connors <[email protected]>
Thank you for all the suggestions! I've incorporated them or slight variations on them. Everything looks good to me. Let me know if there's anything more I can do to help! (also: is there a good forum to post short articles and get feedback on frontier or challenging visualizations? For example, I'm interested in layered or combinatorial legends for maps or scatterplots that might e.g. use shape to denote the type of school, fill or hollow to denote grade levels served, and color to denote test scores. I've got the code, but there's a bunch of subtlety about e.g. what design choices to make and how much information is too much. I can find almost nothing on how to do this thoughtfully online and it feels simultaneously powerful and tricky -- so I'd love to find the right place to advance the conversation -- and the Plotly docs and forums and Medium.com all seem to be not quite the right place to do it. Is there e.g. a blog/blogger that would take guest posts or coauthor?) |
Sorry for the delay @rl-utility-man. Just was trying to figure out the failing build-doc. Once I merge #4938 I'll be able to take one last look at this and get it merged. Good question about the forum. I don't know of anything, unfortunatley, but maybe @Coding-with-Adam would? |
Documentation PR
doc/README.md
filedoc-prod
branch OR it targets themaster
branchpx
example if at all possibleplotly.graph_objects as go
/plotly.express as px
/plotly.io as pio
df
fig = <something>
call is high up in each new/modified example (eitherpx.<something>
ormake_subplots
orgo.Figure
)fig.add_*
andfig.update_*
rather thango.Figure(data=..., layout=...)
in every new/modified examplefig.add_shape
andfig.update_xaxes
are used instead of bigfig.update_layout
calls in every new/modified examplefig.show()
is at the end of each new/modified exampleplotly.plot()
andplotly.iplot()
are not used in any new/modified exampleI appreciate the Plotly community and hope this is helpful!
Code PR
plotly.graph_objects
, my modifications concern thecodegen
files and not generated files.modified existing tests.
new tutorial notebook (please see the doc checklist as well).
-->