constraints
	alignement
	arrows not over lapping


	depth of arrow for overlapping arrow
		shortest length to turn on top

direction arrow

            .-----.
            v     |
          .-U-.   |
          |   |   |   .------------.
          '---'   |   |            |
    .---.         |   |   .---.    |   .---.      .---.
    |   R---------'   |   |   R----'   |   R---.  |   R---.
    '---'             |   '---'        '---'   |  '---'   |
                      '-----.                  |          |
                            |                  |          |
                          .-U-.                |        .-U-.
                          |   |          .-----'        |   |
                          '---'          |              '---'
                                         |
                                         |
                                       .-U-.
                                       |   |
                                       '---'

	with A*
		build bulwark around box except for connector
		tunnel around connector to force direction
		variable size bulwark
		on demand  optimization if too slow
		bulwark other  elements
		semi permeable bulwark on arrows

	without A*
		start, go connectors favorite direction

		end
			one virtual point, 1 character in end's favorite direction
			next direction, everything except favorite direction opposite

documentation format and structure
	makdown
	directory structure reflecting contents

	output
		text info
		md
		#html

	document usage of peek and key-mon
		https://github.com/phw/peek
		https://github.com/scottkirkwood/key-mon

geo-selection
	selecting without tab is slow if there are many components
	movement with emulated cursors are slow
	select based on location
		enter geo-location
			remove currently selected from candidates
			chose a direction, up/down/left/right
			remove half of the elements
			select a middle object in the remaining objects
				and select it
			loop until found or none left

		in case of error, reset everything and restart

		can we achieve he same result without state?
			no entering geo-state
			no list of not matching currently selected

text interface
	vim script
		open file under cursor

objects
	any orientation text/arrow
		call a sub that returns a text, sub gets direction and length
		different sub used to implement angled-arrow
	
		labled arrows
	
	angle arrow dialog does nothing
	
	table exec-box
	
	s-arrow
	
	multi-wirl arrow routing

display
	GUI/TUI: a faster stencil picker
		TUI can use fzf
			with preview

architecture
	handle multiple binary format versions

optimization 
	Z buffer
		https://metacpan.org/pod/Tree::Interval::Fast

	Selecting an object takes long time when there are many objects
		is stripes coordinates used rather than object to filter out?
		
		Zbuffer/bit masks
			when rendering stripes, keep list of objects per cell
				IE: quadrant size is 1 cell
	
	update_display called every time mouse changes grid cell
		optimize by first looking if there are objects changes
			use object CHANGED field which is not a boolean but an index
			save CHANGED field for all objects wen doing an undo snapshot
		
		if object has changed, compute changed window
		
		we may still get an event where everything needs to be redrawn 
	
	Connection optimizer
		use CHANGED field which is not a boolean but an index
		
		auto connection using A* module http://search.cpan.org/~acdalton/AI-Pathfinding-AStar-0.10/
			- orthogonal or orthogonal and diagonal arrows
			- add get_cost_map to base Asciio
				- get_cost_map can also be implemented in draw in sub classes
			- connectors and elements could have different costs
		
		http://www-cs-students.stanford.edu/~amitp/gameprog.html
		Path finding, see ISBN 2550-0124977820
		
		https://github.com/brean/python-pathfinding/tree/main/pathfinding/finder
		
		connected, non auto-connect, arrows loose their connection if the connectee is resized
			=> this is because resize doesn't keep the connection. The 
				canonizer reconnects elements but non auto-connect objects are not handled by the canonizer
				
				=> make canonizer re connect to the same place instead for changing the connector
		
		optimize current arrow (A* pathfinder)
	
	do_stack serialization
		put ID to objects in ELEMENTS rather than serialized elements
			large test shows time 0.2s vs 0.002s
			
			objects versions can be kept in memory or serialized separately

