Skip to content

Commit

Permalink
Merge branch 'main' into kobutri-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-ng committed Jun 12, 2024
2 parents 2253c14 + c642253 commit 4fc3a32
Show file tree
Hide file tree
Showing 39 changed files with 408 additions and 155 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2

updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: daily
40 changes: 28 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI
on:
workflow_dispatch:
pull_request:
branches: [ master ]
branches: [ main ]
push:
branches: [ master ]
branches: [ main ]

# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
Expand All @@ -21,18 +21,18 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all -- --check
- run: cd ${{ github.workspace }}/examples && cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
Expand All @@ -46,6 +46,20 @@ jobs:
# lint the wasm examples
- run: cd ${{ github.workspace }}/examples && cargo clippy --target wasm32-unknown-unknown --package "wasm*"

semver:
name: semver
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
package: plotly
feature-group: only-explicit-features
features: kaleido
rust-toolchain: stable
release-type: minor

test:
name: Tests
strategy:
Expand All @@ -54,23 +68,25 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --features plotly_ndarray,plotly_image,kaleido

- if: ${{ matrix.os == 'windows-latest' }}
run: gci -recurse -filter "*example*"

code-coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@cargo-llvm-cov
# we are skipping anything to do with wasm here
- run: cargo llvm-cov --workspace --features plotly_ndarray,plotly_image,kaleido --lcov --output-path lcov.info
- uses: codecov/codecov-action@v3

build_examples:
name: Build Examples
strategy:
Expand All @@ -91,10 +107,10 @@ jobs:
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cd ${{ github.workspace }}/examples/${{ matrix.example }} && cargo build

build_wasm_examples:
name: Build Wasm Examples
strategy:
Expand All @@ -103,7 +119,7 @@ jobs:
example: [wasm-yew-minimal]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Deploy to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo login ${{ env.CRATES_IO_TOKEN }}
env:
Expand Down
40 changes: 21 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,38 @@ All notable changes to this project will be documented in this file.

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).

## [0.8.5] - 2023-xx-xx
## [0.8.5] - 2024-xx-xx
### Added
- [[#153](https://github.com/igiagkiozis/plotly/pull/153)] Added `LayoutScene`
- [[#181](https://github.com/plotly/plotly,rs/pull/181)] Fix compilation error when mixing the crate with `askama/with-axum` by adding `with-axum` feature.
- [[#180](https://github.com/plotly/plotly.rs/pull/180)] Add setter for `Mapbox::domain`.
- [[#163](https://github.com/plotly/plotly.rs/pull/163)] Added `DensityMapbox`.
- [[#153](https://github.com/plotly/plotly.rs/pull/153)] Added `LayoutScene`.

## [0.8.4] - 2023-07-09
### Added
- [[#143](https://github.com/igiagkiozis/plotly/pull/143)] Widen version range of `askama`.
- [[#143](https://github.com/plotly/plotly.rs/pull/143)] Widen version range of `askama`.

### Fixed
- [[#129](https://github.com/igiagkiozis/plotly/pull/129)] Fix issue for plots not showing in browser in Windows. Thanks to [@juanespj](https://github.com/juanespj) and [@M-NK-Y](https://github.com/M-NK-Y) for the PRs.
- [[#147](https://github.com/igiagkiozis/plotly/pull/147)] Update documentation for `jupyter notebook` example.
- [[#129](https://github.com/plotly/plotly.rs/pull/129)] Fix issue for plots not showing in browser in Windows. Thanks to [@juanespj](https://github.com/juanespj) and [@M-NK-Y](https://github.com/M-NK-Y) for the PRs.
- [[#147](https://github.com/plotly/plotly.rs/pull/147)] Update documentation for `jupyter notebook` example.

## [0.8.3] - 2022-11-04
### Fixed
- [[#122](https://github.com/igiagkiozis/plotly/pull/122)] Compilation error for the `wasm` feature.
- [[#123](https://github.com/igiagkiozis/plotly/pull/123)] Compilation error for the `plotly_kaleido` feature.
- [[#122](https://github.com/plotly/plotly.rs/pull/122)] Compilation error for the `wasm` feature.
- [[#123](https://github.com/plotly/plotly.rs/pull/123)] Compilation error for the `plotly_kaleido` feature.

## [0.8.2] - 2022-11-03
### Added
- [[#110](https://github.com/igiagkiozis/plotly/pull/110)] `LegendGroupTitle` to existing traces.
- [[#88](https://github.com/igiagkiozis/plotly/pull/88)] `Mesh3D`, `Image`, `ScatterMapbox` traces.
- [[#110](https://github.com/plotly/plotly.rs/pull/110)] `LegendGroupTitle` to existing traces.
- [[#88](https://github.com/plotly/plotly.rs/pull/88)] `Mesh3D`, `Image`, `ScatterMapbox` traces.

### Changed
- [[#113](https://github.com/igiagkiozis/plotly/pull/113)] Refactored the structure of the examples to make them more accessible, whilst adding more examples e.g. for `wasm`.
- [[#115](https://github.com/igiagkiozis/plotly/pull/115)] Simplify the function signature of Plot.to_inline_html() so that it just takes `Option<&str>` as an argument.
- [[#113](https://github.com/plotly/plotly.rs/pull/113)] Refactored the structure of the examples to make them more accessible, whilst adding more examples e.g. for `wasm`.
- [[#115](https://github.com/plotly/plotly.rs/pull/115)] Simplify the function signature of Plot.to_inline_html() so that it just takes `Option<&str>` as an argument.

## [0.8.1] - 2022-09-25
### Added
- Button support (i.e. [updatemenus](https://plotly.com/javascript/reference/layout/updatemenus/)) contibuted by [@sreenathkrishnan](https://github.com/sreenathkrishnan). Details and examples in this well written PR [#99](https://github.com/igiagkiozis/plotly/pull/99).
- Button support (i.e. [updatemenus](https://plotly.com/javascript/reference/layout/updatemenus/)) contibuted by [@sreenathkrishnan](https://github.com/sreenathkrishnan). Details and examples in this well written PR [#99](https://github.com/plotly/plotly.rs/pull/99).
- Internally, there is now a `plotly-derive` crate which defines a `FieldSetter` procedural macro. This massively cuts down the amount of code duplication by generating the setter methods based on the struct fields. Again thanks to @sreenathkrishnan for this effort.

## [0.8.0] - 2022-08-26
Expand All @@ -46,8 +49,7 @@ Version 0.8.0 represents a significant release which refactors a lot of the code
- Support for `Sankey` diagrams
- Support for `Plot3D` - 3D plots for scatter, line and surface data
### Changed
- Improve implementation of `private::NumOrString` to support more primitive types ([Issue
#47](https://github.com/igiagkiozis/plotly/issues/47))
- Improve implementation of `private::NumOrString` to support more primitive types ([Issue #47](https://github.com/plotly/plotly.rs/issues/47))
- Remove `private::TruthyEnum` in favour of a more robust way of serializing to `String` or `bool`
- Refactor `Color` module
- Refactored HTML templates with cleaner Javascript code
Expand All @@ -57,7 +59,7 @@ Version 0.8.0 represents a significant release which refactors a lot of the code
- `Plot::to_html()` now has similar behaviour to `Plot::to_inline_html()` and just returns a `String`
### Fixed
- Typos in `CONTRIBUTING.md`
- Serialization of `plotly_kaleido::PlotData` ([Issue #50](https://github.com/igiagkiozis/plotly/issues/50))
- Serialization of `plotly_kaleido::PlotData` ([Issue #50](https://github.com/plotly/plotly.rs/issues/50))
### Updated
- `ndarray` to `0.15.4`.
- `serde` to `1.0.132`.
Expand Down Expand Up @@ -85,11 +87,11 @@ Version 0.8.0 represents a significant release which refactors a lot of the code

## [0.6.0] - 2020-07-25
### Added
- Shapes support ([documentation](https://igiagkiozis.github.io/plotly/content/fundamentals/shapes.html)).
- Shapes support ([documentation](https://plotly.github.io/plotly.rs/content/fundamentals/shapes.html)).
- Annotations support.
- Docstrings to `Scatter`.
- `ndarray` support ([documentation](https://igiagkiozis.github.io/plotly/content/fundamentals/ndarray_support.html)).
- Jupyter lab and notebook support ([documentation](https://igiagkiozis.github.io/plotly/content/fundamentals/jupyter_support.html)).
- `ndarray` support ([documentation](https://plotly.github.io/plotly.rs/content/fundamentals/ndarray_support.html)).
- Jupyter lab and notebook support ([documentation](https://plotly.github.io/plotly.rs/content/fundamentals/jupyter_support.html)).
### Changed
- Removed `num` dependence.
- Removed `plotly_orca` and the `orca` feature. Use the `kaleido` feature for static image generation.
Expand All @@ -107,7 +109,7 @@ Version 0.8.0 represents a significant release which refactors a lot of the code

## [0.5.0] - 2020-07-12
### Added
- [Plotly.rs Book](https://igiagkiozis.github.io/plotly/).
- [Plotly.rs Book](https://plotly.github.io/plotly.rs/).
- Using plotly.js from the official CDN is now the default. To use the local version use the `Plot::use_local_plotly` method.
- Plot rasterization to `png`, `jpg`, `eps`, `pdf`, `webp` and `svg` using [plotly/Kaleido](https://github.com/plotly/Kaleido), enabled using the `kaleido` feature.
- Multi-axis support and examples.
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ When making a feature request, please make it clear what problem you intend to s

## Pull Requests

Before spending time and effort in making changes to the library, it's a good idea to discuss it first on the issue tracker to see whether your change is likely to be accepted.
Before spending time and effort in making changes to the library, it's a good idea to discuss it first on the issue tracker to see whether your change is likely to be accepted.

Fork [plotly](https://igiagkiozis.github.io/plotly/) to your own account and create a new branch for your feature. Remember to update the [changelog](CHANGELOG.md) - use previous entries as a template.
Fork [plotly](https://github.com/plotly/plotly.rs.git) to your own account and create a new branch for your feature. Remember to update the [changelog](CHANGELOG.md) - use previous entries as a template.

When your contribution is ready for review, make a pull request with your changes directly to the `master` branch. One of the maintainers will have a look at what you've done, suggest any necessary changes and, when everyone is happy, merge the pull request.
When your contribution is ready for review, make a pull request with your changes directly to the `main` branch. One of the maintainers will have a look at what you've done, suggest any necessary changes and, when everyone is happy, merge the pull request.

## Code of Conduct

Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<h1>Plotly.rs</h1>
<p><strong>Plotly for Rust</strong></p>
<p>
<a href="https://github.com/igiagkiozis/plotly/actions?query=branch%3Amaster" style="text-decoration: none!important;">
<img src="https://img.shields.io/github/actions/workflow/status/igiagkiozis/plotly/ci.yml?branch=master" alt="Build status">
<a href="https://github.com/plotly/plotly.rs/actions?query=branch%3Amain" style="text-decoration: none!important;">
<img src="https://img.shields.io/github/actions/workflow/status/plotly/plotly.rs/ci.yml?branch=main" alt="Build status">
</a>
<a href="https://crates.io/crates/plotly" style="text-decoration: none!important;">
<img src="https://img.shields.io/crates/v/plotly.svg" alt="Crates.io">
Expand All @@ -14,18 +14,18 @@
<a href="https://docs.rs/plotly" style="text-decoration: none!important;">
<img src="https://img.shields.io/badge/docs.rs-plotly-green" alt="Documentation">
</a>
<a href="https://app.codecov.io/github/igiagkiozis/plotly" style="text-decoration: none!important;">
<a href="https://app.codecov.io/github/plotly/plotly.rs" style="text-decoration: none!important;">
<img src="https://img.shields.io/codecov/c/github/igiagkiozis/plotly" alt="Code coverage">
</a>
</p>
<h4>
<a href="https://igiagkiozis.github.io/plotly/content/getting_started.html">Getting Started</a>
<a href="https://plotly.github.io/plotly.rs/content/getting_started.html">Getting Started</a>
<span> | </span>
<a href="https://igiagkiozis.github.io/plotly/content/recipes.html">Recipes</a>
<a href="https://plotly.github.io/plotly.rs/content/recipes.html">Recipes</a>
<span> | </span>
<a href="https://docs.rs/crate/plotly/">API Docs</a>
<span> | </span>
<a href="https://github.com/igiagkiozis/plotly/blob/master/CHANGELOG.md">Changelog</a>
<a href="https://github.com/plotly/plotly.rs/tree/main/CHANGELOG.md">Changelog</a>
</h4>
</div>

Expand All @@ -44,10 +44,10 @@

A plotting library for Rust powered by [Plotly.js](https://plot.ly/javascript/).

Documentation and numerous interactive examples are available in the [Plotly.rs Book](https://igiagkiozis.github.io/plotly/content/getting_started.html), the [examples/](https://github.com/igiagkiozis/plotly/tree/master/examples) directory and [docs.rs](https://docs.rs/crate/plotly).
Documentation and numerous interactive examples are available in the [Plotly.rs Book](https://plotly.github.io/plotly.rs/content/getting_started.html), the [examples/](https://github.com/plotly/plotly.rs/tree/main/examples) directory and [docs.rs](https://docs.rs/crate/plotly).


For changes since the last version, please consult the [changelog](https://github.com/igiagkiozis/plotly/blob/master/CHANGELOG.md).
For changes since the last version, please consult the [changelog](https://github.com/plotly/plotly.rs/tree/main/CHANGELOG.md).

# Basic Usage

Expand Down Expand Up @@ -163,21 +163,21 @@ pub fn plot_component() -> Html {
}
});


use_effect_with_deps(move |_| {
p.run();
|| ()
}, (),
);


html! {
<div id="plot-div"></div>
}
}
```

More detailed standalone examples can be found in the [examples/](https://github.com/igiagkiozis/plotly/tree/master/examples) directory.
More detailed standalone examples can be found in the [examples/](https://github.com/plotly/plotly.rs/tree/main/examples) directory.

# Crate Feature Flags

Expand All @@ -201,12 +201,12 @@ Enables compilation for the `wasm32-unknown-unknown` target and provides access

# Contributing

* If you've spotted a bug or would like to see a new feature, please submit an issue on the [issue tracker](https://github.com/igiagkiozis/plotly/issues).
* If you've spotted a bug or would like to see a new feature, please submit an issue on the [issue tracker](https://github.com/plotly/plotly.rs/issues).

* Pull requests are welcome, see the [contributing guide](https://github.com/igiagkiozis/plotly/blob/master/CONTRIBUTING.md) for more information.
* Pull requests are welcome, see the [contributing guide](https://github.com/plotly/plotly.rs/tree/main/CONTRIBUTING.md) for more information.

# License

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

See [LICENSE-MIT](https://github.com/igiagkiozis/plotly/blob/master/LICENSE-MIT), and [COPYRIGHT](https://github.com/igiagkiozis/plotly/blob/master/COPYRIGHT) for details.
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.
10 changes: 5 additions & 5 deletions docs/book/src/fundamentals.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div align="center">
<a href="https://github.com/igiagkiozis/plotly/tree/master">
<img src="https://img.shields.io/badge/Plotly.rs-master-brightgreen" alt="build status">
<a href="https://github.com/plotly/plotly.rs/tree/main">
<img src="https://img.shields.io/badge/Plotly.rs-main-brightgreen" alt="build status">
</a>
<a href="https://github.com/igiagkiozis/plotly/actions">
<img src="https://github.com/igiagkiozis/plotly/workflows/build/badge.svg" alt="build status">
<a href="https://github.com/plotly/plotly.rs/actions?query=branch%3Amain" style="text-decoration: none!important;">
<img src="https://img.shields.io/github/actions/workflow/status/plotly/plotly.rs/ci.yml?branch=main" alt="Build status">
</a>
<a href="https://crates.io/crates/plotly">
<img src="https://img.shields.io/crates/v/plotly.svg" alt="Crates.io">
Expand All @@ -18,4 +18,4 @@

# Fundamentals

Functionality that applies to the library as a whole is described in the next sections.
Functionality that applies to the library as a whole is described in the next sections.
Loading

0 comments on commit 4fc3a32

Please sign in to comment.