companion-gate
v0.4.2
Published
Interactive, animated logic diagrams, from relays to flip-flops, as a custom HTML element.
Readme
Companion Gate
Interactive, animated logic diagrams, from relays to flip-flops, as a custom HTML element.
The diagrams go from a single relay, through relay gates and logic gates, up to adders, decoders, selectors, latches, flip-flops, counters and addressable memory. The diagram catalogue lists them all.
Early release. The API is unstable and may change in any
0.xversion.
Usage
npm install companion-gateimport { defineLogicDiagramElement } from 'companion-gate';
defineLogicDiagramElement();<logic-diagram name="relay-and" inputs="A=1" controls="full"></logic-diagram>Attributes are documented in docs/embedding.md.
Development
Requirements: Node.js (see .tool-versions).
npm ci
npm startnpm start serves the dev pages at http://localhost:8000 with live reload:
a gallery of every diagram, and a page to debug one diagram with every attribute
and the debug overlay. npm run check runs every check (tests, linters,
formatting, builds). See CONTRIBUTING.md for conventions and
ARCHITECTURE.md for the design.
Documentation
- ARCHITECTURE.md: goals, principles, structure, long-term direction.
- docs/: diagram catalogue, definition format, engines, rendering, playback, embedding, shortcuts register, known issues, planning and work log.
- CONTRIBUTING.md: conventions for humans and agents; AGENTS.md adds agent-specific instructions.
