Skip to content

Commit 5112b85

Browse files
authored
add colorbar orientation field (#152)
1 parent 44d9d0e commit 5112b85

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plotly/src/common/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ pub struct ColorBar {
750750
len_mode: Option<ThicknessMode>,
751751
#[serde(rename = "nticks")]
752752
n_ticks: Option<usize>,
753+
orientation: Option<Orientation>,
753754
#[serde(rename = "outlinecolor")]
754755
outline_color: Option<Box<dyn Color>>,
755756
#[serde(rename = "outlinewidth")]
@@ -852,6 +853,11 @@ impl ColorBar {
852853
self
853854
}
854855

856+
pub fn orientation(mut self, orientation: Orientation) -> Self {
857+
self.orientation = Some(orientation);
858+
self
859+
}
860+
855861
pub fn outline_color<C: Color>(mut self, outline_color: C) -> Self {
856862
self.outline_color = Some(Box::new(outline_color));
857863
self
@@ -1662,6 +1668,7 @@ mod tests {
16621668
.len(99)
16631669
.len_mode(ThicknessMode::Pixels)
16641670
.n_ticks(500)
1671+
.orientation(Orientation::Horizontal)
16651672
.outline_color("#789456")
16661673
.outline_width(7)
16671674
.separate_thousands(true)
@@ -1702,6 +1709,7 @@ mod tests {
17021709
"len": 99,
17031710
"lenmode": "pixels",
17041711
"nticks": 500,
1712+
"orientation": "h",
17051713
"outlinecolor": "#789456",
17061714
"outlinewidth": 7,
17071715
"separatethousands": true,

0 commit comments

Comments
 (0)