{"id":36500259,"url":"https://github.com/xmindltd/xmind-embed-viewer","last_synced_at":"2026-01-12T02:19:58.370Z","repository":{"id":57540132,"uuid":"482759245","full_name":"xmindltd/xmind-embed-viewer","owner":"xmindltd","description":"Use XMind share to present your .xmind files on your blog or website.","archived":false,"fork":false,"pushed_at":"2023-07-24T02:53:34.000Z","size":277,"stargazers_count":129,"open_issues_count":8,"forks_count":18,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-17T04:50:18.767Z","etag":null,"topics":["blog","mindmap","mindmap-viewer","mindmaps","viewer","xmind"],"latest_commit_sha":null,"homepage":"https://xmindltd.github.io/xmind-embed-viewer/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xmindltd.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-18T07:42:33.000Z","updated_at":"2025-10-01T13:40:41.000Z","dependencies_parsed_at":"2024-06-21T12:54:15.814Z","dependency_job_id":"0b343c2d-d861-410b-b52e-bdbb33e5ae01","html_url":"https://github.com/xmindltd/xmind-embed-viewer","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":"0.11538461538461542","last_synced_commit":"423627eb87f24c72aa68f20e961c9f12d4e7d021"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/xmindltd/xmind-embed-viewer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmindltd%2Fxmind-embed-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmindltd%2Fxmind-embed-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmindltd%2Fxmind-embed-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmindltd%2Fxmind-embed-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmindltd","download_url":"https://codeload.github.com/xmindltd/xmind-embed-viewer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmindltd%2Fxmind-embed-viewer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blog","mindmap","mindmap-viewer","mindmaps","viewer","xmind"],"created_at":"2026-01-12T02:19:57.841Z","updated_at":"2026-01-12T02:19:58.363Z","avatar_url":"https://github.com/xmindltd.png","language":"TypeScript","readme":"# XMind Embed Viewer\nUse XMind share to present your `.xmind` files on your blog or website.\n\n[Demo](https://xmindltd.github.io/xmind-embed-viewer/)\n\n## Quick start\n### Install\nAs an npm module\n\n```shell\nnpm i xmind-embed-viewer\n```\n\nOr alternatively from `unpkg`/`jsdelivr` with a script tag as a UMD bundle\n```html\n\u003cscript src=\"https://unpkg.com/xmind-embed-viewer/dist/umd/xmind-embed-viewer.js\"\u003e\u003c/script\u003e\n\u003c!-- or https://www.jsdelivr.com/npm/xmind-embed-viewer/dist/umd/xmind-embed-viewer.js --\u003e\n\u003cscript\u003e // window.XMindEmbedViewer are available now. \u003c/script\u003e\n```\n### Base usage\n```typescript\nconst viewer = new XMindEmbedViewer({\n  el: '#container-or-iframe-selector', // HTMLElement | HTMLIFrameElement | string\n  // 如果在中国大陆境内速度慢，可以添加的参数 `region: 'cn'` 改为使用 xmind.cn 的图库作为依赖。\n  // region: 'cn' //optinal, global(default) or cn\n})\nfetch('test-1.xmind')\n  .then(res =\u003e res.arrayBuffer())\n  .then(file =\u003e viewer.load(file))\n```\nThe example are using [HTTP Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\n\nSee also demo source code [here](./public/index.html).\n\n### Methods\n#### Get viewer state\n```typescript\nconsole.log('Current zoomscales: ', viewer.zoomScale)\nconsole.log('Current activated sheet id: ', viewer.currentSheetId)\nconsole.log('All Sheets: ', viewer.sheets)\n```\n\n#### Load file into viewer\n`viewer.load` are only accept `ArrayBuffer` object.\n```typescript\nfetch('test-1.xmind')\n  .then(res =\u003e res.arrayBuffer())\n  .then(file =\u003e viewer.load(file))\n```\n#### ZoomScale Control\nUse extract scale value, Range: `50` - `500`\n```typescript\nviewer.setZoomScale(100)\n```\nAuto-fits with container bounds\n```typescript\nviewer.setFitMap()\n```\n\n#### Sheet Control\nYou can use `viewer.sheets` to retrieve all sheet attribute.\n```typescript\nviewer.switchSheet('sheet-id')\n```\n\n#### Update iframe style\n```typescript\nviewer.setStyles({\n  'width': '100%',\n  // CSS styles are available here\n})\n```\n\n### Events\n#### Add listener\n```typescript\nconst callback = (payload) =\u003e {\n    console.log('Event callback with payload', payload)\n}\nviewer.addEventListener('event-name', callback)\nviewer.removeEventListener('event-name', callback)\n```\n#### Available events:\n* `map-ready`\n* `zoom-change`\n* `sheet-switch`\n* `sheets-load`\n\n## License\nThis project is licensed under the MIT License - see [LICENSE.md](LICENSE.md) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmindltd%2Fxmind-embed-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmindltd%2Fxmind-embed-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmindltd%2Fxmind-embed-viewer/lists"}