UNPKG

30.1 kBHTMLView Raw
1<!DOCTYPE html>
2<html lang="en">
3 <head>
4<meta charset="utf-8"/>
5<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover"/>
6
7<link rel="stylesheet" href="../assets/css/style.css"/>
8<!-- Copyright 1998-2021 by Northwoods Software Corporation. --> <title> GoJS User Permissions -- Northwoods Software </title>
9 <link rel="stylesheet" href="../assets/css/prism.css" />
10 </head>
11 <script>
12
13 window.diagrams = [];
14 window.goCode = function(pre, w, h, parentid, animation) {
15 window.diagrams.push([pre, w, h, parentid, animation]);
16 }
17 </script>
18 <body>
19 <nav id="navTop" class="w-full z-30 top-0 text-white bg-nwoods-primary">
20 <div class="w-full container max-w-screen-lg mx-auto flex flex-wrap sm:flex-nowrap items-center justify-between mt-0 py-2">
21 <div class="md:pl-4">
22 <a class="text-white hover:text-white no-underline hover:no-underline
23 font-bold text-2xl lg:text-4xl rounded-lg hover:bg-nwoods-secondary " href="../">
24 <h1 class="mb-0 p-1 ">GoJS</h1>
25 </a>
26 </div>
27 <button id="topnavButton" class="rounded-lg sm:hidden focus:outline-none focus:ring" aria-label="Navigation">
28 <svg fill="currentColor" viewBox="0 0 20 20" class="w-6 h-6">
29 <path id="topnavOpen" fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM9 15a1 1 0 011-1h6a1 1 0 110 2h-6a1 1 0 01-1-1z" clip-rule="evenodd"></path>
30 <path id="topnavClosed" class="hidden" fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path>
31 </svg>
32 </button>
33 <div id="topnavList" class="hidden sm:block items-center w-auto mt-0 text-white p-0 z-20">
34 <ul class="list-reset list-none font-semibold flex justify-end flex-wrap sm:flex-nowrap items-center px-0 pb-0">
35 <li class="p-1 sm:p-0"><a class="topnav-link" href="../learn/">Learn</a></li>
36 <li class="p-1 sm:p-0"><a class="topnav-link" href="../samples/">Samples</a></li>
37 <li class="p-1 sm:p-0"><a class="topnav-link" href="../intro/">Intro</a></li>
38 <li class="p-1 sm:p-0"><a class="topnav-link" href="../api/">API</a></li>
39 <li class="p-1 sm:p-0"><a class="topnav-link" href="https://www.nwoods.com/products/register.html">Register</a></li>
40 <li class="p-1 sm:p-0"><a class="topnav-link" href="../download.html">Download</a></li>
41 <li class="p-1 sm:p-0"><a class="topnav-link" href="https://forum.nwoods.com/c/gojs/11">Forum</a></li>
42 <li class="p-1 sm:p-0"><a class="topnav-link" href="https://www.nwoods.com/contact.html"
43 target="_blank" rel="noopener" onclick="getOutboundLink('https://www.nwoods.com/contact.html', 'contact');">Contact</a></li>
44 <li class="p-1 sm:p-0"><a class="topnav-link" href="https://www.nwoods.com/sales/index.html"
45 target="_blank" rel="noopener" onclick="getOutboundLink('https://www.nwoods.com/sales/index.html', 'buy');">Buy</a></li>
46 </ul>
47 </div>
48 </div>
49 <hr class="border-b border-gray-600 opacity-50 my-0 py-0" />
50 </nav>
51
52 <div class="md:flex flex-col md:flex-row md:min-h-screen w-full max-w-screen-xl mx-auto">
53
54 <div id="navSide" class="flex flex-col w-full md:w-40 lg:w-48 text-gray-700 bg-white flex-shrink-0">
55 <div class="flex-shrink-0 px-8 py-4">
56 <button id="navButton" class="rounded-lg md:hidden focus:outline-none focus:ring" aria-label="Navigation">
57 <svg fill="currentColor" viewBox="0 0 20 20" class="w-6 h-6">
58 <path id="navOpen" fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM9 15a1 1 0 011-1h6a1 1 0 110 2h-6a1 1 0 01-1-1z" clip-rule="evenodd"></path>
59 <path id="navClosed" class="hidden" fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path>
60 </svg>
61 </button>
62 </div>
63 <nav id="navList" class="min-h-screen hidden md:block sidebar-nav flex-grow px-1 lg:px-4 pb-4 md:pb-0 md:overflow-y-auto break-words">
64 <a href="index.html">Basics</a>
65 <a href="buildingObjects.html">Building Parts</a>
66 <a href="usingModels.html">Using Models</a>
67 <a href="dataBinding.html">Data Binding</a>
68 <a href="react.html">GoJS with React</a>
69 <a href="angular.html">GoJS with Angular</a>
70 <a href="textBlocks.html">TextBlocks</a>
71 <a href="shapes.html">Shapes</a>
72 <a href="pictures.html">Pictures</a>
73 <a href="panels.html">Panels</a>
74 <a href="tablePanels.html">Table Panels</a>
75 <a href="brush.html">Brushes</a>
76 <a href="sizing.html">Sizing Objects</a>
77 <a href="itemArrays.html">Item Arrays</a>
78 <a href="changedEvents.html">Changed Events</a>
79 <a href="transactions.html">Transactions</a>
80 <a href="viewport.html">Coordinates</a>
81 <a href="initialView.html">Initial View</a>
82 <a href="collections.html">Collections</a>
83 <a href="links.html">Links</a>
84 <a href="linkLabels.html">Link Labels</a>
85 <a href="connectionPoints.html">Link Points</a>
86 <a href="ports.html">Ports</a>
87 <a href="nodes.html">Nodes</a>
88 <a href="debugging.html">Debugging</a>
89 <a href="layouts.html">Layouts</a>
90 <a href="trees.html">Trees</a>
91 <a href="subtrees.html">SubTrees</a>
92 <a href="groups.html">Groups</a>
93 <a href="subgraphs.html">SubGraphs</a>
94 <a href="sizedGroups.html">Sized Groups</a>
95 <a href="selection.html">Selection</a>
96 <a href="highlighting.html">Highlighting</a>
97 <a href="animation.html">Animation</a>
98 <a href="toolTips.html">ToolTips</a>
99 <a href="contextmenus.html">Context Menus</a>
100 <a href="events.html">Diagram Events</a>
101 <a href="tools.html">Tools</a>
102 <a href="commands.html">Commands</a>
103 <a href="permissions.html">Permissions</a>
104 <a href="validation.html">Validation</a>
105 <a href="HTMLInteraction.html">HTML Interaction</a>
106 <a href="layers.html">Layers &amp; Z-ordering</a>
107 <a href="palette.html">Palette</a>
108 <a href="overview.html">Overview</a>
109 <a href="resizing.html">Resizing Diagrams</a>
110 <a href="replacingDeleting.html">Replacing and Deleting</a>
111 <a href="buttons.html">Buttons</a>
112 <a href="templateMaps.html">Template Maps</a>
113 <a href="legends.html">Legends and Titles</a>
114 <a href="extensions.html">Extensions</a>
115 <a href="geometry.html">Geometry Strings</a>
116 <a href="grids.html">Grid Patterns</a>
117 <a href="graduatedPanels.html">Graduated Panels</a>
118 <a href="makingImages.html">Diagram Images</a>
119 <a href="makingSVG.html">Diagram SVG</a>
120 <a href="printing.html">Printing</a>
121 <a href="serverSideImages.html">Server-side Images</a>
122 <a href="nodeScript.html">GoJS in Node.js</a>
123 <a href="testing.html">Testing</a>
124 <a href="storage.html">Storage</a>
125 <a href="performance.html">Performance</a>
126 <a href="source.html">Building from Source</a>
127 <a href="platforms.html">Platforms</a>
128 <a href="deployment.html">Deployment</a>
129 </nav>
130 </div>
131 <div class="pt-4 px-2 md:px-0 lg:px-4 pb-16 w-full overflow-hidden">
132
133<h1>User Permissions</h1>
134<p>
135Programmatically there are no restrictions on what you can do.
136However you may want to restrict the actions that your users may perform.
137</p>
138
139<h3 id="DiagramIsEnabled">Diagram.isEnabled</h3>
140<p>
141The simplest restriction is to set <a>Diagram.isEnabled</a> to false.
142Users will not be able to do much of anything.
143In this example, even though the grouping, undo, and redo commands are enabled,
144the commands cannot execute because the diagram is disabled.
145</p>
146<pre class="lang-js" id="isEnabled"><code>
147 diagram.commandHandler.archetypeGroupData =
148 { key: "Group", isGroup: true, color: "blue" };
149
150 var nodeDataArray = [
151 { key: "Alpha" },
152 { key: "Beta" },
153 { key: "Delta", group: "Epsilon" },
154 { key: "Gamma", group: "Epsilon" },
155 { key: "Epsilon", isGroup: true }
156 ];
157 var linkDataArray = [
158 { from: "Alpha", to: "Beta" },
159 { from: "Beta", to: "Beta" },
160 { from: "Gamma", to: "Delta" },
161 { from: "Delta", to: "Alpha" }
162 ];
163 diagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);
164 diagram.undoManager.isEnabled = true;
165
166 diagram.add($(go.Part, // this is just a visual comment
167 { location: new go.Point(200, 50) },
168 $(go.TextBlock, "Diagram.isEnabled == false",
169 { font: "16pt bold", stroke: "red" })
170 ));
171
172 // Disable the diagram!
173 diagram.isEnabled = false;
174</code></pre>
175<script>goCode("isEnabled", 600, 150)</script>
176
177<h3 id="DiagramIsReadOnly">Diagram.isReadOnly</h3>
178<p>
179More common is to set <a>Diagram.isReadOnly</a> to true.
180This allows users to scroll and zoom and to select parts, but not to insert or delete or drag or modify parts.
181(If you want to allow scroll and zoom but not selection, you can disable selection, as discussed below.)
182</p>
183<pre class="lang-js" id="isReadOnly"><code>
184 diagram.commandHandler.archetypeGroupData =
185 { key: "Group", isGroup: true, color: "blue" };
186
187 var nodeDataArray = [
188 { key: "Alpha" },
189 { key: "Beta" },
190 { key: "Delta", group: "Epsilon" },
191 { key: "Gamma", group: "Epsilon" },
192 { key: "Epsilon", isGroup: true }
193 ];
194 var linkDataArray = [
195 { from: "Alpha", to: "Beta" },
196 { from: "Beta", to: "Beta" },
197 { from: "Gamma", to: "Delta" },
198 { from: "Delta", to: "Alpha" }
199 ];
200 diagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);
201 diagram.undoManager.isEnabled = true;
202
203 diagram.add($(go.Part, // this is just a visual comment
204 { location: new go.Point(200, 50) },
205 $(go.TextBlock, "Diagram.isReadOnly == true",
206 { font: "16pt bold", stroke: "red" })
207 ));
208
209 // Disable diagram modifications, but allow navigation and selection
210 diagram.isReadOnly = true;
211</code></pre>
212<script>goCode("isReadOnly", 600, 150)</script>
213
214<h3 id="DiagramIsModelReadOnly">Diagram.isModelReadOnly</h3>
215<p>
216Another possibility is to set <a>Model.isReadOnly</a> to true.
217This allows users to scroll, zoom, select, and move parts, but not to insert or delete parts,
218including not adding or removing links nor adding or removing group members.
219</p>
220<p>
221The <a>Diagram.isModelReadOnly</a> property just gets and sets the <a>Model.isReadOnly</a> property.
222If you are loading new Models, you will need to set this Diagram property after setting <a>Diagram.model</a>.
223</p>
224<pre class="lang-js" id="isModelReadOnly"><code>
225 diagram.commandHandler.archetypeGroupData =
226 { key: "Group", isGroup: true, color: "blue" };
227
228 var nodeDataArray = [
229 { key: "Alpha" },
230 { key: "Beta" },
231 { key: "Delta", group: "Epsilon" },
232 { key: "Gamma", group: "Epsilon" },
233 { key: "Epsilon", isGroup: true }
234 ];
235 var linkDataArray = [
236 { from: "Alpha", to: "Beta" },
237 { from: "Beta", to: "Beta" },
238 { from: "Gamma", to: "Delta" },
239 { from: "Delta", to: "Alpha" }
240 ];
241 diagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);
242 diagram.undoManager.isEnabled = true;
243
244 diagram.add($(go.Part, // this is just a visual comment
245 { location: new go.Point(200, 50) },
246 $(go.TextBlock, "Diagram.model.isReadOnly == true",
247 { font: "16pt bold", stroke: "red" })
248 ));
249 // Disable adding or removing parts
250 diagram.model.isReadOnly = true;
251</code></pre>
252<script>goCode("isModelReadOnly", 600, 150)</script>
253
254<h3 id="AllowingCollapseExpand">Allowing Collapse and Expand</h3>
255<p>
256One common situation with diagrams that are <a>Diagram.isReadOnly</a> is that the user can not
257collapse or expand trees or subgraphs. Instead of setting <a>Diagram.isReadOnly</a>, you can set
258these properties:
259</p>
260<pre class="lang-js" id="collapseExpand"><code>
261$(go.Palette, "myPaletteDiv",
262 {
263 isReadOnly: false,
264 isModelReadOnly: true,
265 allowDelete: false,
266 allowInsert: false,
267 allowLink: false,
268 allowMove: false,
269 allowTextEdit: false,
270 // maybe other Diagram.allow... properties too, depending on your templates
271 // also consider disabling Tools
272 "contextMenuTool.isEnabled": false,
273 nodeTemplateMap: . . .
274 })
275</code></pre>
276
277<h2 id="SpecificPermissions">Specific permissions</h2>
278<p>
279More precise restrictions on the user can be imposed by setting properties of the <a>Diagram</a> or of a particular <a>Layer</a>
280or of a particular <a>Part</a> or <a>GraphObject</a>.
281</p>
282<p>
283Some restrictions, such as <a>Diagram.allowZoom</a>, only make sense when applying to the whole diagram.
284Others may also apply to individual parts, such as <a>Part.copyable</a> and <a>Layer.allowCopy</a> corresponding to <a>Diagram.allowCopy</a>.
285Finally some may apply to any <a>GraphObject</a>, for example properties for ports such as <a>GraphObject.toLinkable</a>,
286or to text objects such as <a>TextBlock.editable</a>.
287</p>
288<p>
289Any <a>Tool</a> can be disabled by setting <a>Tool.isEnabled</a> to false.
290By default all Tools are enabled, but many cannot run because the conditions are not right for <a>Tool.canStart</a> to return true.
291</p>
292<p>
293Here is a listing of what users can do and the properties that limit that functionality.
294Most of these properties have a default value of true.
295</p>
296
297<h3 id="CutCommand">Cut command (<a>CommandHandler</a>)</h3>
298<ul>
299 <li><a>Diagram.allowCopy</a>, <a>Diagram.allowDelete</a>, <a>Diagram.allowClipboard</a></li>
300 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
301</ul>
302
303<h3 id="CopyCommand">Copy command (<a>CommandHandler</a>)</h3>
304<ul>
305 <li><a>Diagram.allowCopy</a>, <a>Diagram.allowClipboard</a></li>
306 <li><a>Layer.allowCopy</a></li>
307 <li><a>Part.copyable</a></li>
308</ul>
309
310<h3 id="PasteCommand">Paste command (<a>CommandHandler</a>)</h3>
311<ul>
312 <li><a>Diagram.allowInsert</a>, <a>Diagram.allowClipboard</a></li>
313 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
314 <li>The clipboard's data format must be the same as the <a>Model.dataFormat</a></li>
315</ul>
316
317<h3 id="DeleteCommand">Delete command (<a>CommandHandler</a>)</h3>
318<ul>
319 <li><a>Diagram.allowDelete</a></li>
320 <li><a>Layer.allowDelete</a></li>
321 <li><a>Part.deletable</a></li>
322 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
323</ul>
324
325<h3 id="DragAndDropWithinDiagram">Drag-and-drop within diagram (<a>DraggingTool</a>)</h3>
326<ul>
327 <li><a>Diagram.allowMove</a>, <a>Diagram.allowCopy</a>, <a>Diagram.allowInsert</a></li>
328 <li><a>Layer.allowMove</a>, <a>Layer.allowCopy</a></li>
329 <li><a>Part.movable</a>, <a>Part.copyable</a></li>
330 <li><a>DraggingTool.isCopyEnabled</a></li>
331 <li><a>Diagram.isReadOnly</a> for moving (default value is false)</li>
332 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> for copying (default values are false)</li>
333 <li>Many properties affect dragging, including: <a>Part.maxLocation</a>, <a>Part.minLocation</a>, <a>Part.dragComputation</a>, and <a>DraggingTool.isGridSnapEnabled</a>.
334 Read about limiting user drags to be only horizontal or only vertical or only within the containing <a>Group</a> in the documentation for <a>DraggingTool</a>.</li>
335 <li><a>DraggingTool.isEnabled</a></li>
336</ul>
337
338<h3 id="DragAndDropOutOfDiagram">Drag-and-drop out of diagram (<a>DraggingTool</a>)</h3>
339<ul>
340 <li><a>Diagram.allowDragOut</a> (default value is false except for <a>Palette</a> where it is true)</li>
341 <li><a>DraggingTool.isEnabled</a></li>
342</ul>
343
344<h3 id="DragAndDropIntoDiagram">Drag-and-drop into diagram (<a>DraggingTool</a>)</h3>
345<ul>
346 <li><a>Diagram.allowDrop</a> (default value is true)</li>
347 <li><a>Diagram.allowInsert</a></li>
348 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
349 <li><a>DraggingTool.isEnabled</a></li>
350</ul>
351
352<h3 id="InPlaceTextEditing">In-place text editing (<a>TextEditingTool</a>)</h3>
353<ul>
354 <li><a>Diagram.allowTextEdit</a></li>
355 <li><a>Layer.allowTextEdit</a></li>
356 <li><a>Part.textEditable</a></li>
357 <li>
358 <a>TextBlock.editable</a>, <a>TextBlock.textValidation</a>, and <a>TextEditingTool.textValidation</a>
359 affect text editing (these are discussed in the section about <a href="validation.html">Validation</a>)
360 </li>
361 <li><a>Diagram.isReadOnly</a> (default value is false)</li>
362 <li><a>TextEditingTool.isEnabled</a></li>
363 <li><a>TextEditingTool.starting</a> controls how the editing may be initiated.</li>
364</ul>
365
366<h3 id="GroupCommand">Group command (<a>CommandHandler</a>)</h3>
367<ul>
368 <li><a>Diagram.allowGroup</a>, <a>Diagram.allowInsert</a></li>
369 <li><a>Layer.allowGroup</a></li>
370 <li><a>Part.groupable</a></li>
371 <li>The <a>CommandHandler.groupSelection</a> command requires that <a>CommandHandler.archetypeGroupData</a>
372 has been set to a data object to be copied into the model to be represented by a new group in the diagram;
373 this property is null by default, causing the command to be disabled.
374 You will need to set the property to an object so that newly created groups have the desired
375 property values for any data binding by the group template.</li>
376 <li><a>Group.memberValidation</a> and <a>CommandHandler.memberValidation</a> also control which Parts may become members of a Group</li>
377 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
378</ul>
379
380<h3 id="UngroupCommand">Ungroup command (<a>CommandHandler</a>)</h3>
381<ul>
382 <li><a>Diagram.allowUngroup</a>, <a>Diagram.allowDelete</a></li>
383 <li><a>Layer.allowUngroup</a></li>
384 <li><a>Group.ungroupable</a> (default value is false)</li>
385 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
386</ul>
387
388<h3 id="ClickCreating">Click-creating (<a>ClickCreatingTool</a>)</h3>
389<ul>
390 <li><a>Diagram.allowInsert</a></li>
391 <li>
392 The <a>ClickCreatingTool</a> requires that <a>ClickCreatingTool.archetypeNodeData</a>
393 has been set to a data object to be copied into the model to be represented by a new part in the diagram;
394 this property is null by default, causing the tool to be disabled.
395 You will need to set the property to an object so that newly created nodes have the desired
396 property values for any data binding by the node template.
397 </li>
398 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
399 <li><a>ClickCreatingTool.isEnabled</a></li>
400 <li><a>ClickCreatingTool.isDoubleClick</a> whether to insert on single click or double click.</li>
401</ul>
402
403<h3 id="DrawingNewLink">Drawing a new link (<a>LinkingTool</a>)</h3>
404<ul>
405 <li><a>Diagram.allowLink</a></li>
406 <li><a>Layer.allowLink</a></li>
407 <li>
408 <a>GraphObject.fromLinkable</a>, <a>GraphObject.fromLinkableDuplicates</a>,
409 <a>GraphObject.fromLinkableSelfNode</a>, <a>GraphObject.fromMaxLinks</a>,
410 <a>GraphObject.toLinkable</a>, <a>GraphObject.toLinkableDuplicates</a>,
411 <a>GraphObject.toLinkableSelfNode</a>, <a>GraphObject.toMaxLinks</a>
412 (these are discussed in the section about <a href="validation.html">Validation</a>)
413 </li>
414 <li>The <a>LinkingTool</a> requires that <a>LinkingTool.archetypeLinkData</a>
415 has been set to a data object to be copied into the model to be represented by a new link in the diagram;
416 this property is by default set to an empty JavaScript object.
417 You may need to want to set properties on this object so that newly created links have the desired
418 property values for any data binding by the link template.</li>
419 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
420 <li><a>LinkingTool.isEnabled</a></li>
421</ul>
422
423<h3 id="RelinkingExistingLink">Relinking an existing link (<a>RelinkingTool</a>)</h3>
424<ul>
425 <li><a>Diagram.allowRelink</a></li>
426 <li><a>Layer.allowRelink</a></li>
427 <li><a>Link.relinkableFrom</a>, <a>Link.relinkableTo</a> (default values are false)</li>
428 <li>
429 <a>GraphObject.fromLinkable</a>, <a>GraphObject.fromLinkableDuplicates</a>,
430 <a>GraphObject.fromLinkableSelfNode</a>, <a>GraphObject.fromMaxLinks</a>,
431 <a>GraphObject.toLinkable</a>, <a>GraphObject.toLinkableDuplicates</a>,
432 <a>GraphObject.toLinkableSelfNode</a>, <a>GraphObject.toMaxLinks</a>
433 (these are discussed in the section about <a href="validation.html">Validation</a>)
434 </li>
435 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
436 <li><a>RelinkingTool.isEnabled</a></li>
437</ul>
438
439<h3 id="ReshapingLink">Reshaping a link (<a>LinkReshapingTool</a>)</h3>
440<ul>
441 <li><a>Diagram.allowReshape</a></li>
442 <li><a>Layer.allowReshape</a></li>
443 <li><a>Part.reshapable</a> (default value is false)</li>
444 <li><a>Link.resegmentable</a> also affects whether segments can be added or removed (default value is false)</li>
445 <li><a>Diagram.isReadOnly</a> (default value is false)</li>
446 <li><a>LinkReshapingTool.isEnabled</a></li>
447</ul>
448
449<h3 id="ResizingObject">Resizing an object (<a>ResizingTool</a>)</h3>
450<ul>
451 <li><a>Diagram.allowResize</a></li>
452 <li><a>Layer.allowResize</a></li>
453 <li><a>Part.resizable</a> (default value is false)</li>
454 <li><a>Part.resizeCellSize</a>, <a>GraphObject.maxSize</a>, and <a>GraphObject.minSize</a> limit the size to which the user may resize the <a>Part.resizeObject</a></li>
455 <li><a>ResizingTool.maxSize</a>, <a>RotatingTool.minSize</a>, and <a>RotatingTool.cellSize</a> limit the size to which the user may resize the <a>Part.resizeObject</a></li>
456 <li><a>Diagram.isReadOnly</a> (default value is false)</li>
457 <li><a>ResizingTool.isEnabled</a></li>
458</ul>
459
460<h3 id="RotatingObject">Rotating an object (<a>RotatingTool</a>)</h3>
461<ul>
462 <li><a>Diagram.allowRotate</a></li>
463 <li><a>Layer.allowRotate</a></li>
464 <li><a>Part.rotatable</a> (default value is false)</li>
465 <li><a>RotatingTool.snapAngleMultiple</a> and <a>RotatingTool.snapAngleEpsilon</a> limit the angles to which the user may rotate the <a>Part.rotateObject</a></li>
466 <li><a>Diagram.isReadOnly</a> (default value is false)</li>
467 <li><a>RotatingTool.isEnabled</a></li>
468</ul>
469
470<h3 id="ArrowAndPageCommands">Arrow and Page commands (<a>CommandHandler</a>), panning/scrolling the diagram (<a>PanningTool</a> and scrollbars)</h3>
471<ul>
472 <li><a>Diagram.allowHorizontalScroll</a>, <a>Diagram.allowVerticalScroll</a></li>
473 <li><a>Diagram.hasHorizontalScrollbar</a>, <a>Diagram.hasVerticalScrollbar</a></li>
474 <li><a>Diagram.scrollMargin</a> and <a>Diagram.padding</a></li>
475 <li><a>Diagram.scrollMode</a> and <a>Diagram.positionComputation</a> for controlling how far the user may scroll</li>
476 <li><a>ToolManager.mouseWheelBehavior</a> controls whether mouse wheel events scroll or zoom</li>
477 <li>
478 See the DrawCommandHandler in the <a href="../extensions">Extensions</a> directory for
479 a <a>CommandHandler</a> that customizes the behavior of the arrow keys
480 </li>
481 <li><a>PanningTool.isEnabled</a></li>
482 <li><a>PanningTool.bubbles</a> controls whether panning gestures scroll the page rather than the viewport.</li>
483</ul>
484
485<h3 id="SelectAllCommand">SelectAll command (<a>CommandHandler</a>), click selecting (<a>ClickSelectingTool</a>), drag selecting (<a>DragSelectingTool</a>)</h3>
486<ul>
487 <li><a>Diagram.allowSelect</a></li>
488 <li><a>Layer.allowSelect</a></li>
489 <li><a>Part.selectable</a></li>
490 <li><a>Diagram.maxSelectionCount</a> limits how many selectable <a>Part</a>s the user may select</li>
491 <li><a>DragSelectingTool.isEnabled</a></li>
492</ul>
493
494<h3 id="UndoRedoCommands">Undo/Redo commands (<a>CommandHandler</a>)</h3>
495<ul>
496 <li><a>Diagram.allowUndo</a></li>
497 <li><a>UndoManager.isEnabled</a> (default value is false)</li>
498 <li><a>Diagram.isReadOnly</a> and <a>Model.isReadOnly</a> (default values are false)</li>
499</ul>
500
501<h3 id="ZoomCommands">Zoom commands (<a>CommandHandler</a>), zooming/rescaling the diagram (<a>ToolManager</a>)</h3>
502<ul>
503 <li><a>Diagram.allowZoom</a></li>
504 <li><a>ToolManager.mouseWheelBehavior</a> controls whether mouse wheel events scroll or zoom</li>
505 <li><a>Diagram.minScale</a>, <a>Diagram.maxScale</a>, and <a>Diagram.scaleComputation</a> for controlling how far the user may zoom.</li>
506</ul>
507
508<h3 id="ContextMenus">Context Menus (<a>ContextMenuTool</a>)</h3>
509<ul>
510 <li><a>GraphObject.contextMenu</a></li>
511 <li><a>Diagram.contextMenu</a></li>
512 <li><a>ContextMenuTool.isEnabled</a></li>
513</ul>
514
515 </div>
516 </div>
517
518 <div class="bg-nwoods-primary">
519 <section class="max-w-screen-lg text-white container mx-auto py-2 px-12">
520 <p id="version" class="leading-none mb-2 my-4">GoJS</p>
521 </section>
522 </div><footer class="bg-nwoods-primary text-white">
523 <div class="container max-w-screen-lg mx-auto px-8">
524 <div class="w-full py-6">
525
526 <div class="max-w-screen-lg xl:max-w-screen-xl mx-auto px-4 sm:px-6 md:px-8">
527 <ul class="text-sm font-medium pb-14 sm:pb-20 grid grid-cols-1 sm:grid-cols-3 gap-y-10">
528 <li class="list-none row-span-2">
529 <h2 class="text-base font-semibold tracking-wide">GoJS</h2>
530 <ul class="list-none space-y-4 md:space-y-1 px-0">
531 <li>
532 <a href="../samples/index.html">Samples</a>
533 </li>
534 <li>
535 <a href="../learn/index.html">Learn</a>
536 </li>
537 <li>
538 <a href="../intro/index.html">Intro</a>
539 </li>
540 <li>
541 <a href="../api/index.html">API</a>
542 </li>
543 <li>
544 <a href="../changelog.html">Changelog</a>
545 </li>
546 <li>
547 <a href="https://github.com/NorthwoodsSoftware/GoJS">GitHub</a>
548 </li>
549 </ul>
550 </li>
551 <li class="list-none row-span-2">
552 <h2 class="text-base font-semibold tracking-wide">Support</h2>
553 <ul class="list-none space-y-4 md:space-y-1 px-0">
554 <li>
555 <a href="https://www.nwoods.com/contact.html"
556 target="_blank" rel="noopener" onclick="getOutboundLink('https://www.nwoods.com/contact.html', 'contact');">Contact</a>
557 </li>
558 <li>
559 <a href="https://forum.nwoods.com/c/gojs">Forum</a>
560 </li>
561 <li>
562 <a href="https://www.nwoods.com/app/activate.aspx?sku=gojs">Activate</a>
563 </li>
564 <li>
565 <a href="https://www.nwoods.com/sales/index.html"
566 target="_blank" rel="noopener" onclick="getOutboundLink('https://www.nwoods.com/sales/index.html', 'buy');">Buy</a>
567 </li>
568 <li>
569 <a href="https://www.youtube.com/channel/UC9We8EoX596-6XFjJDtZIDg">Videos</a>
570 </li>
571 </ul>
572 </li>
573 <li class="list-none row-span-2">
574 <h2 class="text-base font-semibold tracking-wide">Company</h2>
575 <ul class="list-none space-y-4 md:space-y-1 px-0">
576 <li>
577 <a href="https://www.nwoods.com">Northwoods</a>
578 </li>
579 <li>
580 <a href="https://www.nwoods.com/about.html">About Us</a>
581 </li>
582 <li>
583 <a href="https://www.nwoods.com/contact.html">Contact Us</a>
584 </li>
585 <li>
586 <a href="https://twitter.com/northwoodsgo">Twitter</a>
587 </li>
588
589 </ul>
590 </li>
591 </ul>
592
593
594 <p class="text-sm text-gray-100 md:mb-6">
595 Copyright 1998-2021 <a class="text-white" href="https://www.nwoods.com">Northwoods Software</a>
596 </p>
597 </div>
598 </div>
599</footer> </body>
600
601<script async src="https://www.googletagmanager.com/gtag/js?id=UA-1506307-5"></script>
602<script>
603 window.dataLayer = window.dataLayer || [];
604 function gtag(){dataLayer.push(arguments);}
605 gtag('js', new Date()); gtag('config', 'UA-1506307-5');
606 var getOutboundLink = function(url, label) {
607 gtag('event', 'click', {
608 'event_category': 'outbound',
609 'event_label': label,
610 'transport_type': 'beacon'
611 });
612 }
613
614 // topnav
615 var topButton = document.getElementById("topnavButton");
616 var topnavList = document.getElementById("topnavList");
617 topButton.addEventListener("click", function() {
618 this.classList.toggle("active");
619 topnavList.classList.toggle("hidden");
620 document.getElementById("topnavOpen").classList.toggle("hidden");
621 document.getElementById("topnavClosed").classList.toggle("hidden");
622 });
623</script>
624 <script src="../assets/js/prism.js"></script>
625 <script src="../release/go.js"></script>
626 <script src="../assets/js/goDoc.js"></script>
627 <script>
628 document.addEventListener("DOMContentLoaded", function() {
629 if (window.go) document.getElementById('version').textContent = "GoJS version " + go.version;
630 if (window.goDoc) window.goDoc();
631 var d = window.diagrams;
632 for (var i = 0; i < d.length; i++) {
633 var dargs = d[i];
634 goCodeExecute(dargs[0], dargs[1], dargs[2], dargs[3], dargs[4]);
635 }
636 if (window.extra) window.extra();
637 });
638 </script>
639</html>