Repository navigation
Directed graph XML: expose document, shape and connector options (part of #225) - #230
Merged
Merged
Conversation
Adds optional XML for more of the DirectedGraphDocument model (part of #225): a <documentoptions> element (template, borderwidth, borderheight); pageborderwidth/pageborderheight on <renderoptions>; on <shape> width and height, <hyperlink> children, a <cells> element (any ShapeCells property by name) and typed <customprop> (type, label, prompt, format); and on <connector> a per-edge connectortype, <cells> and <customprop>. Everything is optional, so existing XML loads unchanged. MsaglRenderer now applies Edge.CustomProperties to the drawn connector (it previously ignored them) for both dynamic and Bezier connectors. 24 new tests in DirectedGraphXmlOptionsTests (loader and live drawing). DefaultShapeSize and per-edge master/stencil are not exposed; DefaultShapeSize is never used for nodes because masters resolve their sizes first. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
DirectedGraphDocument.Template goes to NewDocumentFromTemplate, which opens the template as a docked stencil and returns a blank document (filed as #229). The new test only checks that the option is accepted and the graph still draws. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
pageborderwidth/pageborderheight have no effect on the XML path: after the renderer sizes the page, DrawDirectedGraphDocument resizes it again using the document's BorderSize, which wins (live-verified: a page border of 3 gave the same page width as the default, a document border of 3 doubled it). Exposing a no-op option would mislead, so only the document-level borderwidth and borderheight remain. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 1, 2026
Merged
Resolves the CHANGELOG conflict with the DrawOrgChart fix (both entries kept) and refreshes the test counts, CLAUDE.md state and the Models docs backlog entry for the XML options. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the agreed first tier of #225: more of the directed graph model can be set from the directed graph XML format. Every addition is optional, so existing XML loads unchanged. This is part of #225, not all of it (see "Not included").
New XML
<documentoptions template borderwidth borderheight>as a child of<directedgraph>(a new element, so the root still takes no attributes). If only one border attribute is given the other keeps its default.<shape>:widthandheight(both or neither);<hyperlink name address subaddress description>children (theurlattribute's link stays first); a<cells><cell name value/></cells>child that sets anyShapeCellsproperty by name (case-insensitive, unknown names throw); and<customprop>gainstype(string,number,boolean,date),label,promptandformat.<connector>: a per-edgeconnectortypethat overrides the page setting, a<cells>child (explicit cells win over thecolor,weightand arrow defaults), and<customprop>children.Renderer fix
MsaglRenderernow appliesEdge.CustomPropertiesto the drawn connector (dynamic and Bezier). It previously ignored them, so connector custom properties could not have worked from any path.Not included, and why
pageborderwidth/pageborderheight(PageBorderWidth): built, then removed. They have no effect on the XML path:DrawDirectedGraphDocumentresizes each page again with the document'sBorderSize, which wins (live-verified: a page border of 3 gave the same page width as the default; a document border of 3 doubled it).DefaultShapeSize: never used for nodes, because masters resolve their sizes first.DirectedGraphStylingfrom XML: out of the agreed scope; they need model and pipeline changes. Directed graph XML format: expose all DirectedGraphLayout model options #225 should stay open for them.templateis exposed, but note it inherits NewDocumentFromTemplate creates a blank document and opens the template as a stencil, instead of basing the document on it #229:NewDocumentFromTemplateopens the template as a docked stencil and returns a blank drawing. Filed separately.Testing
DirectedGraphXmlOptionsTests(loader tests plus live drawing tests).Import-VisioModel x.xml | Out-VisioApplication) with an XML file using the new options: sizes, fill color, both hyperlinks, number and boolean custom properties, the connector's arrow and custom property all reached the drawn shapes.Notes
NuGet/CHANGELOG.md[Unreleased]gets an Added section and a Fixed entry.docs/TESTING.mdorCLAUDE.md: PR Fix DrawOrgChart resizing the target page #228 edits the same lines. They need a refresh after both merge.Refs #225, #229
🤖 Generated with Claude Code