Skip to content

Commit

Permalink
WIP Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf committed Nov 26, 2024
1 parent 39ef220 commit 2c4fcd0
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions tests/plot/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@
x-min: -360,
x-max: 360,
y-tick-step: 1,
x2-label: none,
x2-min: -90,
x2-max: 90,
x2-tick-step: 45,
x2-minor-tick-step: 15,
y2-label: none,
y2-min: -1.5,
y2-max: 1.5,
y2-tick-step: .5,
y2-minor-tick-step: .1,
u-label: none,
u-min: -90,
u-max: 90,
u-tick-step: 45,
u-minor-tick-step: 15,
v-label: none,
v-min: -1.5,
v-max: 1.5,
v-tick-step: .5,
v-minor-tick-step: .1,
{
plot.add(data)
plot.add(data, style: (stroke: blue), axes: ("x2", "y2"))
plot.add(data, style: (stroke: blue), axes: ("u", "v"))
})
})

/* School-Book Style */
#test-case({
plot.plot(size: (5, 4),
axis-style: "school-book",
template: "school-book",
x-tick-step: 180,
y-tick-step: 1,
{
Expand All @@ -58,7 +58,7 @@
/* Clipping */
#test-case({
plot.plot(size: (5, 4),
axis-style: "school-book",
template: "school-book",
x-min: auto,
x-max: 350,
x-tick-step: 180,
Expand All @@ -75,7 +75,6 @@
plot.plot(size: (5, 4),
x-label: [Rainbow],
x-tick-step: none,
axis-style: "scientific",
y-label: [Color],
y-max: 8,
y-tick-step: none,
Expand All @@ -92,21 +91,21 @@
/* Tick Step Calculation */
#test-case({
plot.plot(size: (12, 4),
y2-decimals: 4,
v-decimals: 4,
{
plot.add(((0,0), (1,10)), axes: ("x", "y"))
plot.add(((0,0), (.1,.01)), axes: ("x2", "y2"))
plot.add(((0,0), (.1,.01)), axes: ("u", "v"))
})
})

#test-case({
plot.plot(size: (12, 4),
y2-decimals: 9,
x2-decimals: 9,
y2-format: "sci",
v-decimals: 9,
u-decimals: 9,
v-format: "sci",
{
plot.add(((0,0), (30,2500)), axes: ("x", "y"))
plot.add(((0,0), (.001,.0001)), axes: ("x2", "y2"))
plot.add(((0,0), (.001,.0001)), axes: ("u", "v"))
})
})

Expand Down Expand Up @@ -136,10 +135,10 @@
yb-min: -1.5, yb-max: .5,
yt-min: -.5, yt-max: 1.5,
{
plot.add-cartesian-axis("xl", (0, 0), (4, 0))
plot.add-cartesian-axis("xr", (0, 4), (4, 4))
plot.add-cartesian-axis("yt", (0, 0), (0, 4))
plot.add-cartesian-axis("yb", (4, 0), (4, 4))
plot.lin-axis("xl")
plot.lin-axis("xr")
plot.lin-axis("yt")
plot.lin-axis("yb")
plot.add(circle-data)
plot.add(circle-data, axes: ("xl", "y"), style: (stroke: green))
plot.add(circle-data, axes: ("xr", "y"), style: (stroke: red))
Expand All @@ -159,10 +158,10 @@
yb-min: -1.75, yb-max: .25,
yt-min: -.25, yt-max: 1.75,
{
plot.add-cartesian-axis("xl", (0, 0), (4, 0))
plot.add-cartesian-axis("xr", (0, 4), (4, 4))
plot.add-cartesian-axis("yt", (0, 0), (0, 4))
plot.add-cartesian-axis("yb", (4, 0), (4, 4))
plot.lin-axis("xl")
plot.lin-axis("xr")
plot.lin-axis("yt")
plot.lin-axis("yb")
plot.add(circle-data)
plot.add(circle-data, axes: ("xl", "y"), style: (stroke: green))
plot.add(circle-data, axes: ("xr", "y"), style: (stroke: red))
Expand Down Expand Up @@ -217,19 +216,20 @@
y-tick-step: none,
y-ticks: (-1, 0, 1),
y-format: x => $y_(#x)$,
x2-tick-step: none,
x2-ticks: (-1, 0, 1),
x2-format: x => $x_(2,#x)$,
y2-tick-step: none,
y2-ticks: (-1, 0, 1),
y2-format: x => $y_(2,#x)$,
u-tick-step: none,
u-ticks: (-1, 0, 1),
u-format: x => $x_(2,#x)$,
v-tick-step: none,
v-ticks: (-1, 0, 1),
v-format: x => $y_(2,#x)$,
{
plot.add(samples: 2, domain: (-1, 1), x => -x, axes: ("x", "y"))
plot.add(samples: 2, domain: (-1, 1), x => x, axes: ("x2", "y2"))
plot.add(samples: 2, domain: (-1, 1), x => x, axes: ("u", "v"))
})
})

// Test plot with anchors only
/*
#test-case({
import draw: *
Expand All @@ -256,13 +256,13 @@
tick: (
length: -.1,
),
left: (
y: (
stroke: (paint: red),
tick: (
stroke: auto,
)
),
bottom: (
x: (
stroke: (paint: blue, thickness: 2pt),
tick: (
stroke: auto,
Expand Down

0 comments on commit 2c4fcd0

Please sign in to comment.