Skip to content

Commit 416a9c6

Browse files
authored
Merge pull request #38 from kigafarz/dev
add matches to Axis
2 parents 3d06377 + a882ac3 commit 416a9c6

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

CHANGELOG.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ 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.6.0] - 2021-01-31
8+
### Added
9+
- tag matches for struct Axis : allow for synchronisation between subplots on x-axis
10+
- fn matches in impl of Axis
711

812
## [0.6.0] - 2020-xx-xx
913
### Added
@@ -46,7 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4650

4751
## [0.4.1] - 2020-03-26
4852
### Fixed
49-
- Added error message to capture the scenario when there is no default browser (or no browser at all) on a machine.
53+
- Added error message to capture the scenario when there is no default browser (or no browser at all) on a machine.
5054
The message suggests a few alternatives.
5155

5256
## [0.4.0] - 2020-02-27
@@ -66,10 +70,10 @@ The message suggests a few alternatives.
6670
- `TraceSerialize` renamed to `Trace`
6771
- `Plot::show_jpg` renamed to `Plot::show_jpeg` for consistency
6872
- Removed HexColor type. Hex color input is still supported using `String`s or string slices
69-
- Refactored project structure:
73+
- Refactored project structure:
7074
- All plots `Trace`s are now accessible from the main namespace `plotly::`.
7175
- Enums and structs common to more than 1 plot type and/or the `Layout` now live in `plotly::common::`
72-
- Internal methods and structs that are not considered part of the public API are now in `plotly::private::`
76+
- Internal methods and structs that are not considered part of the public API are now in `plotly::private::`
7377

7478
### Fixed
7579
- Color serialization was operating correctly only on Rgb, Rgba and Hex colors ignoring the named colors
@@ -84,7 +88,7 @@ The message suggests a few alternatives.
8488
- Box plot
8589
- Scatter and Box plot with error bars
8690
- Candlestick plot
87-
- OHLC plot
91+
- OHLC plot
8892
- Extended README.md with a few basic examples
8993
- The API is now based on the builder pattern
9094
- Extended color set
@@ -119,4 +123,4 @@ The message suggests a few alternatives.
119123
## [0.1.0] - 2020-01-26
120124
### Added
121125
- Placeholder repository.
122-
- Proof of concept implementation of a scatter plot.
126+
- Proof of concept implementation of a scatter plot.

plotly/src/layout.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,9 @@ pub struct Axis {
736736
#[serde(skip_serializing_if = "Option::is_none")]
737737
dtick: Option<f64>,
738738

739+
#[serde(skip_serializing_if = "Option::is_none")]
740+
matches: Option<String>,
741+
739742
#[serde(skip_serializing_if = "Option::is_none", rename = "tickvals")]
740743
tick_values: Option<Vec<f64>>,
741744
#[serde(skip_serializing_if = "Option::is_none", rename = "tick_text")]
@@ -839,6 +842,13 @@ impl Axis {
839842
Default::default()
840843
}
841844

845+
pub fn matches(mut self, matches : bool) -> Axis {
846+
if matches {
847+
self.matches = Some(String::from("x"));
848+
}
849+
self
850+
}
851+
842852
pub fn visible(mut self, visible: bool) -> Axis {
843853
self.visible = Some(visible);
844854
self

0 commit comments

Comments
 (0)