Skip to content

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;
}

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.

const styledElements = model.diagramObjects.filter(
(o) => o.style?.fillColor === '#ff0000',
);
console.log('red diagram objects:', styledElements.length);

ArchiStyle is shared by the visual types:

  • ArchiDiagramObject
  • ArchiDiagramConnection
  • ArchiNote

Elements and relationships do not carry styles — styling lives on their visual representations, not on the semantic model.