GB_graph - Quick reference guide

Notations :
G.selected := the whole graph if no node selected, else selected node(s).
G.selected* : selected nodes only
s#0 : first selected node . Then s#1,...s#k, ..
(s#i,s#k) : edge between nodes
K(node) : closure(node) = all neighbours of neighbours of ... of node

Links

User guide

Mail for FAQ, bugs reports, etc.

ESCape : close this window

Mouse

• Alt-click anywhere : creates a new node and connect it to current selection (use [Backspace] to unlink if needed)
• Click anywhere : deselect all
• Cmd-click inside face : select face leader

• Click on node : select/deselect node
• Alt-click on node : select node  and connect to last selected
• Double-click on node : select node and its closure
• Cmd-click on node : add/remove from selection

• Click-on-node-and-drag : select and move node
• Maj-click-on-node-and-drag : select and move node and its closure (cluster)
• Alt-click-on-node-and-drag : select node and rotate its closure

• Click-anywhere-and-drag : draw selection rectangle
• Shift-Click-anywhere-and-drag : draw selection ellipse
• Click-anywhere-and-Shift-drag : draw selection square
• Click-anywhere-and-Cmd/Ctrl-drag : constrained (2x3,4x3,..) rectangle (cf. Dimensions menu)

Keyboard

Cmd-Keys : ⌘-Key or Ctrl-Key

Cmd-S	Save	: same as menu Graph|Save

Cmd-X	Cut  ALL  (and edges, and faces)
Cmd-x	Cut G.selected*
Cmd-Z	Undo	Undo last operation(s) up to 16 undo levels : Very useful
Cmd-Y	Redo	Undoes the last Undo
Cmd-E	Edit 	selected node label (text)
Cmd-A	Select	all nodes connected to G.selected (union of closure(s))
Cmd-I	Invert selection
Cmd-L	Select nodes with same label (text) as s#0

Cmd-C	Copy	selected node label (text)	
Cmd-V	Paste	label to selected node(s)

Short-cuts & Debug commands

!		G.saveForUndo() : push current position & refresh gradients (if moved nodes)
&		Dump(s#0)
d		Debug++
0		G.selected.toggleRadius 0 <--> R :  show/hide nodes
1		G.selected.radius *= 0.8 : decrease radii
2		G.selected.radius *= 1.2 : increase radii
3		G.selected.setRandomRadius()	
4		G.selected.bumpLineWidth(-1);
5		G.selected.bumpLineWidth(+1);

6		setFaceLeader(s#0)
7		makeNewFaces(selected)  

8		rectangular/circular graph from selection rectangle/ellipse
9		killAllControls() 

m		hide/show menus
?		this window
ESC		quits node text editor, stops animations, emergency exit, ...

Edges and Faces

k		show/hide edges
C		connect s#0 to G.nodes , or closure(s#0) to closure(s#1)
c		toggle self connect (loop) for G.selected
i		edge or spline : insert middle node in K(s#0) or between s#0 and s#1
M		merge s#0, s#1 and their edges, or merge paths (s0..s#1) ,(s#2..s#3)


[Backspace]		kill last edge
x		kill s#0 or last node 
X		kill Edges  ⛔️  / G.selected*
Y		add edges :  convex hull of G.selected

:		hide Faces (: or H to un-hide)
F		same as '🔷 Faces' Menu action : build/kill faces

⇞ ⇟  ↖ ↘ 	page up/down, home/end keys : navigate thru face leaders

Node selection and displays

0	toggle radius 0 <--> R : show/hide G.selected
h	hide G.selected 
H	un-hideall : nodes & faces
%	show hidden nodes
t	display node labels. Toggles 0:none, 1:labels only, 2:all, 3:z's layers
T	clear labels of G.selected
v	Verbose : Toggles graph information. 0:none, 1:standard,  2,3: debug
^	select node#0
$	select last node
TAB	select next node
Shift-TAB select previous node
y	select frontier nodes : lowest degree
n	select same color node(s)

#<label>	: select nodes by label
#<id>		: select & blinks node #id


O	display images library (Cmd-Z to return)
G	push current selection
W	pop selection

l		toggles lock 📌 for G.selected
L		🔑 unlocks all

Palettes

<space>	apply next palette to G.selected
B	basic palette
o	set previous palette
O	invert colors of G.selected
p	set colors from current palette for selected nodes
e	set colors from current palette for selected edges
q	set next palette
P	display palettes  - ESC to close
Palette menu new gradient palette from (s#0 [,s#1]) colors

§	set background to next palette color
;	toggles background black/white
,	toggle rulers

 Palettes grid
ESC:  quit
Click: select palette
Shift-click: add clicked color to selected palette
Alt-click: delete color
'i': invert palette|
'<','>': sort palettes
'w': swap with last
'N': New random paletteS;

K	show/hide color picKer
Cmd-Alt click: Pick screen color and apply to G.selected* & Add color to current palette

Graph transformation (use Cmd-Z to Undo)

Cmd-X	🔴 clears ALL 
x or [Suppr]/[Delete]	kill s#0 or last Node
[Backspace]			kill last edge
X 
a	align G.selected onto 20x20px grid
A	align G.selected onto rulers grid or 40x40 if no ruler
_	align G.selected* onto line s#0...s#last
*	scale			the whole graph and saveForUndo()
s	scale -				zoom - on	G.selected (scales distances and radii)
S	scale +				zoom + on	G.selected
r	rotate				G.selected by + 10 °
R	rotate				G.selected by - 10 °
w	swap nodes
← → ↑ ↓ arrows move G.selected up/down/left/right (shift to accelerate)

New objects

Enter	new Quad from  ◻︎
/	    new node from  ◻︎

Libraries

E	display Emojis library  DblClick to apply
I	display Images library  Dblclick to apply
P	display palettes. Click to change

Groups

g		group/ungroup G.selected*
node.click	 -> select all nodes in group
node.Cmd-click	select node(s) in group

Decoration

>		special links   selected nodes  : show arrows
<		special unLinks selected 

Particles

(		G.selected := attractor+ (white)
)		G.selected := attractor- (red)

Animations

j	{S*}	bouncer jump
t	toggle Trace
x	clear Trace

3D operations

=	reset		all z's to 0 for selected nodes
+	increase	z by 100 for selected nodes
-	decrease	z by 100 for selected nodes
z	invert z's (z := -z) for G.selected

Label edition

Cmd-e	edit s#0 label (text)
Enter	save label and quit editor
Escape	clears label and quit editor
Backspace, delete, .. as usual
Cmd-v	Paste last edited node label to G.selected

Label syntax

Line breaks : '|'. Ex. Comme|par|hasard
Label := string .. @var ... @var.. [* at end ->  apply to all selected]

Nodes attributes:
@[x|y|z|r|id|col|hsl]	: (x,y,z) coords, radius, id, color

Misc vars :
@A				random letter
@bigp			random bigInt pseudo-prime
@rnd			random not prime
@rndp			random prime
@pre			Prenom : Mauricette,..
@pat			Patronyme : Bourbaki,...
@adj			Adjectif (masculin)
@date,@time		Current time : Updated at screen drawing time
@secs			Elapsed seconds : Updated every second

Evaluation :
${expression} Ex: ${Math.atan2(@y,@x)}

Misc text :
${LABELS[7]}
@label = ${LABELS[@id]} ...

Commands :
/emoji(id)		sets node emoji. Ex: /emoji(@id)

Label example :	Node @id at @x,@y  color:@col * -> applies to all selected

🎨 🖋️ Drawing mode

@			Enter/Leave drawing mode
ESC			Leave drawing mode
TAB			Select next drawer
MAJ-TAB		Select next path
Alt-click 	anywhere	New drawer
Cmd-V		Duplicate drawer
x			Suppress last point
[Delete]	last line
[Suppr]		last path

/			shape to rectangle
E			shape to Ellipse

Alphabetically


/	new Dot/Rect from from  ◻︎
_	align G.selected*
-	decreases z by 50 for selected nodes
?	this window
§	set background to next palette color
:	hide Faces (: or H to un-hide)
;	set background to black
,	toggle rulers
!	saveForUndo()
*	scale	the whole graph and saveForUndo()
&	Dump(s#0)
^	select node#0
+	increases z by 50 for selected nodes
<	unLinks    selected nodes
=	reset		all z's to 0 for selected nodes
>	links      selected nodes with arrows
$	select last node
%	start/top animations

[Enter]		New Quad from  ◻︎
[Enter]		Node label editor : save label and quit editor
[ESC]		close this window, stops animations, quits node tex editor, etc.

[Suppr]	 kill last node or s#0
[Backspace]	kill last edge
← → ↑ ↓ arrows	move G.selected up/down/left/right
⇞ ⇟  ↖ ↘ 	page up/down, home/end keys : show first/last, next/previous face leaders

<space>	apply next palette to G.selected

(		G.selected := attractor+ (green)
)		G.selected := attractor- (red)

0		G.selected.toggleRadius(0 <--> R)
1		G.selected.radius *= 0.8
2		G.selected.radius *= 1.2
3		G.selected.setRandomRadius()		
4		G.selected.bumpLineWidth(+1)
5		G.selected.bumpLineWidth(-1)
6		setFaceLeader(s#0)
7		makeNewFaces(selected)  
8		rectangular/circular graph from selection rectangle/ellipse
9		killAllControls() 

a	align onto 20x20px grid
A	align onto graph rulers or 40x40px grid if no rulers

b	
B	basic palette #0
c	toggles self connect (loop) / G.selected*
C	connects closure(s#0)   closure(s#1)

d	Debug++

Cmd-S	Save	graph to persistent memory
Cmd-A	Select	all nodes connected to G.selected (closure)
Cmd-C	Copy	selected node label (text)	
Cmd-V	Paste	label to selected node(s)
Cmd-E	Edit 	s#0 label
Cmd-I	Invert selection
Cmd-L	Select nodes with same label (text) as s#0
Cmd-V	Paste	drawer
Cmd-V	Paste last edited node label to G.selected
Cmd-X	Cut ALL
Cmd-x	Cut G.selected*
Cmd-Y	Redo
Cmd-Z	Undo	Undo last operation(s) up to 16 undo levels : Very useful

e		set colors from current palette for selected edges
E		display Emojis library - ESC to close

f		screen capture -> new Image - variant 0:transparent 1:black background
F		same as 'Faces' Menu action : toggle kill/build faces
g		group/ungroup G.selected nodes
G		push current selection		
h		hide G.selected 
H		un-hide all : nodes & faces
i		insert middle node in K(s#0) or between s#0 and s#1
I		display image Library (ESC to quit)
j		bouncer jump (animation)
J		

k		show/hide edges konnections
K		show/hide color picKer
l		toggles lock 📌 / G.selected
L		🔑 unlocks all
m		hide/show menus	
M		merge s#0, s#1 and their edges, or merge paths (s0..s#1),(s#2..s#3)

n	Select same color node(s)
N	toggle noclick nodes / G.selected*
o	set previous palette
O	G.selected: invert cOlors
p	set colors from current palette for selected nodes
P	display palettes library  - ESC to close
q	set next palette
r	rotate		G.selected by + PI/32;
R	rotate		G.selected by - PI/16 ;
s	scale -		zoom - /	G.selected
S	scale +		zoom + /	G.selected

t	display node labels. Toggles 0:none, 1:labels only, 2:all, 3: z's
T	G.selected* : clear labels
TAB	select next node
Shift-TAB select previous node
U	
v	Verbose : Toggles graph information. 0:none, 1:standard,  2,3: debug
w	swap nodes
W	pop selection
x	kill s#0 or last node
X	kill Edges  ⛔️  / G.selected*
y	select frontier nodes
Y	add edges :  convex hull / G.selected
N	toggle immutable nodes / G.selected*
z	invert z's (z := -z) / G.selected
Z   toggle noclick nodes / G.selected*

GB_graph

4 nodes, 4 edges, one 3-cycle, 1 face, 1 selected node, 1 text label

Introduction

	Graphs are made of nodes, edges, and faces.
	A node has a size or radius, a shape (round dot, rectangle, custom shape, ...), a color and possibly a color gradient or an image, and a label (text). Nodes are denoted  #0 (first node), #1, ...#last.
	Nodes are connected by edges, or links. An edge between #i and #j is denoted (#i,#j). There is at most one edge between two nodes. An edge is undirected : (#i,#j) is the same as (#j,#i). Edges can be displayed as lines, dotted lines, gradients, arrows, curves or springs.
	A path between two nodes a and b is a sequence of edges (#a,#i)(#i,#j)(#j,#k)...(#m,#b); A n-cycle is a closed path of n nodes from one node to itself : (#a,#i)(#i,#j)(#j,#k)...(#m,#a).
	Cycles may enclose faces, colored polygons. Faces may be drawn with color gradrients, or as 'smoothfaces' using Bezier curves. Faces are automatically found by GB_graph, or user-defined.
	

Survival kit

	Meta keys notation : Cmd-Key denotes either ⌘-Key or Ctrl-Key. Cmd-A and Cmd-a, etc. are the same.
	'A' denotes press the 'A' key = Shift-a, 'b' press the 'b' key, ... 
	ESC is the ESCape key. Alt is the Alt or Option key.
	
	Useful commands :
	• Cmd-z : Undo last operation. GB-graph has an history stack to remember the 16 last graphs. The undoLevel  - 0 to 16 - is displayed in the info area (top left of screen). Press Cmd-z, Cmd-z, Cmd-z, ...to go back in time.
	• Cmd-X : clear all and start a new graph (undoable)
	• '?' : show help window
	• ESC : quit help window, quit text editor, stop animations, etc.
	
	

Mouse

	• Click on node : select/deselect node
	• Cmd-click on node : add/remove to/from selection
	
	• Alt-click anywhere : create a new node and connect it to current selection (use 'Backspace' to unlink if needed)
	• Click anywhere : deselect all
	• Cmd-click anywhere : move selection to click location (animated)
	• Click-and-drag anywhere : make a selection rectangle, enclosing nodes to select, then Cmd-a.
	
	The following apply to unselected nodes :
	
	• Alt-click on node : select node and connect to last selected
	• Double-click on node : select node and its closure
	• Click-and-drag : select and move node
	• Maj-click-and-drag : select and move node and its closure (cluster)
	• Alt-click-and-drag : select node and rotate its closure
	

Mouse wheel

	• Menu Preferences|mouseWheel to enable/disable the wheel
	• Wheel to zoom +/-
	• Shift-wheel to rotate +/-
	• Alt-wheel to move left/right (X axis)
	• Cmd-wheel to move up/down (Y axis)
	

Menus

	Menus items allow to launch menu actions : yellow background menus, eg. Faces, or to tune parameters values with sliders; The 'reset' action at the end of a menu resets parameters to default values. Menu are denoted by Name|<item name>. Ex : Nodes|radius
	
	• Click onto a menu name : Nodes,Random,... to open/close it
	• Clicking on a tagged menu name : • Anims,• Screens,.. will open/close its sub-menus.
	• 'm' : close all menus / submenus
	

First steps

Nodes & Shapes

Shapes, variant, sizes

	- Clean everybody : 'Cmd-X'
	• NewNode : Add a node somewhere : Alt-click
	- Select it : Click or Cmd-click
	- Select a shape : Nodes|Shape
	- Change its radius : Set Nodes|radius = ...  or keys '1', '2'
	- Select a variant : Nodes|variant
	- Try to set Nodes|rotate, Nodes|extent, Nodes|nColor
	• Goto NewNode.
	

Faces & leaders

	Faces are delimited by cycles of any length > 2. Each face has a leader node which is used to set the face color or gradient.
	• NewFaces : Draw ...
	

Triangles

	- Clean everybody : 'Cmd-X'
	• Draw the (D) polygon
	- Unselect all : click anywhere
	- Draw faces : 'F'
	- Operations|QuadsToTriangles
	- Repeat : Operations|TrianglesToTriangles
	- [Add a few gradients] Notation : [... is an optional step]
	- [Try another palette : <space>,<space>,...]
	- Menu Nodes|radius = 0 or Key '0'
	- Menu Nodes|lineColor = 16 = black
	- Menu Nodes|lineWidth = 1 or 2 or 0
	

Operations

Homothety

Homothety (n = 2 : two copies, scale = 0.5 , variant =1 : connect)

Revolution!

	A surface of revolution is a surface in Euclidean space created by rotating a curve (the generatrix) around an axis of rotation. 
	• Draw the generatrix path (G)
	- [insert intermediate nodes : select all, then 'I','I',...]
	- [Set MoreGraphs|variant to the minimal radius Rmin]
	- 
	

Links

GB_graph app

Mail for FAQ, bugs report, etc.