Skip to content

Commit e97624b

Browse files
committed
## 1.1.31
### Added - Added cursor-anchored wheel zoom and pinch-anchored gesture zoom in fullscreen mode. Toolbar zoom controls now zoom around the rendered SVG center. - Added ZenUML external-diagram registration and a complete advanced example catalog covering all 30 Mermaid diagram types supported by this package. ### Fixed - Fixed theme changes re-rendering diagrams while a zoom or pan transform was active. Mermaid now renders at an identity transform and restores the user's fitted view, zoom level, and pan position afterward. Fixes #14. - Fixed `fitToContainer` so fitting is a base visual transform while the toolbar's initial zoom level remains `100%`. User zoom and pan are preserved across re-renders and fullscreen transitions. Fixes #15. - Fixed Reset View with `fitToContainer` so it restores the unscaled `100%` user view instead of the fitted and centered position. Fixes #16. - Added a short zoom transition that does not interfere with reset or fit measurement. Fixes #17. - Corrected the Requirement and Radar examples to use Mermaid's current syntax. ### Changed - Optimized the smoke-test package setup to remove and reinstall only the local `vitepress-mermaid-renderer` dependency instead of deleting all test-project dependencies. - Expanded renderer, navigation, and end-to-end coverage for theme rerenders, fit behavior, focal fullscreen zoom, and the advanced diagram catalog.
1 parent 218a76d commit e97624b

20 files changed

Lines changed: 2104 additions & 194 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,5 @@ test-project/node_modules
139139
test-project/.yalc
140140
playwright-report
141141
test-results
142-
.omo/
142+
.omo/
143+
.playwright-mcp/

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Changelog
22

3+
## 1.1.31
4+
5+
### Added
6+
7+
- Added cursor-anchored wheel zoom and pinch-anchored gesture zoom in fullscreen
8+
mode. Toolbar zoom controls now zoom around the rendered SVG center.
9+
- Added ZenUML external-diagram registration and a complete advanced example
10+
catalog covering all 30 Mermaid diagram types supported by this package.
11+
12+
### Fixed
13+
14+
- Fixed theme changes re-rendering diagrams while a zoom or pan transform was
15+
active. Mermaid now renders at an identity transform and restores the user's
16+
fitted view, zoom level, and pan position afterward. Fixes #14.
17+
- Fixed `fitToContainer` so fitting is a base visual transform while the
18+
toolbar's initial zoom level remains `100%`. User zoom and pan are preserved
19+
across re-renders and fullscreen transitions. Fixes #15.
20+
- Fixed Reset View with `fitToContainer` so it restores the unscaled `100%` user
21+
view instead of the fitted and centered position. Fixes #16.
22+
- Added a short zoom transition that does not interfere with reset or fit
23+
measurement. Fixes #17.
24+
- Corrected the Requirement and Radar examples to use Mermaid's current syntax.
25+
26+
### Changed
27+
28+
- Optimized the smoke-test package setup to remove and reinstall only the local
29+
`vitepress-mermaid-renderer` dependency instead of deleting all test-project
30+
dependencies.
31+
- Expanded renderer, navigation, and end-to-end coverage for theme rerenders,
32+
fit behavior, focal fullscreen zoom, and the advanced diagram catalog.
33+
334
## 1.1.30
435

536
### Added in 1.1.30

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# VitePress Mermaid Renderer
22

3-
[![npm version](https://img.shields.io/npm/v/vitepress-mermaid-renderer)](https://npmx.dev/package/vitepress-mermaid-renderer)
4-
[![npm monthly downloads](https://img.shields.io/npm/dm/vitepress-mermaid-renderer)](https://npmx.dev/package/vitepress-mermaid-renderer)
5-
[![Release](https://github.com/sametcn99/vitepress-mermaid-renderer/actions/workflows/release.yml/badge.svg)](https://github.com/sametcn99/vitepress-mermaid-renderer/actions/workflows/release.yml)
6-
73
Transform static Mermaid diagrams into interactive visualizations in VitePress.
84
Enable smooth zooming, panning, fullscreen dialogs, and dynamic theme
95
adaptations.

bun.lock

Lines changed: 105 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/content/en/examples/advanced.md

Lines changed: 323 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,326 @@ C4Context
192192
193193
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
194194
```
195+
196+
## Swimlane Diagram
197+
198+
```mermaid
199+
swimlane-beta LR
200+
subgraph Customer
201+
request[Open request]
202+
update[Receive update]
203+
end
204+
205+
subgraph Support
206+
triage[Triage request]
207+
answer[Send answer]
208+
end
209+
210+
request --> triage --> answer --> update
211+
```
212+
213+
## Class Diagram
214+
215+
```mermaid
216+
classDiagram
217+
class Account {
218+
+String id
219+
+Decimal balance
220+
+deposit(amount)
221+
}
222+
class Customer {
223+
+String name
224+
}
225+
Customer "1" --> "*" Account : owns
226+
```
227+
228+
## User Journey
229+
230+
```mermaid
231+
journey
232+
title Checkout journey
233+
section Browse
234+
Find a product: 5: Customer
235+
Add to cart: 4: Customer
236+
section Purchase
237+
Enter payment details: 3: Customer
238+
Receive confirmation: 5: Customer
239+
```
240+
241+
## Gantt Chart
242+
243+
```mermaid
244+
gantt
245+
title Release plan
246+
dateFormat YYYY-MM-DD
247+
section Development
248+
Design :done, design, 2026-03-01, 3d
249+
Implement :active, implement, after design, 5d
250+
section Release
251+
Verify :verify, after implement, 2d
252+
Deploy :milestone, deploy, after verify, 0d
253+
```
254+
255+
## Pie Chart
256+
257+
```mermaid
258+
pie showData
259+
title Traffic by device
260+
"Desktop" : 55
261+
"Mobile" : 35
262+
"Tablet" : 10
263+
```
264+
265+
## Quadrant Chart
266+
267+
```mermaid
268+
quadrantChart
269+
title Feature prioritization
270+
x-axis Low effort --> High effort
271+
y-axis Low impact --> High impact
272+
quadrant-1 Invest
273+
quadrant-2 Quick wins
274+
quadrant-3 Avoid
275+
quadrant-4 Consider
276+
Improve search: [0.25, 0.8]
277+
Redesign dashboard: [0.8, 0.7]
278+
Update copy: [0.2, 0.3]
279+
```
280+
281+
## Requirement Diagram
282+
283+
```mermaid
284+
requirementDiagram
285+
requirement user_login {
286+
id: 1
287+
text: the login requirement
288+
risk: high
289+
verifymethod: test
290+
}
291+
292+
element authentication_service {
293+
type: simulation
294+
}
295+
296+
authentication_service - satisfies -> user_login
297+
```
298+
299+
## Mindmap
300+
301+
```mermaid
302+
mindmap
303+
root((Release))
304+
Planning
305+
Scope
306+
Schedule
307+
Delivery
308+
Build
309+
Test
310+
Operations
311+
Monitor
312+
```
313+
314+
## Timeline
315+
316+
```mermaid
317+
timeline
318+
title Product milestones
319+
2024 : Research
320+
: Prototype
321+
2025 : Public beta
322+
: General availability
323+
2026 : Expansion
324+
```
325+
326+
## ZenUML Sequence Diagram
327+
328+
```mermaid
329+
zenuml
330+
title Order processing
331+
Customer->Service: Place order
332+
Service->Inventory: Reserve items
333+
Inventory->Service: Items reserved
334+
Service->Customer: Confirm order
335+
```
336+
337+
## Sankey Diagram
338+
339+
```mermaid
340+
sankey-beta
341+
Visitors,Documentation,700
342+
Visitors,Examples,300
343+
Documentation,Installation,420
344+
Documentation,Configuration,280
345+
Examples,Advanced examples,180
346+
Examples,Basic examples,120
347+
```
348+
349+
## XY Chart
350+
351+
```mermaid
352+
xychart
353+
title "Monthly signups"
354+
x-axis [Jan, Feb, Mar, Apr]
355+
y-axis "Users" 0 --> 100
356+
bar [35, 52, 76, 90]
357+
line [30, 50, 72, 85]
358+
```
359+
360+
## Block Diagram
361+
362+
```mermaid
363+
block
364+
columns 3
365+
Browser space API
366+
space:3
367+
Cache space Database
368+
Browser --> API
369+
API --> Cache
370+
API --> Database
371+
```
372+
373+
## Packet Diagram
374+
375+
```mermaid
376+
packet
377+
title UDP Packet
378+
+16: "Source Port"
379+
+16: "Destination Port"
380+
+16: "Length"
381+
+16: "Checksum"
382+
+32: "Payload"
383+
```
384+
385+
## Kanban Board
386+
387+
```mermaid
388+
kanban
389+
backlog[Backlog]
390+
research[Research requirements]
391+
progress[In progress]
392+
implement[Implement renderer]@{ assigned: "Developer", priority: "High" }
393+
done[Done]
394+
tests[Add browser tests]
395+
```
396+
397+
## Architecture Diagram
398+
399+
```mermaid
400+
architecture-beta
401+
group platform(cloud)[Platform]
402+
403+
service web(server)[Web app] in platform
404+
service api(server)[API] in platform
405+
service data(database)[Database] in platform
406+
407+
web:R --> L:api
408+
api:B --> T:data
409+
```
410+
411+
## Radar Chart
412+
413+
```mermaid
414+
radar-beta
415+
title Engineering metrics
416+
axis quality["Quality"], delivery["Delivery"], reliability["Reliability"]
417+
curve current["Current"]{80, 70, 75}
418+
curve target["Target"]{90, 85, 90}
419+
max 100
420+
```
421+
422+
## Event Modeling Diagram
423+
424+
```mermaid
425+
eventmodeling
426+
427+
tf 01 ui CheckoutUI
428+
tf 02 cmd SubmitOrder
429+
tf 03 evt OrderSubmitted
430+
```
431+
432+
## Treemap
433+
434+
```mermaid
435+
treemap-beta
436+
"Documentation"
437+
"Guides": 45
438+
"Examples": 30
439+
"Source"
440+
"Components": 35
441+
"Composables": 20
442+
```
443+
444+
## Venn Diagram
445+
446+
```mermaid
447+
venn-beta
448+
title "Team skills"
449+
set frontend[Frontend]
450+
set backend[Backend]
451+
union frontend,backend[Full stack]
452+
```
453+
454+
## Ishikawa Diagram
455+
456+
```mermaid
457+
ishikawa-beta
458+
Slow page load
459+
Network
460+
High latency
461+
Large payloads
462+
Application
463+
Expensive queries
464+
Uncached responses
465+
Browser
466+
Blocking scripts
467+
```
468+
469+
## Wardley Map
470+
471+
```mermaid
472+
wardley-beta
473+
title Delivery platform
474+
475+
anchor User [0.9, 0.9]
476+
component WebApp [0.75, 0.6]
477+
component API [0.6, 0.7]
478+
component Cloud [0.3, 0.9]
479+
480+
User -> WebApp
481+
WebApp -> API
482+
API -> Cloud
483+
```
484+
485+
## Cynefin Framework
486+
487+
```mermaid
488+
cynefin-beta
489+
title Delivery decisions
490+
491+
complex
492+
"Explore a new product"
493+
complicated
494+
"Tune a database"
495+
clear
496+
"Apply a routine update"
497+
chaotic
498+
"Restore an unavailable service"
499+
confusion
500+
"Classify an incident"
501+
502+
complex --> complicated : "Pattern identified"
503+
clear --> chaotic : "Complacency"
504+
```
505+
506+
## TreeView Diagram
507+
508+
```mermaid
509+
treeView-beta
510+
vitepress-mermaid-renderer/
511+
src/
512+
MermaidDiagram.vue
513+
index.ts
514+
tests/
515+
e2e/
516+
package.json
517+
```

0 commit comments

Comments
 (0)