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

Overview

XMind Embed Viewer

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

Demo

Quick start

Install

As an npm module

npm i xmind-embed-viewer

Or alternatively from unpkg/jsdelivr with a script tag as a UMD bundle

<script src="https://unpkg.com/xmind-embed-viewer/dist/umd/xmind-embed-viewer.js"></script>
<!-- or https://www.jsdelivr.com/npm/xmind-embed-viewer/dist/umd/xmind-embed-viewer.js -->
<script> // window.XMindEmbedViewer are available now. </script>

Base usage

const viewer = new XMindEmbedViewer({
  el: '#container-or-iframe-selector', // HTMLElement | HTMLIFrameElement | string
})
fetch('test-1.xmind')
  .then(res => res.arrayBuffer())
  .then(file => viewer.load(file))

The example are using HTTP Fetch API.

See also demo source code here.

Methods

Get viewer state

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

Load file into viewer

viewer.load are only accept ArrayBuffer object.

fetch('test-1.xmind')
  .then(res => res.arrayBuffer())
  .then(file => viewer.load(file))

ZoomScale Control

Use extract scale value, Range: 50 - 500

viewer.setZoomScale(100)

Auto-fits with container bounds

viewer.setFitMap()

Sheet Control

You can use viewer.sheets to retrieve all sheet attribute.

viewer.switchSheet('sheet-id')

Update iframe style

viewer.setStyles({
  'width': '100%',
  // CSS styles are available here
})

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.

You might also like...

nice-dag is a lightweight javascript library, which is used to present a DAG diagram.

nice-dag is a lightweight javascript library, which is used to present a DAG diagram.

Nice-DAG Overview Nice-DAG is a lightweight javascript library, which is used to present a DAG diagram. Essentially, it uses dagre to layout nodes and

Oct 25, 2022

Gatsby-blog-cosmicjs - 🚀⚡️ Blazing fast blog built with Gatsby and the Cosmic Headless CMS 🔥

Gatsby-blog-cosmicjs - 🚀⚡️ Blazing fast blog built with Gatsby and the Cosmic Headless CMS 🔥

Gatsby + Cosmic This repo contains an example blog website that is built with Gatsby, and Cosmic. See live demo hosted on Netlify Uses the Cosmic Gats

Jan 29, 2022

This is a blog built with sveltekit, tailwind and daisyUI, made to be used as my personal blog.

This is a blog built with sveltekit, tailwind and daisyUI, made to be used as my personal blog.

svelte-blogger This is a blog built with sveltekit, tailwind and daisyUI, made to be used as my personal blog. This app also use graphql and use markd

Jun 23, 2022

A simple way to share files and clipboard within a local network.

Shortcut Simple way to share files and clipboard with devices within a local network. Usage Run the ./shortcut executable. A browser window will be op

Mar 13, 2022

How often do you get asked about the gadgets or software that you use? If the answer is quite often, you should be trying show off out. Curate the list of gadgets and software and share it with your fans and followers.

How often do you get asked about the gadgets or software that you use? If the answer is quite often, you should be trying show off out. Curate the list of gadgets and software and share it with your fans and followers.

Show Off - Showcase your setup! How often do you get asked about the gadgets or software that you use? If the answer is quite often, you should be try

Nov 24, 2022

Turn queries into easy-to-use tools your teammates can share.

Turn queries into easy-to-use tools your teammates can share.

Turn queries into easy-to-use tools your teammates can share. Parameterize! Visualize! Collaboratize?! qwaver links: Latest Build •Use Cases • Help! •

Nov 3, 2022

Journeys is a django based community-focused website that allows users to bookmark URLs (through chrome extension) and share their journeys through timelines.

Journeys is a django based community-focused website that allows users to bookmark URLs (through chrome extension) and share their journeys through timelines.

Journeys is a django based community-focused website that allows users to bookmark URLs (through chrome extension) and share their journeys through timelines. A timeline is a collection of links that share a common topic or a journey of building and learning something new. Users can create timelines, share them publicly, and explore resources.

Jun 13, 2022

Big Chief is a website where you find and share everyday cooking inspiration. Discover recipes, cooks, videos, and how-tos based on the food you love.

Big Chief is a website where you find and share everyday cooking inspiration. Discover recipes, cooks, videos, and how-tos based on the food you love.

Big Chief Big Chief is a website where you find and share everyday cooking inspiration. Discover recipes, cooks, videos, and how-tos based on the food

Jun 1, 2022

Piplup: decompile Playdate Pulp .pdx files back to .json project files

Piplup: decompile Playdate Pulp .pdx files back to .json project files This doesn't work yet: I still need to: convert the graphics (.pdt files) back

Mar 25, 2022
Comments
  • Would you mind making the online content of iframes available offline?

    Would you mind making the online content of iframes available offline?

    Since some contents of this viewer are loaded through iframes with https. This module can only be used in online web development, especially the iframe content from 'https://www.xmind.net/embed-viewer/'. Could you please let us access and use this embed-viewer offline one day?

    opened by RaybingChung 1
Releases(v1.1.0)
This blog is still under development! I present a project scope for science articles, it can now be used in production! But there are some details that need to be put up front.

Science-Blog ?? Attention! This blog is still under development! I present a project scope for science articles, it can now be used in production! But

Raissadev 2 Sep 19, 2022
Mind Mapping to excel, or excel to .xmind file

Mind Mapping To Excel Project setup Prepare project npm install 1、Fetch data and generate excel Open the Mind Mapping like this Process On Mind Mappi

xuzelin995 3 May 5, 2022
JOSE ZEPEDA 10 Nov 18, 2022
My personal Website, where I share my blog and project. Build using Nextjs and Tailwind CSS

Personal Blog This is my portfolio website built with Next.js, Tailwind CSS and hosted with Vercel. Perfect Light House Score ?? Installation & Set Up

Ashish Lotake 6 Dec 24, 2022
Website to present projects made by me and that are part of my personal portfolio. It was made using React, HTML y Scss (CSS).

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Portfolio Jesús Leal 0 Dec 23, 2021
Easy and simple way to share data via mobile’s built-in share module.

React-Mobile-Share Provides an easy and simple way to share data (such as text, url and media) via mobile’s built-in share module. It is based on Web

EncoreSky Technologies 36 Dec 28, 2022
Long-press `⌘` key or press `?` to present a shortcut guide for your Web application.

React Shortcut Guide Status: Alpha Long-press command or press ? to present a shortcut guide for your Web application. Gzip+minify < 3kB Install npm i

Reactify Component 9 Jul 29, 2022
Present your links in style 🔗🔮

links Present your links in style ?? ?? links screenshot Have you ever wanted a place that can make all your profiles and links nicely organized, easi

Abhishek Keshri 19 Nov 25, 2022
kimchi is a staple Korean side dish that's present at almost every meal.

(✿◠‿◠)*:・゚✧ (c) 02/2021 Dear reader, Essentially, kimchi is a staple Korean side dish that's present at almost every meal. It's fermented napa cabbage

null 0 Sep 20, 2022
The Covid-19 data-app collects information from API and present data for the novel coronavirus.

COVID-19-data-app This project was bootstrapped with Create React App. The Covid-19 data-app collects information from API and present data for the no

Sentayhu berhanu 8 Jun 23, 2022