Demo
import { XMindEmbedViewer } from 'xmind-embed-viewer'
// Intialize a viewer isntance
const viewer = new XMindEmbedViewer({
el: document.querySelector('#container-or-iframe')
})
// Download remote file and load into the viewer isntance
fetch('test-1.xmind')
.then(res => res.arrayBuffer())
.then(file => viewer.load(file))
console.log('Current zoomscales: ', viewer.zoomScale)
console.log('Current activated sheet id: ', viewer.currentSheetId)
console.log('All Sheets: ', viewer.sheets)
const callback = (payload) => {
console.log('Event callback with payload', payload)
}
viewer.addEventListener('event-name', callback)
viewer.removeEventListener('event-name', callback)
- map-ready
- zoom-scale-changed
- sheet-switch
- sheets-change