Skip to content

Commit

Permalink
Update for cetz 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf committed Oct 10, 2024
1 parent 06e9308 commit deb073a
Show file tree
Hide file tree
Showing 54 changed files with 28 additions and 27 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
**Note: cetz-plot has not been released yet! Use cetz 0.2.2 's internal plotting module.**

# CeTZ-Plot

CeTZ-Plot is a library that adds plots and charts to [CeTZ](https://github.com/cetz-package/cetz), a library for drawing with [Typst](https://typst.app).

CeTZ-Plot requires CeTZ version ≥ 0.3.0.

## Examples
<!-- img width is set so the table gets evenly spaced by GitHubs css -->
<table>
Expand Down Expand Up @@ -39,7 +39,7 @@ For information, see the [manual (stable)](https://github.com/cetz-package/cetz-

To use this package, simply add the following code to your document:
```
#import "@preview/cetz:0.2.2"
#import "@preview/cetz:0.3.0"
#import "@preview/cetz-plot:0.1.0": plot, chart
#cetz.canvas({
Expand Down
Binary file modified gallery/barchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions gallery/barchart.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "@preview/cetz:0.2.2": canvas, draw
#import "@preview/cetz:0.3.0": canvas, draw
#import "@preview/cetz-plot:0.1.0": chart

#set page(width: auto, height: auto, margin: .5cm)
Expand All @@ -22,5 +22,5 @@
x-tick-step: 2.5,
data2,
labels: ([Low], [Medium], [High], [Very high]),
legend: "legend.inner-north-east",)
legend: "inner-north-east",)
})
Binary file modified gallery/line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gallery/line.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "@preview/cetz:0.2.2": canvas, draw
#import "@preview/cetz:0.3.0": canvas, draw
#import "@preview/cetz-plot:0.1.0": plot

#set page(width: auto, height: auto, margin: .5cm)
Expand Down
Binary file modified gallery/piechart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gallery/piechart.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "@preview/cetz:0.2.2"
#import "@preview/cetz:0.3.0"
#import "@preview/cetz-plot:0.1.0": chart

#set page(width: auto, height: auto, margin: .5cm)
Expand Down
2 changes: 1 addition & 1 deletion manual.typ
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CeTZ-Plot is a simple plotting library for use with CeTZ.

This is the minimal starting point:
#pad(left: 1em)[```typ
#import "@preview/cetz:0.2.2"
#import "@preview/cetz:0.3.0"
#import "@preview/cetz-plot:0.1.0"
#cetz.canvas({
import cetz.draw: *
Expand Down
2 changes: 1 addition & 1 deletion src/cetz.typ
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Import cetz into the root scope. Import cetz by importing this file only!
#import "@preview/cetz:0.2.2": *
#import "@preview/cetz:0.3.0": *
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/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/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/piechart/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.
2 changes: 1 addition & 1 deletion tests/plot/annotation/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

#test-case({
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/boxwhisker/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

#let box1 = (
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/contour/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

#let peaks(x, y) = (
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/equal-axis/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

#test-case({
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/grid/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

/* X grid */
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/hvline/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

/* Empty plot */
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/line/between/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

#let size = (6, 4)
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/line/fill/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

#let size = (6, 4)
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/line/line-type/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

/* Draw different line types */
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/line/linearization/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

/* Test linearization */
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/line/mark/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

/* Draw different marks */
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/line/spline/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

/* Draw smoothed data by using spline interpolation */
Expand Down
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.
2 changes: 1 addition & 1 deletion tests/plot/marks/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/cetz.typ": *
#import "/src/lib.typ" as cetz-plot
#import "/src/cetz.typ": *
#import "/tests/helper.typ": *

// cetz-plot #13
Expand Down
Binary file modified tests/plot/mirror-axes/ref/1.png
5 changes: 3 additions & 2 deletions tests/plot/mirror-axes/test.typ
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#set page(width: auto, height: auto)
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

#test-case({
// Force showing tick labels for mirrored axes
cetz.draw.set-style(axes: (tick: (label: ("show": true))))

cetz.plot.plot(size: (8,8), {
cetz.plot.add(domain: (0, 1), x => x)
plot.plot(size: (8,8), {
plot.add(domain: (0, 1), x => x)
})
})
Binary file modified tests/plot/parametric/ref/1.png
2 changes: 1 addition & 1 deletion tests/plot/parametric/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

/* Simple plot */
Expand Down
Binary file modified tests/plot/ref/1.png
Binary file modified tests/plot/reverse-axis/ref/1.png
2 changes: 1 addition & 1 deletion tests/plot/reverse-axis/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

#test-case({
Expand Down
Binary file modified tests/plot/vertical/ref/1.png
2 changes: 1 addition & 1 deletion tests/plot/vertical/test.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#set page(width: auto, height: auto)
#import "/src/lib.typ": *
#import "/src/cetz.typ": *
#import "/src/lib.typ": *
#import "/tests/helper.typ": *

#test-case({
Expand Down
Binary file modified tests/plot/violin/ref/1.png

0 comments on commit deb073a

Please sign in to comment.