Skip to content

Commit

Permalink
Allow font size to be a float (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Jun 25, 2023
1 parent 1dbe387 commit 5548e6f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vl-convert-rs/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct TextInfo {
variant: Option<String>,
weight: Option<String>,
family: Option<String>,
size: i32,
size: f64,
text: Value,
}

Expand Down
4 changes: 3 additions & 1 deletion vl-convert-rs/tests/test_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ mod test_svg {
"stacked_bar_h",
"bar_chart_trellis_compact",
"line_with_log_scale",
"numeric_font_weight"
"numeric_font_weight",
"float_font_size",
)]
name: &str,
) {
Expand Down Expand Up @@ -309,6 +310,7 @@ mod test_png_no_theme {
case("line_with_log_scale", 2.0),
case("remote_images", 1.0),
case("maptile_background", 1.0),
case("float_font_size", 1.0),
)]
fn test(
name: &str,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions vl-convert-rs/tests/vl-specs/float_font_size.vl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": "Some title",
"config": {"title": {"fontSize": 12.75}},
"data": {
"values": [
{"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
{"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
{"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
]
},
"mark": "bar",
"encoding": {
"x": {"field": "a", "type": "nominal", "axis": {"labelAngle": 0}},
"y": {"field": "b", "type": "quantitative"}
}
}

0 comments on commit 5548e6f

Please sign in to comment.