English | 日本語
Somen is a framework-independent Web Component for animated flow diagrams written with HTML nodes and connections. The layout adapts to the available space and the size of each node.
This is an alpha release under the MIT license. The npm package is somenflow.
Install the package in the project that will use it:
npm install somenflow@alphaRegister the custom elements once in a browser-side entry point:
import 'somenflow/register';Then write the diagram in HTML:
<flow-diagram label="Request flow" autoplay>
<flow-node name="client">Client</flow-node>
<flow-connection label="Request"></flow-connection>
<flow-node name="server">Server</flow-node>
</flow-diagram>A connection between two nodes infers its endpoints. Set from and to for branches or reverse connections. Browser imports using the package name require a bundler or import map.
Groups use <flow-group name="phase" label="Phase">…</flow-group>; decision nodes use shape="decision". Connection labels appear on their lines and can be omitted. See groups and decisions and the development demo.
Somen targets small communication diagrams and process flows in articles and documentation. Connections determine layers, and branches keep source order within each layer. The default layout changes to a vertical direction in narrow spaces; wide branches scroll within the diagram. The CLI validates JSON projects and exports standalone HTML pages.
Playback starts automatically only with autoplay, and a reduced-motion preference prevents initial playback. Visitors can pause and resume a diagram. Without JavaScript, node text remains readable, but connections are not rendered.
Somen does not automatically lay out complex graphs or guarantee that lines never cross. Browser interaction has been checked in Chromium; Firefox, Safari, and assistive technology have not yet been verified.
- CLI
- API reference: HTML attributes, appearance, playback, and JSON projects
- Astro guide: Markdown, MDX, and structured data
- Contributing: local setup, checks, and releases
- Security policy: private vulnerability reports
