-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add inherit coord option in container; bunch of docs fixes
- Loading branch information
Showing
25 changed files
with
139 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// A network with a node on the left saying "hello world" and two nodes on the right saying "hello" and "world". There are arrows going from the left node to each of the right nodes. The nodes have gray backgrounds and rounded corners. | ||
let node_args = {fill: '#eee', border_radius: 0.05}; | ||
let node1 = Node(['hello', 'world'], [0.25, 0.5], {size: 0.15, ...node_args}); | ||
let node2 = Node('hello', [0.7, 0.25], node_args); | ||
let node3 = Node('world', [0.8, 0.75], node_args); | ||
let edge1 = Edge([node1, 'n'], node2); | ||
let edge2 = Edge([node1, 's'], node3); | ||
let group = Group([node1, node2, node3, edge1, edge2], {aspect: phi}); | ||
return Frame(group, {padding: 0.05, border: 1, margin: 0.1}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// A horizontal axis with 4 ticks. On the top side, the ticks are labeled "0", "i", "j", and "1". On the bottom side, the middle two ticks are labeled in Latex with "q\_{i,1}" and "q\_{i,2}". | ||
let ticks1 = zip([0, 0.35, 0.7, 1], [Tex('0'), Tex('i'), Tex('j'), Tex('1')]); | ||
let ticks2 = zip([0.35, 0.7], [Tex('q_{i,1}'), Tex('q_{j,2}')]); | ||
let ticks1 = zip([0, 0.35, 0.7, 1], [Latex('0'), Latex('i'), Latex('j'), Latex('1')]); | ||
let ticks2 = zip([0.35, 0.7], [Latex('q_{i,1}'), Latex('q_{j,2}')]); | ||
let axis1 = HAxis(ticks1, {tick_size: 0.5, tick_pos: 'both'}); | ||
let axis2 = HAxis(ticks2, {tick_size: 0.5, label_pos: 'out', label_offset: 0}); | ||
return Frame(Group([axis1, axis2]), {aspect: 6, margin: [0.05, 2]}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
# Edge | ||
|
||
<span class="inherit">[Container](#Container) > [Element](#Element)</span> | ||
<span class="inherit">[ArrowPath](#ArrowPath) > [Container](#Container) > [Element](#Element)</span> | ||
|
||
This creates a Bézier-style path from one point to another with optional arrowheads at either or both ends. It is named `Edge` because of its usage in [Network](#Network) but can be used independently. The emenation directions are automatically inferred from the relative point positions but can be overriden as well. | ||
This creates a cubic spline path from one point to another with optional arrowheads at either or both ends. It is named `Edge` because of its usage in network diagrams. The emenation directions are automatically inferred from the relative point positions but can be overriden as well. | ||
|
||
Positional arguments: | ||
- `beg`/`end` — the beginning and ending points for the path and where the optional arrowheads are placed, or a `[point, direc]` pair where `direc` specifies the emanation direction | ||
|
||
Keyword arguments: | ||
- `arrow`/`arrow_beg`/`arrow_end` = `false` — toggles whether the respective arrowheads are included | ||
- `arrow_size` = `[0.02, 0.015]` — the arrowhead size to use for both arrows (can be individually specified at the subunit level) | ||
- `curve` = `0.03` — the amount of curvature to use in the connecting line, with zero denoting a straight line and `0.5` denoting a line that achieves perpendicularity | ||
- `arrow_size` = `0.03` — the arrowhead size to use for both arrows | ||
|
||
Subunit names: | ||
- `arrow`/`arrow_beg`/`arrow_end` — the respective arrowheads, with `arrow` being applied to both | ||
- `line` — the connecting line element | ||
- `path` — the connecting line element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Math | ||
|
||
<span class="inherit">[Element](#Element)</span> | ||
|
||
Creates a new `Math` math element from LaTeX source. Uses `MathJax` when available to render in SVG and calculate aspect ratio. This is also implicitly accessible through `TextFrame` and `Note` elements when passing `latex: true`. | ||
|
||
Positional arguments: | ||
|
||
- `tex`: a string to be used as the content | ||
|
||
Keyword arguments: | ||
|
||
- `offset` = `[0, 0]`: the position of the center of the element | ||
- `scale` = `1`: the proportional size of the element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
# Node | ||
|
||
<span class="inherit">[Frame](#Frame) > [Container](#Container) > [Element](#Element)</span> | ||
<span class="inherit">[Place](#Place) > [Container](#Container) > [Element](#Element)</span> | ||
|
||
This is a simple container class descending from [Frame](#Frame) that is designed to enclose text in a border. It is called `Node` as it performs that function in the [Network](#Network) class, but can also be used independently. The standard usage is to pass a string that will automatically be converted into a `Text` object. One can also pass a list of strings, which will be used to create a `VStack` of `Text` objects. Finally, one can simply pass a generic `Element`. | ||
This is a container class that encloses text in a `Frame` at a particular position. Passing a string or list of strings to `text` will automatically create a `MultiText` node. One can also simply pass a generic `Element`. The primary usage of this is in the creation of networks in conjunction with `Edge` objects. Additional keyword arguments are passed to the `Frame` constructor. | ||
|
||
Positional arguments: | ||
- `text` — a string, a list of strings, or an `Element` to be used as the content | ||
- `pos` — the position to place the node | ||
|
||
Keyword arguments: | ||
- `padding` = `0.1` — the padding to be added (inside border) | ||
- `border` = `1` — the border width to use | ||
- `spacing` = `0.02` — the space to add between lines in multiline mode | ||
- `align` = `center` — the alignment to use in mutliline mode | ||
- `size` — the size of the node box | ||
|
||
Subunit names: | ||
- `text` — keywords to pass to an auto-generated `Text` object or objects | ||
|
||
Functions: | ||
- `get_center` — returns the center of the node | ||
- `get_anchor(direc)` — returns the anchor point of the node in the specified direction (`n`, `s`, `e`, `w`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.