Skip to content

[graph/canvas] refactor: graph theme naming overhaul#670

Merged
Yonava merged 9 commits into
mainfrom
yva/map-to-override
Jun 12, 2026
Merged

[graph/canvas] refactor: graph theme naming overhaul#670
Yonava merged 9 commits into
mainfrom
yva/map-to-override

Conversation

@Yonava

@Yonava Yonava commented Jun 12, 2026

Copy link
Copy Markdown
Owner

closes #657

Restructures the theme API under a single canvas.theme namespace and tightens up naming throughout.

What changed

getTheme, themeMap, baseTheme, activeThemePreset, and useTheme are now grouped under canvas.theme as _resolveToken, _overrides, base, activePreset, and createLayer
useTheme.ts → createLayer.ts, getThemeResolver.ts → createTokenResolver.ts
ValidGraphThemePath → ThemeToken, FullThemeMap → ThemeOverrides, ThemeMapEntry → ThemeOverride
resolveThemeForNode / resolveThemeForEdge → getNodeStyles / getEdgeStyles
Layer controls shortened: setTheme / removeTheme / removeAllThemes → set / remove / removeAll
Background pattern drawing moved from the product layer (useGraphWithCanvas) into useCanvasPlugin where it belongs
Added a naming conventions glossary to types.ts (StyleValue / ThemeValue / ThemeToken)

Why

The old API was a flat bag of loosely related fields on canvas. Grouping them under canvas.theme makes the surface discoverable and draws a clear line between what plugins can use internally (_resolveToken, _overrides) and what consumers should reach for (createLayer). The full public read API for product code is tracked in #574.

@Yonava Yonava changed the title Yva/map to override [graph/canvas] refactor: graph theme naming overhaul Jun 12, 2026
@Yonava Yonava merged commit db3f9f6 into main Jun 12, 2026
1 check failed
@Yonava Yonava deleted the yva/map-to-override branch June 12, 2026 18:31
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.

[graph/theme]: standardize and unify naming conventions for themes

1 participant