Skip to content

Commit 29d16fa

Browse files
mfreebornIoannis Giagkiozismrhrzg
authored
v0.8.0 (#98)
* Update dependencies * Improve NumOrString (#76) * reimplement NumOrString + tests * changelog * Fix contributing typos (#77) * fix typos * update changelog * Fix Visible enum implementation (#70) * implement proper Visible enum * fix implementation and add tests * improve test * remove TruthyEnum * update changelog * add PartialEq impl and tests (#61) * add PartialEq impl and tests * impl clone with test * add Clone derives * update changelog * Add support for the majority of config options (#65) * add support for the majority of config options * fix enum serialization representations * add DoubleClick enum * refine options * doc fix * add tests * fix dependencies * update changelog * add setter for `Plot.configuration` * impl Serialize for Plot (#68) * impl Serialize for Plot * serialize Traces/Layout separately * improve tests * refactor template rendering with serializable plot * add to doctest to prove html tags aren't escaped * update changelog * add getter for `Plot.configuration` * Add support for layout templates (#62) * add LayoutTemplate struct * add constructor for Template * add test * WIP * support static predefined themes * implement plotly_dark layout template * make theme public * fix colorbar recursive Default impl * fix incorrect rename for Marker.size_mode * make Layout::template() method generic * add plotly_white and default (empty) themes * fix dependencies * update changelog * Serialize plotly_kaleido::PlotData correctly (#75) * impl Serialize for Plot * serialize Traces/Layout separately * improve tests * refactor template rendering with serializable plot * add to doctest to prove html tags aren't escaped * serialize PlotData * serialize PlotData * update changelog * Support wasm (#59) * builds for wasm-unknown-unknown * add wasm feature to readme * update conditional compilation derives * add bindings to plotly.js newPlot() and react() * add helper function Plot::to_js_object() * fix imports * update changelog * update workflows for new feature * fix conditional imports * update readme * fix variable interpolation (#78) * Add tests (#74) * partial test coverage of common/mod.rs * finish tests for common.rs * start layout tests * finish tests for enums * just a few more structs to go for layout... * more tests * make tests pass * update changelog * Support Sankey Diagrams (#69) * working basic example * fix examples * implement the rest of sankey * fix Domain * improve test * add sankey tests * add test for Domain * fix tests * add Sankey to book * Impl clone for colors (#79) * add Clone/Copy derives * update changelog * Update plotly js (#80) * update plotly and mathjax deps * fix imports + typo * update changelog * Add tests for layout module (#81) * add tests for bar trace (#82) * Fix stack overflow in layout tests (#83) * box some layout struct fields * undo method signature changes * Fix unused Dependencies warning with proper feature gating #84 * Tidy up folder structure (#85) * reconfigure folder structure * disambiguate import and fix feature gating * Refactor Color trait and apply throughout codebase (#87) * Add Scatter3d support (#66) * scatter 3D plot example running * added 3D line plot and examples for 3d line plot and surface plot * fixes and cleanup * adjusted CHANGELOG.md * adjusted CHANGELOG.md * remove unintentionally included test output file * fix merge * tweak examples * derive Default and sort imports * fix feature-gated import * add tests * update book * fix examples * add plot3d examples to ci * update book * fix newest book examples Co-authored-by: Michael Freeborn <[email protected]> * Align API for saving/showing plots more closely with plotly.py (#89) * reconfigure API for saving/showing plots * update changelog * update book introduction with new api * add rustfmt step to ci (#90) * add wasm example to book (#91) * Add serde_with::skip_serializing_none macro (#94) * add serde_with dependency * apply skip_serializing_none macro * finish applying skip_if_none macro * fix typo * fix typo * clippy lints (#95) * add tests (#96) * add tests * add tests * prepare v0.8.0 (#97) Co-authored-by: Ioannis Giagkiozis <[email protected]> Co-authored-by: Mario Herzog <[email protected]>
1 parent b8144ad commit 29d16fa

Some content is hidden

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

69 files changed

+14296
-7223
lines changed

.github/workflows/dev_ci.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,26 @@ jobs:
1717
- uses: actions/checkout@v2
1818
- name: build_linux
1919
run: cargo build --all-features --verbose --release
20+
- name: rustfmt
21+
run: cargo fmt --all -- --check
2022
- name: Run tests
21-
run: cargo test --all-features --release --verbose
23+
run: cargo test --features plotly_ndarray,kaleido --release --verbose
2224
- name: Run basic charts
23-
run: cargo run --example basic_charts --all-features --release
25+
run: cargo run --example basic_charts --release
2426
- name: Run financial charts
25-
run: cargo run --example financial_charts --all-features --release
27+
run: cargo run --example financial_charts --release
2628
- name: Run fundamentals
27-
run: cargo run --example fundamentals --all-features --release
29+
run: cargo run --example fundamentals --release
2830
- name: Run ndarray support
29-
run: cargo run --example ndarray_support --all-features --release
31+
run: cargo run --example ndarray_support --features plotly_ndarray --release
3032
- name: Run scientific charts
31-
run: cargo run --example scientific_charts --all-features --release
33+
run: cargo run --example scientific_charts --release
3234
- name: Run statistical charts
33-
run: cargo run --example statistical_charts --all-features --release
35+
run: cargo run --example statistical_charts --release
3436
- name: Run subplots
35-
run: cargo run --example subplots --all-features --release
37+
run: cargo run --example subplots --release
38+
- name: Run 3D plots
39+
run: cargo run --example plot3d --release
3640

3741
build_windows:
3842
runs-on: windows-latest
@@ -42,21 +46,23 @@ jobs:
4246
- name: build_windows
4347
run: cargo build --all-features --verbose --release
4448
- name: Run tests
45-
run: cargo test --all-features --release --verbose
49+
run: cargo test --features plotly_ndarray,kaleido --release --verbose
4650
- name: Run basic charts
47-
run: cargo run --example basic_charts --all-features --release
51+
run: cargo run --example basic_charts --release
4852
- name: Run financial charts
49-
run: cargo run --example financial_charts --all-features --release
53+
run: cargo run --example financial_charts --release
5054
- name: Run fundamentals
51-
run: cargo run --example fundamentals --all-features --release
55+
run: cargo run --example fundamentals --release
5256
- name: Run ndarray support
53-
run: cargo run --example ndarray_support --all-features --release
57+
run: cargo run --example ndarray_support --features plotly_ndarray --release
5458
- name: Run scientific charts
55-
run: cargo run --example scientific_charts --all-features --release
59+
run: cargo run --example scientific_charts --release
5660
- name: Run statistical charts
57-
run: cargo run --example statistical_charts --all-features --release
61+
run: cargo run --example statistical_charts --release
5862
- name: Run subplots
59-
run: cargo run --example subplots --all-features --release
63+
run: cargo run --example subplots --release
64+
- name: Run 3D plots
65+
run: cargo run --example plot3d --release
6066

6167
build_macos:
6268
runs-on: macos-latest
@@ -66,18 +72,20 @@ jobs:
6672
- name: build_macos
6773
run: cargo build --all-features --verbose --release
6874
- name: Run tests
69-
run: cargo test --all-features --release --verbose
75+
run: cargo test --features plotly_ndarray,kaleido --release --verbose
7076
- name: Run basic charts
71-
run: cargo run --example basic_charts --all-features --release
77+
run: cargo run --example basic_charts --release
7278
- name: Run financial charts
73-
run: cargo run --example financial_charts --all-features --release
79+
run: cargo run --example financial_charts --release
7480
- name: Run fundamentals
75-
run: cargo run --example fundamentals --all-features --release
81+
run: cargo run --example fundamentals --release
7682
- name: Run ndarray support
77-
run: cargo run --example ndarray_support --all-features --release
83+
run: cargo run --example ndarray_support --features plotly_ndarray --release
7884
- name: Run scientific charts
79-
run: cargo run --example scientific_charts --all-features --release
85+
run: cargo run --example scientific_charts --release
8086
- name: Run statistical charts
81-
run: cargo run --example statistical_charts --all-features --release
87+
run: cargo run --example statistical_charts --release
8288
- name: Run subplots
83-
run: cargo run --example subplots --all-features --release
89+
run: cargo run --example subplots --release
90+
- name: Run 3D plots
91+
run: cargo run --example plot3d --release

.github/workflows/release_ci.yml

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,70 +14,78 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
18-
- name: build_linux
19-
run: cargo build --all-features --verbose
20-
- name: Run tests
21-
run: cargo test --all-features --release --verbose
22-
- name: Run basic charts
23-
run: cargo run --example basic_charts --all-features --release
24-
- name: Run financial charts
25-
run: cargo run --example financial_charts --all-features --release
26-
- name: Run fundamentals
27-
run: cargo run --example fundamentals --all-features --release
28-
- name: Run ndarray support
29-
run: cargo run --example ndarray_support --all-features --release
30-
- name: Run scientific charts
31-
run: cargo run --example scientific_charts --all-features --release
32-
- name: Run statistical charts
33-
run: cargo run --example statistical_charts --all-features --release
34-
- name: Run subplots
35-
run: cargo run --example subplots --all-features --release
17+
- uses: actions/checkout@v2
18+
- name: build_linux
19+
run: cargo build --all-features --verbose --release
20+
- name: rustfmt
21+
run: cargo fmt --all -- --check
22+
- name: Run tests
23+
run: cargo test --features plotly_ndarray,kaleido --release --verbose
24+
- name: Run basic charts
25+
run: cargo run --example basic_charts --release
26+
- name: Run financial charts
27+
run: cargo run --example financial_charts --release
28+
- name: Run fundamentals
29+
run: cargo run --example fundamentals --release
30+
- name: Run ndarray support
31+
run: cargo run --example ndarray_support --features plotly_ndarray --release
32+
- name: Run scientific charts
33+
run: cargo run --example scientific_charts --release
34+
- name: Run statistical charts
35+
run: cargo run --example statistical_charts --release
36+
- name: Run subplots
37+
run: cargo run --example subplots --release
38+
- name: Run 3D plots
39+
run: cargo run --example plot3d --release
3640

3741
build_windows:
3842
runs-on: windows-latest
3943

4044
steps:
4145
- uses: actions/checkout@v2
4246
- name: build_windows
43-
run: cargo build --all-features --verbose
47+
run: cargo build --all-features --verbose --release
4448
- name: Run tests
45-
run: cargo test --all-features --release --verbose
49+
run: cargo test --features plotly_ndarray,kaleido --release --verbose
4650
- name: Run basic charts
47-
run: cargo run --example basic_charts --all-features --release
51+
run: cargo run --example basic_charts --release
4852
- name: Run financial charts
49-
run: cargo run --example financial_charts --all-features --release
53+
run: cargo run --example financial_charts --release
5054
- name: Run fundamentals
51-
run: cargo run --example fundamentals --all-features --release
55+
run: cargo run --example fundamentals --release
5256
- name: Run ndarray support
53-
run: cargo run --example ndarray_support --all-features --release
57+
run: cargo run --example ndarray_support --features plotly_ndarray --release
5458
- name: Run scientific charts
55-
run: cargo run --example scientific_charts --all-features --release
59+
run: cargo run --example scientific_charts --release
5660
- name: Run statistical charts
57-
run: cargo run --example statistical_charts --all-features --release
61+
run: cargo run --example statistical_charts --release
5862
- name: Run subplots
59-
run: cargo run --example subplots --all-features --release
63+
run: cargo run --example subplots --release
64+
- name: Run 3D plots
65+
run: cargo run --example plot3d --release
6066

6167
build_macos:
6268
runs-on: macos-latest
6369

6470
steps:
6571
- uses: actions/checkout@v2
6672
- name: build_macos
67-
run: cargo build --all-features --verbose
73+
run: cargo build --all-features --verbose --release
6874
- name: Run tests
69-
run: cargo test --all-features --release --verbose
75+
run: cargo test --features plotly_ndarray,kaleido --release --verbose
7076
- name: Run basic charts
71-
run: cargo run --example basic_charts --all-features --release
77+
run: cargo run --example basic_charts --release
7278
- name: Run financial charts
73-
run: cargo run --example financial_charts --all-features --release
79+
run: cargo run --example financial_charts --release
7480
- name: Run fundamentals
75-
run: cargo run --example fundamentals --all-features --release
81+
run: cargo run --example fundamentals --release
7682
- name: Run ndarray support
77-
run: cargo run --example ndarray_support --all-features --release
83+
run: cargo run --example ndarray_support --features plotly_ndarray --release
7884
- name: Run scientific charts
79-
run: cargo run --example scientific_charts --all-features --release
85+
run: cargo run --example scientific_charts --release
8086
- name: Run statistical charts
81-
run: cargo run --example statistical_charts --all-features --release
87+
run: cargo run --example statistical_charts --release
8288
- name: Run subplots
83-
run: cargo run --example subplots --all-features --release
89+
run: cargo run --example subplots --release
90+
- name: Run 3D plots
91+
run: cargo run --example plot3d --release

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ Cargo.lock
44
gh-pages/
55
Untitled*
66
.ipynb_checkpoints/
7-
.DS_Store
7+
.DS_Store
8+
.vscode

CHANGELOG.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,41 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.8.1] - 2022-XX-XX
8+
9+
## [0.8.0] - 2022-08-26
10+
Version 0.8.0 represents a significant release which refactors a lot of the codebase and tries to provide a cleaner API: there are several breaking changes listed below. On the whole, if migrating from v0.7.0, start by following any new compiler errors and, if you're still stuck, open an issue on the issue tracker and we can help out.
11+
### Added
12+
- impl `Clone`, `Serialize` and `PartialEq` for `Plot`
13+
- impl `Clone` +/- `Copy` for color types
14+
- Support for [configuration options](https://plotly.com/javascript/configuration-options/)
15+
- Support for layout templates and pre-defined themes
16+
- Support for WASM environments
17+
- A much enhanced test suite
18+
- Support for `Sankey` diagrams
19+
- Support for `Plot3D` - 3D plots for scatter, line and surface data
20+
### Changed
21+
- Improve implementation of `private::NumOrString` to support more primitive types ([Issue
22+
#47](https://github.com/igiagkiozis/plotly/issues/47))
23+
- Remove `private::TruthyEnum` in favour of a more robust way of serializing to `String` or `bool`
24+
- Refactor `Color` module
25+
- Refactored HTML templates with cleaner Javascript code
26+
- `Plot::save()` is renamed to `Plot::write_image()`
27+
- `Plot::show_{png | jpeg}` is now made generic via the new `Plot::show_image()` across static image formats with the `ImageFormat` enum
28+
- `Plot::write_html()` now takes a filepath and saves the plot to that location
29+
- `Plot::to_html()` now has similar behaviour to `Plot::to_inline_html()` and just returns a `String`
30+
### Fixed
31+
- Typos in `CONTRIBUTING.md`
32+
- Serialization of `plotly_kaleido::PlotData` ([Issue #50](https://github.com/igiagkiozis/plotly/issues/50))
33+
### Updated
34+
- `ndarray` to `0.15.4`.
35+
- `serde` to `1.0.132`.
36+
- `serde_json` to `1.0.73`.
37+
- `askama` to `0.11.0`.
38+
- `rand` to `0.8`.
39+
- `rand_distr` to `0.4`.
40+
- `plotly.js` to `2.12.1`
41+
742
## [0.7.0] - 2022-01-01
843
### Added
944
- `ScatterPolar` contributed by @samlich.
@@ -17,8 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1752

1853
## [0.6.0] - 2021-01-31
1954
### Added
20-
- tag matches for struct Axis : allow for synchronisation between subplots on x-axis
21-
- fn matches in impl of Axis
55+
- tag matches for struct Axis : allow for synchronisation between subplots on x-axis
56+
- fn matches in impl of Axis
2257

2358
## [0.6.0] - 2020-07-25
2459
### Added

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Verifiable example].
1313
[Minimal, Complete, and Verifiable example]: https://stackoverflow.com/help/mcve
1414

1515
When making a feature request, please make it clear what problem you intend to
16-
solve with the feature, any ideas for how Serde could support solving that
16+
solve with the feature, any ideas for how Plotly.rs could support solving that
1717
problem, any possible alternatives, and any disadvantages.
1818

1919
## Process
@@ -27,11 +27,11 @@ appropriately the [change log](CHANGELOG.md).
2727

2828
For change-log updates please use previous entries as reference, namely classify
2929
the nature of the change, e.g. fixed, changed, added etc., and a brief description. The entry in the change-log that should be
30-
used for the update will always be marked with YEAR-XX-XX, e.g. 2020-XX-XX.
30+
used for the update will always be marked with YEAR-XX-XX, e.g. 2022-XX-XX.
3131

3232
Check that the test suite passes locally and that all examples still execute and produce the expected results before submitting a pull request.
3333

34-
Make a pull request with our changes directly to the `dev` branch. Please note, pull requests to the `master` branch will not
34+
Make a pull request with your changes directly to the `dev` branch. Please note, pull requests to the `master` branch will not
3535
be considered. The `master` branch is reserved for release.
3636

3737

@@ -47,4 +47,4 @@ In all forums, we follow the [Rust Code of Conduct]. For escalation or moderatio
4747

4848
## Attribution
4949

50-
Parts of this document are adapted from the [serde](https://github.com/serde-rs/serde) contributing guide.
50+
Parts of this document are adapted from the [serde](https://github.com/serde-rs/serde) contributing guide.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Add this to your `Cargo.toml`:
3939

4040
```toml
4141
[dependencies]
42-
plotly = "0.7.0"
42+
plotly = "0.8.0"
4343
```
4444

4545
Documentation is available in the [Plotly.rs Book](https://igiagkiozis.github.io/plotly/content/getting_started.html) and [Recipes](https://igiagkiozis.github.io/plotly/content/recipes.html).
@@ -55,12 +55,15 @@ The following feature flags are available:
5555
* `plotly_ndarray`
5656
* Optional, compatible with Rust stable.
5757
* Adds support for creating plots directly using [ndarray](https://github.com/rust-ndarray/ndarray) types.
58+
* `wasm`
59+
* Optional, compatible with Rust stable.
60+
* Disables OS-specific functions, therefore allowing compilation in WASM environments. Note that `examples` won't compile when this feature is enabled, as they require OS-specific functions.
5861

5962
Saving to png, jpeg, webp, svg, pdf and eps formats can be made available by enabling the `kaleido` feature:
6063

6164
```toml
6265
[dependencies]
63-
plotly = { version = "0.7.0", features = ["kaleido"] }
66+
plotly = { version = "0.8.0", features = ["kaleido"] }
6467
```
6568
For further details please see [plotly_kaleido](https://github.com/igiagkiozis/plotly/tree/master/plotly_kaleido).
6669

docs/book/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ create-missing = false
1414
default-theme = "Ayu"
1515
mathjax-support = true
1616
additional-css = ["ferris.css"]
17-
additional-js = ["ferris.js", "plotly-2.2.1.min.js"]
17+
additional-js = ["ferris.js", "plotly.min.js"]
1818

1919

2020
[output.html.fold]

docs/book/plotly-2.2.1.min.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

plotly/templates/plotly-2.8.3.min.js renamed to docs/book/plotly.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/book/src/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [Scatter Plots](./recipes/basic_charts/scatter_plots.md)
1212
- [Line Charts](./recipes/basic_charts/line_charts.md)
1313
- [Bar Charts](./recipes/basic_charts/bar_charts.md)
14+
- [Sankey Diagrams](./recipes/basic_charts/sankey_diagrams.md)
1415
- [Statistical Charts](./recipes/statistical_charts.md)
1516
- [Error Bars](./recipes/statistical_charts/error_bars.md)
1617
- [Box Plots](./recipes/statistical_charts/box_plots.md)
@@ -22,6 +23,8 @@
2223
- [Time Series and Date Axes](./recipes/financial_charts/time_series_and_date_axes.md)
2324
- [Candlestick Charts](./recipes/financial_charts/candlestick_charts.md)
2425
- [OHLC Charts](./recipes/financial_charts/ohlc_charts.md)
26+
- [3D Charts](./recipes/3dcharts.md)
27+
- [Scatter 3D](./recipes/3dcharts/3dcharts.md)
2528
- [Subplots](./recipes/subplots.md)
2629
- [Subplots](./recipes/subplots/subplots.md)
2730
- [Multiple Axes](./recipes/subplots/multiple_axes.md)

0 commit comments

Comments
 (0)