Skip to content

Commit 7bfae55

Browse files
Ionizingandrei-ng
andauthored
Make Bar.width to be Option<f64> (#230)
* 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]>
1 parent 34f86fc commit 7bfae55

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plotly/src/traces/bar.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ where
5555
legend_group_title: Option<LegendGroupTitle>,
5656
opacity: Option<f64>,
5757
ids: Option<Vec<String>>,
58-
width: Option<usize>,
59-
offset: Option<Dim<usize>>,
58+
width: Option<f64>,
59+
offset: Option<Dim<f64>>,
6060
text: Option<Dim<String>>,
6161
#[serde(rename = "textposition")]
6262
text_position: Option<Dim<TextPosition>>,
@@ -162,8 +162,8 @@ mod tests {
162162
.legend_group_title("legend-group-title")
163163
.marker(Marker::new())
164164
.name("Bar")
165-
.offset(5)
166-
.offset_array(vec![5, 5])
165+
.offset(5.0)
166+
.offset_array(vec![5.0, 5.0])
167167
.offset_group("offset_group")
168168
.opacity(0.5)
169169
.orientation(Orientation::Vertical)
@@ -178,7 +178,7 @@ mod tests {
178178
.text_template("text_template")
179179
.text_template_array(vec!["text_template"])
180180
.visible(Visible::LegendOnly)
181-
.width(999)
181+
.width(999.0)
182182
.x_axis("xaxis")
183183
.x_calendar(Calendar::Nanakshahi)
184184
.y_axis("yaxis")
@@ -197,8 +197,8 @@ mod tests {
197197
"legendgrouptitle": {"text": "legend-group-title"},
198198
"opacity": 0.5,
199199
"ids": ["1"],
200-
"width": 999,
201-
"offset": [5, 5],
200+
"width": 999.0,
201+
"offset": [5.0, 5.0],
202202
"text": ["text"],
203203
"textposition": ["none"],
204204
"texttemplate": ["text_template"],

0 commit comments

Comments
 (0)