feat(wardley): opt-in automatic label placement (autoPlaceLabels)#7767
Open
tractorjuice wants to merge 5 commits into
Open
feat(wardley): opt-in automatic label placement (autoPlaceLabels)#7767tractorjuice wants to merge 5 commits into
tractorjuice wants to merge 5 commits into
Conversation
- Add `(ecosystem)` source-strategy alongside build/buy/outsource/market. Renders as concentric circles with a diagonal-hatch ring, matching the OWM ecosystem-play symbol. - Add attitude zones using OWM's canonical 4-coordinate form `keyword [v1, m1, v2, m2]`. Renders as a translucent labelled rectangle in OWM's colour palette: pioneers (light blue), settlers (medium blue), townplanners (purple). - Accept `explorers` as an alias for `pioneers` and `villagers` as an alias for `settlers`. - Update Sourcing Strategy docs (corrected misleading shape descriptions for build/buy/outsource/market) and add an Attitude Zones section with example. - Refresh tool URL to create.wardleymaps.ai and drop dead link. Tests: 45 unit tests (parser package + mermaid package + builder), plus Cypress fixtures for both new features. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…s, docs - Wire pioneers/settlers/townplanners stroke+fill and ecosystem outer/middle/inner fills through `themeVariables.wardley?.X` with OWM hex defaults, matching the existing wardley theming pattern. - Restore learnwardleymapping.com link to Resources alongside create.wardleymaps.ai. - Use "evolution" consistently instead of "maturity" in docs. - Clamp attitude zone label Y so it can't fall outside very thin rectangles. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 57797f9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #7767 +/- ##
==========================================
- Coverage 3.33% 3.22% -0.12%
==========================================
Files 542 600 +58
Lines 56881 61564 +4683
Branches 839 918 +79
==========================================
+ Hits 1899 1987 +88
- Misses 54982 59577 +4595
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Adds an opt-in `autoPlaceLabels` config flag to the wardley-beta diagram. When enabled, component/anchor/link/annotation labels are repositioned to avoid overlapping each other, node markers, pipeline boxes, the chart boundary and link lines, with leader lines for far-placed labels. A collision-free manual `label [x, y]` is kept as authored; pipeline child labels prefer placement underneath. Placement is a pure, deterministic, unit-tested module (wardleyLabelPlacement.ts); the renderer path is unchanged when the flag is off. Stacked on mermaid-js#7696 (wardley ecosystem/attitudes).
bf9ba61 to
49b8d57
Compare
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Reword a doc comment to drop a word cspell does not know, and collapse a lonely nested if into its else-if condition (unicorn/no-lonely-if).
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
Adds an opt-in
autoPlaceLabelsconfig flag to thewardley-betadiagram — off by default, so existing maps render unchanged.When enabled, component, anchor, link and annotation labels are repositioned to avoid overlapping each other, node markers, pipeline boxes, the chart boundary and link lines:
label [x, y]is kept exactly as authored; a colliding one is re-placed but biased toward the authored position.wardleyLabelPlacement.ts). The renderer path is unchanged when the flag is off.Enable via config:
This is built on top of #7696 (wardley
(ecosystem)decorator + attitude zones). Until #7696 merges, the diff here also shows #7696's commits — please review #7696 first. The net-new change in this PR is the autoplacement work, 8 files:wardleyLabelPlacement.ts+.spec.ts,wardleyRenderer.ts,styles.ts,config.schema.yaml,config.type.ts, the Cypress wardley spec, and a changeset. I'll rebase ontodeveloponce #7696 merges.Test Plan
packages/mermaid/src/diagrams/wardley).tsc --noEmitis clean.cypress/integration/rendering/wardley/wardley.spec.js: dense map, kept vs re-placed manual labels, pipeline-child placement.🤖 Generated with Claude Code