Skip to content

Commit b33fea6

Browse files
committed
update book as per release 0.9.1
Signed-off-by: Andrei Gherghescu <[email protected]>
1 parent 9d43bb5 commit b33fea6

File tree

15 files changed

+94
-94
lines changed

15 files changed

+94
-94
lines changed

content/fundamentals/shapes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ <h1 id="shapes"><a class="header" href="#shapes">Shapes</a></h1>
188188
Axis, GridPattern, Layout, LayoutGrid, Margin, Shape, ShapeLayer, ShapeLine,
189189
ShapeType,
190190
};
191-
use plotly::{Bar, NamedColor, Plot, Scatter};
191+
use plotly::{Bar, color::NamedColor, Plot, Scatter};
192192
use rand::thread_rng;
193193
use rand_distr::{Distribution, Normal};
194194
<span class="boring">}</span></code></pre></pre>

content/getting_started.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ <h1 class="menu-title">Plotly.rs Book</h1>
196196
<h1 id="getting-started"><a class="header" href="#getting-started">Getting Started</a></h1>
197197
<p>To start using <a href="https://github.com/plotly/plotly.rs">plotly.rs</a> in your project add the following to your <code>Cargo.toml</code>:</p>
198198
<pre><code class="language-toml">[dependencies]
199-
plotly = "0.9.0"
199+
plotly = "0.9.1"
200200
</code></pre>
201201
<p><a href="https://github.com/plotly/plotly.rs">Plotly.rs</a> is ultimately a thin wrapper around the <code>plotly.js</code> library. The main job of this library is to provide <code>structs</code> and <code>enums</code> which get serialized to <code>json</code> and passed to the <code>plotly.js</code> library to actually do the heavy lifting. As such, if you are familiar with <code>plotly.js</code> or its derivatives (e.g. the equivalent Python library), then you should find <a href="https://github.com/plotly/plotly.rs"><code>plotly.rs</code></a> intuitive to use.</p>
202202
<p>A <code>Plot</code> struct contains one or more <code>Trace</code> objects which describe the structure of data to be displayed. Optional <code>Layout</code> and <code>Configuration</code> structs can be used to specify the layout and config of the plot, respectively.</p>
@@ -252,7 +252,7 @@ <h1 id="getting-started"><a class="header" href="#getting-started">Getting Start
252252
<h2 id="saving-plots"><a class="header" href="#saving-plots">Saving Plots</a></h2>
253253
<p>To add the ability to save plots in the following formats: png, jpeg, webp, svg, pdf and eps, you can use the <code>kaleido</code> feature. This feature depends on <a href="https://github.com/plotly/Kaleido">plotly/Kaleido</a>: a cross-platform open source library for generating static images. All the necessary binaries have been included with <code>plotly_kaleido</code> for <code>Linux</code>, <code>Windows</code> and <code>MacOS</code>. Previous versions of <a href="https://github.com/plotly/plotly.rs">plotly.rs</a> used the <code>orca</code> feature, however, this has been deprecated as it provided the same functionality but required additional installation steps. To enable the <code>kaleido</code> feature add the following to your <code>Cargo.toml</code>:</p>
254254
<pre><code class="language-toml">[dependencies]
255-
plotly = { version = "0.9.0", features = ["kaleido"] }
255+
plotly = { version = "0.9.1", features = ["kaleido"] }
256256
</code></pre>
257257
<h2 id="webassembly-support"><a class="header" href="#webassembly-support">WebAssembly Support</a></h2>
258258
<p>As of v0.8.0, <a href="https://github.com/plotly/plotly.rs">plotly.rs</a> can now be used in a <code>Wasm</code> environment by enabling the <code>wasm</code> feature in your <code>Cargo.toml</code>:</p>

content/print.html

Lines changed: 46 additions & 46 deletions
Large diffs are not rendered by default.

content/recipes/basic_charts/bar_charts.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ <h1 id="bar-charts"><a class="header" href="#bar-charts">Bar Charts</a></h1>
185185
ColorScale, ColorScalePalette, DashType, Fill, Font, Line, LineShape, Marker, Mode, Title,
186186
};
187187
use plotly::layout::{Axis, BarMode, Layout, Legend, TicksDirection};
188-
use plotly::{Bar, NamedColor, Plot, Rgb, Rgba, Scatter};
188+
use plotly::{Bar, color::{NamedColor, Rgb, Rgba}, Plot, Scatter};
189189
use rand_distr::{Distribution, Normal, Uniform};
190190
<span class="boring">}</span></code></pre></pre>
191191
<p>The <code>to_inline_html</code> method is used to produce the html plot displayed in this page.</p>

content/recipes/basic_charts/line_charts.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ <h1 id="line-charts"><a class="header" href="#line-charts">Line Charts</a></h1>
185185
ColorScale, ColorScalePalette, DashType, Fill, Font, Line, LineShape, Marker, Mode, Title,
186186
};
187187
use plotly::layout::{Axis, BarMode, Layout, Legend, TicksDirection};
188-
use plotly::{Bar, NamedColor, Plot, Rgb, Rgba, Scatter};
188+
use plotly::{Bar, color::{NamedColor, Rgb, Rgba}, Plot, Scatter};
189189
use rand_distr::{Distribution, Normal, Uniform};
190190
<span class="boring">}</span></code></pre></pre>
191191
<p>The <code>to_inline_html</code> method is used to produce the html plot displayed in this page.</p>
@@ -203,7 +203,7 @@ <h2 id="adding-names-to-line-and-scatter-plot"><a class="header" href="#adding-n
203203
.mode(Mode::LinesMarkers)
204204
.name("Scatter + Lines");
205205

206-
let layout = Layout::new().title(Title::new("Adding Names to Line and Scatter Plot"));
206+
let layout = Layout::new().title(Title::with_text("Adding Names to Line and Scatter Plot"));
207207
let mut plot = Plot::new();
208208
plot.add_trace(trace1);
209209
plot.add_trace(trace2);
@@ -248,7 +248,7 @@ <h2 id="line-and-scatter-styling"><a class="header" href="#line-and-scatter-styl
248248
.marker(Marker::new().color(Rgb::new(128, 0, 128)).size(12))
249249
.line(Line::new().color(Rgb::new(128, 0, 128)).width(1.0));
250250

251-
let layout = Layout::new().title(Title::new("Line and Scatter Styling"));
251+
let layout = Layout::new().title(Title::with_text("Line and Scatter Styling"));
252252
let mut plot = Plot::new();
253253
plot.add_trace(trace1);
254254
plot.add_trace(trace2);
@@ -288,7 +288,7 @@ <h2 id="styling-line-plot"><a class="header" href="#styling-line-plot">Styling L
288288
.line(Line::new().color(Rgb::new(55, 128, 191)).width(1.0));
289289

290290
let layout = Layout::new()
291-
.title(Title::new("Styling Line Plot"))
291+
.title(Title::with_text("Styling Line Plot"))
292292
.width(500)
293293
.height(500);
294294
let mut plot = Plot::new();

content/recipes/basic_charts/scatter_plots.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ <h1 id="scatter-plots"><a class="header" href="#scatter-plots">Scatter Plots</a>
185185
ColorScale, ColorScalePalette, DashType, Fill, Font, Line, LineShape, Marker, Mode, Title,
186186
};
187187
use plotly::layout::{Axis, BarMode, Layout, Legend, TicksDirection};
188-
use plotly::{Bar, NamedColor, Plot, Rgb, Rgba, Scatter};
188+
use plotly::{Bar, color::{NamedColor, Rgb, Rgba}, Plot, Scatter};
189189
use rand_distr::{Distribution, Normal, Uniform};
190190
<span class="boring">}</span></code></pre></pre>
191191
<p>The <code>to_inline_html</code> method is used to produce the html plot displayed in this page.</p>
@@ -329,9 +329,9 @@ <h2 id="data-labels-hover"><a class="header" href="#data-labels-hover">Data Labe
329329
plot.add_trace(trace2);
330330

331331
let layout = Layout::new()
332-
.title(Title::new("Data Labels Hover"))
333-
.x_axis(Axis::new().title(Title::new("x")).range(vec![0.75, 5.25]))
334-
.y_axis(Axis::new().title(Title::new("y")).range(vec![0., 8.]));
332+
.title(Title::with_text("Data Labels Hover"))
333+
.x_axis(Axis::new().title(Title::with_text("x")).range(vec![0.75, 5.25]))
334+
.y_axis(Axis::new().title(Title::with_text("y")).range(vec![0., 8.]));
335335
plot.set_layout(layout);
336336
if show {
337337
plot.show();
@@ -372,7 +372,7 @@ <h2 id="data-labels-on-the-plot"><a class="header" href="#data-labels-on-the-plo
372372
plot.add_trace(trace2);
373373

374374
let layout = Layout::new()
375-
.title(Title::new("Data Labels on the Plot"))
375+
.title(Title::with_text("Data Labels on the Plot"))
376376
.x_axis(Axis::new().range(vec![0.75, 5.25]))
377377
.y_axis(Axis::new().range(vec![0., 8.]));
378378
plot.set_layout(layout);
@@ -464,14 +464,14 @@ <h2 id="colored-and-styled-scatter-plot"><a class="header" href="#colored-and-st
464464
.marker(Marker::new().color(Rgb::new(142, 124, 195)).size(12));
465465

466466
let layout = Layout::new()
467-
.title(Title::new("Quarter 1 Growth"))
467+
.title(Title::with_text("Quarter 1 Growth"))
468468
.x_axis(
469469
Axis::new()
470-
.title(Title::new("GDP per Capita"))
470+
.title(Title::with_text("GDP per Capita"))
471471
.show_grid(false)
472472
.zero_line(false),
473473
)
474-
.y_axis(Axis::new().title(Title::new("Percent")).show_line(false));
474+
.y_axis(Axis::new().title(Title::with_text("Percent")).show_line(false));
475475
let mut plot = Plot::new();
476476
plot.add_trace(trace1);
477477
plot.add_trace(trace2);

content/recipes/financial_charts/time_series_and_date_axes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ <h2 id="time-series-plot-with-custom-date-range"><a class="header" href="#time-s
203203

204204
let layout = Layout::new()
205205
.x_axis(Axis::new().range(vec!["2016-07-01", "2016-12-31"]))
206-
.title(Title::new("Manually Set Date Range"));
206+
.title(Title::with_text("Manually Set Date Range"));
207207
plot.set_layout(layout);
208208

209209
if show {
@@ -243,7 +243,7 @@ <h2 id="time-series-with-range-slider"><a class="header" href="#time-series-with
243243

244244
let layout = Layout::new()
245245
.x_axis(Axis::new().range_slider(RangeSlider::new().visible(true)))
246-
.title(Title::new("Manually Set Date Range"));
246+
.title(Title::with_text("Manually Set Date Range"));
247247
plot.set_layout(layout);
248248

249249
if show {

content/recipes/scientific_charts/contour_plots.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ <h2 id="colorscale-for-contour-plot"><a class="header" href="#colorscale-for-con
247247
];
248248
let trace = Contour::new_z(z).color_scale(ColorScale::Palette(ColorScalePalette::Jet));
249249

250-
let layout = Layout::new().title(Title::new("Colorscale for Contour Plot"));
250+
let layout = Layout::new().title(Title::with_text("Colorscale for Contour Plot"));
251251
let mut plot = Plot::new();
252252
plot.set_layout(layout);
253253
plot.add_trace(trace);
@@ -289,7 +289,7 @@ <h2 id="customizing-size-and-range-of-a-contour-plot-contours"><a class="header"
289289
.auto_contour(false)
290290
.contours(Contours::new().start(0.0).end(8.0).size(2));
291291

292-
let layout = Layout::new().title(Title::new("Customizing Size and Range of Contours"));
292+
let layout = Layout::new().title(Title::with_text("Customizing Size and Range of Contours"));
293293
let mut plot = Plot::new();
294294
plot.set_layout(layout);
295295
plot.add_trace(trace);
@@ -334,7 +334,7 @@ <h2 id="customizing-spacing-between-x-and-y-ticks"><a class="header" href="#cust
334334
.dy(10.0)
335335
.y0(10.0);
336336

337-
let layout = Layout::new().title(Title::new("Customizing Size and Range of Contours"));
337+
let layout = Layout::new().title(Title::with_text("Customizing Size and Range of Contours"));
338338
let mut plot = Plot::new();
339339
plot.set_layout(layout);
340340
plot.add_trace(trace);

content/recipes/statistical_charts/box_plots.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ <h1 id="box-plots"><a class="header" href="#box-plots">Box Plots</a></h1>
185185
use plotly::common::{ErrorData, ErrorType, Line, Marker, Mode, Orientation, Title};
186186
use plotly::histogram::{Bins, Cumulative, HistFunc, HistNorm};
187187
use plotly::layout::{Axis, BarMode, BoxMode, Layout, Margin};
188-
use plotly::{Bar, BoxPlot, Histogram, NamedColor, Plot, Rgb, Rgba, Scatter};
188+
use plotly::{Bar, BoxPlot, Histogram, color::{NamedColor, Rgb, Rgba}, Scatter};
189189
use rand_distr::{Distribution, Normal, Uniform};
190190

191191
<span class="boring">}</span></code></pre></pre>
@@ -328,7 +328,7 @@ <h2 id="grouped-box-plot"><a class="header" href="#grouped-box-plot">Grouped Box
328328
let layout = Layout::new()
329329
.y_axis(
330330
Axis::new()
331-
.title(Title::new("normalized moisture"))
331+
.title(Title::with_text("normalized moisture"))
332332
.zero_line(false),
333333
)
334334
.box_mode(BoxMode::Group);
@@ -393,7 +393,7 @@ <h2 id="box-plot-styling-outliers"><a class="header" href="#box-plot-styling-out
393393
.marker(Marker::new().color(Rgb::new(107, 174, 214)))
394394
.box_points(BoxPoints::Outliers);
395395

396-
let layout = Layout::new().title(Title::new("Box Plot Styling Outliers"));
396+
let layout = Layout::new().title(Title::with_text("Box Plot Styling Outliers"));
397397

398398
let mut plot = Plot::new();
399399
plot.set_layout(layout);
@@ -442,7 +442,7 @@ <h2 id="box-plot-styling-mean-and-standard-deviation"><a class="header" href="#b
442442
.name("Mean and Standard Deviation")
443443
.marker(Marker::new().color(Rgb::new(8, 81, 156)))
444444
.box_mean(BoxMean::StandardDeviation);
445-
let layout = Layout::new().title(Title::new("Box Plot Styling Mean and Standard Deviation"));
445+
let layout = Layout::new().title(Title::with_text("Box Plot Styling Mean and Standard Deviation"));
446446

447447
let mut plot = Plot::new();
448448
plot.set_layout(layout);
@@ -510,10 +510,10 @@ <h2 id="grouped-horizontal-box-plot"><a class="header" href="#grouped-horizontal
510510
plot.add_trace(trace3);
511511

512512
let layout = Layout::new()
513-
.title(Title::new("Grouped Horizontal Box Plot"))
513+
.title(Title::with_text("Grouped Horizontal Box Plot"))
514514
.x_axis(
515515
Axis::new()
516-
.title(Title::new("normalized moisture"))
516+
.title(Title::with_text("normalized moisture"))
517517
.zero_line(false),
518518
)
519519
.box_mode(BoxMode::Group);

content/recipes/statistical_charts/error_bars.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ <h1 id="error-bars"><a class="header" href="#error-bars">Error Bars</a></h1>
185185
use plotly::common::{ErrorData, ErrorType, Line, Marker, Mode, Orientation, Title};
186186
use plotly::histogram::{Bins, Cumulative, HistFunc, HistNorm};
187187
use plotly::layout::{Axis, BarMode, BoxMode, Layout, Margin};
188-
use plotly::{Bar, BoxPlot, Histogram, NamedColor, Plot, Rgb, Rgba, Scatter};
188+
use plotly::{Bar, BoxPlot, Histogram, Plot, color::{NamedColor, Rgb, Rgba}, Scatter};
189189
use rand_distr::{Distribution, Normal, Uniform};
190190

191191
<span class="boring">}</span></code></pre></pre>

0 commit comments

Comments
 (0)