Repository navigation
feat(mindmap): add coloring by hierarchy depth - #1
Closed
jackroberts236 wants to merge 2 commits into
Closed
jackroberts236 wants to merge 2 commits into
jackroberts236 wants to merge 2 commits into
Conversation
jackroberts236
force-pushed
the
feature/mindmap-depth-colors
branch
from
October 5, 2026 12:36
f049054 to
eff6be6
Compare
jackroberts236
force-pushed
the
feature/mindmap-depth-colors
branch
4 times, most recently
from
October 6, 2026 11:23
8c619b3 to
f9d1164
Compare
Add `mindmap.colorBy: depth`, which assigns color sections by distance from the root instead of by top-level branch. Depth follows parent-child relationships, not indentation, and reuses the existing section styles. `branch` remains the default.
jackroberts236
force-pushed
the
feature/mindmap-depth-colors
branch
from
October 6, 2026 12:07
f9d1164 to
ce983f8
Compare
In the neo look, SVG text switches color with the backgrounds the theme paints, but HTML labels kept the classic label colors. The root label was unreadable on dark and forest, and so were the labels of neutral's second section. Give span labels the same color as the neo SVG text, for section and root nodes. Section labels in redux-dark also change to match the neo text color.
jackroberts236
force-pushed
the
feature/mindmap-depth-colors
branch
from
October 6, 2026 12:07
ce983f8 to
cbf89ab
Compare
Owner
Author
|
Moved upstream: mermaid-js#8394 |
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 a
mindmap.colorByoption so mindmaps can be colored by hierarchy level instead of by branch.branch(default): current behavior, so existing diagrams are unchanged.depth: nodes at the same distance from the root share a color across all branches.--- config: mindmap: colorBy: depth --- mindmap Root Planning Tasks Delivery ReleasesThe same mindmap with
branch(left) anddepth(right), in the classic look with the default theme and the neo look with redux-color:This PR also fixes HTML labels in the neo look. SVG text switches color with the backgrounds a theme paints, but HTML labels kept the classic label colors. The root label was unreadable on
darkandforest(1.2:1 and 1.4:1 contrast), and so were the labels of the second section onneutral(#F4F4F4text on#eee). This affected branch coloring too, and depth coloring made it more visible. Section labels inredux-darkalso change to match the neo text color, so its existing neo snapshot will differ slightly.Resolves #2
Design decisions
cScale1–cScale11, and deeper levels repeat. Styling reuses the existing section rules, so every theme and look treats depth colors the same way it treats branch colors, with no new theme variables.span) now use the same color as the neo SVG text rules, for section nodes and the root. A Playwright test checks label contrast on the repainted themes in both modes. As a result, the neo HTML root label now usescScaleLabel0instead ofgitBranchLabel0. Palettes that set onlygitBranchLabel0should also setcScaleLabel0. WithuseGradient: false, thedarkroot label drops to 2.8:1, the same contrast its SVG text already had. I kept the SVG rule rather than picking the variable by background, because that would dropforestwithuseGradient: falsefrom 10.7:1 to 2:1.colorto.mindmap-node-label. The current renderer doesn't emit that class, and this PR's rules target the labelspandirectly, so the two don't interact and can merge in either order.