File tree Expand file tree Collapse file tree 3 files changed +47
-2
lines changed
Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ defineConfig({
2222 wrap : true
2323 } ,
2424
25+ head : [
26+ [ 'script' , { src :
'https://unpkg.com/[email protected] /dist/panzoom.min.js' } ] 27+ ] ,
28+
2529 title : "Eclipse Daanse" ,
2630 description : "Data Analysis Services" ,
2731 base : "/" ,
Original file line number Diff line number Diff line change 11import DefaultTheme from 'vitepress/theme'
2- export default DefaultTheme
3-
2+ import { onMounted } from 'vue'
43import './styles.css'
4+
5+ export default {
6+ extends : DefaultTheme ,
7+ setup ( ) {
8+ onMounted ( ( ) => {
9+ // Wait for Mermaid diagrams to be rendered
10+ setTimeout ( ( ) => {
11+ const mermaidElements = document . querySelectorAll ( '.mermaid svg' )
12+ mermaidElements . forEach ( svg => {
13+ // Check if panzoom is available globally
14+ if ( typeof window !== 'undefined' && ( window as any ) . panzoom ) {
15+ // Initialize panzoom for each Mermaid SVG
16+ ( window as any ) . panzoom ( svg , {
17+ maxZoom : 5 ,
18+ minZoom : 0.1 ,
19+ zoomDoubleClickSpeed : 1.5 ,
20+ bounds : true ,
21+ boundsPadding : 0.1
22+ } )
23+ }
24+ } )
25+ } , 2000 ) // Give Mermaid time to render
26+ } )
27+ }
28+ }
Original file line number Diff line number Diff line change 5757code {
5858 background: # f
5959}
60+
61+ /* Mermaid diagram zoom styles */
62+ .mermaid {
63+ overflow : visible;
64+ cursor : grab;
65+ user-select : none;
66+ }
67+
68+ .mermaid : active {
69+ cursor : grabbing;
70+ }
71+
72+ .mermaid svg {
73+ max-width : 100% ;
74+ height : auto;
75+ transition : transform 0.2s ease;
76+ }
You can’t perform that action at this time.
0 commit comments