Visual styling
Visual styling is captured in ArchiStyle
and ArchiFontStyle:
interface ArchiStyle { lineColor: string | null; // hex color, e.g. "#000000" lineWidth: number | null; fillColor: string | null; // hex color, e.g. "#ffffff" font: ArchiFontStyle | null;}
interface ArchiFontStyle { name: string | null; size: number | null; style: string | null; // e.g. "bold", "italic" color: string | null;}Null-safe parsing
Section titled “Null-safe parsing”Every style attribute is parsed independently: a missing or
non-numeric/non-string attribute yields null for that field only — the
parser never fabricates 0 or an empty string, and never fails the whole
object because of one bad field. Style values are always preserved verbatim
as Archi wrote them, with no normalization or clamping.
Example
Section titled “Example”const styledElements = model.diagramObjects.filter( (o) => o.style?.fillColor === '#ff0000',);
console.log('red diagram objects:', styledElements.length);Who carries styles
Section titled “Who carries styles”ArchiStyle is shared by the visual types:
ArchiDiagramObjectArchiDiagramConnectionArchiNote
Elements and relationships do not carry styles — styling lives on their visual representations, not on the semantic model.