<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Orbifold &#187; Diagramming</title>
	<atom:link href="http://visualizationtools.net/default/tag/diagramming/feed/" rel="self" type="application/rss+xml" />
	<link>http://visualizationtools.net/default</link>
	<description>Think. Visualize. Understand.</description>
	<lastBuildDate>Wed, 18 Jan 2012 09:08:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A functional graph library in F#</title>
		<link>http://visualizationtools.net/default/functional-graph-library/</link>
		<comments>http://visualizationtools.net/default/functional-graph-library/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 10:46:56 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[FSharp]]></category>
		<category><![CDATA[Diagramming]]></category>
		<category><![CDATA[F#]]></category>

		<guid isPermaLink="false">http://visualizationtools.net/default/?p=5636</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s well-know that adjacency lists are the way to go if you wish to model a graph data structure, so we&#8217;ll represent a graph as (node*adjacency list) and include some generic data buckets in the tuple. More precisely</p>
<div class="wp_codebox">
<table>
<tr id="p56361">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre>
</td>
<td class="code" id="p5636code1">
<pre class="fsharp" style="font-family:monospace;"><span style="color: #06c; font-weight: bold;">type</span> Node <span style="color: #a52a2a;">=</span>
    <span style="color: #06c; font-weight: bold;">int</span> <span style="color: #5d478b; font-style: italic;">(* node identifier *)</span> <span style="color: #a52a2a;">*</span>
    <span style="color: #3cb371;">'TDaton (* node data *)
&nbsp;
type Connection&lt;'</span>TDaton<span style="color: #a52a2a;">&gt;</span> <span style="color: #a52a2a;">=</span>
    <span style="color: #06c; font-weight: bold;">int</span> <span style="color: #5d478b; font-style: italic;">(* source Id *)</span> <span style="color: #a52a2a;">*</span>
    <span style="color: #06c; font-weight: bold;">int</span> <span style="color: #5d478b; font-style: italic;">(* sink Id *)</span> <span style="color: #a52a2a;">*</span>
    <span style="color: #06c; font-weight: bold;">int</span> <span style="color: #5d478b; font-style: italic;">(* weight *)</span> <span style="color: #a52a2a;">*</span>
    <span style="color: #3cb371;">'TDaton (* connection data *)
&nbsp;
type Adjacency&lt;'</span>TDaton<span style="color: #a52a2a;">&gt;</span> <span style="color: #a52a2a;">=</span>
    Connection<span style="color: #a52a2a;">&lt;</span><span style="color: #3cb371;">'TDaton&gt; list (* a list of connections to other nodes*)
&nbsp;
type Atom&lt;'</span>TNodeDaton, <span style="color: #3cb371;">'TConnectionDaton&gt; =
    Node&lt;'</span>TNodeDaton<span style="color: #a52a2a;">&gt;</span> <span style="color: #a52a2a;">*</span> Adjacency<span style="color: #a52a2a;">&lt;</span><span style="color: #3cb371;">'TConnectionDaton&gt;
&nbsp;
type Graph&lt;'</span>TNodeDaton, <span style="color: #3cb371;">'TConnectionDaton&gt; =
    Atom&lt;'</span>TNodeDaton, <span style="color: #3cb371;">'TConnectionDaton&gt; list</span></pre>
</td>
</tr>
</table>
</div>
<p>The connections are directed links between nodes and the weight tuple factor is taken out of the generic data bucket in order to make weighted graph analysis possible. One could replace the generic data attached to the connection by an interface which would require a weight property, but here again this would complicate things in code. In any case, in the documentation of the library I have added an example of how to attach polymorphic data buckets to nodes and connections.</p>
<p>The adjacency type is just an alias for a connection list and, finally, the graph is as advertised above just a list of nodes with their adjacency list. The Atom type is a type alias for one single graph (list) element and comes handy in the algorithms.</p>
<p>From these few type definitions you can spend the rest of your life doing graph analysis and implementing all the known (or unknown) graph algorithms; shortest path, Hamiltionian cycles, connected components and so on. At this point the current implementation contains the most used ones and the emphasis was also on having a quick (and easy) way to display the graph (and their properties).</p>
<div class="image-wrap portfolio"><a href="/default/wp-content/uploads/2011/07/FGraphInteractive.png" rel="prettyPhoto" title="FGraph in F# Interactive"><span class="zoom"></span>
<img src="http://visualizationtools.net/default/wp-content/uploads/2011/07/FGraphInteractive-300x173.png" alt="FGraph Interactive" title="FGraph Interactive" width="300" height="173" class="alignnone size-medium wp-image-5643" />
</a></div><p style="clear:both;">&nbsp;</p><p style="clear:both">&nbsp;</p>
<p>Obviously, if you want to implement some graph algorithms you need all the basics like; adding nodes, removing connections, setting node data, fetching upstream and downstream nodes, testing whether a link exists and so on. In addition, you also need a way to easily create graphs or generate random graphs (with a fixed node degree for example). Since most of the graph analysis focuses on paths and structure it&#8217;s often not necessary to adorn the graph with data or weights, hence the possibility to define graphs through a more simple structure:</p>
<div class="wp_codebox">
<table>
<tr id="p56362">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
</pre>
</td>
<td class="code" id="p5636code2">
<pre class="fsharp" style="font-family:monospace;">&nbsp;
<span style="color: #06c; font-weight: bold;">let</span> pregraph <span style="color: #a52a2a;">=</span>
        <span style="color: #6c6;">&#91;</span>
        <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">1</span>, <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">2</span><span style="color: #6c6;">&#93;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;</span>
        <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">2</span>, <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">5</span><span style="color: #6c6;">&#93;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;</span>
        <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">3</span>, <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">4</span><span style="color: #6c6;">&#93;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;</span>
        <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">5</span>, <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">4</span><span style="color: #6c6;">&#93;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;</span>
        <span style="color: #6c6;">&#93;</span>
<span style="color: #06c; font-weight: bold;">let</span> graph <span style="color: #a52a2a;">=</span> Orbifold.<span style="color: #060;">FGraph</span>.<span style="color: #060;">ParseList</span> pregraph
graph <span style="color: #a52a2a;">|&gt;</span> GraphVisualizer.<span style="color: #060;">Show</span></pre>
</td>
</tr>
</table>
</div>
<p>This will launch the visualizer and produce the following simple graph:</p>
<p><img class="alignnone size-full wp-image-5638" title="a simple graph" src="http://visualizationtools.net/default/wp-content/uploads/2011/07/simplegraph.png" alt="a simple graph" width="547" height="509" /></p>
<p>The power of F# resides in the handling of lists and avoiding loops as one would in C# tremendously helps in situations like this. One should compare the ParseList method implementation with what it would take in C#:</p>
<div class="wp_codebox">
<table>
<tr id="p56363">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre>
</td>
<td class="code" id="p5636code3">
<pre class="fsharp" style="font-family:monospace;"><span style="color: #5d478b; font-style: italic;">///&lt;summary&gt;Parses a simple list made out of tuples of (int, int list). The first integer is the index and the list is the list of nodes indices to which the current node is connected.&lt;/summary&gt;</span>
<span style="color: #06c; font-weight: bold;">let</span> ParseList <span style="color: #6c6;">&#40;</span>list : <span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">int</span><span style="color: #a52a2a;">*</span> <span style="color: #06c; font-weight: bold;">int</span> list<span style="color: #6c6;">&#41;</span> list<span style="color: #6c6;">&#41;</span> : Graph<span style="color: #a52a2a;">&lt;</span>Object,Object<span style="color: #a52a2a;">&gt;=</span>
        <span style="color: #06c; font-weight: bold;">let</span> g <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">ref</span> Graph.<span style="color: #060;">Empty</span>
        <span style="color: #06c; font-weight: bold;">let</span> linkedIds: <span style="color: #06c; font-weight: bold;">int</span> list <span style="color: #06c; font-weight: bold;">ref</span> <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">ref</span> <span style="color: #6c6;">&#91;</span><span style="color: #6c6;">&#93;</span>
        <span style="color: #06c; font-weight: bold;">let</span> containsNumber number list <span style="color: #a52a2a;">=</span> <a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html"><span style="color: #06c; font-weight: bold;">List</span></a>.<span style="color: #060;">exists</span> <span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">fun</span> elem <span style="color: #a52a2a;">-&gt;</span> elem <span style="color: #a52a2a;">=</span> number<span style="color: #6c6;">&#41;</span> list
        g.<span style="color: #060;">Value</span> <span style="color: #a52a2a;">&lt;-</span> <span style="color: #6c6;">&#40;</span>list <span style="color: #a52a2a;">|&gt;</span> <a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html"><span style="color: #06c; font-weight: bold;">List</span></a>.<span style="color: #060;">map</span> <span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">fun</span> <span style="color: #6c6;">&#40;</span>idx,adjs<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">-&gt;</span>
                                <span style="color: #06c; font-weight: bold;">let</span> newNode : Node<span style="color: #a52a2a;">&lt;</span>Object<span style="color: #a52a2a;">&gt;</span> <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span>idx, <span style="color: #06c; font-weight: bold;">null</span><span style="color: #6c6;">&#41;</span>
                                <span style="color: #06c; font-weight: bold;">let</span> ad <span style="color: #a52a2a;">=</span> <a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html"><span style="color: #06c; font-weight: bold;">List</span></a>.<span style="color: #060;">map</span> <span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">fun</span> t<span style="color: #a52a2a;">-&gt;</span>
                                                        <span style="color: #06c; font-weight: bold;">if</span> <span style="color: #06c; font-weight: bold;">not</span> <span style="color: #6c6;">&#40;</span>containsNumber t <span style="color: #a52a2a;">!</span>linkedIds<span style="color: #6c6;">&#41;</span> <span style="color: #06c; font-weight: bold;">then</span> linkedIds.<span style="color: #060;">Value</span><span style="color: #a52a2a;">&lt;-</span> t::<span style="color: #a52a2a;">!</span>linkedIds
                                                        <span style="color: #06c; font-weight: bold;">let</span> con : Connection<span style="color: #a52a2a;">&lt;</span>Object<span style="color: #a52a2a;">&gt;</span> <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span>idx,t,<span style="color: #c6c;">0</span>,<span style="color: #06c; font-weight: bold;">null</span><span style="color: #6c6;">&#41;</span>
                                                        con
                                                   <span style="color: #6c6;">&#41;</span> adjs
                                <span style="color: #06c; font-weight: bold;">let</span> atom : Atom<span style="color: #a52a2a;">&lt;</span>Object,Object<span style="color: #a52a2a;">&gt;</span> <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span>newNode,ad<span style="color: #6c6;">&#41;</span>
                                atom
                          <span style="color: #6c6;">&#41;</span><span style="color: #6c6;">&#41;</span>
        <span style="color: #5d478b; font-style: italic;">(*we auto-add the node if it appears in the connections*)</span>
        linkedIds.<span style="color: #060;">Value</span> <span style="color: #a52a2a;">|&gt;</span> <a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html"><span style="color: #06c; font-weight: bold;">List</span></a>.<span style="color: #060;">iter</span> <span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">fun</span> t <span style="color: #a52a2a;">-&gt;</span>
                                             <span style="color: #06c; font-weight: bold;">if</span> <span style="color: #06c; font-weight: bold;">not</span> <span style="color: #6c6;">&#40;</span>NodeExists t <span style="color: #a52a2a;">!</span>g<span style="color: #6c6;">&#41;</span> <span style="color: #06c; font-weight: bold;">then</span>
                                                            <span style="color: #06c; font-weight: bold;">let</span> n : Node<span style="color: #a52a2a;">&lt;</span>Object<span style="color: #a52a2a;">&gt;</span> <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#40;</span>t,<span style="color: #06c; font-weight: bold;">null</span><span style="color: #6c6;">&#41;</span>
                                                            <span style="color: #06c; font-weight: bold;">let</span> c : Adjacency<span style="color: #a52a2a;">&lt;</span>Object<span style="color: #a52a2a;">&gt;</span> <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#91;</span><span style="color: #6c6;">&#93;</span>
                                                            g.<span style="color: #060;">Value</span><span style="color: #a52a2a;">&lt;-</span><span style="color: #6c6;">&#40;</span>n,c<span style="color: #6c6;">&#41;</span>::<span style="color: #a52a2a;">!</span>g
                                      <span style="color: #6c6;">&#41;</span>
        g.<span style="color: #060;">Value</span></pre>
</td>
</tr>
</table>
</div>
<p>The interesting part of the library sits in the analysis module where one encounters the unavoidable traversals and where I tried to also implement useful variants like the depth-first traversal of edges:</p>
<div class="wp_codebox">
<table>
<tr id="p56364">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre>
</td>
<td class="code" id="p5636code4">
<pre class="fsharp" style="font-family:monospace;"><span style="color: #06c; font-weight: bold;">let</span> DFTEdgeVisit <span style="color: #6c6;">&#40;</span>g:Graph<span style="color: #a52a2a;">&lt;</span>_,_<span style="color: #a52a2a;">&gt;</span><span style="color: #6c6;">&#41;</span> <span style="color: #6c6;">&#40;</span>start:<span style="color: #06c; font-weight: bold;">int</span><span style="color: #6c6;">&#41;</span> <span style="color: #6c6;">&#40;</span>processEdge: <span style="color: #06c; font-weight: bold;">int</span><span style="color: #a52a2a;">*</span>int<span style="color: #a52a2a;">-&gt;</span><span style="color: #06c; font-weight: bold;">unit</span><span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span>
        <span style="color: #06c; font-weight: bold;">let</span> nextToVisit <span style="color: #a52a2a;">=</span> Stack<span style="color: #a52a2a;">&lt;</span><span style="color: #06c; font-weight: bold;">int</span><span style="color: #a52a2a;">&gt;</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span>
        <span style="color: #06c; font-weight: bold;">let</span> discovered <span style="color: #a52a2a;">=</span> HashSet<span style="color: #a52a2a;">&lt;</span><span style="color: #06c; font-weight: bold;">int</span><span style="color: #a52a2a;">&gt;</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span>
        <span style="color: #06c; font-weight: bold;">let</span> v <span style="color: #a52a2a;">=</span> <span style="color: #06c; font-weight: bold;">ref</span> <span style="color: #c6c;">0</span> <span style="color: #5d478b; font-style: italic;">(* current vertex *)</span>
        <span style="color: #06c; font-weight: bold;">ignore</span><span style="color: #6c6;">&#40;</span>nextToVisit.<span style="color: #060;">Push</span><span style="color: #6c6;">&#40;</span>start<span style="color: #6c6;">&#41;</span><span style="color: #6c6;">&#41;</span>
        <span style="color: #06c; font-weight: bold;">ignore</span><span style="color: #6c6;">&#40;</span>discovered.<span style="color: #060;">Add</span><span style="color: #6c6;">&#40;</span>start<span style="color: #6c6;">&#41;</span><span style="color: #6c6;">&#41;</span>
        <span style="color: #06c; font-weight: bold;">let</span> parents <span style="color: #a52a2a;">=</span> Dictionary<span style="color: #a52a2a;">&lt;</span><span style="color: #06c; font-weight: bold;">int</span>,<span style="color: #06c; font-weight: bold;">int</span><span style="color: #a52a2a;">&gt;</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span>
        <span style="color: #06c; font-weight: bold;">while</span> nextToVisit.<span style="color: #060;">Count</span> <span style="color: #a52a2a;">&gt;</span> <span style="color: #c6c;">0</span> <span style="color: #06c; font-weight: bold;">do</span>
            v.<span style="color: #060;">Value</span> <span style="color: #a52a2a;">&lt;-</span> nextToVisit.<span style="color: #060;">Pop</span><span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span>
            <span style="color: #06c; font-weight: bold;">if</span> parents.<span style="color: #060;">ContainsKey</span><span style="color: #6c6;">&#40;</span><span style="color: #a52a2a;">!</span>v<span style="color: #6c6;">&#41;</span> <span style="color: #06c; font-weight: bold;">then</span> processEdge <span style="color: #6c6;">&#40;</span>parents.<span style="color: #6c6;">&#91;</span><span style="color: #a52a2a;">!</span>v<span style="color: #6c6;">&#93;</span>,<span style="color: #a52a2a;">!</span>v<span style="color: #6c6;">&#41;</span>
            <span style="color: #06c; font-weight: bold;">let</span> someDescendants <span style="color: #a52a2a;">=</span> GetDescendants <span style="color: #a52a2a;">!</span>v g
            <span style="color: #06c; font-weight: bold;">match</span> someDescendants <span style="color: #06c; font-weight: bold;">with</span>
            |None <span style="color: #a52a2a;">-&gt;</span> <span style="color: #6c6;">&#40;</span><span style="color: #6c6;">&#41;</span>
            |Some<span style="color: #6c6;">&#40;</span>desc<span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">-&gt;</span> <a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html"><span style="color: #06c; font-weight: bold;">List</span></a>.<span style="color: #060;">iter</span> <span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">fun</span> d <span style="color: #a52a2a;">-&gt;</span> <span style="color: #06c; font-weight: bold;">if</span> <span style="color: #06c; font-weight: bold;">not</span> <span style="color: #6c6;">&#40;</span>discovered.<span style="color: #060;">Contains</span><span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">fst</span> d<span style="color: #6c6;">&#41;</span><span style="color: #6c6;">&#41;</span> <span style="color: #06c; font-weight: bold;">then</span>
                                                                                    <span style="color: #06c; font-weight: bold;">ignore</span><span style="color: #6c6;">&#40;</span>parents.<span style="color: #060;">Add</span><span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">fst</span> d,<span style="color: #a52a2a;">!</span>v<span style="color: #6c6;">&#41;</span><span style="color: #6c6;">&#41;</span>
                                                                                    <span style="color: #06c; font-weight: bold;">ignore</span><span style="color: #6c6;">&#40;</span>discovered.<span style="color: #060;">Add</span><span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">fst</span> d<span style="color: #6c6;">&#41;</span><span style="color: #6c6;">&#41;</span>
                                                                                    <span style="color: #06c; font-weight: bold;">ignore</span><span style="color: #6c6;">&#40;</span>nextToVisit.<span style="color: #060;">Push</span><span style="color: #6c6;">&#40;</span><span style="color: #06c; font-weight: bold;">fst</span> d<span style="color: #6c6;">&#41;</span><span style="color: #6c6;">&#41;</span><span style="color: #6c6;">&#41;</span> <span style="color: #6c6;">&#40;</span><a href="http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/namespaces.html"><span style="color: #06c; font-weight: bold;">List</span></a>.<span style="color: #060;">rev</span> desc<span style="color: #6c6;">&#41;</span></pre>
</td>
</tr>
</table>
</div>
<p>Here again, one would use in C# Action<> parameters for the visitors but in F# things are made easy since functions and variables are on the same footing.</p>
<p>Some of the algorithms, like the shortest path between two nodes, are quite straightforward in C# but are really an headache when trying to convert to purely functional analogs. At this points the library does its best to honour the functional paradigm (also because often it represents immense performance gains w.r.t. the more linear non-functional versions) but sometimes the traditional algorithms are more readable and hence more accessible for developers who wish to alter the code. </p>
<p>Finally, I&#8217;d like to highlight the graph visualization part which resides in a separate library. When experimenting with F# and graphs in the F# interactive mode you can easily display the graph by feeding it to the <strong>GraphVisualizer.Show</strong> method:</p>
<div class="wp_codebox">
<table>
<tr id="p56365">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
</pre>
</td>
<td class="code" id="p5636code5">
<pre class="fsharp" style="font-family:monospace;"><span style="color: #06c; font-weight: bold;">let</span> g <span style="color: #a52a2a;">=</span>
        <span style="color: #6c6;">&#91;</span>
        <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">1</span>, <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">2</span><span style="color: #6c6;">&#93;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;</span>
        <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">2</span>, <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">3</span><span style="color: #a52a2a;">;</span><span style="color: #c6c;">5</span><span style="color: #6c6;">&#93;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;</span>
        <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">3</span>, <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">4</span><span style="color: #6c6;">&#93;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;</span>
        <span style="color: #6c6;">&#40;</span><span style="color: #c6c;">5</span>, <span style="color: #6c6;">&#91;</span><span style="color: #c6c;">4</span><span style="color: #6c6;">&#93;</span><span style="color: #6c6;">&#41;</span><span style="color: #a52a2a;">;</span>
        <span style="color: #6c6;">&#93;</span>
g <span style="color: #a52a2a;">|&gt;</span> GraphVisualizer.<span style="color: #060;">Show</span><span style="color: #a52a2a;">;;</span>
GraphVisualizer.<span style="color: #060;">ShowShortestPath</span><span style="color: #6c6;">&#40;</span><span style="color: #c6c;">1</span>,<span style="color: #c6c;">4</span>,g<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">;;</span></pre>
</td>
</tr>
</table>
</div>
<p>You can also use the graph visualizer as a WPF component in your application. The control is a classic MVVM control with an ItemsSource accepting a Graph structure. Typically you&#8217;d use it as follows:</p>
<div class="wp_codebox">
<table>
<tr id="p56366">
<td class="line_numbers">
<pre>1
</pre>
</td>
<td class="code" id="p5636code6">
<pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Visualizer:GraphControl</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;Diagram&quot;</span> <span style="color: #000066;">Grid.Row</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">Tension</span>=<span style="color: #ff0000;">&quot;{Binding Value, ElementName=TensionSlider}&quot;</span> <span style="color: #000066;">ItemsSource</span>=<span style="color: #ff0000;">&quot;{Binding Graph}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre>
</td>
</tr>
</table>
</div>
<p>where the tension determines the tension between the node in the spring-embedder layout algorithm. I&#8217;ll add some more layout algorithms in the next pass (tree layout variations in particular).</p>
<p>The WPF component also has easy access to the analysis like for example the shortes path:</p>
<div class="wp_codebox">
<table>
<tr id="p56367">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre>
</td>
<td class="code" id="p5636code7">
<pre class="fshapr" style="font-family:monospace;">let g2 = Graph.ParseList [
                            (1, [3;6;9]);
                            (2, [4]);
                            (3, [2;5]);
                            (5, [20]);
                            (6, [7;8]);
                            (7, [12]);
                            (9, [10;11]);
                            (12, [13]);
                            (20, [12]);
&nbsp;
                        ]
this.Graph &lt;- Graph.Analysis.ColorizeShortestPath( 1,13, g2)</pre>
</td>
</tr>
</table>
</div>
<p>where &#8220;this.Graph&#8221; is here the MVVM property of the model bound to the GraphControl. The result would be the picture below.<br />
<img src="http://visualizationtools.net/default/wp-content/uploads/2011/07/shortestpath.png" alt="shortest path visualization" title="shortest path visualization" width="572" height="571" class="alignnone size-full wp-image-5639" /></p>
<p>Some final remarks and questions regarding this project:</p>
<ul>
<li>all&#8217;s F#; the custom diagramming control, the library and the MVVM stuff. It would make sense to use this library in a C# context (to benefit from the F# performance) but I haven&#8217;t put any energy in this. Not sure it&#8217;s a priority since our other libraries (<a href="/G2" title="G2 library" target="_blank">G2</a>, <a href="/Lynx" title="Lynx library" target="_blank">Lynx</a>) contain all this as well. </li>
<li>this is work in progress and I spend a lot of time documenting things as well as creating sample code, I reckon things will settle by September this year.</li>
<li>making this open source would be a good thing for the community but I&#8217;ll have to sleep over it. You can try to convince me.</li>
<li>the WPF control is a templated control and can be customized. On the other hand, the arrow and node visual are hard coded. It could be useful to template them as well and in this fashion enable databinding of the databuckets defined above to the visuals. However, this library is not a full-fledged Visio replacement, rather it focuses on graph analysis. Does is make sense to invent a mechanism to enable more line-of-business scenario&#8217;s? I think our existing graph libraries are filling the need there. The only reason I would put energy in this is that at this moment there is no graph visualization library for F# on the market. </li>
<li>What about Silverlight? Well, I don&#8217;t see a technical issue there but I am less sure about the audience doing Silverlight development in F#. Is there an audience for this?</li>
</ul>
<p>Thanks to <a href="http://tomasp.net/" title="Tomas Petricek" target="_blank">Tomas Petricek</a> for some useful suggestions and the <a href="http://www.ffconsultancy.com/" title="Flying Frog Consulting" target="_blank">Flying Frog</a> for insightful directions.</p>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/functional-graph-library/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Twirl: like Live Pivot but better</title>
		<link>http://visualizationtools.net/default/twirl-like-live-pivot-but-better/</link>
		<comments>http://visualizationtools.net/default/twirl-like-live-pivot-but-better/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 13:06:01 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[Diverse]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Diagramming]]></category>

		<guid isPermaLink="false">http://visualizationtools.net/default/?p=4188</guid>
		<description><![CDATA[We re-invented Live Pivot and took away the limitations along the way.]]></description>
			<content:encoded><![CDATA[<p>A recurring issue in the projects we do is centered around the scalability of diagramming solutions. Typically I get questions like &#8220;<em>How many nodes can one display in this or this framework?</em>&#8221; and  &#8220;<em>Will the graph layout be still fluid and interactive if we add a thousand items?&#8221;</em> These questions are legitimate but not always straightforward to answer. There are several aspects in this context:</p>
<ul>
<li> The <strong>usability </strong>aspect: how meaningful is a diagram with thousands of nodes, does the user still get insights with potentially a million links between so many nodes? Here are I have to think about how useless the <a title="Architecture tools in VS2010 ultimate" href="http://blogs.msdn.com/b/somasegar/archive/2009/08/29/architecture-tools-in-vsts-2010.aspx" target="_blank">Visual Studio 2010 architecture visualizer</a> is if you try to display a big assembly. See the picture below which displays a small portion of the G2 architecture; 20.000 nodes and 90.000 links&#8230;useful? I don&#8217;t think so.</li>
<li>The<strong> .Net framework</strong> aspect: out of the box the .Net classes related to WPF and Silverlight (the UIElement and FrameworkElement, that is) are &#8216;heavy&#8217;. These base classes contain stuff related to templating, databinding, triggers, animation and whatnot. It means that even if you don&#8217;t need any of this you have to carry around in the memory of your application a large amount of material. If you scale a diagramming solution to thousands of item it shows. If one really wants to display very large amount of data in a diagram there is no other way but to find alternatives to the retained graphics pipeline of .Net and go back to the good old low-level mechanisms.</li>
<li><a href="/default/wp-content/uploads/architecturediagram.png"><img class="size-medium wp-image-4189 alignright" title="G2 architecture diagram" src="/default/wp-content/uploads/architecturediagram-300x228.png" alt="G2 architecture diagram" width="300" height="228" /></a>The <strong>granularity </strong>aspect: much like the usability aspect, is it meaningful to have a lot of animations and gimmicks when displaying large datasets?  I suppose if you wish to display large diagrams you are not interested in details and interactivity, or do you? Well, some customer do and want to have both a high-level overview and the ability to zoom down to a finer level of details. This is difficult to achieve with the current technology and average hardware. Being able to display a million nodes with databound entities and remain fluid is tough, the only solution being to switch in the zooming process from one algorithm to another. Much to say about this but it&#8217;s not the topic of this post.</li>
</ul>
<p>In the end there are three solutions to these problems:</p>
<ul>
<li><strong>Drop Silverlight/WPF</strong> as the technology in which you try to visualize something and move to C/C++ but in this way sacrificing a lot of magic  these frameworks offer. While sometimes a viable solution for the customer, usually not a solution I like to push too much for obvious reasons.</li>
<li><strong>Compromise between scalability and functionality</strong> by emphasizing the usability aspect; decision makers want clear diagrams and yet another cluttered interface is the last thing a company wants to pay for.</li>
<li>Come up with an <strong>ingenious or new way of visualizing data</strong>. Often the type of data and the business context dictates here what &#8216;ingenious&#8217; means, each type of data has its own peculiarities. So, finding a generic solution in this line is usually not easy.</li>
</ul>
<p>While I describe all this in the context of diagramming, the remarks are valid for any data visualization solution. In the end, what matters the most to a customer is having a solution whether it&#8217;s a diagram or a different type of visualization often doesn&#8217;t matter.</p>
<p><a title="Live Pivot" href="http://www.getpivot.com/" target="_blank">Live Pivot</a> falls into the last category and is a new data visualization approach which handles the issues mentioned above quite well even if the amount of data it handles is still moderate. No links or diagramming here but a way to traverse a multi-dimensional dataset by filtering out data through various widgets and pivot-like datagrams which are well-known from Microsoft Excel. The name &#8216;Live&#8217; Pivot is hence aptly chosen as it displays pivot charts dynamically in function of the user&#8217;s criteria. I highly advice you to take a look and play with it, it&#8217;s a <a title="The Live Pivot SDK" href="http://www.silverlight.net/learn/pivotviewer/" target="_blank">free Silverlight framework</a> and I&#8217;m sure we&#8217;ll see interesting applications of it in the near future.</p>
<p>Now, the reason of this post is that although I was enjoying Live Pivot in the beginning I got more and more frustrated by the limitations imposed as time passed by:</p>
<ul>
<li>The datapool on which the visualization is based is a variation of XML called <strong>CXML</strong>. Though Microsoft created various tools to support the creation of CXML it remains a bit an awkward format if you want to work with data coming from WCF or use the visualization with your legacy data entities. Even if possible theoretically to convert your entities in memory using the supplied assemblies, it remains a bit of show-stopper when developing for Pivot.</li>
<li>The visuals in Live Pivot are based on the <a title="SeaDragon technology" href="http://www.seadragon.com/" target="_blank"><strong>SeaDragon </strong></a>technology which even for small amounts of entities will force you to have huge amounts of server space because for every image you need, say, a hundred copies of it in various resolutions. This is related to the Morton layout algorithm used internally to refine images as the user zooms on different levels of the dataset under consideration.</li>
<li> <strong>Updating or serving collections from a database</strong> is possible but in practice no-one is doing this because it involves undocumented wizardry (see for example <a title="What do you mean?" href="http://www.getpivot.com/developer-info/hosting.aspx" target="_blank">the cryptic explanation on the Pivot site</a>). I&#8217;m sure things will become easier in the future though.</li>
<li> The whole design and development process of Pivot collections is off the main development route, <strong>the framework doesn&#8217;t integrate well into a traditional N-tier application</strong>. In a way, creating a Pivot collection is more like the design of a Photoshop template for a website: you do it once and then try to not change it in fear of the consequences it has on the rest of the site.</li>
<li>Live Pivot is freely available and well developed but if you wish to customize things for a customer&#8230;well, you can&#8217;t since <strong>the source is not yours</strong>.</li>
</ul>
<p>Summary: Live Pivot is hardly a solution for the typical customer I meet. This said, I started to develop my own version of a Pivot-ish solution which would enable one to:</p>
<ul>
<li> Use WCF as a backend to serve collections and to handle large amounts of data (not limited by the client&#8217;s memory). One of our customer talks about terrabytes of records, how would one handle this in Live Pivot?</li>
<li> Use standard POCO entities as data buckets. This goes hand in hand with the WCF requirement, of course.</li>
<li> Use any XAML in the UI instead of only pictures. Let&#8217;s imagine you want buttons, tooltips, &#8230;in the display rather than just Morton-related images?</li>
<li> Adapt the partitioning and visualization in function of customer needs.</li>
<li> Have an iterative filtering of data outside the memory boundary. That is, use the whole SQL database backend as a datapool rather than just the entities in memory.</li>
<li> Make use of all the fluid animation features of Silverlight</li>
<li> Possibly combine diagramming and Pivot-ish visualization together.</li>
<li> Run away from the horrible SeaDragon mechanics involving hundreds of little images</li>
<li> The possibility to transpose the solution to WPF and have shared code WPF/Silverlight solutions</li>
</ul>
<p>This Silverlight library is called &#8216;<strong>Twirl</strong>&#8216; and contains (as good as) all the features above. The things which still need to be worked on are the WCF integration and the dynamic querying of the backend.</p>
<p>While developing Twirl I discovered that a whole lot of features are really available out of the box in Silverlight (together with the SL toolkit, Expression Blend etc.) which made the development easy, in particular:</p>
<ul>
<li>The new fluid animation features of SL4 and Blend</li>
<li>The ability to databind lists to any path, not just ItemsControl and ListBox</li>
<li>The filtering and sorting of data through ICollectionView and  related classes</li>
<li>The MVVM pattern with good support in Blend</li>
<li>Easing functions, animations etc.</li>
</ul>
<p>The biggest challenge was really <strong>how to partition data in several columns</strong>? That is; how do you organize an arbitrary set of data on the basis of a certain datatype into a limited amount of partitions? Here I had to go deep into unknown territories like <strong>data mining, clustering algorithms (k-means in particular), text analysis</strong> and more. At some point I developed an F# clustering library but had difficulties to map the F# vector type into C# types&#8230;and gave the interop effort up (it was a good learning exercise though). After much research and a lot of trials and errors I just developed my own view on the problem and a home-made algorithm came out of this. Currently the partitioning is quite good but more datasets and types of data need to be used in order to refine the algorithm.</p>
<p>Below are some screenshots of Twirl in various situations.</p>
<p><a href="/default/wp-content/uploads/Twirl4.png"><img class="alignnone size-medium wp-image-4194" title="Twirl " src="/default/wp-content/uploads/Twirl4-300x170.png" alt="" width="300" height="170" /></a></p>
<p><a href="/default/wp-content/uploads/Twirl3.png"><img class="alignnone size-medium wp-image-4195" title="Twirl " src="/default/wp-content/uploads/Twirl3-300x169.png" alt="" width="300" height="169" /></a></p>
<p><a href="/default/wp-content/uploads/Twirl2.png"><img class="alignnone size-medium wp-image-4196" title="Twirl " src="/default/wp-content/uploads/Twirl2-300x171.png" alt="" width="300" height="171" /></a></p>
<p><a href="/default/wp-content/uploads/Twirl1.png"><img class="alignnone size-medium wp-image-4197" title="Twirl1" src="/default/wp-content/uploads/Twirl1-300x185.png" alt="" width="300" height="185" /></a></p>
<p>Twirl offers, much like Live Pivot but beyond it as well, the following opportunities:</p>
<ul>
<li>visualization of large datasets stored on SQL Server</li>
<li>exploration of local drives through the out-of-browser or COM capability of Silverlight</li>
<li>traversals of datasets which share a common set of properties</li>
<li>interactive shopping carts and filtering of items</li>
<li>cataloguing of ebooks or e-documents in general. Here we are looking into the integration with Windows indexing service and alike</li>
<li>customization of the partitioning and the display</li>
<li>integration with other visualization techniques (diagramming, charting and whatnot)</li>
</ul>
<p>This Twirl development was inspired by a bigger customer project which also embraces Microsoft StreamInsight and correlation research of very large datasets. While the development of Twirl was mainly in function of our customers I realize it might benefit a lot from the input from others. Whether this means I need to put the code on CodePlex, I don&#8217;t know yet. Anyway, if you have interest in Twirl or want to share your thoughts, <a title="Contact us" href="/Contact" target="_blank">contact us</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/twirl-like-live-pivot-but-better/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>G2&#039;s interface hierarchy</title>
		<link>http://visualizationtools.net/default/g2s-interface-hierarchy/</link>
		<comments>http://visualizationtools.net/default/g2s-interface-hierarchy/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 07:19:29 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[Diagramming]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://www.orbifold.net/default/?p=2377</guid>
		<description><![CDATA[Some (self-indulgent) overview of G2's interface hierarchy is available.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.orbifold.net/default/wp-content/uploads/TheRootOfItAll.png"><img class="size-medium wp-image-2370 alignleft" title="G2 interface hierarchy" src="http://www.orbifold.net/default/wp-content/uploads/TheRootOfItAll-300x188.png" alt="G2 interface hierarchy" width="300" height="188" /></a>A company shouldn&#8217;t give away its trade and manufacturing secrets but there you go; you can get <a title="G2 interface hierarchy" href="http://www.orbifold.net/default/?page_id=2369" target="_self">an overview of G2&#8242;s interface hierarchy</a>. While this might seem like  low-level technical blabla it&#8217;s actually the result of ten years of research and evolution to organize an high-end diagramming control! The interface hierarchy of any software sits at the core of its architecture. In the same way that any person can handle any radio on the basis of some simple interface knowledge (though every actual radio type is different, everybody knows that the &#8216;On&#8217; button means switching the radio on) so one should be able to understand any software on the basis of its interfaces. Well, mostly true since a lot of languages cannot handle interfaces (nope, I didn&#8217;t mention JavaScript&#8230;). I let this knowledge of G2&#8242;s interfaces out in the wide open blue for two reasons: for our customers to be able to get around in the sometimes daunting complexity of G2 and for other diagramming freaks (vendors?) to rely on some wisdom which simply works well (a wide diversity of custom applications on top of G2 and hundreds of unit tests cannot be wrong). One important things as well, these interfaces actually articulate the extensibility of G2 since all concrete interface implementations are instantiated via the Unity framework (dependency injections). It means that any of G2&#8242;s elements described in this interface hierarchy can be replaced with custom (customer) implementations and thus extend the application scope of G2 considerably. In fact, besides these interfaces there is also a whole MVC architecture and other extensible elements (like the graph layout machinery) <strong>which makes G2 the best and most refined WPF diagramming framework around</strong>.</p>
<p>As <a title="G2 v2.0" href="http://www.orbifold.net/default/?p=2305" target="_self">V2.0 of G2 is solidifying</a>, we are much investing in the creation of diverse samples and (intelligent, ie. non-compiled API)Â  documentation. See also these articles in this context:</p>
<ul>
<li><a title="G2 terminology" href="http://www.orbifold.net/default/?page_id=2019" target="_self">G2: some terminology</a></li>
<li><a title="G2 styling and templating" href="http://www.orbifold.net/default/?page_id=2232" target="_self">G2: styling and templating</a></li>
<li><a title="G2 the layout algorithms" href="http://www.orbifold.net/default/?page_id=2093" target="_self">G2: how to use the layout algorithms</a></li>
<li><a title="G2: getting started" href="http://www.orbifold.net/default/?page_id=2014" target="_self">G2: getting started</a></li>
</ul>
<p><em>PS: sorry for the self-indulgent tone, but one should now and then feel satisfied about years of work <img src='http://visualizationtools.net/default/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/g2s-interface-hierarchy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expression Blend&#039;s Sketchflow diagrams with G2</title>
		<link>http://visualizationtools.net/default/expression-blends-sketchflow-diagrams-with-g2/</link>
		<comments>http://visualizationtools.net/default/expression-blends-sketchflow-diagrams-with-g2/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 12:12:05 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[Diverse]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Diagramming]]></category>

		<guid isPermaLink="false">http://www.orbifold.net/default/?p=2338</guid>
		<description><![CDATA[A short sample demonstrating that it's a piece of cake to mimic the latest Expression Blend diagrams (part of Sketchflow) in G2.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.orbifold.net/default/wp-content/uploads/BlendSketchflow.png"><img class="size-thumbnail wp-image-2339 alignleft" title="Expression Blend 3 with Sketchflow" src="http://www.orbifold.net/default/wp-content/uploads/BlendSketchflow-150x150.png" alt="Expression Blend 3 with Sketchflow" width="150" height="150" /></a>One of the aims of G2 is to provide a framework for any type of intelligent diagram (see also <a href="/default/?p=1764">the database diagram sample</a>, <a href="/default/?p=1773">the mindmapping sample</a>, <a href="/default/?p=1735">the class diagram sample</a>&#8230;). The &#8216;intelligent&#8217; refers here to highly interactive diagrams with databinding, animations and adorners in constrast with &#8216;data visualization&#8217; diagrams where the focus is more on getting a bird&#8217;s eye view (many nodes and edges) on the data rather than seeing all the details to the lowest level.</p>
<p>In the past week I had a look at Expression Blend 3 and was impressed with the amount of new features both for WPF and Silverlight. The application is a delight! I&#8217;m not so sure that <a title="Expression Sketchflow" href="http://www.microsoft.com/expression/products/Sketchflow_Overview.aspx" target="_blank">Sketchflow </a>(see screenshot on the left in case you have no idea what it&#8217;s all about) will replace paper and pencil but it does offer a new approach which might suit some workflows in companies. In any case, I was seduced by the diagrammatic representation of the screen-flow which allows you to visualize/change and beautify (screen transitions etc.) the flow of the various WPF/Silverlight forms you hook up together. Obviously it came to my mind to mimic it in G2 and&#8230;presto, I had it done in the course of an evening. The most difficult part in the process was actually not the diagramming bit but the definition of the shifting tray which shows up when one hovers over the nodes. The situation is very common and with customers we always have this kind of discussion: the gizmo&#8217;s and bells should be shown at all time or is usability increased by popups, sliding panels and expanding trays? Expression Blend is in this context different from other Microsoft application where usually the buttons and gears are fixed (cfr. class designer, SQL designer, DSL designers etc.). Well, this is not a bad things since Expression is aimed at designers and people who are looking for cool effects. In fact, WPF and Silverlight offer much effcts and sparkles which are hardly used in line of business applications nowadays. Personally, I continue to be amazed how much one can achieve with WPF (and G2) without much programming and this little sketchflow proof of concept on the basis of G2 was huge fun.</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/G2SketchflowSample.png"><img src="http://www.orbifold.net/default/wp-content/uploads/G2SketchflowSample.png" alt="G2 Sketchflow Sample" title="G2 Sketchflow Sample" width="612" height="518" class="alignnone size-full wp-image-2360" /></a><br />
<span id="more-2338"></span><br />
Below is a short sequence demonstrating the sample. Sorry for not delivering the sample code, <a title="G2" href="/G2">G2 is a commercial component </a>(see however the control template below for an idea of what it involves). If you buy G2 the sample comes with the box together with many other (and ever growing set of) samples.</p>
<p><object id="movie" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="576" height="452" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="quality" value="high" /><param name="bgcolor" value="#4A4A4A" /><param name="allowScriptAccess" value="always" /><param name="src" value="/Default/wp-content/uploads/SketchflowWithG2.swf" /><param name="name" value="movie" /><embed id="movie" type="application/x-shockwave-flash" width="576" height="452" src="/Default/wp-content/uploads/SketchflowWithG2.swf" name="movie" allowscriptaccess="always" bgcolor="#4A4A4A" quality="high"></embed></object></p>
<div class="wp_codebox">
<table>
<tr id="p23388">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
</pre>
</td>
<td class="code" id="p2338code8">
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;style</span> <span style="color: #000066;">TargetType</span>=<span style="color: #ff0000;">&quot;{x:Type Sketchflow:SketchFlowShape}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;MinWidth&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;130&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;MinHeight&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;25&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Background&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;Blue&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Foreground&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;White&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;SnapsToDevicePixels&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;True&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Template&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/setter<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;setter</span> .Value<span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;controltemplate</span> <span style="color: #000066;">TargetType</span>=<span style="color: #ff0000;">&quot;{x:Type Sketchflow:SketchFlowShape}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/controltemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;controltemplate</span> .Resources<span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;storyboard</span> <span style="color: #000066;">x:Key</span>=<span style="color: #ff0000;">&quot;SBExpand&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;doubleanimationusingkeyframes</span> <span style="color: #000066;">BeginTime</span>=<span style="color: #ff0000;">&quot;00:00:00&quot;</span> <span style="color: #000066;">Storyboard.TargetName</span>=<span style="color: #ff0000;">&quot;tray&quot;</span> <span style="color: #000066;">Storyboard.TargetProperty</span>=<span style="color: #ff0000;">&quot;(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;splinedoublekeyframe</span> <span style="color: #000066;">KeyTime</span>=<span style="color: #ff0000;">&quot;00:00:00&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;splinedoublekeyframe</span> <span style="color: #000066;">KeyTime</span>=<span style="color: #ff0000;">&quot;00:00:01&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/doubleanimationusingkeyframes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;doubleanimationusingkeyframes</span> <span style="color: #000066;">BeginTime</span>=<span style="color: #ff0000;">&quot;00:00:00&quot;</span> <span style="color: #000066;">Storyboard.TargetName</span>=<span style="color: #ff0000;">&quot;tray&quot;</span> <span style="color: #000066;">Storyboard.TargetProperty</span>=<span style="color: #ff0000;">&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;splinedoublekeyframe</span> <span style="color: #000066;">KeyTime</span>=<span style="color: #ff0000;">&quot;00:00:00&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">KeySpline</span>=<span style="color: #ff0000;">&quot;0,0,0.625,1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;splinedoublekeyframe</span> <span style="color: #000066;">KeyTime</span>=<span style="color: #ff0000;">&quot;00:00:01&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #000066;">KeySpline</span>=<span style="color: #ff0000;">&quot;0.11,0.99,1,1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/doubleanimationusingkeyframes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/storyboard<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;storyboard</span> <span style="color: #000066;">x:Key</span>=<span style="color: #ff0000;">&quot;SBCollapse&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;doubleanimationusingkeyframes</span> <span style="color: #000066;">BeginTime</span>=<span style="color: #ff0000;">&quot;00:00:00&quot;</span> <span style="color: #000066;">Storyboard.TargetName</span>=<span style="color: #ff0000;">&quot;tray&quot;</span> <span style="color: #000066;">Storyboard.TargetProperty</span>=<span style="color: #ff0000;">&quot;(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;splinedoublekeyframe</span> <span style="color: #000066;">KeyTime</span>=<span style="color: #ff0000;">&quot;00:00:00&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;splinedoublekeyframe</span> <span style="color: #000066;">KeyTime</span>=<span style="color: #ff0000;">&quot;00:00:01&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/doubleanimationusingkeyframes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;doubleanimationusingkeyframes</span> <span style="color: #000066;">BeginTime</span>=<span style="color: #ff0000;">&quot;00:00:00&quot;</span> <span style="color: #000066;">Storyboard.TargetName</span>=<span style="color: #ff0000;">&quot;tray&quot;</span> <span style="color: #000066;">Storyboard.TargetProperty</span>=<span style="color: #ff0000;">&quot;(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;splinedoublekeyframe</span> <span style="color: #000066;">KeyTime</span>=<span style="color: #ff0000;">&quot;00:00:00&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;splinedoublekeyframe</span> <span style="color: #000066;">KeyTime</span>=<span style="color: #ff0000;">&quot;00:00:01&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">KeySpline</span>=<span style="color: #ff0000;">&quot;0.08,1,1,1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/doubleanimationusingkeyframes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/storyboard<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;objectdataprovider</span> <span style="color: #000066;">x:Key</span>=<span style="color: #ff0000;">&quot;Tags&quot;</span> <span style="color: #000066;">ObjectType</span>=<span style="color: #ff0000;">&quot;{x:Type Sketchflow:Stuff}&quot;</span> <span style="color: #000066;">MethodName</span>=<span style="color: #ff0000;">&quot;get_VisualTags&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;style</span> <span style="color: #000066;">x:Key</span>=<span style="color: #ff0000;">&quot;TagButton&quot;</span> <span style="color: #000066;">TargetType</span>=<span style="color: #ff0000;">&quot;{x:Type Button}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Background&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;Transparent&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Button.Command&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;{x:Static Sketchflow:Window1.ChangeBackgroundCommand}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Button.CommandParameter&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;{Binding}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Button.Cursor&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;Hand&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Template&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/setter<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;setter</span> .Value<span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;controltemplate</span> <span style="color: #000066;">TargetType</span>=<span style="color: #ff0000;">&quot;{x:Type Button}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stackpanel</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;line&quot;</span> <span style="color: #000066;">Orientation</span>=<span style="color: #ff0000;">&quot;Horizontal&quot;</span> <span style="color: #000066;">Background</span>=<span style="color: #ff0000;">&quot;{TemplateBinding Background}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rectangle</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">Fill</span>=<span style="color: #ff0000;">&quot;{Binding Color}&quot;</span> <span style="color: #000066;">VerticalAlignment</span>=<span style="color: #ff0000;">&quot;Center&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;5,3,0,0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;textblock</span> <span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;{Binding Title}&quot;</span> <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Stretch&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;7,0,0,0&quot;</span> <span style="color: #000066;">VerticalAlignment</span>=<span style="color: #ff0000;">&quot;Stretch&quot;</span> <span style="color: #000066;">SnapsToDevicePixels</span>=<span style="color: #ff0000;">&quot;{TemplateBinding SnapsToDevicePixels}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/stackpanel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/controltemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;controltemplate</span> .Triggers<span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;trigger</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;IsMouseOver&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;True&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Background&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;Silver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/trigger<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/controltemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/setter<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/style<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/controltemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/setter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;FontSize&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Foreground&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;White&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;datatemplate</span> <span style="color: #000066;">x:Key</span>=<span style="color: #ff0000;">&quot;TagTemplate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;-2,0,0,0&quot;</span> <span style="color: #000066;">Style</span>=<span style="color: #ff0000;">&quot;{DynamicResource TagButton}&quot;</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;79.5&quot;</span> <span style="color: #000066;">Content</span>=<span style="color: #ff0000;">&quot;{Binding }&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/datatemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;grid</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;PART_maingrid&quot;</span> <span style="color: #000066;">DataContext</span>=<span style="color: #ff0000;">&quot;{Binding RelativeSource={RelativeSource TemplatedParent}}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;border</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;tray&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;8,0,0,1.046&quot;</span> <span style="color: #000066;">VerticalAlignment</span>=<span style="color: #ff0000;">&quot;Bottom&quot;</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #000066;">BorderBrush</span>=<span style="color: #ff0000;">&quot;{TemplateBinding Background}&quot;</span> <span style="color: #000066;">BorderThickness</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">CornerRadius</span>=<span style="color: #ff0000;">&quot;0,0,5,5&quot;</span> <span style="color: #000066;">Background</span>=<span style="color: #ff0000;">&quot;#FF333333&quot;</span> <span style="color: #000066;">RenderTransformOrigin</span>=<span style="color: #ff0000;">&quot;0.5,0&quot;</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;83.737&quot;</span> <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Left&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/border<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;border</span> .RenderTransform<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;transformgroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scaletransform</span> <span style="color: #000066;">ScaleX</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">ScaleY</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;skewtransform</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rotatetransform</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;translatetransform</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/transformgroup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/border<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/grid<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;grid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/grid<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;grid</span> .RowDefinitions<span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rowdefinition</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;Auto&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/grid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;grid</span> .ColumnDefinitions<span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;columndefinition</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;columndefinition</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;Auto&quot;</span> <span style="color: #000066;">MinWidth</span>=<span style="color: #ff0000;">&quot;17.053&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/grid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stackpanel</span> <span style="color: #000066;">Orientation</span>=<span style="color: #ff0000;">&quot;Horizontal&quot;</span> <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Left&quot;</span> <span style="color: #000066;">VerticalAlignment</span>=<span style="color: #ff0000;">&quot;Center&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;0,3,0,0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;popup</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;TagPop&quot;</span> <span style="color: #000066;">AllowsTransparency</span>=<span style="color: #ff0000;">&quot;True&quot;</span>   <span style="color: #000066;">PopupAnimation</span>=<span style="color: #ff0000;">&quot;Slide&quot;</span>       <span style="color: #000066;">HorizontalOffset</span>=<span style="color: #ff0000;">&quot;0&quot;</span>  <span style="color: #000066;">VerticalOffset</span>=<span style="color: #ff0000;">&quot;-112&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;border</span> <span style="color: #000066;">Background</span>=<span style="color: #ff0000;">&quot;#FF333333&quot;</span> <span style="color: #000066;">CornerRadius</span>=<span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Left&quot;</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;84&quot;</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;111&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listbox</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;TagList&quot;</span> <span style="color: #000066;">ItemsSource</span>=<span style="color: #ff0000;">&quot;{Binding Source={StaticResource Tags}}&quot;</span>  <span style="color: #000066;">SelectedIndex</span>=<span style="color: #ff0000;">&quot;-1&quot;</span> <span style="color: #000066;">ItemTemplate</span>=<span style="color: #ff0000;">&quot;{DynamicResource TagTemplate}&quot;</span> <span style="color: #000066;">Background</span>=<span style="color: #ff0000;">&quot;{x:Null}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/border<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/popup<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #808080; font-style: italic;">&lt;!--&lt;image Source=&quot;Images/ConnectExistingScreen.png&quot; Width=&quot;12&quot; Height=&quot;12&quot; HorizontalAlignment=&quot;Left&quot; VerticalAlignment=&quot;Center&quot; Margin=&quot;5,0,0,0&quot;/&gt;--&gt;</span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">Style</span>=<span style="color: #ff0000;">&quot;{StaticResource ConnectNewScreen}&quot;</span> <span style="color: #000066;">DataContext</span>=<span style="color: #ff0000;">&quot;{Binding RelativeSource={RelativeSource TemplatedParent}}&quot;</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;12&quot;</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;12&quot;</span> <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Left&quot;</span> <span style="color: #000066;">VerticalAlignment</span>=<span style="color: #ff0000;">&quot;Center&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;5,0,0,0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;image</span> <span style="color: #000066;">Source</span>=<span style="color: #ff0000;">&quot;Images/ConnectNewScreen.png&quot;</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;12&quot;</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;12&quot;</span> <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Left&quot;</span> <span style="color: #000066;">VerticalAlignment</span>=<span style="color: #ff0000;">&quot;Center&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;5,0,0,0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;image</span> <span style="color: #000066;">Source</span>=<span style="color: #ff0000;">&quot;Images/InsertComponentScreen.png&quot;</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;12&quot;</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;12&quot;</span> <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Left&quot;</span> <span style="color: #000066;">VerticalAlignment</span>=<span style="color: #ff0000;">&quot;Center&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;5,0,0,0&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/stackpanel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #808080; font-style: italic;">&lt;!--&lt;image Source=&quot;Images/ChangeVisualTag.png&quot; Width=&quot;Auto&quot; Height=&quot;12&quot; Grid.Column=&quot;1&quot; Margin=&quot;0.872,3,5,0&quot; HorizontalAlignment=&quot;Stretch&quot;/&gt;--&gt;</span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;button</span> <span style="color: #000066;">Style</span>=<span style="color: #ff0000;">&quot;{StaticResource ChangeVisualTag}&quot;</span> <span style="color: #000066;">DataContext</span>=<span style="color: #ff0000;">&quot;{Binding RelativeSource={RelativeSource TemplatedParent}}&quot;</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;Auto&quot;</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;12&quot;</span> <span style="color: #000066;">Grid.Column</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;0.872,3,5,0&quot;</span> <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Stretch&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
&nbsp;
&nbsp;
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rectangle</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;PART_rec&quot;</span> <span style="color: #000066;">RadiusX</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">RadiusY</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">Stroke</span>=<span style="color: #ff0000;">&quot;{x:Null}&quot;</span>  <span style="color: #000066;">StrokeThickness</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;{TemplateBinding Width}&quot;</span> <span style="color: #000066;">Fill</span>=<span style="color: #ff0000;">&quot;{TemplateBinding Background}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;textblock</span> <span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;{TemplateBinding ContentControl.Content}&quot;</span>  <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Center&quot;</span></span>
<span style="color: #009900;">                         <span style="color: #000066;">VerticalAlignment</span>=<span style="color: #ff0000;">&quot;Center&quot;</span> <span style="color: #000066;">Foreground</span>=<span style="color: #ff0000;">&quot;White&quot;</span> <span style="color: #000066;">FontWeight</span>=<span style="color: #ff0000;">&quot;Bold&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #808080; font-style: italic;">&lt;!-- PART_DragThumb --&gt;</span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;core</span> :TranslationThumb <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;PART_DragThumb&quot;</span> <span style="color: #000066;">Cursor</span>=<span style="color: #ff0000;">&quot;SizeAll&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #808080; font-style: italic;">&lt;!-- PART_ConnectorDecorator --&gt;</span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;core</span> :ConnectorDecorator <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;PART_ConnectorDecorator&quot;</span></span>
<span style="color: #009900;">                       <span style="color: #000066;">Visibility</span>=<span style="color: #ff0000;">&quot;Hidden&quot;</span></span>
<span style="color: #009900;">                       <span style="color: #000066;">Template</span>=<span style="color: #ff0000;">&quot;{StaticResource ConnectorDecoratorTemplate}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rectangle</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;Arrow&quot;</span> <span style="color: #000066;">Visibility</span>=<span style="color: #ff0000;">&quot;{TemplateBinding ShowArrow, Converter={StaticResource BoolToVisibilityConverter} }&quot;</span>  <span style="color: #000066;">Stroke</span>=<span style="color: #ff0000;">&quot;{x:Null}&quot;</span> <span style="color: #000066;">HorizontalAlignment</span>=<span style="color: #ff0000;">&quot;Left&quot;</span> <span style="color: #000066;">Width</span>=<span style="color: #ff0000;">&quot;21&quot;</span> <span style="color: #000066;">Height</span>=<span style="color: #ff0000;">&quot;21&quot;</span> <span style="color: #000066;">Fill</span>=<span style="color: #ff0000;">&quot;{DynamicResource LitlArrow}&quot;</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;-7,0,0,14&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;controltemplate</span> .Triggers<span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;datatrigger</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;True&quot;</span> <span style="color: #000066;">Binding</span>=<span style="color: #ff0000;">&quot;{Binding RelativeSource={RelativeSource Self},Path=IsSelected}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">TargetName</span>=<span style="color: #ff0000;">&quot;PART_rec&quot;</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Stroke&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;#83EEEEEE&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;BitmapEffect&quot;</span> <span style="color: #000066;">TargetName</span>=<span style="color: #ff0000;">&quot;PART_rec&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/setter<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;setter</span> .Value<span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;outerglowbitmapeffect</span> <span style="color: #000066;">GlowColor</span>=<span style="color: #ff0000;">&quot;White&quot;</span> <span style="color: #000066;">GlowSize</span>=<span style="color: #ff0000;">&quot;7&quot;</span> <span style="color: #000066;">Noise</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">Opacity</span>=<span style="color: #ff0000;">&quot;.41&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/setter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/datatrigger<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;trigger</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;IsMouseOver&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #808080; font-style: italic;">&lt;!--&lt;setter TargetName=&quot;PART_ConnectorDecorator&quot; Property=&quot;Visibility&quot; Value=&quot;Visible&quot;/&gt;--&gt;</span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">TargetName</span>=<span style="color: #ff0000;">&quot;PART_rec&quot;</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Stroke&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;#83EEEEEE&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/trigger<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;trigger</span> .ExitActions<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;beginstoryboard</span> <span style="color: #000066;">Storyboard</span>=<span style="color: #ff0000;">&quot;{StaticResource SBCollapse}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/trigger<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;trigger</span> .EnterActions<span style="color: #000000; font-weight: bold;">&gt;</span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;beginstoryboard</span> <span style="color: #000066;">Storyboard</span>=<span style="color: #ff0000;">&quot;{StaticResource SBExpand}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/trigger<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;datatrigger</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;True&quot;</span> <span style="color: #000066;">Binding</span>=<span style="color: #ff0000;">&quot;{Binding RelativeSource={RelativeSource Self},Path=IsDragConnectionOver}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;setter</span> <span style="color: #000066;">TargetName</span>=<span style="color: #ff0000;">&quot;PART_ConnectorDecorator&quot;</span> <span style="color: #000066;">Property</span>=<span style="color: #ff0000;">&quot;Visibility&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;Visible&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/datatrigger<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/controltemplate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>
</td>
</tr>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/expression-blends-sketchflow-diagrams-with-g2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proud to include Intel Corp. among our customers</title>
		<link>http://visualizationtools.net/default/proud-to-include-intel-corp-among-our-customers/</link>
		<comments>http://visualizationtools.net/default/proud-to-include-intel-corp-among-our-customers/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 19:56:33 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[Diagramming]]></category>
		<category><![CDATA[Diverse]]></category>

		<guid isPermaLink="false">http://www.orbifold.net/default/?p=2330</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>Our list of customers is steadily growing and with a certain pride we can now even include the Intel Corporation logo.<br />
Thank you all for relying on us for your business!</p>
<table border="0">
<tbody>
<tr>
<td><a title="Intel Corporation" href="http://www.intel.com" target="_blank"><img class="alignnone size-full wp-image-2317" title="Intel Corporation" src="http://www.orbifold.net/default/wp-content/uploads/intlogo.gif" alt="Intel Corporation" width="127" height="51" /></a></td>
</tr>
<tr>
<td><a title="ESRI: The GIS software leaders" href="http://www.esri.com/" target="_blank"><img class="alignnone size-full wp-image-2324" title="ESRI; The GIS software leader" src="http://www.orbifold.net/default/wp-content/uploads/esri.png" alt="ESRI; The GIS software leader" width="414" height="71" /></a></td>
</tr>
<tr>
<td><a title="Gorrie Regan" href="http://www.gregan.com/" target="_blank"><img class="alignnone size-full wp-image-2322" title="Gorrie Regan" src="http://www.orbifold.net/default/wp-content/uploads/gra-logo.gif" alt="Gorrie Regan" width="200" height="35" /></a></td>
</tr>
<tr>
<td><a title="Conchango consulting" href="http://www.conchango.com" target="_blank"><img class="alignnone size-full wp-image-1541" title="Conchango consulting" src="http://www.orbifold.net/default/wp-content/uploads/conchango.gif" alt="" width="184" height="72" /></a></td>
</tr>
<tr>
<td><a title="Softelligent" href="http://www.softelligent.be/" target="_blank"><img class="alignnone size-full wp-image-2326" title="Softelligent" src="http://www.orbifold.net/default/wp-content/uploads/softelligent.png" alt="Softelligent" width="331" height="87" /></a></td>
</tr>
<tr>
<td><a title="Dialogik software components" href="http://www.dialogik.ch" target="_blank"><img class="alignnone size-full wp-image-1537" title="Dialogik AG" src="http://www.orbifold.net/default/wp-content/uploads/logodialogikpositivneg.png" alt="" width="144" height="54" /></a></td>
</tr>
<tr>
<td><a title="LLBL Gen Pro" href="http://www.llblgen.com" target="_blank"><img class="alignnone size-full wp-image-1535" title="LLBL Gen Pro" src="http://www.orbifold.net/default/wp-content/uploads/llblgen.gif" alt="" width="302" height="117" /></a></td>
</tr>
<tr>
<td><a title="Buhl Data" href="http://www.buhl.de/" target="_blank"><img class="alignnone size-full wp-image-2319" title="Buhld ata" src="http://www.orbifold.net/default/wp-content/uploads/buhldata.jpg" alt="Buhld ata" width="170" height="85" /></a></td>
</tr>
<tr>
<td><a title="Acando Gmbh" href="http://acando.de/" target="_blank"><img class="alignnone size-full wp-image-2323" title="Acando Gmbh" src="http://www.orbifold.net/default/wp-content/uploads/acando.gif" alt="Acando Gmbh" width="153" height="44" /></a></td>
</tr>
<tr>
<td><a title="Hommes &amp; Process" href="http://www.hommesetprocess.com/en" target="_blank"><img class="alignnone size-full wp-image-2320" title="Hommes &amp; Process" src="http://www.orbifold.net/default/wp-content/uploads/hompro.png" alt="Hommes &amp; Process" width="300" height="50" /></a></td>
</tr>
<tr>
<td><a title="Ecole Polytechnique Federale de Lausanne" href="http://www.epfl.ch/index.en.html" target="_blank"><img class="alignnone size-full wp-image-2327" title="EPFL-CWIS" src="http://www.orbifold.net/default/wp-content/uploads/epfl-logo.jpg" alt="EPFL-CWIS" width="120" height="63" /></a></td>
</tr>
<tr>
<td><a title="GenWise Studio" href="http://www.genwise.com" target="_blank"><img class="alignnone size-full wp-image-1536" title="GenWise" src="http://www.orbifold.net/default/wp-content/uploads/genwisesitelogopra.gif" alt="" width="237" height="70" /></a></td>
</tr>
<tr>
<td><a title="QMap" href="http://www.qmap.co.uk/" target="_blank"><img class="alignleft size-full wp-image-1883" title="QMap BP " src="http://www.orbifold.net/default/wp-content/uploads/qmap.png" alt="QMap BP " width="151" height="62" /></a></td>
</tr>
<tr>
<td><a href="http://www.orbifold.net/default/wp-content/uploads/thatchertech.jpg"><img class="alignleft size-full wp-image-1881" title="thatchertech" src="http://www.orbifold.net/default/wp-content/uploads/thatchertech.jpg" alt="thatchertech" width="191" height="105" /></a></td>
</tr>
<tr>
<td><a title="TrueSoftware" href="http://www.truesoftware.nl/" target="_blank"><img class="alignnone size-full wp-image-1545" title="TrueSoftware" src="http://www.orbifold.net/default/wp-content/uploads/truesoft.png" alt="" width="153" height="46" /></a></td>
</tr>
<tr>
<td><a title="SD Partners" href="http://www.sd-partners.com" target="_blank"><img class="alignnone size-full wp-image-1546" title="SDPartners" src="http://www.orbifold.net/default/wp-content/uploads/sdpartners.png" alt="" width="391" height="91" /></a></td>
</tr>
<tr>
<td><a title="IcSharp" href="http://www.icsharpcode.net" target="_blank"><img class="alignnone size-full wp-image-1543" title="icsharp" src="http://www.orbifold.net/default/wp-content/uploads/icsharp.gif" alt="" width="363" height="72" /></a></td>
</tr>
<tr>
<td colspan="2"><a title="SequenceViz reflector addin" href="http://www.codeplex.com/sequenceviz" target="_blank"><img class="alignnone size-full wp-image-1538" title="sequenceviz" src="http://www.orbifold.net/default/wp-content/uploads/sequenceviz.png" alt="" width="333" height="54" /></a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/proud-to-include-intel-corp-among-our-customers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>G2: upcoming v2.0 features</title>
		<link>http://visualizationtools.net/default/g2-upcoming-v20-features/</link>
		<comments>http://visualizationtools.net/default/g2-upcoming-v20-features/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 10:06:10 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[Diagramming]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[G2]]></category>

		<guid isPermaLink="false">http://www.orbifold.net/default/?p=2305</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.orbifold.net/default/wp-content/uploads/flowcharting.png"><img class="alignnone size-large wp-image-2306" title="G2 flowcharting" src="http://www.orbifold.net/default/wp-content/uploads/flowcharting-1024x619.png" alt="G2 flowcharting" width="728" height="440" /></a></p>
<p>We&#8217;ve been busy. The screenshots reveal quite a bit the upcoming features but let me be explicit:</p>
<ul>
<li><strong>Groups</strong>: shapes can be embedded in groups ad infinitum (this is an undoable action and copy/cut/paste works with groups as well, of course)</li>
<li><strong>Flowcharting</strong>: better support for standard flowcharting</li>
<li><strong>Arrows and connections</strong>: better support for databinding your stuff (i.e. data backend) to connections and related adorners</li>
<li><strong>Rotations</strong>: rotating shapes and groups (undoable action)</li>
<li><strong>Unity 2.0:</strong> Unity merges with the ObjectBuilder2. Nothing shacking here but it will simplify the underlying data exchange pipeline of G2.</li>
<li><strong>Library support</strong>: shapes, groups, layers, pages and whole diagrams can be saved to libraries and organized in categories. This features is based on an adapter mechanism, which means you can have libraries in a database backend or accessible via WCF etc.</li>
<li><strong>Alignments</strong>: aligning shapes is now possible. In conjunction with the snap &amp; grid features this is particularly useful to have a nice layout.</li>
<li><strong>Snap &amp; grid</strong>: everything has become snap-able.</li>
<li><strong>Linking</strong>: better support inside shapes to (hyper)link data; either diagram elements or data entities coming from your backend.</li>
<li><strong>XML</strong>: better support for XML import/export, extending the already very solid and beautiful data exchange pipeline of v1.0</li>
<li> <strong>Theming of whole diagrams:</strong> apply a style to a complete diagram (cfr. Microsoft PowerPoint)</li>
<li><strong>Auto-connect shapes</strong>: auto-add or auto-connect shapes via the adjacent arrows appearing when hovering over shapes (cfr. Microsoft Visio)</li>
<li><strong>Bug fixes and squadrillions of little changes</strong> to make G2 better, faster, more useful, more business and data oriented, more beautiful.</li>
</ul>
<p>No date fixed yet to release v2.0 though it&#8217;s pretty stable already now. So many things are going on these days&#8230; I sincerely hope to deliver a big headline one of these days regarding our future (and G2&#8242;s future in particular). In any case, I feel immensely proud about G2&#8242;s wonderful architecture and the breadth of applications it can support, the scope of features and the many high-tech subtleties which you will not find in any other diagramming package. It leaves the competition beyond the diagramming horizon.</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/theming.png"><img class="alignnone size-large wp-image-2312" title="G2: theming" src="http://www.orbifold.net/default/wp-content/uploads/theming-1023x553.png" alt="G2: theming" width="754" height="407" /></a></p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/groups.png"><img class="alignnone size-large wp-image-2307" title="G2 groups" src="http://www.orbifold.net/default/wp-content/uploads/groups-1024x619.png" alt="G2 groups" width="737" height="445" /></a></p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/better.png"><img class="alignnone size-large wp-image-2310" title="G2: better, faster, bigger, more beautiful." src="http://www.orbifold.net/default/wp-content/uploads/better-1024x554.png" alt="G2: better, faster, bigger, more beautiful." width="771" height="416" /></a></p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/better.png"></a><a href="http://www.orbifold.net/default/wp-content/uploads/cwis.png"><img class="alignnone size-large wp-image-2309" title="G2: thick arrows" src="http://www.orbifold.net/default/wp-content/uploads/cwis-1024x673.png" alt="G2: thick arrows" width="766" height="503" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/g2-upcoming-v20-features/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Twampoline; a Twitter clique explorer</title>
		<link>http://visualizationtools.net/default/twampoline-a-twitter-clique-explorer/</link>
		<comments>http://visualizationtools.net/default/twampoline-a-twitter-clique-explorer/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 05:22:29 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[Diagramming]]></category>
		<category><![CDATA[graphite]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.orbifold.net/default/?p=2125</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.orbifold.net/default/wp-content/uploads/twampoline.png"></a></p>
<p><a href="http://twampoline.com/"><img class="alignnone size-large wp-image-2127" title="Twampoline" src="http://www.orbifold.net/default/wp-content/uploads/twampoline-1024x660.png" alt="Twampoline" width="674" height="405" /></a></p>
<p><a title="The human web" href="http://en.wikipedia.org/wiki/Six_degrees" target="_blank">Six degrees of freedom </a>is everywhere around us; it&#8217;s how your brain is wired, it&#8217;s the law ruling the internet growth, it describes the strucutre of movies and movie stars relationships, it tells how you are connected to your friends. <a title="Twitter" href="http://twitter.com" target="_blank">Twitter</a> much like any other <em>seemingly</em> random database (<a title="Linkeid" href="http://www.linkedin.com" target="_blank">LinkedIn</a>, <a title="Movie database" href="http://www.imdb.com" target="_blank">IMDB</a>, , <a title="All diseases" href="http://www.diseasesdatabase.com/content.asp" target="_blank">Disease database</a>, <a title="Facebook" href="http://www.facebook.com" target="_blank">Facebook</a>&#8230;) is proving the six degrees behavior. Recently someone took our <a title="Graphite" href="/Graphite">Graphite control for Silverlight </a>to visualize Twitter relationships and created <a title="Twampoline" href="http://twampoline.com/" target="_blank">Twampoline</a>, a Twitter visualizer. It shows so-called <a title="Cliques" href="http://en.wikipedia.org/wiki/Clique" target="_blank">cliques </a>and densities, however if you have a busy network of followers you will have difficulties to see through the clusters. The layout algorithm used should be reparametrized in function of the graph scale.</p>
<p>Aside from this beautiful visualization idea, I have never understood the whole Twitter hype and wonder what the next superlative of all this will be?. From websites, to wiki&#8217;s, to blogs, to twitter, there has been a continuous decrease of content and informative value. The next big thing will be single words or acronyms summarizing one&#8217;s mood and thoughts? Or maybeÂ <a title="The Wave" href="http://wave.google.com/" target="_blank">Google&#8217;s Wave</a> will bringÂ  Web 3.0 to the world butÂ I doubt it.</p>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/twampoline-a-twitter-clique-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Graphite manual and tutorials</title>
		<link>http://visualizationtools.net/default/graphite-manual-and-tutorials/</link>
		<comments>http://visualizationtools.net/default/graphite-manual-and-tutorials/#comments</comments>
		<pubDate>Mon, 04 May 2009 19:18:57 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[Diagramming]]></category>
		<category><![CDATA[Diverse]]></category>

		<guid isPermaLink="false">http://www.orbifold.net/default/?p=1973</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><span style="color: #800000;"><strong>Important update [July 10th, 2009</strong></span>]: note that with Silverlight 3 an update of the Visual Studio 2008 tools are necessary. If you acquired the source code of Graphite for Silverlight, <a title="Add-on for Visual Studio 2008 SP1 for developing Silverlight 3 applications" href="http://www.microsoft.com/downloads/details.aspx?familyid=9442b0f2-7465-417a-88f3-5e7b5409e9dd&amp;displaylang=en" target="_blank">please download the tools from Microsoft</a> since the Silverlight project is based on version 3.0.</p>
<p>To all customers of Graphite, head over to the following articles which compile the tips and solutions related to the customization and integration of Graphite:</p>
<ul>
<li><a href="/default/?page_id=1947">General overview, event logic, import/export, etc.</a></li>
<li><a href="/default/?page_id=1976">How to template the VisualNode of Graphite</a></li>
<li><a href="/default/?page_id=1976">How to change the layout algorithm of Graphite</a></li>
<li><a title="Permanent Link to Graphite: differentiating between parents and children" rel="bookmark" href="/default/?page_id=2008">Graphite: differentiating between parents and children</a></li>
</ul>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/smlogic.png"><img class="aligncenter size-full wp-image-1959" title="smlogic.png" src="http://www.orbifold.net/default/wp-content/uploads/smlogic.png" alt="smlogic.png" width="337" height="298" /></a></p>
<p>Remarks about and requests for particular uncovered topics, just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/graphite-manual-and-tutorials/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Silverlight diagramming, WCF, the Entity Framework and MySQL.</title>
		<link>http://visualizationtools.net/default/wcfdiagrammingandmysql/</link>
		<comments>http://visualizationtools.net/default/wcfdiagrammingandmysql/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 20:30:37 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[Diagramming]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[G2]]></category>

		<guid isPermaLink="false">http://www.orbifold.net/default/?p=1917</guid>
		<description><![CDATA[About our flashy diagramming framework for Silverlight, how to bind MySQL data to Silverlight via the Entity Framework and ADO.Net data service, how to demo a WCF bound Silverlight application without IIS or a dedicated webserver. Some news about our latest commercial moves and our sleepless nights.]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/crystalizerapplication.png"><img src="/oldsite/wp-content/uploads/crystalizerapplication-300x196.png" alt="Codename: Crystalizer" title="Codename: Crystalizer" width="300" height="196" class="aligncenter size-medium wp-image-1929" /></a></p>
<p>It&#8217;s been a while since I jotted something down on this blog&#8230;it&#8217;s been hectic for months now and the pace doesn&#8217;t seem to slow down but I think I have a few interesting things to mention.</p>
<p>Since the end of last year <a title="G2" href="/G2" target="_blank">G2</a> has grown bigger, stronger, more popular and various big customization projects are on our workbenches. At the same time, <a title="About Graphite" href="/Graphite" target="_blank">Graphite </a>continues to be our bestseller but most customers use it &#8216;as is&#8217; without much alterations. There are however a few lines of evolution. On the one hand, Silverlight becomes more and more popular and seems to have a better market penetration than WPF. This means that also Silverlight diagramming solutions are increasingly asked for. In this context, Graphite allows an easy path to data visualization but misses the flexibility and breadth of a true diagramming framework. Equally well (and enforced by the Silverlight wave), more and more customers wish to have a dual solution; all the advantages of diagraming in WPF and the possibility to bring as much as possible on the web (Sharepoint integration, read-only viewers and so on). These evolutions and the obvious gap in our products related to this meant a necessary investment in Silverlight and a common diagramming core. Now, hold your horses and don&#8217;t expect the sky since Silverlight still remains a subset of the .Net framework and even though Silverlight v3 broadens the horizon I don&#8217;t think any day soon you&#8217;ll have a full-compatibility tale (except through XBAP, but that&#8217;s another story). In any case, here is the good-news show and some notes from the field where diagramming meets Silverlight, the Entity Framework, MySQL and WCF.<br />
<span id="more-1917"></span><br />
Before describing the juicy technical details let me give you an overview of the application (screenshot above) we&#8217;ve been working on recently. It&#8217;s a Silverlight application which allows one to visualize any kind of relations between different types of entities; persons, documents, sites, etc. Any kind of relation means that it allows multiple links and generic graphs but can also handle tree-like data and multiple diagram layouts. The database uses just a few tables to store the graph structure and the actual data (persons, documents, metadata) can reside in the database but could also be stored in another database, in  XML files, you name it. The application also allows one to edit relations and to edit the entities; you can draw links and it will be saved in the database, you can change or add entities and so on. Finally (and this is what this blog items is mostly about) this Silverlight application can also be used as a WinForm application and accesses data through a local self-hosted WCF service. The WCF service is a RESTful ADO.Net data service which can also handle standard HTTP requests and thus acts as a local webserver. Minor features of this application is the integrated security system which can be connected to the ASP.Net membership mechanism, to ActiveDirectory services or any legacy single-sign on system you have in-house. <strong>Let me emphasize that this application boasts a full-fledged diagramming framework for Silverlight.</strong> which in many ways extends/surpasses our current Graphite product. For example, just for fun I developed in less than a day a reasonable mindmapping application for Silverlight (screenshot below).</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/l2mm.png"><img src="/oldsite/wp-content/uploads/l2mm-300x155.png" alt="L2 based mindmapping" title="L2 based mindmapping" width="300" height="155" class="aligncenter size-medium wp-image-1930" /></a></p>
<h2>Entity Framework</h2>
<p>First off, I have been <strong>happily surprised by the Entity Framework (EF)</strong>. I know, it&#8217;s got a long list of shortcomings and I&#8217;ve walked the whole avenue of POCO adapters, detached entity tricks, constrained Visual Studio designer and more. However, in the context of Silverlight I was pleased to experience the ease with which it worked on top of MySQL and through the ADO.Net data services (aka Astoria). Initially I wrote the whole framework for SQL Server and had later on to move to MySQL&#8230;oh miraculus! <strong>Only minor changes were necessary on the database level (no Guid&#8217;s in MySQL, no triggers e.g.) and one needs at least MySQL v5 to make it work. </strong> Note that this happy message has more its origins in the hard work which went into developing <a target="_blank" href="http://www.mysql.com/products/connector/">the .Net driver for MySQL</a> rather than how open Microsoft is towards other relational database systems. In fact, I can also claim the same for other systems: <strong>EF works well with SQLite and with SQL Server Compact v3.5.</strong> There are pro&#8217;s and con&#8217;s with each and you need to tweak your model because of datatype differences, missing features (views, stored procedures etc.) but I expected a complete no-go orginally.</p>
<h2>ADO.Net Data Services</h2>
<p>Concerning ADO.Net data services. It<strong> works flawless with the EF, whatever the underlying database-dependent model is</strong>. In fact, if the data type signature is identical in different database systems, you only need to change one word in your code to switch from one to the other:</p>
<div class="wp_codebox">
<table>
<tr id="p19179">
<td class="line_numbers">
<pre>1
2
3
4
5
6
</pre>
</td>
<td class="code" id="p1917code9">
<pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span><span style="color: #000000;">System</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ServiceModel</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ServiceBehavior</span><span style="color: #008000;">&#40;</span>IncludeExceptionDetailInFaults <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> CrystalMsSqlService <span style="color: #008000;">:</span> DataService<span style="color: #008000;">&lt;</span>crystalmysqlcontext<span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&#123;</span>
<span style="color: #008000;">...</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&lt;/</span>crystalmysqlcontext<span style="color: #008000;">&gt;</span></pre>
</td>
</tr>
</table>
</div>
<p>This code is the generator of a REST WCF service on top of a EF model. The CrystalMySQLContext is the data context generated by the EF. If you wish to switch to, let&#8217;s say, SQL Server you only need to replace the data context specification and you&#8217;ll be safe for the rest of the journey.<br />
Note, as a side note, the <strong>ServiceBehavior </strong>attribute which propagates exceptions to the surface and which is not added by default in Visual Studio. You will also want to add a try-catch in the code to convert the exceptions to a <strong>DataServiceException </strong>like this:</p>
<div class="wp_codebox">
<table>
<tr id="p191710">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre>
</td>
<td class="code" id="p1917code10">
<pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> InitializeService<span style="color: #008000;">&#40;</span>IDataServiceConfiguration config<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">try</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008000;">..</span>
        <span style="color: #0000FF;">config</span><span style="color: #008000;">.</span><span style="color: #0000FF;">SetEntitySetAccessRule</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;SomeTable&quot;</span>, EntitySetRights<span style="color: #008000;">.</span><span style="color: #0000FF;">All</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception e<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">throw</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> DataServiceException<span style="color: #008000;">&#40;</span>e<span style="color: #008000;">.</span><span style="color: #0000FF;">Message</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre>
</td>
</tr>
</table>
</div>
<p>It will make debugging much easier, trust me.</p>
<p>Why ADO.Net data service (ADS)? You need to know that Silverlight only likes <strong>asynchronous data exchange</strong> with the outside world. Now, in order to expose data via WCF you can go via a artisanal, hand-crafted WCF service but ADS makes things easy and turns an EF into a RESTful service in a snap. In effect, it means you have all your tables and views available in Silverlight as if they were on the client. The price for this is the asynchronous behavior, which at times can be frustrating; <strong>you cannot have a data request and a data related action in the same C# method</strong>. A wisdom which I can give to you here is: <strong>don&#8217;t try to launch inner join requests from Silverlight</strong> to the REST, it doesn&#8217;t work. If you wish to do this<strong> you need to create a view</strong> in you database and make this view accessible in ADS as if it was a table. This simple fact makes SQL Server Compact immediately a bad choice because it doesn&#8217;t support views (SQL Express will do however).</p>
<h2>WCF (ah, so much beauty!)</h2>
<p>One of the things which kept me busy for a long time was how to demonstrate/ship a Silverlight demo without having to ship a database and without having to buy an expensive SQL Server license? Imagine you have a beautiful Silverlight application for a customer but you don&#8217;t want a whole setup involving a SQL Server database deployment (logins, connection strings etc.) and you also don&#8217;t want a complicated IIS setup wherein the Silverlight, WCF, XAP&#8230;reside. What to do? At first I tried to develop a local WCF proxy which would go to a file based data system. This meant a self-hosted WCF service, some sort of database on the client and a separate local webserver. This worked well up to the point that Silverlight kept on complaining about security issues. No mystery here: <strong>Silverlight doesn&#8217;t want to access data sources if they are not coming from the precise (includes the port number!) same origin as the xap</strong> (i.e. the Silverlight application).</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/allinone.png"><img src="/oldsite/wp-content/uploads/allinone-216x300.png" alt="All in one solution" title="All in one solution" width="216" height="300" class="aligncenter size-medium wp-image-1921" /></a></p>
<p>Easy enough, I thought, but read on. You only need to supply the client with the clientaccesspolicy.xml or the server with the crossdomain.xml. Extend the WCF service like this:</p>
<div class="wp_codebox">
<table>
<tr id="p191711">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
</pre>
</td>
<td class="code" id="p1917code11">
<pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>ServiceContract<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">interface</span> IWebServer
<span style="color: #008000;">&#123;</span>
    <span style="color: #008000;">&#91;</span>OperationContract, WebGet<span style="color: #008000;">&#40;</span>UriTemplate <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;/clientaccesspolicy.xml&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
    Stream GetSilverlightPolicy<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#91;</span>OperationContract, WebGet<span style="color: #008000;">&#40;</span>UriTemplate <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;/crossdomain.xml&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
    Stream GetFlashPolicy<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">...</span><span style="color: #008000;">&#125;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> CrystalMsSqlService <span style="color: #008000;">:</span> DataService<span style="color: #008000;">&lt;</span>crystalmysqlcontext<span style="color: #008000;">&gt;</span>, IWebServer
<span style="color: #008000;">&#123;</span><span style="color: #008000;">...</span>
<span style="color: #0600FF; font-weight: bold;">public</span> Stream GetSilverlightPolicy<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">string</span> result <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;&lt; ?xml version=&quot;</span><span style="color: #666666;">&quot;1.0&quot;</span><span style="color: #666666;">&quot; encoding=&quot;</span><span style="color: #666666;">&quot;utf-8&quot;</span><span style="color: #666666;">&quot;?&gt;
                                &lt;access -policy&gt;
                                    &lt;cross -domain-access&gt;
                                        &lt;policy&gt;
                                            &lt;allow -from http-request-headers=&quot;</span><span style="color: #666666;">&quot;*&quot;</span><span style="color: #666666;">&quot;&gt;
                                                &lt;domain uri=&quot;</span><span style="color: #666666;">&quot;*&quot;</span><span style="color: #666666;">&quot;/&gt;
                                            &lt;/allow&gt;
                                            &lt;grant -to&gt;
                                                &lt;resource path=&quot;</span><span style="color: #666666;">&quot;/&quot;</span><span style="color: #666666;">&quot; include-subpaths=&quot;</span><span style="color: #666666;">&quot;true&quot;</span><span style="color: #666666;">&quot;/&gt;
                                            &lt;/grant&gt;
                                        &lt;/policy&gt;
                                    &lt;/cross&gt;
                                &lt;/access&gt;&quot;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">return</span> StringToStream<span style="color: #008000;">&#40;</span>result<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">public</span> Stream GetFlashPolicy<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">string</span> result <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;&lt; ?xml version=&quot;</span><span style="color: #666666;">&quot;1.0&quot;</span><span style="color: #666666;">&quot;?&gt;
                                &lt; !DOCTYPE cross-domain-policy SYSTEM &quot;</span><span style="color: #666666;">&quot;http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd&quot;</span><span style="color: #666666;">&quot;&gt;
                                &lt;cross -domain-policy&gt;
                                    &lt;allow -access-from domain=&quot;</span><span style="color: #666666;">&quot;*&quot;</span><span style="color: #666666;">&quot; /&gt;
                                &lt;/cross&gt;&quot;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">return</span> StringToStream<span style="color: #008000;">&#40;</span>result<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">...</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&lt;/</span>crystalmysqlcontext<span style="color: #008000;">&gt;</span></pre>
</td>
</tr>
</table>
</div>
<p>It doesn&#8217;t work. Or at least, you can check that the WCF service does supply the policies but for some reasons Silverlight in my case still didn&#8217;t want to query the WCF service.</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/wcfwebserver.png"><img src="/oldsite/wp-content/uploads/wcfwebserver-216x300.png" alt="WCF as a webserver" title="WCF as a webserver" width="216" height="300" class="aligncenter size-medium wp-image-1925" /></a></p>
<p>Now, because REST allows a client to query a WCF as if it&#8217;s a website and because one can serve both ascii and binary data through WCF/REST the obvious next step was to <strong>extend the WCF service with methods which would mimic a webserver behavior.</strong> Easy to do in fact by extending the service with more methods and templating the URL requests:</p>
<div class="wp_codebox">
<table>
<tr id="p191712">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
</pre>
</td>
<td class="code" id="p1917code12">
<pre class="csharp" style="font-family:monospace;">&nbsp;
<span style="color: #008000;">&#91;</span>ServiceContract<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">interface</span> IWebServer
<span style="color: #008000;">&#123;</span>
<span style="color: #008000;">&#91;</span>OperationContract, WebGet<span style="color: #008000;">&#40;</span>UriTemplate <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;/clientaccesspolicy.xml&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
Stream GetSilverlightPolicy<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#91;</span>OperationContract, WebGet<span style="color: #008000;">&#40;</span>UriTemplate <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;/crossdomain.xml&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
Stream GetFlashPolicy<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#91;</span>OperationContract, WebGet<span style="color: #008000;">&#40;</span>UriTemplate <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;/app.htm&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
Stream GetApplicationPage<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008000;">&#91;</span>OperationContract, WebGet<span style="color: #008000;">&#40;</span>UriTemplate <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;/{pagename}&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
Stream GetSitePage<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> pagename<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#91;</span>OperationContract, WebGet<span style="color: #008000;">&#40;</span>UriTemplate <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;/Images/{imagename}&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
Stream GetImage<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> imagename<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#91;</span>OperationContract, WebGet<span style="color: #008000;">&#40;</span>UriTemplate <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;/Crystalizer.One.xap&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
Stream GetCrytal<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008000;">&#125;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> CrystalMsSqlService <span style="color: #008000;">:</span> DataService<span style="color: #008000;">&lt;</span>crystalmysqlcontext<span style="color: #008000;">&gt;</span>, IWebServer
<span style="color: #008000;">&#123;</span><span style="color: #008000;">...</span>
<span style="color: #0600FF; font-weight: bold;">public</span> Stream GetSitePage<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> pagename<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">try</span>
    <span style="color: #008000;">&#123;</span>
        WebOperationContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">OutgoingResponse</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ContentType</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;text/html&quot;</span><span style="color: #008000;">;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> fileContents<span style="color: #008000;">;</span>
        <span style="color: #6666cc; font-weight: bold;">string</span> path<span style="color: #008000;">;</span>
        path <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;WebRoot\{0}&quot;</span>, pagename<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>StreamReader sr <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StreamReader<span style="color: #008000;">&#40;</span>path<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            fileContents <span style="color: #008000;">=</span> sr<span style="color: #008000;">.</span><span style="color: #0000FF;">ReadToEnd</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">return</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> MemoryStream<span style="color: #008000;">&#40;</span>Encoding<span style="color: #008000;">.</span><span style="color: #0000FF;">UTF8</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetBytes</span><span style="color: #008000;">&#40;</span>fileContents<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">public</span> Stream GetImage<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> imagename<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #6666cc; font-weight: bold;">byte</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> fileContents<span style="color: #008000;">;</span>
    fileContents <span style="color: #008000;">=</span> File<span style="color: #008000;">.</span><span style="color: #0000FF;">ReadAllBytes</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;WebRoot\Images\{0}&quot;</span>, imagename<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">// byte[] resp = Encoding.ASCII.GetBytes(string.Format(HttpHeader, &quot;image/png&quot;, fileContents.Length, fileContents));</span>
    <span style="color: #0600FF; font-weight: bold;">return</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> MemoryStream<span style="color: #008000;">&#40;</span>fileContents<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">...</span><span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&lt;/</span>crystalmysqlcontext<span style="color: #008000;">&gt;</span></pre>
</td>
</tr>
</table>
</div>
<p>This now turns your RESTful ADS service into a webserver which serves both the data, the site pages and site images.<br />
One last trick is the fact that because now your WCF service actually implements two interfaces the default endpoint configuration of ADS will not work. To solve this in the self-hosted scenario you can add another endpoint as follows:</p>
<div class="wp_codebox">
<table>
<tr id="p191713">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre>
</td>
<td class="code" id="p1917code13">
<pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> HostWithWebServiceHost<span style="color: #008000;">&#40;</span>Uri baseAddress<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
&nbsp;
    WCFHost <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> WebServiceHost<span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #008000;">&#40;</span>CrystalMsSqlService<span style="color: #008000;">&#41;</span>, baseAddress<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    WebHttpBinding binding <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> WebHttpBinding<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    WCFHost<span style="color: #008000;">.</span><span style="color: #0000FF;">AddServiceEndpoint</span><span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #008000;">&#40;</span><span style="color: #000000;">System.<span style="color: #0000FF;">Data</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Services</span><span style="color: #008000;">.</span><span style="color: #0000FF;">IRequestHandler</span><span style="color: #008000;">&#41;</span>, binding, <span style="color: #666666;">&quot;dataservice&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
&nbsp;
    WCFHost<span style="color: #008000;">.</span><span style="color: #0000FF;">AddServiceEndpoint</span><span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #008000;">&#40;</span>IWebServer<span style="color: #008000;">&#41;</span>, binding, <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Behaviors</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> WebHttpBehavior<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    ServiceMetadataBehavior smb <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> ServiceMetadataBehavior <span style="color: #008000;">&#123;</span>HttpGetEnabled <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
    WCFHost<span style="color: #008000;">.</span><span style="color: #0000FF;">Description</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Behaviors</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>smb<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    WCFHost<span style="color: #008000;">.</span><span style="color: #0000FF;">Open</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre>
</td>
</tr>
</table>
</div>
<p><strong>At this point the Silverlight application will run at the client without any server or internet connection.</strong>. You can go a step further and even host the Silverlight application in a Windows form which at the same time hosts the WCF service, but that&#8217;s really a no-brainer. You simply add a webbrowser control in a WinForm and call the HTML page which contains the Silverlight control and you&#8217;re done. Note that by doing this you have <strong>a Silverlight 2 application which runs as if it&#8217;s a regular WinForm application</strong>. Still, because the WCF service serves ANY client you can also access the Silverlight application through a standard browser. Actually, this fact helps to debug the Silverlight code by attaching the debugger to the browser process. I have not found any other way to debug Silverlight if it&#8217;s not part of a Visual Studio web application (as in my case).</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/finalsolution.png"><img src="/oldsite/wp-content/uploads/finalsolution-203x300.png" alt="Final solution" title="Final solution" width="203" height="300" class="aligncenter size-medium wp-image-1926" /></a></p>
<p>In my final &#8216;show it to the customer without deployment&#8217; solution, I removed the database from the client setup and kept the MySQL on a publicly available location. The only things you need to watch in this case is the fact that by default EF will store the database connection credentials in the web.config. You need to create a EF compiled connection with the EntityConnectionStringBuilder and override the CreateDataSource method of the ADS service:</p>
<div class="wp_codebox">
<table>
<tr id="p191714">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre>
</td>
<td class="code" id="p1917code14">
<pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> CrystalMySQLContext CreateDataSource<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    EntityConnectionStringBuilder entityBuilder <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> EntityConnectionStringBuilder<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    entityBuilder<span style="color: #008000;">.</span><span style="color: #0000FF;">Metadata</span> <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;res://*/MySql.CrystalMySQLModel.csdl|res://*/MySql.CrystalMySQLModel.ssdl|res://*/MySql.CrystalMySQLModel.msl&quot;</span><span style="color: #008000;">;</span>
    entityBuilder<span style="color: #008000;">.</span><span style="color: #0000FF;">Provider</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;MySql.Data.MySqlClient&quot;</span><span style="color: #008000;">;</span>
    entityBuilder<span style="color: #008000;">.</span><span style="color: #0000FF;">ProviderConnectionString</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;server=xxx;user id=xxx;password='xxx';persist security info=True;database=illumineo&quot;</span><span style="color: #008000;">;</span>
&nbsp;
    EntityConnection con <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> EntityConnection<span style="color: #008000;">&#40;</span>entityBuilder<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    CrystalMySQLContext ctx <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> CrystalMySQLContext<span style="color: #008000;">&#40;</span>con<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">return</span> ctx<span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre>
</td>
</tr>
</table>
</div>
<h2>MySQL</h2>
<p>During the testing and deployment phase of this project I encountered various difficulties which were all related to the fact that all the assemblies you assume are not necessarily on a blank machine. <strong>Adding these assemblies to the bin directory doesn&#8217;t solve these issues</strong>, the great trick here is a configuration you need to add in order to tell the CLR these assemblies are available. During the installation of a database driver the machine.config is altered but this is not the case if you deploy a self-hosted service and the binaries are not in the GAC:</p>
<div class="wp_codebox">
<table>
<tr id="p191715">
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
</pre>
</td>
<td class="code" id="p1917code15">
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;">&lt; ?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dbproviderfactories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;clear</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;SqlClient Data Provider&quot;</span> <span style="color: #000066;">invariant</span>=<span style="color: #ff0000;">&quot;System.Data.SqlClient&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;.Net Framework Data Provider for SqlServer&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MySQL Data Provider&quot;</span> <span style="color: #000066;">invariant</span>=<span style="color: #ff0000;">&quot;MySql.Data.MySqlClient&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;.Net Framework Data Provider for MySQL&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.0.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dbproviderfactories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>
</td>
</tr>
</table>
</div>
<h2>Silverlight only likes it async</h2>
<p>Concerning the asynchronous behavior of Silverlight I can only say: you need a different mindset to live with it. In my Silverlight application I invested quite some time to create an MVC pattern on the basis of asynchronous data access. Because Silverlight handles templating/styling differently and doesn&#8217;t have a databinding mechanism which support element names all of this was tricky at times but in the end I think I was able to cook a very clean and felxible Silverlight framework which in fact has not much affinity with diagramming and could be used as a generic framework (just like our O2 framework for WPF).</p>
<h2>Commercial rands</h2>
<p>I mentioned in the introduction that one of the aims of this project was to have a common core between WPF and Silverlight. Bad news here: you cannot share assemblies between Silverlight and WPF, you cannot share template, you cannot share databinding patterns, you cannot&#8230;well, lots of things. You can find on the net different ways to handle these difficulties (pragma&#8217;s in your code for instance) but I haven&#8217;t found any of these satisfactory. So, the end result in this context is a big deception, until Microsoft brings on stage a clear strategy targetting this scenario you have to live with duplicated code. For our diagramming aims this means we have a completely different Silverlight library which covers a lot of the features available in G2 but is nowhere near identical in code as G2. On the surface (read: our commercial offering) we now have</p>
<ul>
<li> an enterprise level diagramming framework (product: G2) for WPF and a MEF-based framework for WPF applications (product: O2). </li>
<li>a very complete diagramming framework (product: L2) for Silverlight and a MVC-based framework for Silverlight applications</li>
</ul>
<p>which in look-and-feel will give you pretty much the same experience. A BPM modeller or a workflow application in Silverlight with the same functionality in WPF&#8230;it&#8217;s all possible but not on the basis of a common core. In commercial terms this means that a customer wishing to have a dual Silverlight/WPF product needs to pay twice for customizations but can share a common data access layer hidden behind a WCF facade. Speaking about <strong>commercial moves</strong> I should also mention that The Orbifold has acquired recently two new products which were previously in the open source realm: <strong>Denis&#8217; property grid for Silverlight and WPF, as well a Petro&#8217;s S# scripting framework (aka Script.Net)</strong>. More about this in the near future.</p>
<p>There is so much more to say about our other projects and our latest WPF magic but I&#8217;ll stop here and leave if for another blog post.</p>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/wcfdiagrammingandmysql/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Parallel coordinates in WPF</title>
		<link>http://visualizationtools.net/default/parallel-coordinates-in-wpf/</link>
		<comments>http://visualizationtools.net/default/parallel-coordinates-in-wpf/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 05:35:37 +0000</pubDate>
		<dc:creator>Francois Vanderseypen</dc:creator>
				<category><![CDATA[Diagramming]]></category>
		<category><![CDATA[Diverse]]></category>
		<category><![CDATA[data-visualization]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.orbifold.net/default/?p=1886</guid>
		<description><![CDATA[About some customer challenge, multi-dimension data visualization and a custom WPF control which allows you to visualize ANY type of CSV/spreadsheet data.]]></description>
			<content:encoded><![CDATA[<p><strong>March 20th update</strong>: you can <a href="http://www.orbifold.net/downloads/paragraph/paragraph.demo.zip">download </a>a demo of this control now and Denis has also <a href="http://denisvuyka.wordpress.com/2009/03/20/first-wpf-parallel-coordinates-control/" target="_blank">posted an article</a> on this development.</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/accumulation.png"><img class="alignleft size-medium wp-image-1887" title="accumulation" src="http://www.orbifold.net/default/wp-content/uploads/accumulation-300x238.png" alt="accumulation" width="300" height="238" /></a>How to picture a 5-dimensional sphere or a see the correlation ofÂ  112-dimensional weather data? The answer was found in 1885 when <a title="Wikipedia reference" href="http://en.wikipedia.org/wiki/Parallel_coordinates" target="_blank">parallel coordinates </a>were invented and later refined in 1959 throughÂ  <a title="The man and his story." href="http://www.math.tau.ac.il/~aiisreal/" target="_blank">Inselberg</a>. The idea is actually very simple, given some N-dimensional space of data you draw N parallel lines and each line has its own scale. Plot a given data point on these lines by creating a line between the N point of this multi-didmensional point. In this way you get a line per data point and the series of given data points are mapped to a series of lines on the graph. The situation being much like projective geometry where we also find a back-and-forth thinking between lines and points in space. The good thing about such a representation is that if points have some accumulation in a particular dimension you will see it because lines will accumulate on the axis representing this dimension (see adjacent image). This kind of correlation can usually only be detected through statistical analysis, but what do you do if you want to record or supervise data which continuously comes in from real-time systems? This would mean a continuous mathematical analysis of the sampled data and this would entail some very custom algorithm bound to the particular context.</p>
<p>A customer of ours recently challenged us to implement the parallel coordinates visualization in WPF. While quite straightforward at first sight it proved to be more difficult than we initially thought for two reasons:</p>
<ul>
<li><strong>non-numeric data</strong>: what to do if you have some string data in one of the dimensions? Say, you want to visualize in one of the dimensions a timestamp or telephone numbers or names of patients.</li>
<li><strong>how to emphasize the accumulation points</strong> in the graph? While in the screenshots above you can actually see well the discrete tendence in the second dimension, the screenshot on the right bestows you with a challenge to detect it.</li>
</ul>
<p>The first problem was tackled through an internal mapping of the data which spreads the non-numeric data across an axis. The drawback of this is that at various levels one has to switch between the actual</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/nocorrelation.png"><img class="alignright size-medium wp-image-1890" title="Where is it?" src="http://www.orbifold.net/default/wp-content/uploads/nocorrelation-300x236.png" alt="Where is it?" width="300" height="236" /></a></p>
<p>data and the internal representation for labels, line hit during hovering, the histogram (see below) and any calculation in general. The second was more difficult and entailed some analysis of the data and various visual alternatives to attract the attention of the user (human interpreter of the data). The end-result is an <strong>histogram </strong>which like a rotated bar chart on the axis graphs the relative amount of crossings on the axis. The histogram actually shows also the opposite of an accumulation, since (see the second axis in the screenshot below) an equal spreading of the histogram&#8217;s rectangles means an equal distribution of the lines across the dimension axis.</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/histogram.png"><img class="alignleft size-medium wp-image-1894" title="Histogram" src="http://www.orbifold.net/default/wp-content/uploads/histogram-300x239.png" alt="Histogram" width="300" height="239" /></a>Other minor features we added to this data visualization are; the possibility to hover over the graph and see the actual data of the multi-dimensional points, datagrid binding and editing, customization of look &amp; feel through dependency properties, swapping data axes, scaling data vertically on a particular axis.</p>
<p>Probably the most satisfactory moment for myself during the development was at the point when it became clear that just <strong>any CSV/spreadsheet data can be bound to the parallel graph visualization</strong>. Indeed, due to the internal mapping mechanism one can present any type of tabular data and as a proof of concept I mocked some random spreadsheet in Excel which was subsequently visualized without a hitch.</p>
<p>Stocks &amp; shares anyone? Let me know.</p>
<p><a href="http://www.orbifold.net/default/wp-content/uploads/datagrid.png"><img class="aligncenter size-medium wp-image-1895" title="More visual beauty" src="http://www.orbifold.net/default/wp-content/uploads/datagrid-300x150.png" alt="More visual beauty" width="300" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://visualizationtools.net/default/parallel-coordinates-in-wpf/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  www.visualizationtools.net/default/tag/diagramming/feed/ ) in 1.37258 seconds, on Feb 9th, 2012 at 7:21 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 9th, 2012 at 8:21 am UTC -->
