Visio JavaScript APIs extend the capabilities of Visio Online by enabling developers to build rich mashup solutions to meet their organization’s specific needs. The solution needs to reference the Visio JavaScript library from the CDN location at, https://appsforoffice.microsoft.com/embedded/1.0/visio-web-embedded.js.
NPM is a JavaScript package manager and the visio-web-embedded.js is published as part of the Office NPM package, as a copy of what gets published to the official CDN above.
Installing
1. Get NPM.
2. Create a new folder on your machine for your package and navigate to that folder using command line interface.
3. Run the following commands for installing the Office NPM package containing the Visio JS.
npm init
npm install @microsoft/office-js
Once installed, the script reference can be used as
<script src="node_modules\@microsoft\office-js\embedded\visio-web-embedded.js"></script>
IntelliSense
IntelliSense definitions can be acquired either by
• Running npm install @types/office-js using command line interface or
• Referring the index file as ///<reference path="node_modules\@microsoft\office-js\dist\office.d.ts" />
More Info
For more information on Visio JavaScript APIs and mashup solutions, see:
• Visio JavaScript APIs Overview
• Migration from Visio Web Access to Visio Online
We’re constantly looking for ways to improve Visio Online APIs and invite you to send us your ideas through our UserVoice site. For questions about Visio Online APIs and other features, please email us at tellvisio@microsoft.com. You can also follow on Twitter, LinkedIn, Facebook and YouTube for the latest around Visio.
Rahul Mittal | Program Manager | Microsoft Visio