Skip to content

Commit

Permalink
add note documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
iamlemec committed Jun 13, 2024
1 parent 37334c7 commit 9f97cba
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/code/note.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// add a note to a paricular place
let line = SymPath({fy: x => 1-x*x, xlim: [-1, 1]});
let note = Note('1 - x^2', {pos: [0, 1.1], rad: 0.2, latex: true});
let plot = Plot([line, note], {
aspect: phi, ylim: [0, 1.5], yticks: 4, grid: true, grid_opacity: 0.1
});
return Frame(plot, {margin: 0.15});
3 changes: 2 additions & 1 deletion docs/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"Axis",
"Graph",
"Plot",
"BarPlot"
"BarPlot",
"Note"
],
"networks": [
"Node",
Expand Down
12 changes: 12 additions & 0 deletions docs/text/note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Note

<span class="inherit">[Place](#Place) > [Container](#Container) > [Element](#Element)</span>

Place a text note at a particular location with a given size. Simple wrapper around [Place](#Place). Additionally supports LaTeX rendering.

Positional arguments:
- `text` — text to display

Keyword arguments (plus any [Place](#Place) arguments):
- `pos`/`rad` = `[0.5, 0.5]` — a position and radius specifying rectangle placement
- `latex` — whether to run through LaTeX renderer

0 comments on commit 9f97cba

Please sign in to comment.