🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

xmind-embed-viewer

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xmind-embed-viewer

Use XMind share to present your `.xmind` files on your blog or website.

1.0.2
Source
npm
Version published
Weekly downloads
373
-20.81%
Maintainers
1
Weekly downloads
 
Created
Source

XMind Embed Viewer

Use XMind share to present your .xmind files on your blog or website.

Example

Demo

Document

Initialization

Install the package or reference the umd module.

Install
npm i xmind-embed-viewer
Use module
import { XMindEmbedViewer } from 'xmind-embed-viewer'
// Intialize a viewer isntance
const viewer = new XMindEmbedViewer({
  el: '#container-or-iframe', // HTMLElement | HTMLIFrameElement | string
})

see also demo source code here.

Methods

Load file into viewer

// Download remote file and load into the viewer instance
fetch('test-1.xmind')
  .then(res => res.arrayBuffer())
  .then(file => viewer.load(file))

Get viewer state

console.log('Current zoomscales: ', viewer.zoomScale)
console.log('Current activated sheet id: ', viewer.currentSheetId)
console.log('All Sheets: ', viewer.sheets)

Events

Add listener

const callback = (payload) => {
    console.log('Event callback with payload', payload)
}
viewer.addEventListener('event-name', callback)
viewer.removeEventListener('event-name', callback)

Available events:

  • map-ready
  • zoom-change
  • sheet-switch
  • sheets-load

License

This project is licensed under the MIT License - see LICENSE.md file for details.

Keywords

xmind

FAQs

Package last updated on 18 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts