diagram_io/src/blank.rs#
Source: lib/diagram_io/src/blank.rs
blank -- new documents from scratch: drawing, template, stencil (vsdx::new_document)
Everything here is JFLib's own: the style sheets and the document sheet hold values chosen
for the NetLab look, the theme is the own DrawingML theme "NetLab" (theme.rs); nothing comes
from Visio's files. What a file needs so that Visio opens it follows the public [MS-VSDX]:
the document part with its root style sheet ID 0 "No Style" (every other style inherits from
it), Colors and FaceNames with at least one entry each, a Pages part with one page whose
PageSheet is there (a drawing's and template's page has its own part, a stencil's none), the
theme part named by the document part, the document properties (optional, written with the
application's name only: no user data). And windows.xml: [MS-VSDX] calls the windows part
unused, but desktop Visio refuses a file without it (error 271, found with the user's Visio
on 2026-11-17); an empty Windows element with the client size is enough (windows_xml).
The styles (universal names as Visio knows them, so that formulas and Visio's connector
detection find them), with the IDs of Visio's own: Visio 16 names the styles 1, 2 and 3 of a
file it opens Text Only, None and Normal whatever their names, and gives a style that then
has a taken name another ("Style.4"); its new drawing has 0 No Style, 1 Text Only, 2 None,
3 Normal, 4 Guide, 6 Theme, and its connector tool adds 7 Connector based on Normal unless
there is a Connector already (JD26 Visio check, 2026-11-27: with Connector at 2 and Guide at
3, Visio's connector tool drew in our guide's look). Files written before keep their IDs.
0 No Style the root: every line, fill, text block, character and paragraph cell with a
plain value -- the NetLab look without a design (Signalblau 1 pt line, light
blue fill, anthracite Inter 10 pt, centred text); themed cells fall back to it
6 Theme based on No Style (JD11): every cell a design sets is THEMEVAL() (V "Themed"),
the QuickStyle cells 100 (the variant's colour 1 and style 1), the theme index
cells 65534 (the page's design)
3 Normal based on Theme: what shapes use
2 None based on Normal: no line, no fill (as Visio's)
7 Connector based on Normal: the connector scheme's style 1 (line with its arrow, text),
no fill, the background colour behind the text; the line in the variant's
colour 7 (QuickStyleLineColor 106): NetLab's connector line is dk2 (slate),
which Visio 16 does not take from a theme's style lists -- there it draws the
shape's quick style colour instead (as for phClr; also a fixed srgbClr, and
transforms on dk1 it drops), and colour 7 is that slate in NetLab's variants
1 .. 3 (JD26 Visio check, 2026-11-27). JFDiagrammer reads dk2 as dk2; the
designs whose connector line is dk1 look the same with any colour
4 Guide based on No Style: thin light blue dashed line, no fill
1 Text Only based on Normal: no line, no fill, the dark text of font style 1, with
Visio's contrast rule for text (QuickStyleVariation 2)
DocumentSettings name Normal as the default text, line and fill style and Guide as the
default guide style. The page is A4 (metric, millimetres) or Letter (US, inches), landscape,
and shows the design NetLab, variant 1 (design::catalog).
enum Measurethe measuring system of a new document (FEATURES LG-07, MS-07)Metric-- millimetres, A4Us-- inches, Letter
fn new_document(kind: DocKind, measure: Measure) -> Documenta new document of this kind with JFLib's own defaults (see the module comment); a stencil has no masters yet, a drawing and a template one empty page