Repository navigation
Quick fixes: SVG XML error location, Vega-Lite cornerRadiusEnd, SCAD angle fragments - #154
Conversation
…ments, class text stroke check - SVG: a stream that is not well-formed XML names the line and column of the error (Load and GetInfo), and says that '--' is not allowed inside an XML comment when that is the cause; the location reaches the corrupt-input message of canvasnet render in text and JSON. - Vega-Lite: bars and rects honor cornerRadiusTopLeft/TopRight/BottomRight/ BottomLeft, and bars round their value end with cornerRadiusEnd as Vega-Lite 6.5 does (sign-aware, every corner of a ranged bar, mark beats config); stacked segments are rounded per segment (documented difference). SceneRect gains an optional CornerRadii painted per corner; the scene snapshots only gain CornerRadii=null. - OpenSCAD: link and input fragments accept azimuth= and elevation= (like --azimuth and --elevation, replacing the angles of the named view); an input fragment overrides each of view, azimuth, and elevation of the command individually; invalid values are image-fragment-invalid. - Mermaid: verified that Mermaid 11 never paints class texts with a class stroke style; added a regression test and documented the behavior. Requirements, design, verification, user guides, help cards, and README updated to match. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Active documentation and implementation issues remain, including incorrect view-angle guidance, lost per-corner radius precedence, and missing validation for newly supported corner properties.
3 open issues
What changed in this PR
This pull request adds malformed-SVG error locations, SCAD camera-angle fragment parameters, and Vega-Lite per-corner and value-end bar rounding, along with Mermaid regression coverage and related documentation, verification, requirements, and design updates.
Changes:
- Reports SVG XML line and column details with a targeted XML-comment hint.
- Supports
azimuthandelevationfragment parameters for SCAD inputs with validation and precedence handling. - Adds Vega-Lite
cornerRadiusEndand individual corner-radius support with scenegraph rendering and tests. - Adds Mermaid class-label stroke regression coverage and updates traceability artifacts.
| File | Description |
|---|---|
| test/DemaConsulting.CanvasNet.Viewer.Tests/Imaging/InputSelectionTests.cs | Tests SCAD fragment-angle precedence, merging, and validation. |
| test/DemaConsulting.CanvasNet.Viewer.Tests/CanvasNetViewerFragmentTests.cs | Tests rendering and rejection of SCAD angle fragments. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/VegaLiteSystemIntegrationTests.cs | Tests rendered rounded value ends for vertical and horizontal bars. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Scenegraph/ScenePainterTests.cs | Tests independent corner-radius rendering, clamping, and non-finite handling. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Marks/MarkBuilderTests.cs | Tests corner-radius resolution, bar-end rounding, and precedence. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Fixtures/SceneSnapshots/single-stacked-bars.scene.txt | Updates the stacked-bar scene snapshot for the new corner-radius field. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Fixtures/SceneSnapshots/single-histogram.scene.txt | Updates the histogram scene snapshot for the new corner-radius field. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Fixtures/SceneSnapshots/single-container-fit.scene.txt | Updates the container-fit scene snapshot for the new corner-radius field. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Fixtures/SceneSnapshots/single-bar-nominal.scene.txt | Updates the nominal-bar scene snapshot for the new corner-radius field. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Fixtures/SceneSnapshots/layered-own-data-independent-legend.scene.txt | Updates the layered scene snapshot for the new corner-radius field. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Fixtures/SceneSnapshots/layered-nested-text.scene.txt | Updates the layered-text scene snapshot for the new corner-radius field. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Fixtures/SceneSnapshots/layered-dual-axis.scene.txt | Updates the dual-axis scene snapshot for the new corner-radius field. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Fixtures/SceneSnapshots/layered-boxplot.scene.txt | Updates the boxplot scene snapshot for the new corner-radius field. |
| test/DemaConsulting.CanvasNet.VegaLite.Tests/Fixtures/SceneSnapshots/layered-bar-rule.scene.txt | Updates the bar-rule scene snapshot for the new corner-radius field. |
| test/DemaConsulting.CanvasNet.Tool.Tests/Commands/RenderCommandTests.cs | Tests malformed SVG line and column reporting in text and JSON output. |
| test/DemaConsulting.CanvasNet.Tool.Tests/Commands/InputFragmentTests.cs | Tests SCAD angle fragments and command-line behavior. |
| test/DemaConsulting.CanvasNet.Tool.Tests/Commands/HelpTopicsTests.cs | Verifies that SCAD angle parameters appear in help content. |
| test/DemaConsulting.CanvasNet.Svg.Tests/SvgCodecTests.cs | Tests malformed XML locations and the double-hyphen comment hint. |
| test/DemaConsulting.CanvasNet.Mermaid.Tests/Rendering/ShapeLibraryTests.cs | Tests that class strokes affect outlines but not label text. |
| src/DemaConsulting.CanvasNet.Viewer/LoaderImageSource.cs | Parses and validates SCAD angle fragment parameters. |
| src/DemaConsulting.CanvasNet.Viewer/Imaging/InputSelection.cs | Merges fragment azimuth and elevation values with command options. |
| src/DemaConsulting.CanvasNet.VegaLite/Scenegraph/ScenePainter.cs | Paints rectangles with independent corner radii. |
| src/DemaConsulting.CanvasNet.VegaLite/Scenegraph/SceneModel.cs | Adds per-corner radius data to scene rectangles. |
| src/DemaConsulting.CanvasNet.VegaLite/Marks/MarkBuilder.cs | Resolves Vega-Lite corner-radius properties and bar value ends. |
| src/DemaConsulting.CanvasNet.Tool/Commands/RenderCommand.cs | Updates render-command help for SCAD angle fragments. |
| src/DemaConsulting.CanvasNet.Tool/Commands/Help/vega-lite/marks.md | Documents corner-radius support and stacked-bar behavior. |
| src/DemaConsulting.CanvasNet.Tool/Commands/Help/svg/fragments.md | Documents fragment angle parameters and precedence. |
| src/DemaConsulting.CanvasNet.Tool/Commands/Help/svg/diagnostics.md | Documents malformed XML location reporting. |
| src/DemaConsulting.CanvasNet.Tool/Commands/Help/scad/views.md | Documents SCAD fragment camera angles. |
| src/DemaConsulting.CanvasNet.Tool/Commands/Help/scad/differences.md | Documents SCAD angle-fragment behavior and validation. |
| src/DemaConsulting.CanvasNet.Svg/SvgCodec.Parsing.cs | Updated as part of this pull request. |
| README.md | Adds SCAD angle fragments to the feature overview. |
| docs/verification/canvas-net-viewer/imaging/source-loader.md | Records SCAD angle-fragment verification coverage. |
| docs/verification/canvas-net-viewer/canvas-net-viewer.md | Records rendered SCAD angle-fragment scenarios. |
| docs/verification/canvas-net-vega-lite/scenegraph/scene-painter.md | Records per-corner scene-painter verification. |
| docs/verification/canvas-net-vega-lite/marks/mark-builder.md | Records bar corner-radius and precedence verification. |
| docs/verification/canvas-net-vega-lite.md | Records public rounded-bar integration verification. |
| docs/verification/canvas-net-tool/commands/render-command.md | Records malformed SVG and SCAD fragment command verification. |
| docs/verification/canvas-net-svg/svg-codec.md | Records malformed XML location verification. |
| docs/verification/canvas-net-mermaid/rendering/shape-library.md | Records Mermaid class-text stroke verification. |
| docs/user_guide/canvas-net.md | Updates general fragment parameter documentation. |
| docs/user_guide/canvas-net-viewer.md | Documents SCAD angle fragments and option precedence. |
| docs/user_guide/canvas-net-vega-lite.md | Documents Vega-Lite corner-radius support and stack behavior. |
| docs/user_guide/canvas-net-tool.md | Documents command fragment angles and camera behavior. |
| docs/user_guide/canvas-net-svg.md | Documents malformed SVG location errors and angle fragments. |
| docs/user_guide/canvas-net-scad.md | Documents SCAD angle fragments for linked models. |
| docs/sysml2/model/canvas-net-viewer/canvas-net-viewer.sysml | Updates the viewer architecture description for angle fragments. |
| docs/sysml2/model/canvas-net-vega-lite/marks/mark-builder.sysml | Updates the MarkBuilder architecture description for corner radii. |
| docs/reqstream/canvas-net-viewer/imaging/source-loader.yaml | Adds SCAD angle-fragment requirements and verification traceability. |
| docs/reqstream/canvas-net-viewer/canvas-net-viewer.yaml | Adds viewer angle-fragment requirements and verification traceability. |
| docs/reqstream/canvas-net-viewer.yaml | Updated as part of this pull request. |
| docs/reqstream/canvas-net-vega-lite/scenegraph/scene-painter.yaml | Adds per-corner scene-painter requirements and tests. |
| docs/reqstream/canvas-net-vega-lite/marks/mark-builder.yaml | Adds corner-radius MarkBuilder requirements and tests. |
| docs/reqstream/canvas-net-vega-lite/marks.yaml | Links the corner-radius requirement into the marks hierarchy. |
| docs/reqstream/canvas-net-vega-lite.yaml | Links the rounded-bar system integration verification. |
| docs/reqstream/canvas-net-tool/commands/render-command.yaml | Adds malformed SVG and SCAD angle requirements and tests. |
| docs/reqstream/canvas-net-svg/svg-codec.yaml | Adds malformed XML location requirements and tests. |
| docs/reqstream/canvas-net-svg.yaml | Links malformed XML location requirements into the SVG hierarchy. |
| docs/reqstream/canvas-net-mermaid/rendering/shape-library.yaml | Adds Mermaid class-text stroke requirements and tests. |
| docs/design/canvas-net-viewer/imaging/source-loader.md | Describes SCAD angle parsing and merge behavior. |
| docs/design/canvas-net-viewer/canvas-net-viewer.md | Updates viewer design documentation for angle fragments. |
| docs/design/canvas-net-vega-lite/scenegraph/scene-painter.md | Describes per-corner rectangle painting. |
| docs/design/canvas-net-vega-lite/scenegraph/scene-model.md | Documents the scene corner-radius model. |
| docs/design/canvas-net-vega-lite/marks/mark-builder.md | Describes corner-radius resolution and stack behavior. |
| docs/design/canvas-net-svg/svg-codec.md | Documents malformed XML error construction. |
| docs/design/canvas-net-mermaid/rendering/shape-library.md | Documents Mermaid class-label stroke behavior. |
Review effort: Lite
- Validate cornerRadiusEnd and the four single-corner radii of a mark definition as numbers or expression references, like cornerRadius; add wrong-type rows and valid forms to the SpecParser tests. - Clarify the ranged-bar corner radius comment in MarkBuilder and pin that a corner set on the mark keeps its radius against a configuration cornerRadiusEnd (ranged and positive bars). - Replace the stale fragment view-angle sentence in the tool user guide and extend the scad/views help card. - Update the spec-parser design and the spec-parser and mark-builder verification documents. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The change spans several independent rendering paths, and full runtime verification was not possible because the repository’s pinned dependencies could not be restored in the review container.
No open issues 🎉
3 resolved since last review
Review effort: Lite


Pull Request
Description
Four small backlog fixes.
canvasnet rendertext and--jsonoutput, for exampleThe stream does not contain well-formed XML (line 2, column 10): '--' is not allowed inside an XML comment.The hint covers only the comment case. It is found from the XML reader's English message, so on a non-English .NET runtime only the line and column appear.cornerRadiusEnd. Before this change onlycornerRadiuswas read;cornerRadiusEndand the four single-corner settings were silently ignored. A bar now rounds:x2/y2).A
rectmark ignorescornerRadiusEnd, and a mark setting beats a config setting.cornerRadiusTopLeft,cornerRadiusTopRight,cornerRadiusBottomLeftandcornerRadiusBottomRightare supported too.Known difference, documented in the user guide and help card: in a stack each segment is rounded by itself, where Vega-Lite rounds only the outer ends of the whole stack.
Nine scene snapshots changed only by an added
CornerRadii=null.#azimuth=and#elevation=fragment keys for SCAD models. These keys set the camera angles of an embedded or input model, the same way--azimuthand--elevationdo: they replace the angles of theview=named view, so#view=front&azimuth=90draws the right view. Azimuth can be any finite number and is normalized to 0–360; elevation must be from -90 to 90. Anything else isimage-fragment-invalid. The Pandoc filter needs no change, because it already takesazimuth/elevationattributes.stroke:#f00on the label text, but the browser doesn't paint it: the PNG has no red in the text. CanvasNet already draws the same thing. A regression test now covers it (text without a stroke, red outline).Before and after
Vega-Lite
"mark": {"type": "bar", "cornerRadiusEnd": 8}: before, the setting was ignored; after, each bar rounds at its value end (including the negative bar B, which rounds at the bottom).SCAD
canvasnet render "ell.scad#azimuth=200&elevation=50": before, both keys were ignored withimage-fragment-unknown-parameterwarnings and the model drew from the default view; after, the camera turns to azimuth 200, elevation 50.SVG XML error for a comment containing
--(<!-- step 1 -- step 2 -->on line 2):Type of Change
Related Issues
Backlog items, no issues filed.
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
pwsh ./build.ps1(passed, 0 failures)Code Quality
Quality Checks
Please run the following checks before submitting:
pwsh ./lint.ps1(passed)Testing
Documentation
Additional Notes
After the next release,
docs/images/showcase.png,composition.pngandvegalite-gallery.pngshould be regenerated so their charts show the rounded bars. The image script uses the released tool, so this PR does not regenerate them.