Skip to content

Commit 7aecfa7

Browse files
authored
Merge pull request #255 from Nick-Pearson/general-book-improvements
Fix broken links and incorrect graphs in book
2 parents 5f79fad + 5dd45ac commit 7aecfa7

File tree

6 files changed

+21
-10
lines changed

6 files changed

+21
-10
lines changed

Diff for: .github/workflows/book.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- run: cargo install mdbook
18+
- run: cargo install mdbook --no-default-features --features search --vers "^0.4" --locked --quiet
1919
- name: Build examples
2020
run: |
2121
cd ${{ github.workspace }}/examples/basic_charts && cargo run
@@ -40,5 +40,9 @@ jobs:
4040
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
4141
4242
git add content
43-
git commit --allow-empty -m 'Deploy to GitHub Pages'
43+
if [ "${{ github.ref_type }}" == "tag" ]; then
44+
git commit --allow-empty -m "update book for release ${{ github.ref }}"
45+
else
46+
git commit --allow-empty -m 'update book from commit ${{ github.sha }}'
47+
fi
4448
git push origin gh-pages

Diff for: docs/book/src/fundamentals/ndarray_support.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This extends the [Plotly.rs](https://github.com/plotly/plotly.rs) API in two way
1010
* `Scatter` traces can now be created using the `Scatter::from_ndarray` constructor,
1111
* and also multiple traces can be created with the `Scatter::to_traces` method.
1212

13-
The full source code for the examples below can be found [here](https://github.com/plotly/plotly.rs/tree/main/examples/ndarray_support).
13+
The full source code for the examples below can be found [here](https://github.com/plotly/plotly.rs/tree/main/examples/ndarray).
1414

1515
## `ndarray` Traces
1616

Diff for: docs/book/src/getting_started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ plot.show_image(ImageFormat::PNG, 1280, 900);
8383

8484
will display in the browser the rasterised plot; 1280 pixels wide and 900 pixels tall, in png format.
8585

86-
Once a satisfactory result is achieved, and assuming the [`kaleido`](getting_started#saving-plots) feature is enabled, the plot can be saved using the following:
86+
Once a satisfactory result is achieved, and assuming the [`kaleido`](#saving-plots) feature is enabled, the plot can be saved using the following:
8787

8888
```rust
8989
plot.write_image("/home/user/plot_name.ext", ImageFormat::PNG, 1280, 900, 1.0);

Diff for: docs/book/src/plotly_rs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ Contributions are always welcomed, no matter how large or small. Refer to the [c
3333

3434
Plotly.rs is distributed under the terms of the MIT license.
3535

36-
See [LICENSE-MIT](https://github.com/plotly/plotly.rs/tree/main/LICENSE-MIT), and [COPYRIGHT](https://github.com/plotly/plotly.rs/tree/main/COPYRIGHT) for details.
36+
See [LICENSE](https://github.com/plotly/plotly.rs/tree/main/LICENSE)

Diff for: docs/book/src/recipes/3dcharts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 3D Charts
22

3-
The complete source code for the following examples can also be found [here](https://github.com/plotly/plotly.rs/tree/main/examples/plot3d).
3+
The complete source code for the following examples can also be found [here](https://github.com/plotly/plotly.rs/tree/main/examples/3d_charts).
44

55
Kind | Link
66
:---|:----:

Diff for: examples/statistical_charts/src/main.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,19 @@ fn box_plot_that_displays_the_underlying_data(show: bool) -> Plot {
214214

215215
// ANCHOR: horizontal_box_plot
216216
fn horizontal_box_plot(show: bool) -> Plot {
217-
let trace1 = BoxPlot::new(vec![1, 2, 3, 4, 4, 4, 8, 9, 10]).name("Set 1");
218-
let trace2 = BoxPlot::new(vec![2, 3, 3, 3, 3, 5, 6, 6, 7]).name("Set 2");
217+
let x = vec![
218+
"Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 2",
219+
"Set 2", "Set 2", "Set 2", "Set 2", "Set 2", "Set 2", "Set 2", "Set 2",
220+
];
221+
222+
let trace = BoxPlot::new_xy(
223+
vec![1, 2, 3, 4, 4, 4, 8, 9, 10, 2, 3, 3, 3, 3, 5, 6, 6, 7],
224+
x.clone(),
225+
)
226+
.orientation(Orientation::Horizontal);
219227

220228
let mut plot = Plot::new();
221-
plot.add_trace(trace1);
222-
plot.add_trace(trace2);
229+
plot.add_trace(trace);
223230

224231
if show {
225232
plot.show();

0 commit comments

Comments
 (0)