Created
June 18, 2018 09:04
-
-
Save tswistak/eff928ba396903b7ab060a91203c89a5 to your computer and use it in GitHub Desktop.
GoJS tutorial part 3, listing 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var initDiagram = function () { | |
diagram = $(go.Diagram, | |
'diagram-content', { | |
initialContentAlignment: go.Spot.Center, | |
allowDrop: true | |
}); | |
// ... | |
} | |
var initPalette = function () { | |
palette = $(go.Palette, 'palette-content'); | |
getTemplates().forEach(x => palette.nodeTemplateMap.add(x.category, x.template)); | |
palette.model.nodeDataArray = [ | |
{key: 1, category: 'first'}, | |
{key: 2, category: 'second'}, | |
{key: 3, category: 'third'} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment