Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf committed Nov 1, 2024
1 parent c674903 commit 802122f
Show file tree
Hide file tree
Showing 29 changed files with 10 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/plot.typ
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,6 @@
}
}

// Remove unused axes
for (k, v) in ctx.axes {
if not v.at("used", default: false) {
let _ = ctx.axes.remove(k)
}
}

// Set axis options
ctx.axes = plot-util.setup-axes(cetz-ctx, ctx.axes, options.named(), size)

Expand Down
5 changes: 2 additions & 3 deletions src/plot/util.typ
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,8 @@
axis.min = get-axis-option(name, "min", axis.min)
axis.max = get-axis-option(name, "max", axis.max)

assert(axis.min not in (none, auto) and
axis.max not in (none, auto),
message: "Axis min and max must be set.")
if axis.min == none { axis.min = 0 }
if axis.max == none { axis.max = axis.min }
if axis.min == axis.max {
axis.min -= 1; axis.max += 1
}
Expand Down
Binary file modified tests/axes/log-mode/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/chart/boxwhisker/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/chart/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/annotation/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/bar/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/boxwhisker/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/broken-axes/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/contour/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/equal-axis/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/format/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/grid/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/hvline/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/legend/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/line/between/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/line/fill/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/line/line-type/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/line/linearization/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/line/mark/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/line/spline/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/marks/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/mirror-axes/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/parametric/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/reverse-axis/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions tests/plot/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,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.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 @@ -155,6 +159,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.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
Binary file modified tests/plot/vertical/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/plot/violin/ref/1.png

0 comments on commit 802122f

Please sign in to comment.