All customers can use the go.js
and go-debug.js
files or the corresponding ES module files to run their app. However, if you have
purchased a license to the GoJS TypeScript source code, you can build your app from the TypeScript source. Popular module bundlers such as Webpack are
able to remove a number of modules from the source, provided you are not using them, to shrink the size of the deliverable file.
Because the go.js
and go-debug.js
files are built in a custom process to reduce size, using Webpack or another bundler with the GoJS
source, even though it removes unused modules, may result in a larger file size than just using go.js
. However, programmers using TypeScript may
appreciate the feedback and debugging capabilities of building from source.
Several classes, such as CommandHandler
and the Tools, may be essential to add to your project, while others such as all or all but one
Layout
and one type of Model
can often be removed. Below is a list of modules that webpack can remove from builds, provided they are
not referenced in your code:
SVGSurface
, used by Diagram.makeSvg.Model
.There are several "built in" Panel types, each of which is a PanelLayout. Some of these are required for building the source:
PanelLayoutPosition
PanelLayoutVertical
PanelLayoutLink
PanelLayoutAuto
PanelLayoutGrid
PanelLayoutHorizontal
PanelLayoutSpot
PanelLayoutTable
PanelLayoutViewbox
PanelLayoutTableRow
PanelLayoutTableColumn
PanelLayoutGraduated
The source index files demonstrate the necessary calls to Panel.addPanelLayout
to include each panel type.
A typical GoJS project is not expected to remove all or even most of these modules, and may use the majority of them.
The GoJS source code is subject to the terms of our license, contained in SoftwareLicenseAgreement.pdf.
Do not use, release (deploy), or distribute the unminified source code. To build GoJS for your own application you must use a popular obfuscation/minification tool.