Skip to content

Fix broken links and incorrect graphs in book #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo install mdbook
- run: cargo install mdbook --no-default-features --features search --vers "^0.4" --locked --quiet
- name: Build examples
run: |
cd ${{ github.workspace }}/examples/basic_charts && cargo run
Expand All @@ -40,5 +40,9 @@ jobs:
git config --global user.email 'github-actions[bot]@users.noreply.github.com'

git add content
git commit --allow-empty -m 'Deploy to GitHub Pages'
if [ "${{ github.ref_type }}" == "tag" ]; then
git commit --allow-empty -m "update book for release ${{ github.ref }}"
else
git commit --allow-empty -m 'update book from commit ${{ github.sha }}'
fi
git push origin gh-pages
2 changes: 1 addition & 1 deletion docs/book/src/fundamentals/ndarray_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This extends the [Plotly.rs](https://github.com/plotly/plotly.rs) API in two way
* `Scatter` traces can now be created using the `Scatter::from_ndarray` constructor,
* and also multiple traces can be created with the `Scatter::to_traces` method.

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

## `ndarray` Traces

Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ plot.show_image(ImageFormat::PNG, 1280, 900);

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

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:
Once a satisfactory result is achieved, and assuming the [`kaleido`](#saving-plots) feature is enabled, the plot can be saved using the following:

```rust
plot.write_image("/home/user/plot_name.ext", ImageFormat::PNG, 1280, 900, 1.0);
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/plotly_rs.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ Contributions are always welcomed, no matter how large or small. Refer to the [c

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

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.
See [LICENSE](https://github.com/plotly/plotly.rs/tree/main/LICENSE)
2 changes: 1 addition & 1 deletion docs/book/src/recipes/3dcharts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 3D Charts

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

Kind | Link
:---|:----:
Expand Down
15 changes: 11 additions & 4 deletions examples/statistical_charts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,19 @@ fn box_plot_that_displays_the_underlying_data(show: bool) -> Plot {

// ANCHOR: horizontal_box_plot
fn horizontal_box_plot(show: bool) -> Plot {
let trace1 = BoxPlot::new(vec![1, 2, 3, 4, 4, 4, 8, 9, 10]).name("Set 1");
let trace2 = BoxPlot::new(vec![2, 3, 3, 3, 3, 5, 6, 6, 7]).name("Set 2");
let x = vec![
"Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 1", "Set 2",
"Set 2", "Set 2", "Set 2", "Set 2", "Set 2", "Set 2", "Set 2", "Set 2",
];

let trace = BoxPlot::new_xy(
vec![1, 2, 3, 4, 4, 4, 8, 9, 10, 2, 3, 3, 3, 3, 5, 6, 6, 7],
x.clone(),
)
.orientation(Orientation::Horizontal);

let mut plot = Plot::new();
plot.add_trace(trace1);
plot.add_trace(trace2);
plot.add_trace(trace);

if show {
plot.show();
Expand Down
Loading