Search API

- Preparing search index...
- The search index is not available

Show Summaries
GoJS® Diagramming Components
version 1.8.23 for JavaScript/HTML
by Northwoods Software®

## Class Palette

Extends Diagram. Palette extends the Diagram class to allow objects to be dragged and placed onto other Diagrams. Its Diagram.layout is a GridLayout. The Palette is Diagram.isReadOnly but to support drag-and-drop its Diagram.allowDragOut is true.

For more discussion, see Introduction to Palettes. See samples that make use of Palettes in the samples index.

You can control the order of Parts in the palette in several manners:

- If you want to keep the order given by `myPalette.model.nodeDataArray`, just set `myPalette.layout.sorting = go.GridLayout.Forward` (GridLayout.sorting).
- If you want to sort based on some text string associated with each Part, just bind Part.text.
- If you want to sort more generally, set `myPalette.layout.comparer` (GridLayout.comparer).

## Constructor Summary Details

Name | Description
--- | ---
Palette(div) | More... Parameters: {HTMLDivElement|string} div A reference to a div or its ID as a string.

Properties borrowed from class Diagram:
  allowClipboard, allowCopy, allowDelete, allowDragOut, allowDrop, allowGroup, allowHorizontalScroll, allowInsert, allowLink, allowMove, allowRelink, allowReshape, allowResize, allowRotate, allowSelect, allowTextEdit, allowUndo, allowUngroup, allowVerticalScroll, allowZoom, animationManager, autoScale, autoScrollRegion, click, commandHandler, contentAlignment, contextClick, contextMenu, currentCursor, currentTool, CycleAll, CycleDestinationTree, CycleNotDirected, CycleNotUndirected, CycleSourceTree, defaultCursor, defaultTool, div, documentBounds, DocumentScroll, doubleClick, firstInput, fixedBounds, grid, groupSelectionAdornmentTemplate, groupTemplate, groupTemplateMap, hasHorizontalScrollbar, hasVerticalScrollbar, highlighteds, InfiniteScroll, initialAutoScale, initialContentAlignment, initialDocumentSpot, initialPosition, initialScale, initialViewportSpot, isEnabled, isModelReadOnly, isModified, isMouseCaptured, isReadOnly, isTreePathToChildren, lastInput, layers, layout, links, linkSelectionAdornmentTemplate, linkTemplate, linkTemplateMap, maxScale, maxSelectionCount, minScale, model, mouseDragOver, mouseDrop, mouseHold, mouseHover, mouseOver, nodes, nodeSelectionAdornmentTemplate, nodeTemplate, nodeTemplateMap, None, padding, parts, position, positionComputation, scale, scaleComputation, scrollHorizontalLineChange, scrollMargin, scrollMode, scrollsPageOnFocus, scrollVerticalLineChange, selection, skipsUndoManager, toolManager, toolTip, undoManager, Uniform, UniformToFill, validCycle, viewportBounds, zoomPoint

Methods borrowed from class Diagram:
  add, addChangedListener, addDiagramListener, addLayer, addLayerAfter, addLayerBefore, addModelChangedListener, alignDocument, centerRect, clear, clearHighlighteds, clearSelection, commit, commitTransaction, computeBounds, computePartsBounds, copyParts, delayInitialization, findLayer, findLinkForData, findLinksByExample, findNodeForData, findNodeForKey, findNodesByExample, findObjectAt, findObjectsAt, findObjectsIn, findObjectsNear, findPartAt, findPartForData, findPartForKey, findTopLevelGroups, findTreeRoots, focus, highlight, highlightCollection, layoutDiagram, makeImage, makeImageData, makeSvg, moveParts, rebuildParts, remove, removeChangedListener, removeDiagramListener, removeLayer, removeModelChangedListener, removeParts, requestUpdate, rollbackTransaction, scroll, scrollToRect, select, selectCollection, setProperties, startTransaction, transformDocToView, transformViewToDoc, updateAllRelationshipsFromData, updateAllTargetBindings, zoomToFit, zoomToRect