Skip to content

Commit 802f5da

Browse files
update book for release refs/tags/0.11.0
1 parent b33fea6 commit 802f5da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1777
-4329
lines changed

content/404.html

Lines changed: 17 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE HTML>
2-
<html lang="en" class="ayu" dir="ltr">
2+
<html lang="en" class="ayu sidebar-visible" dir="ltr">
33
<head>
44
<!-- Book generated using mdBook -->
55
<meta charset="UTF-8">
@@ -8,7 +8,7 @@
88

99

1010
<!-- Custom HTML head -->
11-
11+
1212
<meta name="description" content="Plotly.rs documentation">
1313
<meta name="viewport" content="width=device-width, initial-scale=1">
1414
<meta name="theme-color" content="#ffffff">
@@ -34,15 +34,17 @@
3434

3535
<!-- MathJax -->
3636
<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
37-
</head>
38-
<body class="sidebar-visible no-js">
39-
<div id="body-container">
37+
4038
<!-- Provide site root to javascript -->
4139
<script>
4240
var path_to_root = "";
4341
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "ayu";
4442
</script>
45-
43+
<!-- Start loading toc.js asap -->
44+
<script src="toc.js"></script>
45+
</head>
46+
<body>
47+
<div id="body-container">
4648
<!-- Work around some values being stored in localStorage wrapped in quotes -->
4749
<script>
4850
try {
@@ -64,19 +66,16 @@
6466
var theme;
6567
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
6668
if (theme === null || theme === undefined) { theme = default_theme; }
67-
var html = document.querySelector('html');
69+
const html = document.documentElement;
6870
html.classList.remove('ayu')
6971
html.classList.add(theme);
70-
var body = document.querySelector('body');
71-
body.classList.remove('no-js')
72-
body.classList.add('js');
72+
html.classList.add("js");
7373
</script>
7474

7575
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
7676

7777
<!-- Hide / unhide sidebar before it is displayed -->
7878
<script>
79-
var body = document.querySelector('body');
8079
var sidebar = null;
8180
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
8281
if (document.body.clientWidth >= 1080) {
@@ -86,41 +85,21 @@
8685
sidebar = 'hidden';
8786
}
8887
sidebar_toggle.checked = sidebar === 'visible';
89-
body.classList.remove('sidebar-visible');
90-
body.classList.add("sidebar-" + sidebar);
88+
html.classList.remove('sidebar-visible');
89+
html.classList.add("sidebar-" + sidebar);
9190
</script>
9291

9392
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
94-
<div class="sidebar-scrollbox">
95-
<ol class="chapter"><li class="chapter-item expanded "><a href="plotly_rs.html"><strong aria-hidden="true">1.</strong> Plotly.rs</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="getting_started.html"><strong aria-hidden="true">1.1.</strong> Getting Started</a></li></ol></li><li class="chapter-item expanded "><a href="fundamentals.html"><strong aria-hidden="true">2.</strong> Fundamentals</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="fundamentals/jupyter_support.html"><strong aria-hidden="true">2.1.</strong> Jupyter Support</a></li><li class="chapter-item "><a href="fundamentals/ndarray_support.html"><strong aria-hidden="true">2.2.</strong> ndarray Support</a></li><li class="chapter-item "><a href="fundamentals/shapes.html"><strong aria-hidden="true">2.3.</strong> Shapes</a></li></ol></li><li class="chapter-item expanded "><a href="recipes.html"><strong aria-hidden="true">3.</strong> Recipes</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="recipes/basic_charts.html"><strong aria-hidden="true">3.1.</strong> Basic Charts</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="recipes/basic_charts/scatter_plots.html"><strong aria-hidden="true">3.1.1.</strong> Scatter Plots</a></li><li class="chapter-item "><a href="recipes/basic_charts/line_charts.html"><strong aria-hidden="true">3.1.2.</strong> Line Charts</a></li><li class="chapter-item "><a href="recipes/basic_charts/bar_charts.html"><strong aria-hidden="true">3.1.3.</strong> Bar Charts</a></li><li class="chapter-item "><a href="recipes/basic_charts/sankey_diagrams.html"><strong aria-hidden="true">3.1.4.</strong> Sankey Diagrams</a></li></ol></li><li class="chapter-item "><a href="recipes/statistical_charts.html"><strong aria-hidden="true">3.2.</strong> Statistical Charts</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="recipes/statistical_charts/error_bars.html"><strong aria-hidden="true">3.2.1.</strong> Error Bars</a></li><li class="chapter-item "><a href="recipes/statistical_charts/box_plots.html"><strong aria-hidden="true">3.2.2.</strong> Box Plots</a></li><li class="chapter-item "><a href="recipes/statistical_charts/histograms.html"><strong aria-hidden="true">3.2.3.</strong> Histograms</a></li></ol></li><li class="chapter-item "><a href="recipes/scientific_charts.html"><strong aria-hidden="true">3.3.</strong> Scientific Charts</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="recipes/scientific_charts/contour_plots.html"><strong aria-hidden="true">3.3.1.</strong> Contour Plots</a></li><li class="chapter-item "><a href="recipes/scientific_charts/heatmaps.html"><strong aria-hidden="true">3.3.2.</strong> Heatmaps</a></li></ol></li><li class="chapter-item "><a href="recipes/financial_charts.html"><strong aria-hidden="true">3.4.</strong> Financial Charts</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="recipes/financial_charts/time_series_and_date_axes.html"><strong aria-hidden="true">3.4.1.</strong> Time Series and Date Axes</a></li><li class="chapter-item "><a href="recipes/financial_charts/candlestick_charts.html"><strong aria-hidden="true">3.4.2.</strong> Candlestick Charts</a></li><li class="chapter-item "><a href="recipes/financial_charts/ohlc_charts.html"><strong aria-hidden="true">3.4.3.</strong> OHLC Charts</a></li></ol></li><li class="chapter-item "><a href="recipes/3dcharts.html"><strong aria-hidden="true">3.5.</strong> 3D Charts</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="recipes/3dcharts/3dcharts.html"><strong aria-hidden="true">3.5.1.</strong> Scatter 3D</a></li></ol></li><li class="chapter-item "><a href="recipes/subplots.html"><strong aria-hidden="true">3.6.</strong> Subplots</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="recipes/subplots/subplots.html"><strong aria-hidden="true">3.6.1.</strong> Subplots</a></li><li class="chapter-item "><a href="recipes/subplots/multiple_axes.html"><strong aria-hidden="true">3.6.2.</strong> Multiple Axes</a></li></ol></li></ol></li></ol>
96-
</div>
93+
<!-- populated by js -->
94+
<mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
95+
<noscript>
96+
<iframe class="sidebar-iframe-outer" src="toc.html"></iframe>
97+
</noscript>
9798
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
9899
<div class="sidebar-resize-indicator"></div>
99100
</div>
100101
</nav>
101102

102-
<!-- Track and set sidebar scroll position -->
103-
<script>
104-
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
105-
sidebarScrollbox.addEventListener('click', function(e) {
106-
if (e.target.tagName === 'A') {
107-
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
108-
}
109-
}, { passive: true });
110-
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
111-
sessionStorage.removeItem('sidebar-scroll');
112-
if (sidebarScrollTop) {
113-
// preserve sidebar scroll position when navigating via links within sidebar
114-
sidebarScrollbox.scrollTop = sidebarScrollTop;
115-
} else {
116-
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
117-
var activeSection = document.querySelector('#sidebar .active');
118-
if (activeSection) {
119-
activeSection.scrollIntoView({ block: 'center' });
120-
}
121-
}
122-
</script>
123-
124103
<div id="page-wrapper" class="page-wrapper">
125104

126105
<div class="page">

content/book.js

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ function playground_text(playground, hidden = true) {
225225
}
226226

227227
var clipButton = document.createElement('button');
228-
clipButton.className = 'fa fa-copy clip-button';
228+
clipButton.className = 'clip-button';
229229
clipButton.title = 'Copy to clipboard';
230230
clipButton.setAttribute('aria-label', clipButton.title);
231231
clipButton.innerHTML = '<i class=\"tooltiptext\"></i>';
@@ -258,7 +258,7 @@ function playground_text(playground, hidden = true) {
258258

259259
if (window.playground_copyable) {
260260
var copyCodeClipboardButton = document.createElement('button');
261-
copyCodeClipboardButton.className = 'fa fa-copy clip-button';
261+
copyCodeClipboardButton.className = 'clip-button';
262262
copyCodeClipboardButton.innerHTML = '<i class="tooltiptext"></i>';
263263
copyCodeClipboardButton.title = 'Copy to clipboard';
264264
copyCodeClipboardButton.setAttribute('aria-label', copyCodeClipboardButton.title);
@@ -289,6 +289,10 @@ function playground_text(playground, hidden = true) {
289289
var themeToggleButton = document.getElementById('theme-toggle');
290290
var themePopup = document.getElementById('theme-list');
291291
var themeColorMetaTag = document.querySelector('meta[name="theme-color"]');
292+
var themeIds = [];
293+
themePopup.querySelectorAll('button.theme').forEach(function (el) {
294+
themeIds.push(el.id);
295+
});
292296
var stylesheets = {
293297
ayuHighlight: document.querySelector("[href$='ayu-highlight.css']"),
294298
tomorrowNight: document.querySelector("[href$='tomorrow-night.css']"),
@@ -317,7 +321,7 @@ function playground_text(playground, hidden = true) {
317321
function get_theme() {
318322
var theme;
319323
try { theme = localStorage.getItem('mdbook-theme'); } catch (e) { }
320-
if (theme === null || theme === undefined) {
324+
if (theme === null || theme === undefined || !themeIds.includes(theme)) {
321325
return default_theme;
322326
} else {
323327
return theme;
@@ -459,17 +463,6 @@ function playground_text(playground, hidden = true) {
459463
try { localStorage.setItem('mdbook-sidebar', 'visible'); } catch (e) { }
460464
}
461465

462-
463-
var sidebarAnchorToggles = document.querySelectorAll('#sidebar a.toggle');
464-
465-
function toggleSection(ev) {
466-
ev.currentTarget.parentElement.classList.toggle('expanded');
467-
}
468-
469-
Array.from(sidebarAnchorToggles).forEach(function (el) {
470-
el.addEventListener('click', toggleSection);
471-
});
472-
473466
function hideSidebar() {
474467
body.classList.remove('sidebar-visible')
475468
body.classList.add('sidebar-hidden');
@@ -597,12 +590,12 @@ function playground_text(playground, hidden = true) {
597590

598591
function hideTooltip(elem) {
599592
elem.firstChild.innerText = "";
600-
elem.className = 'fa fa-copy clip-button';
593+
elem.className = 'clip-button';
601594
}
602595

603596
function showTooltip(elem, msg) {
604597
elem.firstChild.innerText = msg;
605-
elem.className = 'fa fa-copy tooltipped';
598+
elem.className = 'clip-button tooltipped';
606599
}
607600

608601
var clipboardSnippets = new ClipboardJS('.clip-button', {

content/css/chrome.css

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ a > .hljs {
4040
border-block-end-style: solid;
4141
}
4242
#menu-bar.sticky,
43-
.js #menu-bar-hover-placeholder:hover + #menu-bar,
44-
.js #menu-bar:hover,
45-
.js.sidebar-visible #menu-bar {
43+
#menu-bar-hover-placeholder:hover + #menu-bar,
44+
#menu-bar:hover,
45+
html.sidebar-visible #menu-bar {
4646
position: -webkit-sticky;
4747
position: sticky;
4848
top: 0 !important;
@@ -91,7 +91,7 @@ a > .hljs {
9191
display: flex;
9292
margin: 0 5px;
9393
}
94-
.no-js .left-buttons button {
94+
html:not(.js) .left-buttons button {
9595
display: none;
9696
}
9797

@@ -107,7 +107,7 @@ a > .hljs {
107107
overflow: hidden;
108108
text-overflow: ellipsis;
109109
}
110-
.js .menu-title {
110+
.menu-title {
111111
cursor: pointer;
112112
}
113113

@@ -250,8 +250,8 @@ pre > .buttons i {
250250
pre > .buttons button {
251251
cursor: inherit;
252252
margin: 0px 5px;
253-
padding: 3px 5px;
254-
font-size: 14px;
253+
padding: 4px 4px 3px 5px;
254+
font-size: 23px;
255255

256256
border-style: solid;
257257
border-width: 1px;
@@ -262,6 +262,27 @@ pre > .buttons button {
262262
transition-property: color,border-color,background-color;
263263
color: var(--icons);
264264
}
265+
266+
pre > .buttons button.clip-button {
267+
padding: 2px 4px 0px 6px;
268+
}
269+
pre > .buttons button.clip-button::before {
270+
/* clipboard image from octicons (https://github.com/primer/octicons/tree/v2.0.0) MIT license
271+
*/
272+
content: url('data:image/svg+xml,<svg width="21" height="20" viewBox="0 0 24 25" \
273+
xmlns="http://www.w3.org/2000/svg" aria-label="Copy to clipboard">\
274+
<path d="M18 20h2v3c0 1-1 2-2 2H2c-.998 0-2-1-2-2V5c0-.911.755-1.667 1.667-1.667h5A3.323 3.323 0 \
275+
0110 0a3.323 3.323 0 013.333 3.333h5C19.245 3.333 20 4.09 20 5v8.333h-2V9H2v14h16v-3zM3 \
276+
7h14c0-.911-.793-1.667-1.75-1.667H13.5c-.957 0-1.75-.755-1.75-1.666C11.75 2.755 10.957 2 10 \
277+
2s-1.75.755-1.75 1.667c0 .911-.793 1.666-1.75 1.666H4.75C3.793 5.333 3 6.09 3 7z"/>\
278+
<path d="M4 19h6v2H4zM12 11H4v2h8zM4 17h4v-2H4zM15 15v-3l-4.5 4.5L15 21v-3l8.027-.032L23 15z"/>\
279+
</svg>');
280+
filter: var(--copy-button-filter);
281+
}
282+
pre > .buttons button.clip-button:hover::before {
283+
filter: var(--copy-button-filter-hover);
284+
}
285+
265286
@media (pointer: coarse) {
266287
pre > .buttons button {
267288
/* On mobile, make it easier to tap buttons. */
@@ -399,15 +420,30 @@ ul#searchresults span.teaser em {
399420
background-color: var(--sidebar-bg);
400421
color: var(--sidebar-fg);
401422
}
423+
.sidebar-iframe-inner {
424+
background-color: var(--sidebar-bg);
425+
color: var(--sidebar-fg);
426+
padding: 10px 10px;
427+
margin: 0;
428+
font-size: 1.4rem;
429+
}
430+
.sidebar-iframe-outer {
431+
border: none;
432+
height: 100%;
433+
position: absolute;
434+
top: 0;
435+
bottom: 0;
436+
left: 0;
437+
right: 0;
438+
}
402439
[dir=rtl] .sidebar { left: unset; right: 0; }
403440
.sidebar-resizing {
404441
-moz-user-select: none;
405442
-webkit-user-select: none;
406443
-ms-user-select: none;
407444
user-select: none;
408445
}
409-
.no-js .sidebar,
410-
.js:not(.sidebar-resizing) .sidebar {
446+
html:not(.sidebar-resizing) .sidebar {
411447
transition: transform 0.3s; /* Animation: slide away */
412448
}
413449
.sidebar code {

content/css/general.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ kbd {
190190
vertical-align: middle;
191191
}
192192

193+
sup {
194+
/* Set the line-height for superscript and footnote references so that there
195+
isn't an awkward space appearing above lines that contain the footnote.
196+
197+
See https://github.com/rust-lang/mdBook/pull/2443#discussion_r1813773583
198+
for an explanation.
199+
*/
200+
line-height: 0;
201+
}
202+
193203
:not(.footnote-definition) + .footnote-definition,
194204
.footnote-definition + :not(.footnote-definition) {
195205
margin-block-start: 2em;

content/css/variables.css

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
--search-mark-bg: #e3b171;
5757

5858
--color-scheme: dark;
59+
60+
/* Same as `--icons` */
61+
--copy-button-filter: invert(45%) sepia(6%) saturate(621%) hue-rotate(198deg) brightness(99%) contrast(85%);
62+
/* Same as `--sidebar-active` */
63+
--copy-button-filter-hover: invert(68%) sepia(55%) saturate(531%) hue-rotate(341deg) brightness(104%) contrast(101%);
5964
}
6065

6166
.coal {
@@ -100,9 +105,14 @@
100105
--search-mark-bg: #355c7d;
101106

102107
--color-scheme: dark;
108+
109+
/* Same as `--icons` */
110+
--copy-button-filter: invert(26%) sepia(8%) saturate(575%) hue-rotate(169deg) brightness(87%) contrast(82%);
111+
/* Same as `--sidebar-active` */
112+
--copy-button-filter-hover: invert(36%) sepia(70%) saturate(503%) hue-rotate(167deg) brightness(98%) contrast(89%);
103113
}
104114

105-
.light {
115+
.light, html:not(.js) {
106116
--bg: hsl(0, 0%, 100%);
107117
--fg: hsl(0, 0%, 0%);
108118

@@ -144,6 +154,11 @@
144154
--search-mark-bg: #a2cff5;
145155

146156
--color-scheme: light;
157+
158+
/* Same as `--icons` */
159+
--copy-button-filter: invert(45.49%);
160+
/* Same as `--sidebar-active` */
161+
--copy-button-filter-hover: invert(14%) sepia(93%) saturate(4250%) hue-rotate(243deg) brightness(99%) contrast(130%);
147162
}
148163

149164
.navy {
@@ -188,6 +203,11 @@
188203
--search-mark-bg: #a2cff5;
189204

190205
--color-scheme: dark;
206+
207+
/* Same as `--icons` */
208+
--copy-button-filter: invert(51%) sepia(10%) saturate(393%) hue-rotate(198deg) brightness(86%) contrast(87%);
209+
/* Same as `--sidebar-active` */
210+
--copy-button-filter-hover: invert(46%) sepia(20%) saturate(1537%) hue-rotate(156deg) brightness(85%) contrast(90%);
191211
}
192212

193213
.rust {
@@ -231,11 +251,14 @@
231251
--searchresults-li-bg: #dec2a2;
232252
--search-mark-bg: #e69f67;
233253

234-
--color-scheme: light;
254+
/* Same as `--icons` */
255+
--copy-button-filter: invert(51%) sepia(10%) saturate(393%) hue-rotate(198deg) brightness(86%) contrast(87%);
256+
/* Same as `--sidebar-active` */
257+
--copy-button-filter-hover: invert(77%) sepia(16%) saturate(1798%) hue-rotate(328deg) brightness(98%) contrast(83%);
235258
}
236259

237260
@media (prefers-color-scheme: dark) {
238-
.light.no-js {
261+
html:not(.js) {
239262
--bg: hsl(200, 7%, 8%);
240263
--fg: #98a3ad;
241264

@@ -275,5 +298,12 @@
275298
--searchresults-border-color: #98a3ad;
276299
--searchresults-li-bg: #2b2b2f;
277300
--search-mark-bg: #355c7d;
301+
302+
--color-scheme: dark;
303+
304+
/* Same as `--icons` */
305+
--copy-button-filter: invert(26%) sepia(8%) saturate(575%) hue-rotate(169deg) brightness(87%) contrast(82%);
306+
/* Same as `--sidebar-active` */
307+
--copy-button-filter-hover: invert(36%) sepia(70%) saturate(503%) hue-rotate(167deg) brightness(98%) contrast(89%);
278308
}
279309
}

0 commit comments

Comments
 (0)