Open cserteGT3 opened 1 year ago
That's great :-)
So just please don't open a PR with this because long story short, it's very tricky to maintain docs for all the plotting libs in Julia since each of them has their own requirements / dependencies and it makes the docs ever more complex.
The hope is to move from that to each plotting library gets a single tutorial page (exactly like the one you just so kindly wrote) which is deployed by itself, and the main docs just points to these tutorial pages :-)
I had that a while back, among other things to compare effective TTFX at deployment time, but I lost that work (not very hard to bring back and your tutorial is a good reminder to do it!) once that's in place you can PR this to it 🙏
Edit: one thing would be great, making the plots themselves larger. But I don't know how to achieve that.
this is all CSS I believe changing the width
or max-width
of the div that contains the plot, have you tried?
Edit: one thing would be great, making the plots themselves larger. But I don't know how to achieve that.
this is all CSS I believe changing the
width
ormax-width
of the div that contains the plot, have you tried?
Editing the html in the lx_plotlyfig
function did not help, but changing the width of the franklin-content
class(?) in judoc.css
worked. Or at least I achieved what I wanted: make the whole body of the pages larger:
/* on wide screens, fix content width to a max value */
@media (min-width: 940px) {
.franklin-content {
width: 900px; /* original was 705px*/
margin-left: auto;
margin-right: auto; }
}
Thanks for the tip, I was putting off this so long and now it looks just like I wanted :D
Back to my favourite topic: how to include Plotly plots. I've worked out the details, but wanted to open an issue for discussion before opening a PR to document it fully.
The following steps are required:
head.html
, create and fillhead_plotly.html
hasplotly
value toconfig.md
lx_plotlyfig()
function to ˙utils.jl˙hasplotly=true
, save the resulted plot as json, use the\plotlyfig
command)Let me know what you think of this guide!
Edit: one thing would be great, making the plots themselves larger. But I don't know how to achieve that.
Guide itself:
Editing the head htmls
Add this line to your
_layout/head.html
file:Create the
_layout/head_plotly.html
file:I suggest using the lib served by CDN, because then one must not replicate it in their git repo (but can be added if one wants to).
config.md
Add a line to your
config.md
file, that sets the default value forhasplotly
. If you will have only a few pages, where plotly plots will be, then it is suggested to set it tofalse
.utils.jl
Add the following function to your
utils.jl
file. It will define the\plotlyfig{...}
command, that we can use in our markdown source.Edit the desired page
Follow this example and note the followings:
hasplotly=true
.json
extension when calling\plotlyfig{...}
And example page looks like this:
Works without extension:
\plotlyfig{example}
Works with extension:
\plotlyfig{example.json}