Skip to content

Conversation

@kumilingus
Copy link
Contributor

Summary

  • Add built-in link theme support with properties: color, width, sourceMarker, targetMarker, className, pattern
  • Remove attrs usage from storybook files in favor of theme properties
  • Add parent property support for element embedding
  • Add new "Containers" storybook demonstrating parent-child relationships

Link Theme Properties

Links now support these theme properties out of the box:

  • color - stroke color (default: #333333)
  • width - stroke width (default: 2)
  • sourceMarker / targetMarker - marker presets (arrow, arrow-open, circle, circle-outline, diamond, bar, cross, none) or custom dia.SVGMarkerJSON
  • className - CSS class for the link line
  • pattern - stroke dash pattern (e.g., '5,5' for dashed)

Containers Storybook

New example showing:

  • Parent-child element relationships using parent property
  • embeddingMode Paper option for drag-and-drop embedding
  • validateEmbedding callback to control which elements can be containers

Test plan

  • All existing tests pass (380 tests)
  • Verify link theme properties work in storybook demos
  • Verify containers storybook embedding behavior

🤖 Generated with Claude Code

kumilingus and others added 12 commits January 31, 2026 13:43
- Update all storybook examples to use `color` theme property instead of
  `attrs.line.stroke` for link styling
- Add `mapDataToLinkAttributes` to stories that need custom link types
  (standard.DoubleLink, standard.ShadowLink) or custom attrs
- Store theme properties (color, width, sourceMarker, targetMarker) in
  cell.data for proper bidirectional sync between React state and graph
- Update tests to use new theme properties and reflect stored data structure

Stories updated:
- with-minimap: uses `color` property
- with-resizable-node: uses `color` property
- with-list-node: uses `color` property
- with-rotable-node: uses `color` property
- with-svg-node: uses `color` property
- with-cell-actions: uses `color` property with dynamic updates
- with-build-in-shapes: uses mapDataToLinkAttributes for custom types
- with-link-tools: uses mapDataToLinkAttributes for strokeDasharray
- with-custom-link: uses mapDataToLinkAttributes for custom LinkModel
- with-selection: uses mapDataToLinkAttributes and theme properties

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant