# weisj/jsvg architecture

> Architecture diagram of the GitHub repository weisj/jsvg, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/weisj/jsvg
- Repository: https://github.com/weisj/jsvg

## Overview

JSVG is a Java SVG user agent: applications load an SVG into an SVGDocument and render it to graphics output. The graph preserves parsing, SVG content, styling, geometry, filters, text, animation, and alternate JavaFX rendering as distinct product areas. Evidence is limited to the README excerpt and indexed or sampled source; several internal connections are therefore left unasserted or marked unverified.

Main entry points: [`jsvg/src/main/java/com/github/weisj/jsvg/SVGDocument.java`](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/SVGDocument.java) (SVG Document), [`jsvg/src/main/java/com/github/weisj/jsvg/nodes`](https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/nodes) (SVG Elements), [`jsvg/src/main/java/com/github/weisj/jsvg/renderer/RenderContext.java`](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/renderer/RenderContext.java) (Render Context), [`jsvg-javafx/src/main/java/com/github/weisj/jsvg/ui/jfx/FXSVGCanvas.java`](https://github.com/weisj/jsvg/blob/master/jsvg-javafx/src/main/java/com/github/weisj/jsvg/ui/jfx/FXSVGCanvas.java) (JavaFX Canvas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Document Workflow"]
  node_loader["SVG Loading"]
  node_document["SVG Document<br/>[SVGDocument.java]"]
end

subgraph group_interpret["SVG Interpretation"]
  node_css["CSS Parsing"]
  node_attributes["Attribute Parsing"]
  node_paintparse["Paint Parsing"]
  node_svgnodes["SVG Elements"]
  node_geometry["Geometry"]
  node_lengths["Lengths and Units<br/>[Length.java]"]
  node_animation["Animation"]
  node_filters["SVG Filters"]
  node_text["SVG Text"]
end

subgraph group_render["Rendering Engine"]
  node_context["Render Context<br/>[RenderContext.java]"]
  node_paintcontext["Paint Context<br/>[PaintContext.java]"]
  node_svgpaint["SVG Paint<br/>[SVGPaint.java]"]
  node_measure["Measurement"]
  node_output["Graphics Output<br/>[Output.java]"]
end

subgraph group_integrations["Platform Integrations"]
  node_javafxcanvas["JavaFX Canvas<br/>[FXSVGCanvas.java]"]
  node_javafxoutput["JavaFX Output<br/>[FXOutputImpl.java]"]
  node_logging["Logging API<br/>[Logger.java]"]
  node_slf4j["SLF4J Adapter"]
  node_systemlogger["System Logger"]
end

node_app(("Application"))

node_app -->|"loads SVG"| node_loader
node_loader -->|"produces document"| node_document
node_app -->|"renders"| node_document
node_document -->|"renders to"| node_output
node_document -.->|"uses context"| node_context
node_context -->|"holds paint state"| node_paintcontext
node_context -->|"uses measurements"| node_measure
node_paintcontext -->|"stores paints"| node_svgpaint
node_attributes -->|"parses lengths"| node_lengths
node_paintparse -->|"creates paints"| node_svgpaint
node_css -.->|"provides values"| node_attributes
node_svgnodes -.->|"uses shapes"| node_geometry
node_svgnodes -.->|"supports filters"| node_filters
node_svgnodes -.->|"supports text"| node_text
node_svgnodes -.->|"supports animation"| node_animation
node_javafxcanvas -->|"renders document"| node_document
node_javafxcanvas -.->|"selects backend"| node_javafxoutput
node_javafxoutput -->|"implements output"| node_output
node_slf4j -->|"implements API"| node_logging
node_systemlogger -->|"implements API"| node_logging

click node_loader "https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/parser"
click node_document "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/SVGDocument.java"
click node_css "https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/parser/css"
click node_attributes "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/parser/impl/AttributeParser.java"
click node_paintparse "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/paint/impl/DefaultPaintParser.java"
click node_svgnodes "https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/nodes"
click node_geometry "https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/geometry"
click node_lengths "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/geometry/size/Length.java"
click node_animation "https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/animation"
click node_filters "https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/nodes/filter"
click node_text "https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/nodes/text"
click node_context "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/renderer/RenderContext.java"
click node_paintcontext "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/renderer/impl/context/PaintContext.java"
click node_svgpaint "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/paint/SVGPaint.java"
click node_measure "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/renderer/MeasureContext.java"
click node_output "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/renderer/output/Output.java"
click node_javafxcanvas "https://github.com/weisj/jsvg/blob/master/jsvg-javafx/src/main/java/com/github/weisj/jsvg/ui/jfx/FXSVGCanvas.java"
click node_javafxoutput "https://github.com/weisj/jsvg/blob/master/jsvg-javafx/src/main/java/com/github/weisj/jsvg/renderer/jfx/impl/FXOutputImpl.java"
click node_logging "https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/logging/Logger.java"
click node_slf4j "https://github.com/weisj/jsvg/blob/master/jsvg-slf4j/src/main/java/com/github/weisj/jsvg/logging/slf4j/Slf4jLogManager.java"
click node_systemlogger "https://github.com/weisj/jsvg/blob/master/jsvg-systemlogger/src/main/java/com/github/weisj/jsvg/logging/systemlogger/SystemLoggerLogManager.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loader,node_document toneBlue
class node_css,node_attributes,node_paintparse,node_svgnodes,node_geometry,node_lengths,node_animation,node_filters,node_text toneAmber
class node_context,node_paintcontext,node_svgpaint,node_measure,node_output toneMint
class node_javafxcanvas,node_javafxoutput,node_logging,node_slf4j,node_systemlogger toneRose
class node_app toneIndigo
```

## Components

### Document Workflow

- [SVG Loading](https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/parser): `jsvg/src/main/java/com/github/weisj/jsvg/parser`
- [SVG Document](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/SVGDocument.java): `jsvg/src/main/java/com/github/weisj/jsvg/SVGDocument.java`

### SVG Interpretation

- [CSS Parsing](https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/parser/css): `jsvg/src/main/java/com/github/weisj/jsvg/parser/css`
- [Attribute Parsing](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/parser/impl/AttributeParser.java): `jsvg/src/main/java/com/github/weisj/jsvg/parser/impl/AttributeParser.java`
- [Paint Parsing](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/paint/impl/DefaultPaintParser.java): `jsvg/src/main/java/com/github/weisj/jsvg/paint/impl/DefaultPaintParser.java`
- [SVG Elements](https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/nodes): `jsvg/src/main/java/com/github/weisj/jsvg/nodes`
- [Geometry](https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/geometry): `jsvg/src/main/java/com/github/weisj/jsvg/geometry`
- [Lengths and Units](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/geometry/size/Length.java): `jsvg/src/main/java/com/github/weisj/jsvg/geometry/size/Length.java`
- [Animation](https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/animation): `jsvg/src/main/java/com/github/weisj/jsvg/animation`
- [SVG Filters](https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/nodes/filter): `jsvg/src/main/java/com/github/weisj/jsvg/nodes/filter`
- [SVG Text](https://github.com/weisj/jsvg/tree/master/jsvg/src/main/java/com/github/weisj/jsvg/nodes/text): `jsvg/src/main/java/com/github/weisj/jsvg/nodes/text`

### Rendering Engine

- [Render Context](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/renderer/RenderContext.java): `jsvg/src/main/java/com/github/weisj/jsvg/renderer/RenderContext.java`
- [Paint Context](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/renderer/impl/context/PaintContext.java): `jsvg/src/main/java/com/github/weisj/jsvg/renderer/impl/context/PaintContext.java`
- [SVG Paint](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/paint/SVGPaint.java): `jsvg/src/main/java/com/github/weisj/jsvg/paint/SVGPaint.java`
- [Measurement](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/renderer/MeasureContext.java): `jsvg/src/main/java/com/github/weisj/jsvg/renderer/MeasureContext.java`
- [Graphics Output](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/renderer/output/Output.java): `jsvg/src/main/java/com/github/weisj/jsvg/renderer/output/Output.java`

### Platform Integrations

- [JavaFX Canvas](https://github.com/weisj/jsvg/blob/master/jsvg-javafx/src/main/java/com/github/weisj/jsvg/ui/jfx/FXSVGCanvas.java): `jsvg-javafx/src/main/java/com/github/weisj/jsvg/ui/jfx/FXSVGCanvas.java`
- [JavaFX Output](https://github.com/weisj/jsvg/blob/master/jsvg-javafx/src/main/java/com/github/weisj/jsvg/renderer/jfx/impl/FXOutputImpl.java): `jsvg-javafx/src/main/java/com/github/weisj/jsvg/renderer/jfx/impl/FXOutputImpl.java`
- [Logging API](https://github.com/weisj/jsvg/blob/master/jsvg/src/main/java/com/github/weisj/jsvg/logging/Logger.java): `jsvg/src/main/java/com/github/weisj/jsvg/logging/Logger.java`
- [SLF4J Adapter](https://github.com/weisj/jsvg/blob/master/jsvg-slf4j/src/main/java/com/github/weisj/jsvg/logging/slf4j/Slf4jLogManager.java): `jsvg-slf4j/src/main/java/com/github/weisj/jsvg/logging/slf4j/Slf4jLogManager.java`
- [System Logger](https://github.com/weisj/jsvg/blob/master/jsvg-systemlogger/src/main/java/com/github/weisj/jsvg/logging/systemlogger/SystemLoggerLogManager.java): `jsvg-systemlogger/src/main/java/com/github/weisj/jsvg/logging/systemlogger/SystemLoggerLogManager.java`

### Other components

- **Application**

## Connections

- Application → SVG Loading: loads SVG (evidence: `README.md`)
- SVG Loading → SVG Document: produces document (evidence: `README.md`)
- Application → SVG Document: renders (evidence: `README.md`)
- SVG Document → Graphics Output: renders to (evidence: `README.md`)
- SVG Document → Render Context: uses context (evidence: `jsvg/src/main/java/com/github/weisj/jsvg/SVGDocument.java`)
- Render Context → Paint Context: holds paint state (evidence: `jsvg/src/main/java/com/github/weisj/jsvg/renderer/RenderContext.java`)
- Render Context → Measurement: uses measurements (evidence: `jsvg/src/main/java/com/github/weisj/jsvg/renderer/RenderContext.java`)
- Paint Context → SVG Paint: stores paints (evidence: `jsvg/src/main/java/com/github/weisj/jsvg/renderer/impl/context/PaintContext.java`)
- Attribute Parsing → Lengths and Units: parses lengths (evidence: `jsvg/src/main/java/com/github/weisj/jsvg/parser/impl/AttributeParser.java`)
- Paint Parsing → SVG Paint: creates paints (evidence: `jsvg/src/main/java/com/github/weisj/jsvg/paint/impl/DefaultPaintParser.java`)
- CSS Parsing → Attribute Parsing: provides values (evidence: `jsvg/src/main/java/com/github/weisj/jsvg/parser/impl/AttributeParser.java`)
- SVG Elements → Geometry: uses shapes (evidence: `jsvg/src/main/java/com/github/weisj/jsvg/geometry/path/PathParser.java`)
- SVG Elements → SVG Filters: supports filters (evidence: `jsvg/src/main/java/com/github/weisj/jsvg/nodes/filter/ChannelStorage.java`)
- SVG Elements → SVG Text: supports text
- SVG Elements → Animation: supports animation
- JavaFX Canvas → SVG Document: renders document (evidence: `jsvg-javafx/src/main/java/com/github/weisj/jsvg/ui/jfx/FXSVGCanvas.java`)
- JavaFX Canvas → JavaFX Output: selects backend
- JavaFX Output → Graphics Output: implements output (evidence: `jsvg-javafx/src/main/java/com/github/weisj/jsvg/renderer/jfx/impl/FXOutputImpl.java`)
- SLF4J Adapter → Logging API: implements API (evidence: `jsvg-slf4j/src/main/java/com/github/weisj/jsvg/logging/slf4j/Slf4jLogManager.java`)
- System Logger → Logging API: implements API (evidence: `jsvg-systemlogger/src/main/java/com/github/weisj/jsvg/logging/systemlogger/SystemLoggerLogManager.java`)
