rete-draw
A rete network as an SVG picture, from the network that runs:
facts on the left, the tests on them, the joins where a rule's tests meet, and
the rules on the right, with what is known marked on it (filled is what a rule
that holds stands on, outlined was learned and not needed, dashed failed), the
rules that decided a step numbered in order, and a line from a rule back round
to the fact its effect teaches.
It is its own crate so that rete stays free of presentation. A host draws
with rete(network, known, fired, legend, shown, link), which returns markup
(maud) to put in a page, or with standalone(network, legend, style), which
returns a file. The host says what only it can: a Legend of the frames to
draw round facts that arrive together, and how a rule's effect reads in words.
shown prints a number beside a known fact, and link makes facts and tests
clickable.
The markup carries classes and no styles; src/lib.rs lists them. standalone
puts the stylesheet the host passes in the file, because an image is drawn
without the page's.
| File | What |
|---|---|
src/lib.rs | The drawing, sequence, and standalone. |
src/tests.rs | The drawing of a small domain of its own. |
Run the tests with mise run test from the repository root.