Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5fcea76

Browse files
Merge branch 'main' into multiples-axis
2 parents 3e910b2 + 7bfae55 commit 5fcea76

File tree

31 files changed

+99
-90
lines changed

31 files changed

+99
-90
lines changed

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## [0.9.1] - 2024年09月06日
7+
### Added
8+
- [[#217](https://github.com/plotly/plotly.rs/pull/217)] Added show_html(filename) method to bypass situations where accessing default `/tmp` is not possible, e.g., with in SNAP Firefox
9+
- [[#227](https://github.com/plotly/plotly.rs/pull/227)] Switch from HTML template render from `askama` to `rinja`
10+
11+
### Fixed
12+
- [[#232](https://github.com/plotly/plotly.rs/pull/232)] Generalize OS detection in the context of opening HTML pages with default app via `xdg-open`
13+
- [[#233](https://github.com/plotly/plotly.rs/pull/233)] Fix mdBook code examples
14+
615
## [0.9.0] - 2024年06月29日
716
### Added
817
- [[#153](https://github.com/plotly/plotly.rs/pull/153)] Added `LayoutScene`.

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Add this to your `Cargo.toml`:
6161

6262
```toml
6363
[dependencies]
64-
plotly = "0.9.0"
64+
plotly = "0.9.1"
6565
```
6666

6767
## Exporting an Interactive Plot
@@ -103,7 +103,7 @@ To save a plot as a static image, the `kaleido` feature is required:
103103
# Cargo.toml
104104

105105
[dependencies]
106-
plotly = { version = "0.9.0", features = ["kaleido"] }
106+
plotly = { version = "0.9.1", features = ["kaleido"] }
107107
```
108108

109109
With this feature enabled, plots can be saved as any of `png`, `jpeg`, `webp`, `svg`, `pdf` and `eps`. Note that the plot will be a static image, i.e. they will be non-interactive.
@@ -130,7 +130,7 @@ Using `Plotly.rs` in a Wasm-based frontend framework is possible by enabling the
130130
# Cargo.toml
131131

132132
[dependencies]
133-
plotly = { version = "0.9.0", features = ["wasm"] }
133+
plotly = { version = "0.9.1", features = ["wasm"] }
134134
```
135135

136136
First, make sure that you have the Plotly JavaScript library in your base HTML template:

‎docs/book/src/fundamentals/shapes.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use plotly::layout::{
1111
Axis, GridPattern, Layout, LayoutGrid, Margin, Shape, ShapeLayer, ShapeLine,
1212
ShapeType,
1313
};
14-
use plotly::{Bar, NamedColor, Plot, Scatter};
14+
use plotly::{Bar, color::NamedColor, Plot, Scatter};
1515
use rand::thread_rng;
1616
use rand_distr::{Distribution, Normal};
1717
```

‎docs/book/src/getting_started.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To start using [plotly.rs](https://github.com/plotly/plotly.rs) in your project
2222

2323
```toml
2424
[dependencies]
25-
plotly = "0.9.0"
25+
plotly = "0.9.1"
2626
```
2727

2828
[Plotly.rs](https://github.com/plotly/plotly.rs) is ultimately a thin wrapper around the `plotly.js` library. The main job of this library is to provide `structs` and `enums` which get serialized to `json` and passed to the `plotly.js` library to actually do the heavy lifting. As such, if you are familiar with `plotly.js` or its derivatives (e.g. the equivalent Python library), then you should find [`plotly.rs`](https://github.com/plotly/plotly.rs) intuitive to use.
@@ -97,7 +97,7 @@ To add the ability to save plots in the following formats: png, jpeg, webp, svg,
9797

9898
```toml
9999
[dependencies]
100-
plotly = { version = "0.9.0", features = ["kaleido"] }
100+
plotly = { version = "0.9.1", features = ["kaleido"] }
101101
```
102102

103103
## WebAssembly Support

‎docs/book/src/recipes/basic_charts/bar_charts.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ use plotly::common::{
88
ColorScale, ColorScalePalette, DashType, Fill, Font, Line, LineShape, Marker, Mode, Title,
99
};
1010
use plotly::layout::{Axis, BarMode, Layout, Legend, TicksDirection};
11-
use plotly::{Bar, NamedColor, Plot, Rgb, Rgba, Scatter};
11+
use plotly::{Bar, color::{NamedColor, Rgb, Rgba}, Plot, Scatter};
1212
use rand_distr::{Distribution, Normal, Uniform};
1313
```
1414

1515
The `to_inline_html` method is used to produce the html plot displayed in this page.
1616

1717

1818
## Basic Bar Chart
19-
```rust
19+
```rust
2020
fn basic_bar_chart(show: bool) {
2121
let animals = vec!["giraffes", "orangutans", "monkeys"];
2222
let t = Bar::new(animals, vec![20, 14, 23]);
@@ -43,7 +43,7 @@ var layout = {};
4343
</script>
4444

4545
## Grouped Bar Chart
46-
```rust
46+
```rust
4747
fn grouped_bar_chart(show: bool) {
4848
let animals1 = vec!["giraffes", "orangutans", "monkeys"];
4949
let trace1 = Bar::new(animals1, vec![20, 14, 23]).name("SF Zoo");
@@ -79,7 +79,7 @@ var layout = {"barmode":"group"};
7979

8080

8181
## Stacked Bar Chart
82-
```rust
82+
```rust
8383
fn stacked_bar_chart(show: bool) {
8484
let animals1 = vec!["giraffes", "orangutans", "monkeys"];
8585
let trace1 = Bar::new(animals1, vec![20, 14, 23]).name("SF Zoo");

‎docs/book/src/recipes/basic_charts/line_charts.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use plotly::common::{
88
ColorScale, ColorScalePalette, DashType, Fill, Font, Line, LineShape, Marker, Mode, Title,
99
};
1010
use plotly::layout::{Axis, BarMode, Layout, Legend, TicksDirection};
11-
use plotly::{Bar, NamedColor, Plot, Rgb, Rgba, Scatter};
11+
use plotly::{Bar, color::{NamedColor, Rgb, Rgba}, Plot, Scatter};
1212
use rand_distr::{Distribution, Normal, Uniform};
1313
```
1414

@@ -28,7 +28,7 @@ fn adding_names_to_line_and_scatter_plot(show: bool) {
2828
.mode(Mode::LinesMarkers)
2929
.name("Scatter + Lines");
3030

31-
let layout = Layout::new().title(Title::new("Adding Names to Line and Scatter Plot"));
31+
let layout = Layout::new().title(Title::with_text("Adding Names to Line and Scatter Plot"));
3232
let mut plot = Plot::new();
3333
plot.add_trace(trace1);
3434
plot.add_trace(trace2);
@@ -74,7 +74,7 @@ fn line_and_scatter_styling(show: bool) {
7474
.marker(Marker::new().color(Rgb::new(128, 0, 128)).size(12))
7575
.line(Line::new().color(Rgb::new(128, 0, 128)).width(1.0));
7676

77-
let layout = Layout::new().title(Title::new("Line and Scatter Styling"));
77+
let layout = Layout::new().title(Title::with_text("Line and Scatter Styling"));
7878
let mut plot = Plot::new();
7979
plot.add_trace(trace1);
8080
plot.add_trace(trace2);
@@ -114,7 +114,7 @@ fn styling_line_plot(show: bool) {
114114
.line(Line::new().color(Rgb::new(55, 128, 191)).width(1.0));
115115

116116
let layout = Layout::new()
117-
.title(Title::new("Styling Line Plot"))
117+
.title(Title::with_text("Styling Line Plot"))
118118
.width(500)
119119
.height(500);
120120
let mut plot = Plot::new();

‎docs/book/src/recipes/basic_charts/scatter_plots.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use plotly::common::{
88
ColorScale, ColorScalePalette, DashType, Fill, Font, Line, LineShape, Marker, Mode, Title,
99
};
1010
use plotly::layout::{Axis, BarMode, Layout, Legend, TicksDirection};
11-
use plotly::{Bar, NamedColor, Plot, Rgb, Rgba, Scatter};
11+
use plotly::{Bar, color::{NamedColor, Rgb, Rgba}, Plot, Scatter};
1212
use rand_distr::{Distribution, Normal, Uniform};
1313
```
1414

@@ -156,9 +156,9 @@ fn data_labels_hover(show: bool) {
156156
plot.add_trace(trace2);
157157

158158
let layout = Layout::new()
159-
.title(Title::new("Data Labels Hover"))
160-
.x_axis(Axis::new().title(Title::new("x")).range(vec![0.75, 5.25]))
161-
.y_axis(Axis::new().title(Title::new("y")).range(vec![0., 8.]));
159+
.title(Title::with_text("Data Labels Hover"))
160+
.x_axis(Axis::new().title(Title::with_text("x")).range(vec![0.75, 5.25]))
161+
.y_axis(Axis::new().title(Title::with_text("y")).range(vec![0., 8.]));
162162
plot.set_layout(layout);
163163
if show {
164164
plot.show();
@@ -201,7 +201,7 @@ fn data_labels_on_the_plot(show: bool) {
201201
plot.add_trace(trace2);
202202

203203
let layout = Layout::new()
204-
.title(Title::new("Data Labels on the Plot"))
204+
.title(Title::with_text("Data Labels on the Plot"))
205205
.x_axis(Axis::new().range(vec![0.75, 5.25]))
206206
.y_axis(Axis::new().range(vec![0., 8.]));
207207
plot.set_layout(layout);
@@ -295,14 +295,14 @@ fn colored_and_styled_scatter_plot(show: bool) {
295295
.marker(Marker::new().color(Rgb::new(142, 124, 195)).size(12));
296296

297297
let layout = Layout::new()
298-
.title(Title::new("Quarter 1 Growth"))
298+
.title(Title::with_text("Quarter 1 Growth"))
299299
.x_axis(
300300
Axis::new()
301-
.title(Title::new("GDP per Capita"))
301+
.title(Title::with_text("GDP per Capita"))
302302
.show_grid(false)
303303
.zero_line(false),
304304
)
305-
.y_axis(Axis::new().title(Title::new("Percent")).show_line(false));
305+
.y_axis(Axis::new().title(Title::with_text("Percent")).show_line(false));
306306
let mut plot = Plot::new();
307307
plot.add_trace(trace1);
308308
plot.add_trace(trace2);

‎docs/book/src/recipes/financial_charts/time_series_and_date_axes.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn time_series_plot_with_custom_date_range(show: bool) {
2727

2828
let layout = Layout::new()
2929
.x_axis(Axis::new().range(vec!["2016年07月01日", "2016年12月31日"]))
30-
.title(Title::new("Manually Set Date Range"));
30+
.title(Title::with_text("Manually Set Date Range"));
3131
plot.set_layout(layout);
3232

3333
if show {
@@ -68,7 +68,7 @@ fn time_series_with_range_slider(show: bool) {
6868

6969
let layout = Layout::new()
7070
.x_axis(Axis::new().range_slider(RangeSlider::new().visible(true)))
71-
.title(Title::new("Manually Set Date Range"));
71+
.title(Title::with_text("Manually Set Date Range"));
7272
plot.set_layout(layout);
7373

7474
if show {

‎docs/book/src/recipes/scientific_charts/contour_plots.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn colorscale_for_contour_plot(show: bool) {
7272
];
7373
let trace = Contour::new_z(z).color_scale(ColorScale::Palette(ColorScalePalette::Jet));
7474

75-
let layout = Layout::new().title(Title::new("Colorscale for Contour Plot"));
75+
let layout = Layout::new().title(Title::with_text("Colorscale for Contour Plot"));
7676
let mut plot = Plot::new();
7777
plot.set_layout(layout);
7878
plot.add_trace(trace);
@@ -115,7 +115,7 @@ fn customizing_size_and_range_of_a_contour_plots_contours(show: bool) {
115115
.auto_contour(false)
116116
.contours(Contours::new().start(0.0).end(8.0).size(2));
117117

118-
let layout = Layout::new().title(Title::new("Customizing Size and Range of Contours"));
118+
let layout = Layout::new().title(Title::with_text("Customizing Size and Range of Contours"));
119119
let mut plot = Plot::new();
120120
plot.set_layout(layout);
121121
plot.add_trace(trace);
@@ -161,7 +161,7 @@ fn customizing_spacing_between_x_and_y_ticks(show: bool) {
161161
.dy(10.0)
162162
.y0(10.0);
163163

164-
let layout = Layout::new().title(Title::new("Customizing Size and Range of Contours"));
164+
let layout = Layout::new().title(Title::with_text("Customizing Size and Range of Contours"));
165165
let mut plot = Plot::new();
166166
plot.set_layout(layout);
167167
plot.add_trace(trace);

‎docs/book/src/recipes/statistical_charts/box_plots.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use plotly::box_plot::{BoxMean, BoxPoints};
88
use plotly::common::{ErrorData, ErrorType, Line, Marker, Mode, Orientation, Title};
99
use plotly::histogram::{Bins, Cumulative, HistFunc, HistNorm};
1010
use plotly::layout::{Axis, BarMode, BoxMode, Layout, Margin};
11-
use plotly::{Bar, BoxPlot, Histogram, NamedColor, Plot, Rgb, Rgba, Scatter};
11+
use plotly::{Bar, BoxPlot, Histogram, color::{NamedColor, Rgb, Rgba}, Scatter};
1212
use rand_distr::{Distribution, Normal, Uniform};
1313

1414
```
@@ -156,7 +156,7 @@ fn grouped_box_plot(show: bool) {
156156
let layout = Layout::new()
157157
.y_axis(
158158
Axis::new()
159-
.title(Title::new("normalized moisture"))
159+
.title(Title::with_text("normalized moisture"))
160160
.zero_line(false),
161161
)
162162
.box_mode(BoxMode::Group);
@@ -222,7 +222,7 @@ fn box_plot_styling_outliers(show: bool) {
222222
.marker(Marker::new().color(Rgb::new(107, 174, 214)))
223223
.box_points(BoxPoints::Outliers);
224224

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

227227
let mut plot = Plot::new();
228228
plot.set_layout(layout);
@@ -272,7 +272,7 @@ fn box_plot_styling_mean_and_standard_deviation(show: bool) {
272272
.name("Mean and Standard Deviation")
273273
.marker(Marker::new().color(Rgb::new(8, 81, 156)))
274274
.box_mean(BoxMean::StandardDeviation);
275-
let layout = Layout::new().title(Title::new("Box Plot Styling Mean and Standard Deviation"));
275+
let layout = Layout::new().title(Title::with_text("Box Plot Styling Mean and Standard Deviation"));
276276

277277
let mut plot = Plot::new();
278278
plot.set_layout(layout);
@@ -341,10 +341,10 @@ fn grouped_horizontal_box_plot(show: bool) {
341341
plot.add_trace(trace3);
342342

343343
let layout = Layout::new()
344-
.title(Title::new("Grouped Horizontal Box Plot"))
344+
.title(Title::with_text("Grouped Horizontal Box Plot"))
345345
.x_axis(
346346
Axis::new()
347-
.title(Title::new("normalized moisture"))
347+
.title(Title::with_text("normalized moisture"))
348348
.zero_line(false),
349349
)
350350
.box_mode(BoxMode::Group);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /