diff --git a/packages/preview/simpleplot/0.1.0/.gitignore b/packages/preview/simpleplot/0.1.0/.gitignore new file mode 100644 index 000000000..27dfea364 --- /dev/null +++ b/packages/preview/simpleplot/0.1.0/.gitignore @@ -0,0 +1,2 @@ +.png +.pdf diff --git a/packages/preview/simpleplot/0.1.0/LICENSE.txt b/packages/preview/simpleplot/0.1.0/LICENSE.txt new file mode 100644 index 000000000..2390ec7b6 --- /dev/null +++ b/packages/preview/simpleplot/0.1.0/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Tobs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/preview/simpleplot/0.1.0/README.md b/packages/preview/simpleplot/0.1.0/README.md new file mode 100644 index 000000000..f401963b5 --- /dev/null +++ b/packages/preview/simpleplot/0.1.0/README.md @@ -0,0 +1,32 @@ +a simple package to quickly add simple graphs into your document. + +# instructions: +- connect multiple points with a line: + - add((dots)) example: add(((1,5),(4,6))) +- scale the graph: + - xsize: horizontal size + - ysize: vertical size +- position the graph: + - vertikal: top, bottom, horizon + - horizontal: left, right, center +- specify axis style: + - axis-style: [scientific, scientific-auto, school-book] +- full example: +``` +#simpleplot( + xsize: 5, + ysize: 5, + alignment: center+horizon, + axis-style: "school-book", + { + add(((0, 0), (4, 6))) + add(((-5, -3), (4, 6),(5,4))) + } +) +``` +- will look like this: + + + +- to display this text, add the ``help()`` function to your document. +- this is using cetz and cetz-plot. so if you are familiar, you can add more to the body of the function. diff --git a/packages/preview/simpleplot/0.1.0/graph.pdf b/packages/preview/simpleplot/0.1.0/graph.pdf new file mode 100644 index 000000000..498fa6cf1 Binary files /dev/null and b/packages/preview/simpleplot/0.1.0/graph.pdf differ diff --git a/packages/preview/simpleplot/0.1.0/graph.png b/packages/preview/simpleplot/0.1.0/graph.png new file mode 100644 index 000000000..5fa6912e2 Binary files /dev/null and b/packages/preview/simpleplot/0.1.0/graph.png differ diff --git a/packages/preview/simpleplot/0.1.0/graph_bright.png b/packages/preview/simpleplot/0.1.0/graph_bright.png new file mode 100644 index 000000000..afdf9a944 Binary files /dev/null and b/packages/preview/simpleplot/0.1.0/graph_bright.png differ diff --git a/packages/preview/simpleplot/0.1.0/graph_dark.png b/packages/preview/simpleplot/0.1.0/graph_dark.png new file mode 100644 index 000000000..1a2d415a4 Binary files /dev/null and b/packages/preview/simpleplot/0.1.0/graph_dark.png differ diff --git a/packages/preview/simpleplot/0.1.0/lib.typ b/packages/preview/simpleplot/0.1.0/lib.typ new file mode 100644 index 000000000..89a3045d8 --- /dev/null +++ b/packages/preview/simpleplot/0.1.0/lib.typ @@ -0,0 +1,92 @@ +#import "@preview/cetz:0.3.2": * +#import "@preview/cetz-plot:0.1.1": * +#import draw: * +#import plot: * + + +#let simpleplot(xsize: 5, + ysize: 5, + alignment: center + horizon, + axis-style: "school-book", + body + ) = align( + alignment, + canvas( + plot(axis-style: axis-style, + size: (xsize, ysize), + body + ) + ) +) + + + +#let help(lan: "en") = if lan == "de" { + " + Mehrere Punkte mit einer Linie verbinden: + add((Punkte)) z.B. add(((1,5),(4,6))) + + Position: + vertikal: top, bottom, horizon + horizontal: left, right, center + + Grösse ändern: + xsize: horizontale Grösse + ysize: vertikale Grösse + + Axen Style spezifizieren: + axis-style: [scientific, scientific-auto, school-book] + + Volles Beispiel: + #simpleplot( + xsize: 5, + ysize: 5, + alignment: center+horizon, + axis-style: \"school-book\", + { + add(((0, 0), (4, 6))) + add(((-5, -3), (4, 6),(5,4))) + } + ) + + Wird so aussehen:" +} else if lan == "en" { + " + connect multiple points with a line: + add((dots)) example: add(((1,5),(4,6))) + + position the graph: + vertikal: top, bottom, horizon + horizontal: left, right, center + + scale the graph: + xsize: horizontal size + ysize: vertical size + + specify axis style: + axis-style: [scientific, scientific-auto, school-book] + + full example: + #simpleplot( + xsize: 5, + ysize: 5, + alignment: center+horizon, + axis-style: \"school-book\", + { + add(((0, 0), (4, 6))) + add(((-5, -3), (4, 6),(5,4))) + } + ) + + will look like this:" +}+simpleplot( + xsize: 5, + ysize: 5, + alignment: top+left, + axis-style: "school-book", + { + add(((0, 0), (4, 6))) + add(((-5, -3), (4, 6),(5,4))) + } +) + diff --git a/packages/preview/simpleplot/0.1.0/typst.toml b/packages/preview/simpleplot/0.1.0/typst.toml new file mode 100644 index 000000000..013f7bcae --- /dev/null +++ b/packages/preview/simpleplot/0.1.0/typst.toml @@ -0,0 +1,7 @@ +[package] +name = "simpleplot" +version = "0.1.0" +entrypoint = "lib.typ" +authors = ["Tobs"] +license = "MIT" +description = "A super simple Package to make graphs as simple as possible" \ No newline at end of file