Conversation
When set, the `large-arc-flag` and `sweep-flag` attributes were always considered as true, so the rendering was incorrect. This is a regression introduced during the migration from `mxGraph`. A new story has been added to confirm that the problem is now fixed.
WalkthroughThe changes introduce a new utility for converting string attributes to boolean values in the stencil geometry logic, ensuring consistent interpretation of arc flags. In the Storybook stories for stencils, the local element type guard is replaced with a shared utility function, and the dependency on core constants is removed. Additionally, a new Storybook story is added to visualize and interact with a custom stencil shape, including interactive controls for zooming and fitting the graph view. A new shared utility file provides the Changes
Sequence Diagram(s)sequenceDiagram
participant StorybookUser as User
participant Story as StencilsViewer.stories.ts
participant Graph as maxGraph Graph
participant StencilRegistry as Stencil Registry
StorybookUser->>Story: Open StencilsViewer story
Story->>Story: Parse stencil XML
Story->>StencilRegistry: Register custom stencil shape
Story->>Graph: Initialize graph with plugins and options
Story->>Graph: Insert vertex with custom stencil
StorybookUser->>Story: Click zoom/fit buttons
Story->>Graph: Adjust view (zoom/fit)
sequenceDiagram
participant StencilShape as StencilShape
participant XMLNode as XML Node
XMLNode->>StencilShape: Provide arc flag attributes (as string)
StencilShape->>StencilShape: Call toBoolean on attributes
StencilShape->>StencilShape: Use boolean flags in arcTo drawing logic
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
implementation: only check number in string in the boolean conversion (conform to xsd) improve documentation and comments story: enable panning
|



When set, the
large-arc-flagandsweep-flagattributes were always considered as true, so the rendering was incorrect.This is a regression introduced during the migration from
mxGraph.A new story has been added to confirm that the problem is now fixed.
Notes
Closes #786
Screenshots
Using the new story,
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Chores