Skip to content

@graphty/graph-io / styles / ImporterStyles

Type Alias: ImporterStyles ​

ImporterStyles = { dialect: StyleDialect; edge?: RawStyleValues; node?: RawStyleValues; } | { block?: string | null; canonical: true; dialect?: StyleDialect | null; edge?: ReaderOutput; graph?: GraphStyle; node?: ReaderOutput; notes?: readonly StyleNote[]; opacityInColor?: boolean; readFrom?: { edge?: readonly string[]; node?: readonly string[]; }; tool?: StyleTool | null; units?: "px" | "relative"; }

Defined in: styles/types.ts:1378

What an importer's styles() returns: the simple path (a dialect and raw values; graph-io does the rest) or the advanced path (canonical values and declared rules).

Union Members ​

Type Literal ​

{ dialect: StyleDialect; edge?: RawStyleValues; node?: RawStyleValues; }

dialect ​

readonly dialect: StyleDialect

How the raw values are spelled.

edge? ​

readonly optional edge?: RawStyleValues

Raw edge values.

node? ​

readonly optional node?: RawStyleValues

Raw node values.


Type Literal ​

{ block?: string | null; canonical: true; dialect?: StyleDialect | null; edge?: ReaderOutput; graph?: GraphStyle; node?: ReaderOutput; notes?: readonly StyleNote[]; opacityInColor?: boolean; readFrom?: { edge?: readonly string[]; node?: readonly string[]; }; tool?: StyleTool | null; units?: "px" | "relative"; }

block? ​

readonly optional block?: string | null

The text of a graphty.styles block the file holds in a place of its own (an XML element, an aspect, a comment) rather than as a graph attribute; graph-io reads it exactly as it reads a block carried as a graph attribute.

canonical ​

readonly canonical: true

Marks the advanced path.

dialect? ​

readonly optional dialect?: StyleDialect | null

How the file spelled its values.

edge? ​

readonly optional edge?: ReaderOutput

Edge output.

graph? ​

readonly optional graph?: GraphStyle

The graph's own style.

node? ​

readonly optional node?: ReaderOutput

Node output.

notes? ​

readonly optional notes?: readonly StyleNote[]

The reader's notes.

opacityInColor? ​

readonly optional opacityInColor?: boolean

Whether the format writes a node's fill opacity and an edge's opacity as the alpha of its color (rgba(), #RRGGBBAA), so the reader gives an opacity only below 1. In a file graphty wrote, an opaque color then states opacity 1, which overrides a translucent value of the graphty.styles block (another program made the element opaque).

readFrom? ​

readonly optional readFrom?: object

The data columns the values were read from (a format's own style columns), per target: they hold the styles themselves, so they are not offered to the planner as columns that explain them.

readFrom.edge? ​

readonly optional edge?: readonly string[]

Edge columns.

readFrom.node? ​

readonly optional node?: readonly string[]

Node columns.

tool? ​

readonly optional tool?: StyleTool | null

The program whose defaults apply, or null.

units? ​

readonly optional units?: "px" | "relative"

The unit of every length.