Skip to content

@graphty/graph-io / styles / extractStyles

Function: extractStyles() ​

extractStyles(importer, snapshot, report, options?): ExtractedStyles | null

Defined in: styles/io/generic.ts:117

Reads the styles of a file after its import: the reading importer's own styles() (with what its import() kept for it), or the columns whose role is a style role when it has none; a graphty.styles block carried as a graph attribute gives the rules, with the importer's values as the truth. Called by importGraph() when styles are requested; a caller that drives an importer itself (into its own builder) calls it with the report import() returned.

Parameters ​

importer ​

GraphImporter

the importer that read the file

snapshot ​

GraphSnapshot

the graph it built

report ​

ImportReport

the report its import() returned

options? ​

ExtractStylesOptions = {}

tool defaults and a cancel signal

Returns ​

ExtractedStyles | null

the styles, or null when the file has none