glypho
v0.1.4
Published
LLM-optimized graph notation — parse, render, and convert .g diagrams
Maintainers
Readme
glypho
The shortest way to write diagrams as text. One install for the parser + SVG renderer.
npm install glyphoRender SVG (no React needed)
import { parse, render } from 'glypho';
const { svg } = render('a:r Hello\nb:c World\na>b');
// svg is a complete SVG string — embed in HTML, write to file, serve from APIReact component
npm install glypho reactimport { GlyphoGraph } from 'glypho/react';
import { parse } from 'glypho';
const { graph } = parse('a:r Hello\nb:c World\na>b');
<GlyphoGraph graph={graph} width={800} height={600} />What's included
| Entry point | What you get | React required? |
|-------------|-------------|-----------------|
| glypho | Parser + SVG renderer | No |
| glypho/react | Parser + SVG renderer + GlyphoGraph component | Yes (peer dep) |
CLI
The CLI is a separate package to keep this install lightweight:
npm install -g @glypho/cli # install globally
glypho render flow.g -o flow.svgOr run locally in a project without installing globally:
npm install @glypho/cli
npx glypho render flow.g -o flow.svgIndividual packages
| Package | Description |
|---------|-------------|
| @glypho/parser | Lexer + recursive descent parser, AST types, serializers |
| @glypho/renderer | Layout engine, SVG renderer, React component |
| @glypho/cli | CLI for validation, rendering, and format conversion |
Links
- Documentation
- Full specification
- Glypho Editor — try it online
- License (MIT)
