Skip to content

Commit

Permalink
Make Bar.width to be Option<f64> (#230)
Browse files Browse the repository at this point in the history
* Make Bar.width to be Option<f64>

* make bar offset float as well

- update test

Signed-off-by: Andrei Gherghescu <[email protected]>

---------

Signed-off-by: Andrei Gherghescu <[email protected]>
Co-authored-by: Andrei Gherghescu <[email protected]>
  • Loading branch information
Ionizing and andrei-ng authored Sep 6, 2024
1 parent 34f86fc commit 7bfae55
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions plotly/src/traces/bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ where
legend_group_title: Option<LegendGroupTitle>,
opacity: Option<f64>,
ids: Option<Vec<String>>,
width: Option<usize>,
offset: Option<Dim<usize>>,
width: Option<f64>,
offset: Option<Dim<f64>>,
text: Option<Dim<String>>,
#[serde(rename = "textposition")]
text_position: Option<Dim<TextPosition>>,
Expand Down Expand Up @@ -162,8 +162,8 @@ mod tests {
.legend_group_title("legend-group-title")
.marker(Marker::new())
.name("Bar")
.offset(5)
.offset_array(vec![5, 5])
.offset(5.0)
.offset_array(vec![5.0, 5.0])
.offset_group("offset_group")
.opacity(0.5)
.orientation(Orientation::Vertical)
Expand All @@ -178,7 +178,7 @@ mod tests {
.text_template("text_template")
.text_template_array(vec!["text_template"])
.visible(Visible::LegendOnly)
.width(999)
.width(999.0)
.x_axis("xaxis")
.x_calendar(Calendar::Nanakshahi)
.y_axis("yaxis")
Expand All @@ -197,8 +197,8 @@ mod tests {
"legendgrouptitle": {"text": "legend-group-title"},
"opacity": 0.5,
"ids": ["1"],
"width": 999,
"offset": [5, 5],
"width": 999.0,
"offset": [5.0, 5.0],
"text": ["text"],
"textposition": ["none"],
"texttemplate": ["text_template"],
Expand Down

0 comments on commit 7bfae55

Please sign in to comment.