Skip to content

Commit 12bb271

Browse files
authored
Avoid sizing when faceting vegalite (#204)
1 parent 710cebb commit 12bb271

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/writer/vegalite/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,12 @@ impl Writer for VegaLiteWriter {
10681068
let mut vl_spec = json!({
10691069
"$schema": self.schema
10701070
});
1071-
vl_spec["width"] = json!("container");
1072-
vl_spec["height"] = json!("container");
1071+
// Container sizing doesn't work with faceting in Vega-Lite, so only apply it
1072+
// for non-faceted charts
1073+
if spec.facet.is_none() {
1074+
vl_spec["width"] = json!("container");
1075+
vl_spec["height"] = json!("container");
1076+
}
10731077

10741078
if let Some(labels) = &spec.labels {
10751079
if let Some(title) = labels.labels.get("title") {

0 commit comments

Comments
 (0)