Using GoJS on different platforms
GoJS is intended to run in any environment that executes JavaScript. This includes on browsers and within browser frameworks, and also in headless contexts such as Node.js.
React, Vue, Svelte, Angular
We provide samples and components for common JavaScript UI frameworks. GoJS has no dependencies of its own, and it is our expectation that the library should run within any framework. If you are encountering integration issues with an uncommon framework, please contact us.
We maintain examples for common frameworks:
- React: We provide a React component as an NPM package and a usage sample. See the learn page Using GoJS with React for more information on React integration. We also have a React sample.
- Vue: We provide a Vue.js sample. For a Vue 3 sample, clone the GitHub repository: Vue 3 sample using GoJS called gojs-vue-basic.
- Svelte: Read the learn page about using Svelte. We provide multiple Svelte samples.
- Angular: We provide an Angular component as an NPM package and a usage sample. See the learn page Using GoJS with Angular for more information on Angular integration.
Electron
GoJS can be used in Electron apps. We provide a
sample Electron app using GoJS. Note that an
unlimited domains license is required for use with versions of GoJS before v2.2. As of v2.2, you can specify your Electron app's
package.json "name" attribute when you request a license key.
Blazor
GoJS can be used alongside Blazor, though all code must be written in JavaScript or TypeScript. We have a sample integrating GoJS into a Blazor project.
There is also the GoDiagram library, which is based on the GoJS API, that can be used in C# environments. It will work headlessly or as a WinForms control. When headless, this can be used to output static diagram images for Blazor projects, purely in C#.
Node.js and headless environments
GoJS can be used in environments that do not have a DOM. This can be useful for running on a server. We provide a Node example.
We also have a Puppeteer example in the server-side images section for running on a server with a DOM.
Within iFrames
GoJS can run within iFrames. However, since the library references the global context, such as window on browsers, it is best to invoke GoJS code
from within the frame it is used.