Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
279 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...es/linux/ScaleBar_annotation__should_support_horizontal_orientation__with_0px_padding.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[190, 10, 70, 27] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.81 KB
...caleBar_annotation__should_support_horizontal_orientation__with_0px_padding.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...Bar_annotation__should_support_horizontal_orientation__with_0px_padding_and_no_border.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[190, 10, 70, 27] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.73 KB
...tion__should_support_horizontal_orientation__with_0px_padding_and_no_border.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...s/linux/ScaleBar_annotation__should_support_horizontal_orientation__with_20px_padding.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[150, 10, 110, 67] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.81 KB
...aleBar_annotation__should_support_horizontal_orientation__with_20px_padding.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...uld_support_horizontal_orientation__with_adaptive_sizing__and_with_200px_pixel_length.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[35, 10, 225, 47] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.76 KB
...t_horizontal_orientation__with_adaptive_sizing__and_with_200px_pixel_length.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
..._support_horizontal_orientation__with_adaptive_sizing__and_with_50%_percentage_length.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[35, 10, 225, 47] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.76 KB
...orizontal_orientation__with_adaptive_sizing__and_with_50%_percentage_length.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...should_support_horizontal_orientation__with_exact_sizing__and_with_200px_pixel_length.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[35, 10, 225, 47] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.76 KB
...port_horizontal_orientation__with_exact_sizing__and_with_200px_pixel_length.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...uld_support_horizontal_orientation__with_exact_sizing__and_with_50%_percentage_length.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[35, 10, 225, 47] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.76 KB
...t_horizontal_orientation__with_exact_sizing__and_with_50%_percentage_length.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...es/linux/ScaleBar_annotation__should_support_horizontal_orientation__with_label_above.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[170, 10, 90, 47] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.8 KB
...caleBar_annotation__should_support_horizontal_orientation__with_label_above.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...annotation__should_support_horizontal_orientation__with_label_above_and_20px_standoff.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[170, 10, 90, 62] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.81 KB
...__should_support_horizontal_orientation__with_label_above_and_20px_standoff.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...es/linux/ScaleBar_annotation__should_support_horizontal_orientation__with_label_below.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[170, 10, 90, 47] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.8 KB
...caleBar_annotation__should_support_horizontal_orientation__with_label_below.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...annotation__should_support_horizontal_orientation__with_label_below_and_20px_standoff.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[170, 10, 90, 62] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.81 KB
...__should_support_horizontal_orientation__with_label_below_and_20px_standoff.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...nes/linux/ScaleBar_annotation__should_support_horizontal_orientation__with_label_left.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[129, 10, 131, 42] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.79 KB
...ScaleBar_annotation__should_support_horizontal_orientation__with_label_left.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
..._annotation__should_support_horizontal_orientation__with_label_left_and_20px_standoff.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[114, 10, 146, 42] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.8 KB
...n__should_support_horizontal_orientation__with_label_left_and_20px_standoff.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...es/linux/ScaleBar_annotation__should_support_horizontal_orientation__with_label_right.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[129, 10, 131, 42] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.63 KB
...caleBar_annotation__should_support_horizontal_orientation__with_label_right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...annotation__should_support_horizontal_orientation__with_label_right_and_20px_standoff.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 300, 150] | ||
CartesianFrame bbox=[0, 0, 270, 150] | ||
ScaleBar bbox=[114, 10, 146, 42] | ||
Title bbox=[0, 0, 270, 0] | ||
ToolbarPanel bbox=[270, 0, 30, 150] |
Binary file added
BIN
+2.63 KB
...__should_support_horizontal_orientation__with_label_right_and_20px_standoff.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...hould_support_vertical_orientation__with_adaptive_sizing__and_with_200px_pixel_length.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 150, 300] | ||
CartesianFrame bbox=[0, 0, 120, 300] | ||
ScaleBar bbox=[52, 10, 58, 272] | ||
Title bbox=[0, 0, 120, 0] | ||
ToolbarPanel bbox=[120, 0, 30, 300] |
Binary file added
BIN
+3 KB
...ort_vertical_orientation__with_adaptive_sizing__and_with_200px_pixel_length.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...ld_support_vertical_orientation__with_adaptive_sizing__and_with_50%_percentage_length.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 150, 300] | ||
CartesianFrame bbox=[0, 0, 120, 300] | ||
ScaleBar bbox=[52, 10, 58, 272] | ||
Title bbox=[0, 0, 120, 0] | ||
ToolbarPanel bbox=[120, 0, 30, 300] |
Binary file added
BIN
+3 KB
..._vertical_orientation__with_adaptive_sizing__and_with_50%_percentage_length.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...__should_support_vertical_orientation__with_exact_sizing__and_with_200px_pixel_length.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 150, 300] | ||
CartesianFrame bbox=[0, 0, 120, 300] | ||
ScaleBar bbox=[52, 10, 58, 272] | ||
Title bbox=[0, 0, 120, 0] | ||
ToolbarPanel bbox=[120, 0, 30, 300] |
Binary file added
BIN
+3 KB
...upport_vertical_orientation__with_exact_sizing__and_with_200px_pixel_length.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...hould_support_vertical_orientation__with_exact_sizing__and_with_50%_percentage_length.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 150, 300] | ||
CartesianFrame bbox=[0, 0, 120, 300] | ||
ScaleBar bbox=[52, 10, 58, 272] | ||
Title bbox=[0, 0, 120, 0] | ||
ToolbarPanel bbox=[120, 0, 30, 300] |
Binary file added
BIN
+3 KB
...ort_vertical_orientation__with_exact_sizing__and_with_50%_percentage_length.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...ines/linux/ScaleBar_annotation__should_support_vertical_orientation__with_label_above.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 150, 300] | ||
CartesianFrame bbox=[0, 0, 120, 300] | ||
ScaleBar bbox=[52, 10, 58, 122] | ||
Title bbox=[0, 0, 120, 0] | ||
ToolbarPanel bbox=[120, 0, 30, 300] |
Binary file added
BIN
+3.04 KB
.../ScaleBar_annotation__should_support_vertical_orientation__with_label_above.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...ines/linux/ScaleBar_annotation__should_support_vertical_orientation__with_label_below.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 150, 300] | ||
CartesianFrame bbox=[0, 0, 120, 300] | ||
ScaleBar bbox=[52, 10, 58, 122] | ||
Title bbox=[0, 0, 120, 0] | ||
ToolbarPanel bbox=[120, 0, 30, 300] |
Binary file added
BIN
+3.05 KB
.../ScaleBar_annotation__should_support_vertical_orientation__with_label_below.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...lines/linux/ScaleBar_annotation__should_support_vertical_orientation__with_label_left.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 150, 300] | ||
CartesianFrame bbox=[0, 0, 120, 300] | ||
ScaleBar bbox=[68, 10, 42, 102] | ||
Title bbox=[0, 0, 120, 0] | ||
ToolbarPanel bbox=[120, 0, 30, 300] |
Binary file added
BIN
+3.12 KB
...x/ScaleBar_annotation__should_support_vertical_orientation__with_label_left.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
...ines/linux/ScaleBar_annotation__should_support_vertical_orientation__with_label_right.blf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Plot bbox=[0, 0, 150, 300] | ||
CartesianFrame bbox=[0, 0, 120, 300] | ||
ScaleBar bbox=[68, 10, 42, 102] | ||
Title bbox=[0, 0, 120, 0] | ||
ToolbarPanel bbox=[120, 0, 30, 300] |
Binary file added
BIN
+3.14 KB
.../ScaleBar_annotation__should_support_vertical_orientation__with_label_right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
import {display} from "../_util" | ||
|
||
import {ScaleBar, Plot, Range1d} from "@bokehjs/models" | ||
import type {Location} from "@bokehjs/core/enums" | ||
|
||
describe("ScaleBar annotation", () => { | ||
describe("should support horizontal orientation", () => { | ||
const orientation = "horizontal" as const | ||
|
||
function plot(scale_bar: ScaleBar) { | ||
return new Plot({ | ||
width: 300, | ||
height: 150, | ||
min_border: 0, | ||
x_range: new Range1d({start: 0, end: 1}), | ||
y_range: new Range1d({start: 0, end: 1}), | ||
center: [scale_bar], | ||
}) | ||
} | ||
|
||
async function scale_bar_with_label_location(label_location: Location, label_standoff?: number) { | ||
const scale_bar = new ScaleBar({ | ||
range: new Range1d({start: 0, end: 1}), | ||
bar_length: 0.2, | ||
orientation, | ||
location: "top_right", | ||
label_location, | ||
label_standoff, | ||
}) | ||
await display(plot(scale_bar)) | ||
} | ||
|
||
it("with label above", async () => await scale_bar_with_label_location("above")) | ||
it("with label below", async () => await scale_bar_with_label_location("below")) | ||
it("with label left", async () => await scale_bar_with_label_location("left")) | ||
it("with label right", async () => await scale_bar_with_label_location("right")) | ||
|
||
const standoff = 20 | ||
it(`with label above and ${standoff}px standoff`, async () => await scale_bar_with_label_location("above", standoff)) | ||
it(`with label below and ${standoff}px standoff`, async () => await scale_bar_with_label_location("below", standoff)) | ||
it(`with label left and ${standoff}px standoff`, async () => await scale_bar_with_label_location("left", standoff)) | ||
it(`with label right and ${standoff}px standoff`, async () => await scale_bar_with_label_location("right", standoff)) | ||
|
||
it("with 0px padding", async () => { | ||
const scale_bar = new ScaleBar({ | ||
range: new Range1d({start: 0, end: 1}), | ||
bar_length: 0.2, | ||
orientation, | ||
location: "top_right", | ||
label_location: "above", | ||
padding: 0, | ||
}) | ||
await display(plot(scale_bar)) | ||
}) | ||
|
||
it("with 20px padding", async () => { | ||
const scale_bar = new ScaleBar({ | ||
range: new Range1d({start: 0, end: 1}), | ||
bar_length: 0.2, | ||
orientation, | ||
location: "top_right", | ||
label_location: "above", | ||
padding: 20, | ||
}) | ||
await display(plot(scale_bar)) | ||
}) | ||
|
||
it("with 0px padding and no border", async () => { | ||
const scale_bar = new ScaleBar({ | ||
range: new Range1d({start: 0, end: 1}), | ||
bar_length: 0.2, | ||
orientation, | ||
location: "top_right", | ||
label_location: "above", | ||
padding: 0, | ||
border_line_color: null, | ||
}) | ||
await display(plot(scale_bar)) | ||
}) | ||
|
||
for (const length_sizing of ["adaptive", "exact"] as const) { | ||
describe(`with ${length_sizing} sizing`, () => { | ||
it("and with 50% percentage length", async () => { | ||
const scale_bar = new ScaleBar({ | ||
range: new Range1d({start: 0, end: 1}), | ||
bar_length: 0.5, | ||
length_sizing, | ||
orientation, | ||
location: "top_right", | ||
}) | ||
await display(plot(scale_bar)) | ||
}) | ||
|
||
it("and with 200px pixel length", async () => { | ||
const scale_bar = new ScaleBar({ | ||
range: new Range1d({start: 0, end: 1}), | ||
bar_length: 200, | ||
length_sizing, | ||
orientation, | ||
location: "top_right", | ||
}) | ||
await display(plot(scale_bar)) | ||
}) | ||
}) | ||
} | ||
}) | ||
|
||
describe("should support vertical orientation", () => { | ||
const orientation = "vertical" as const | ||
|
||
function plot(scale_bar: ScaleBar) { | ||
return new Plot({ | ||
width: 150, | ||
height: 300, | ||
min_border: 0, | ||
x_range: new Range1d({start: 0, end: 1}), | ||
y_range: new Range1d({start: 0, end: 1}), | ||
center: [scale_bar], | ||
}) | ||
} | ||
|
||
async function scale_bar_with_label_location(label_location: Location) { | ||
const scale_bar = new ScaleBar({ | ||
range: new Range1d({start: 0, end: 1}), | ||
bar_length: 0.2, | ||
orientation, | ||
location: "top_right", | ||
label_location, | ||
}) | ||
await display(plot(scale_bar)) | ||
} | ||
|
||
it("with label above", async () => await scale_bar_with_label_location("above")) | ||
it("with label below", async () => await scale_bar_with_label_location("below")) | ||
it("with label left", async () => await scale_bar_with_label_location("left")) | ||
it("with label right", async () => await scale_bar_with_label_location("right")) | ||
|
||
for (const length_sizing of ["adaptive", "exact"] as const) { | ||
describe(`with ${length_sizing} sizing`, () => { | ||
it("and with 50% percentage length", async () => { | ||
const scale_bar = new ScaleBar({ | ||
range: new Range1d({start: 0, end: 1}), | ||
bar_length: 0.5, | ||
length_sizing, | ||
orientation, | ||
location: "top_right", | ||
}) | ||
await display(plot(scale_bar)) | ||
}) | ||
|
||
it("and with 200px pixel length", async () => { | ||
const scale_bar = new ScaleBar({ | ||
range: new Range1d({start: 0, end: 1}), | ||
bar_length: 200, | ||
length_sizing, | ||
orientation, | ||
location: "top_right", | ||
}) | ||
await display(plot(scale_bar)) | ||
}) | ||
}) | ||
} | ||
}) | ||
}) |