The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Today's Posts

 
How to Markov Chain Thread Tools Search this Thread Display Modes
Dear there,

I frequently need to draw different kinds of Markov Chains for my work. For example:


However, it is not easy to consistently draw the arcs, especially those self-looping arcs. Any suggestions? Especially any ideas without programming?

Sincerely Yours,
Michael
 
I might prepare some single-point bezier links and some 16 magnet circles and keep them in a stencil document.



--
Attached Thumbnails
Click image for larger version

Name:	16MagnetCircle.png
Views:	478
Size:	14.5 KB
ID:	2273   Click image for larger version

Name:	SinglePointBezier.png
Views:	492
Size:	11.2 KB
ID:	2274   Click image for larger version

Name:	InterLinks.png
Views:	481
Size:	18.4 KB
ID:	2275   Click image for larger version

Name:	MarkovChainStencil.png
Views:	1595
Size:	43.8 KB
ID:	2293  
Attached Files
File Type: zip Markov.gstencil 2.zip (34.5 KB, 548 views)

Last edited by RobTrew; 2012-02-22 at 08:40 AM.. Reason: Updated the simple stencil (also submitted to Graffletopia)
 
PS to prepare 16 magnet circles like the one above, you would need to adjust the start angle of the script (as below) so that there are two magnets at each cardinal direction.

Code:
property plngMagnets : 16
property prStartDegrees : 360 / 32

on run
	set lstMagnets to RadialMagnets(plngMagnets, prStartDegrees)
	tell application id "OGfl"
		tell front window
			repeat with oGraphic in (selection) as list
				if class of oGraphic = shape then set magnets of oGraphic to lstMagnets
			end repeat
		end tell
	end tell
end run

on RadialMagnets(lngN, rStartDegree)
	if lngN < 1 then return {}
	
	set lstMagnets to {}
	set rTheta to rStartDegree
	set rDelta to 360 / lngN
	
	repeat with i from 1 to lngN
		set end of lstMagnets to {sin(rTheta), -(cos(rTheta))}
		set rTheta to rTheta + rDelta
	end repeat
	return lstMagnets
end RadialMagnets


on sin(rDegrees)
	(do shell script "echo 'echo $((sin(" & (rDegrees / 180) * pi & ")))' | ksh") as number
end sin

on cos(rDegrees)
	(do shell script "echo 'echo $((cos(" & (rDegrees / 180) * pi & ")))' | ksh") as number
end cos

Last edited by RobTrew; 2012-02-19 at 11:12 AM..
 
Updated the simple stencil to add links at multiples of 45º
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
CCPM / Critical Chain ericsmw OmniPlan General 11 2013-01-28 09:36 PM
"Chain" visualization (à la Toodledo) macula OmniFocus 1 for Mac 0 2010-01-21 04:18 AM


All times are GMT -8. The time now is 09:30 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.