Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Added

- Bar and histogram layers now support the `linewidth` and `linetype`
aesthetics.
- New `TABULATE` clause renders a query result as a table instead of a
plot. Tables are rendered via new `html` writer. `TABULATE` supports the
following clauses:
Expand Down
2 changes: 2 additions & 0 deletions src/plot/layer/geom/bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ impl GeomTrait for Bar {
("fill", DefaultAestheticValue::String("black")),
("stroke", DefaultAestheticValue::String("black")),
("opacity", DefaultAestheticValue::Number(0.8)),
("linewidth", DefaultAestheticValue::Number(1.0)),
("linetype", DefaultAestheticValue::String("solid")),
],
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/plot/layer/geom/histogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ impl GeomTrait for Histogram {
("fill", DefaultAestheticValue::String("black")),
("stroke", DefaultAestheticValue::String("black")),
("opacity", DefaultAestheticValue::Number(0.8)),
("linewidth", DefaultAestheticValue::Number(1.0)),
("linetype", DefaultAestheticValue::String("solid")),
// pos2 and pos1end are produced by stat_histogram but not valid for manual MAPPING
("pos2", DefaultAestheticValue::Delayed),
("pos1end", DefaultAestheticValue::Delayed),
Expand Down
7 changes: 7 additions & 0 deletions src/plot/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,15 @@ mod tests {
assert!(bar.is_supported("fill"));
assert!(bar.is_supported("pos2")); // Bar accepts optional pos2
assert!(bar.is_supported("pos1")); // Bar accepts optional pos1
assert!(bar.is_supported("linewidth"));
assert!(bar.is_supported("linetype"));
assert_eq!(bar.required(), &[] as &[&str]); // No required aesthetics

// Histogram geom
let histogram = Geom::histogram().aesthetics();
assert!(histogram.is_supported("linewidth"));
assert!(histogram.is_supported("linetype"));

// Text geom - requires label
let text = Geom::text().aesthetics();
assert!(text.is_supported("label"));
Expand Down
Loading