You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,3 +62,38 @@ save(page, "myplot.html")
62
62
63
63
- See `?Plot` for details on the `Plot` object.
64
64
- See `?PlotlyLight.src!` for details on how javascript gets loaded.
65
+
66
+
## Defaults
67
+
68
+
A common workflow is to create multiple plots with a similar style. Rather then setting nearly identical layouts for multiple plots, you can set default values for a variety of items. HTML defaults (`class`/`style`/`parent_class`/`parent_style`) are chosen to make the plot reactive to the browser window size.
69
+
70
+
```julia
71
+
module Defaults
72
+
src =Ref(:cdn) # How plotly gets loaded. see ?PlotlyLight.src!
73
+
class =Ref("") # class of the <div> the plot is inside of.
74
+
style =Ref("height: 100%;") # style of the <div> the plot is inside of.
75
+
parent_class =Ref("") # class of the plot's parent <div>.
76
+
parent_style =Ref("height: 100vh;") # style of the plot's parent <div>.
The themes available in [Plotly's python package](https://plotly.com/python/templates/) are also made available in PlotlyLight.jl. They can be set via:
0 commit comments