Skip to content
Merged
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
3 changes: 2 additions & 1 deletion crates/ironlab-gallery/src/figures/bar_chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ pub fn figure() -> Figure {
.tag("legend")
.tag("comparison")
.tag("categorical")
.tag("physics")
.tag("grouped")
.tag("aerodynamics")
.parameter("dimensionality", "2D")
.parameter("artists", SECTIONS.len() as i64)
.parameter("data_points", 16)
Expand Down
7 changes: 6 additions & 1 deletion crates/ironlab-gallery/src/figures/bar_variants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ pub fn figure() -> Figure {
.tag("legend")
.tag("categorical")
.tag("ticks")
.tag("physics")
.tag("stacked")
.tag("horizontal")
.tag("floating")
.tag("highlighted")
.tag("tick-angle")
.tag("engineering")
.parameter("dimensionality", "2D")
.parameter("artists", 9)
.parameter("data_points", 96)
Expand Down
5 changes: 5 additions & 0 deletions crates/ironlab-gallery/src/figures/branch_coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ pub fn figure() -> Figure {
.tag("categorical")
.tag("aspect")
.tag("simulations")
.tag("occupancy")
.tag("grouped-rows")
.tag("hidden-axis")
.tag("coverage")
.tag("testing")
.parameter("dimensionality", "2D")
.parameter("artists", 1)
.parameter("data_points", 760)
Expand Down
5 changes: 5 additions & 0 deletions crates/ironlab-gallery/src/figures/coverage_matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ pub fn figure() -> Figure {
.tag("ticks")
.tag("aspect")
.tag("simulations")
.tag("occupancy")
.tag("heatmap")
.tag("tick-angle")
.tag("coverage")
.tag("testing")
.parameter("dimensionality", "2D")
.parameter("artists", 2)
.parameter("data_points", 100)
Expand Down
4 changes: 4 additions & 0 deletions crates/ironlab-gallery/src/figures/histogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ pub fn figure() -> Figure {
.tag("statistics")
.tag("measurements")
.tag("comparison")
.tag("histogram")
.tag("density")
.tag("stacked")
.tag("distribution")
.parameter("dimensionality", "2D")
.parameter("artists", 6)
.parameter("data_points", 1071)
Expand Down
5 changes: 4 additions & 1 deletion crates/ironlab-gallery/src/figures/histogram_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ pub fn figure() -> Figure {
.tag("colorbar")
.tag("aspect")
.tag("statistics")
.tag("physics")
.tag("histogram")
.tag("2d-histogram")
.tag("density")
.tag("turbulence")
.parameter("dimensionality", "2D")
.parameter("artists", 2)
.parameter("data_points", 2306)
Expand Down
3 changes: 3 additions & 0 deletions crates/ironlab-gallery/src/figures/stairs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ pub fn figure() -> Figure {
.tag("log")
.tag("signals")
.tag("measurements")
.tag("step")
.tag("sample-and-hold")
.tag("spectrum")
.parameter("dimensionality", "2D")
.parameter("artists", 4)
.parameter("data_points", 692)
Expand Down
60 changes: 60 additions & 0 deletions crates/ironlab-gallery/tests/browsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@ fn the_labels_of_the_gallery_are_the_words_a_reader_would_look_for() {
"markers",
"placement",
"transparency",
"grouped",
"stacked",
"histogram",
"2d-histogram",
"density",
"tick-angle",
"occupancy",
"hidden-axis",
] {
assert!(
values.iter().any(|value| value == wanted),
Expand All @@ -395,6 +403,58 @@ fn the_labels_of_the_gallery_are_the_words_a_reader_would_look_for() {
}
}

// Why: a reader looking for a kind of chart types the word they know for it, and the tag menu offers whole tags,
// so each kind must be named by a tag rather than left to a title. These words name kinds of chart that the bar,
// stairs and cells artists make, which no structural tag distinguishes: a stacked or grouped bar chart and a
// histogram are all bars, and an occupancy matrix and a two-dimensional histogram are both cells. "2d" alone
// would not do, because every flat figure's dimensionality parameter already reads "2D".
#[test]
fn each_kind_of_bar_and_cell_chart_is_found_by_its_name() {
let expect = |query: &str, titles: &[&str]| {
let mut got = found(query);
got.sort();
let mut want: Vec<String> = titles.iter().map(|title| (*title).to_owned()).collect();
want.sort();
assert_eq!(got, want, "{query:?} should find exactly these figures");
};
expect(
"tag:stacked",
&[
"Histograms",
"Stacked, horizontal, floating and highlighted bars",
],
);
expect(
"tag:grouped",
&["Grouped bar chart", "Branch coverage occupancy matrix"],
);
expect(
"tag:histogram",
&[
"Histograms",
"Two-dimensional histogram and density contour",
],
);
expect(
"tag:2d-histogram",
&["Two-dimensional histogram and density contour"],
);
expect(
"tag:angle",
&[
"Stacked, horizontal, floating and highlighted bars",
"Case by subroutine coverage matrix",
],
);
expect(
"tag:occupancy",
&[
"Branch coverage occupancy matrix",
"Case by subroutine coverage matrix",
],
);
}

// Why: the counts are what make the menu worth opening rather than guessing, and they have to come from the whole
// gallery rather than from whatever the panel has drawn. The surfaces are the count worth pinning, because they
// are the request the browser was built for and because several entries draw one without saying so in their title.
Expand Down
Loading