<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Overfloater</title>
	
	<link>http://blog.thejit.org</link>
	<description>Data Visualization, JavaScript and Computer Science related stuff</description>
	<lastBuildDate>Sun, 18 Jul 2010 13:38:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Noumena" /><feedburner:info uri="noumena" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Doctor Who villains from 1963 to 2010 visualized</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/I_YT_sX50oc/</link>
		<comments>http://blog.thejit.org/2010/07/17/doctor-who-villains-from-1963-to-2010-visualized/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 21:34:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript information visualization toolkit (JIT)]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1530</guid>
		<description><![CDATA[While browsing the internet I got to the Guardian&#8217;s Datablog, a blog that gathers interesting information and datasets to explore and make visualizations. Latest post was about Every Doctor Who villain since 1963. There&#8217;s information about each villain&#8217;s first and last year of appearance, their motivation/evil plan, the name of the actors who played the [...]]]></description>
			<content:encoded><![CDATA[<p>While browsing the internet I got to the <a href="http://www.guardian.co.uk/news/datablog">Guardian&#8217;s Datablog</a>, a blog that gathers interesting information and datasets to explore and make visualizations. Latest post was about <a href="http://www.guardian.co.uk/news/datablog/2010/jul/16/doctor-who-villains-list">Every Doctor Who villain since 1963</a>. There&#8217;s information about each villain&#8217;s first and last year of appearance, their motivation/evil plan, the name of the actors who played the role of Doctor Who while that villain was making an appearance, the title of the stories where that villain was in, etc.</p>
<p>I created a &#8220;dynamic&#8221; TreeMap visualization with that data. Here&#8217;s a short screencast I made explaining the TreeMap functionalities (I have a horrible english accent&#8230; I know). You can also play with the demo <a href="http://demos.thejit.org/doctorwho/">here</a>.</p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/vAGk9gIzzEM&amp;hl=en_US&amp;fs=1?rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vAGk9gIzzEM&amp;hl=en_US&amp;fs=1?rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="400"></embed></object></p>
<h4>The Code</h4>
<p>For this example I used a special build of the Toolkit which is currently hosted at <a href="http://github.com/philogb/jit">GitHub</a>. The TreeMap example code looks just like the <a href="http://thejit.org/demos/">TreeMap demos code</a> but I also added an <em>onBeforeCompute</em> callback that checks for the <em>Doctor Actor Name</em> and <em>Villain Motivation</em> filters to fade nodes respectively:</p>
<pre name="code" class="js:nogutter:nocontrols">
onBeforeCompute: function() {
  tm.graph.eachNode(function(n) {
    var prev = false;
    if(n.data.motivations) {
      prev = true;
      if(motivation != 'All'
        &#038;&#038; n.data.motivations.indexOf(motivation) == -1) {
        n.setData('alpha', 0, 'end');
        n.ignore = true;
      } else {
        n.setData('alpha', 1, 'end');
        delete n.ignore;
      }
    }
    if(n.data.doctorActorNames) {
      if(doctorName != 'All'
        &#038;&#038; n.data.doctorActorNames.indexOf(doctorName) == -1) {
        n.setData('alpha', 0, 'end');
        n.ignore = true;
      } else if(!prev) {
        n.setData('alpha', 1, 'end');
        delete n.ignore;
      }
    }
  });
},
</pre>
<p>The anchor click callbacks set the current selected value to the <em>doctorName</em> and <em>motivation</em> variables and also perform an animation by fading nodes and repositioning the remaining visible nodes:</p>
<pre name="code" class="js:nogutter:nocontrols">
anchors.addEvent('click', function(e) {
  doctorName = this.innerHTML;
  tm.compute('end');
  tm.fx.animate({
    modes: {
      position: 'linear',
      'node-property': ['alpha', 'width', 'height']
    },
    duration: 1000,
    fps: 50,
    transition: $jit.Trans.Quart.easeInOut
  });
});
</pre>
<p>The <em>tm.compute(&#8216;end&#8217;);</em> call will trigger the <em>onBeforeCompute</em> callback that will set correct alpha values for the nodes. Then we perform an animation of node positions and node alpha, width and height properties.</p>
<p>I hope you have fun with the <a href="http://demos.thejit.org/doctorwho/">demo</a>!</p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/I_YT_sX50oc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/07/17/doctor-who-villains-from-1963-to-2010-visualized/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/07/17/doctor-who-villains-from-1963-to-2010-visualized/</feedburner:origLink></item>
		<item>
		<title>Speaker at JSConf.eu 2010</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/TS-N2iTAm38/</link>
		<comments>http://blog.thejit.org/2010/07/08/speaker-at-jsconf-eu-2010/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 21:09:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript information visualization toolkit (JIT)]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1517</guid>
		<description><![CDATA[Update: The presentation page is here.
Just a quick post to tell you that I&#8217;ve been selected to speak at JSConf.eu 2010 in Berlin in September. JSConf.eu is the most important JavaScript conference held in Europe. Last year speakers included John Resig, Douglas Crockford and 280 north people among others. I&#8217;m very excited about this event [...]]]></description>
			<content:encoded><![CDATA[<p><em>Update: The presentation page is <a href="http://jsconf.eu/2010/speaker/creating_interactive_data_visu.html">here</a></em>.</p>
<p>Just a quick post to tell you that I&#8217;ve been selected to speak at <a href="http://jsconf.eu">JSConf.eu 2010</a> in Berlin in September. <a href="http://jsconf.eu">JSConf.eu</a> is the most important JavaScript conference held in Europe. <a href="http://jsconf.eu/2009/speakers.html">Last year speakers</a> included <a href="http://en.wikipedia.org/wiki/John_Resig">John Resig</a>, <a href="http://en.wikipedia.org/wiki/Douglas_Crockford">Douglas Crockford</a> and <a href="http://280north.com/">280 north people</a> among others. I&#8217;m very excited about this event and I can&#8217;t wait to meet everyone there!</p>
<p>More updates will come in the next few days. You can also follow feeds from the <a href="http://jsconf.eu">main page event</a> or follow them on <a href="http://twitter.com/jsconfeu">twitter</a>. Oh, I have a <a href="http://twitter.com/philogb">twitter account</a>, too <img src='http://blog.thejit.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/TS-N2iTAm38" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/07/08/speaker-at-jsconf-eu-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/07/08/speaker-at-jsconf-eu-2010/</feedburner:origLink></item>
		<item>
		<title>The JavaScript InfoVis Toolkit 2.0 is out!</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/L0wHryzew0Q/</link>
		<comments>http://blog.thejit.org/2010/06/28/the-javascript-infovis-toolkit-2-0-is-out/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 12:01:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[2.0]]></category>
		<category><![CDATA[JavaScript information visualization toolkit (JIT)]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1492</guid>
		<description><![CDATA[After more than a year of hard work I&#8217;m proud to announce the release of the JavaScript InfoVis Toolkit 2.0!
What&#8217;s the JavaScript InfoVis Toolkit?
The JavaScript InfoVis Toolkit provides web standard based tools to create interactive data visualizations for the Web.
What&#8217;s new in this version?
This version introduces radical new features, an API redesign and new visualizations. [...]]]></description>
			<content:encoded><![CDATA[<p>After more than a year of hard work I&#8217;m proud to announce the release of the <a target="_blank" href="http://thejit.org">JavaScript InfoVis Toolkit 2.0</a>!</p>
<h4>What&#8217;s the JavaScript InfoVis Toolkit?</h4>
<p>The <a target="_blank" href="http://thejit.org">JavaScript InfoVis Toolkit</a> provides web standard based tools to create interactive data visualizations for the Web.</p>
<h4>What&#8217;s new in this version?</h4>
<p>This version introduces radical new features, an API redesign and new visualizations. If you don&#8217;t want to read the whole article and just want to play with the examples you can go to <a href="http://thejit.org/demos/" target="_blank">the demos page</a>.</p>
<h4>New Visualizations</h4>
<p>With this version of the Toolkit the number of available visualizations has doubled. Some of the new visualizations are the AreaChart, BarChart and PieChart, which were described in more detail in <a href="http://blog.thejit.org/2010/04/24/new-javascript-infovis-toolkit-visualizations/">this article</a>. I&#8217;ve also added Sunburst and Force-Directed visualizations. I wrote about these visualizations before <a href="http://blog.thejit.org/2009/10/05/sunburst-visualization/">here</a> and <a href="http://blog.thejit.org/2009/09/30/force-directed-layouts/">here</a>. I also want to thank <a href="http://quux.com.ar" target="_blank">Pablo Flouret</a>, who contributed most of the code for the Icicle visualization, also a new addition to the toolkit.</p>
<p>You can play now with these visualizations at the <a href="http://thejit.org/demos/">demos page</a>!</p>
<h4>Features common to all visualizations</h4>
<p>I&#8217;ve also enhanced all visualizations with new configuration options that enable new features. These features are:</p>
<ul>
<li><em>Panning</em> and <em>zooming</em> across all visualizations.</li>
<li>A new <em>event system</em> that enables you to attach events to DOM elements or to native canvas nodes and also add support for <em>touch events</em>, <em>drag and drop</em>, etc.</li>
<li><em>Complex animations</em> have the ability to animate <b>any style property</b> of a node, edge or label. There is also support for animating canvas specific properties like shadowBlur, shadowColor, fillStyle, etc.</li>
</ul>
<h4>A new TreeMap visualization</h4>
<p>The underlying rendering functions in the TreeMap visualization have changed. While in prior versions of the Toolkit the TreeMap was DOM-based, this new version renders the TreeMap entirely in Canvas. This enables you to add custom nodes of any shape or nature you like (can be images, circles, polygons) and also to take advantage of the new animation engine of the toolkit to add smooth transitions for the drill-down. These new things can be tested at the TreeMap section in the <a target="_bank" href="http://thejit.org/demos/">demos page</a>.</p>
<h4>API Redesign</h4>
<p>The old API was too low level. Before creating any visualization you had to manually create a Canvas widget and pass it as parameter to the visualization class. Also, many other parameters like width and height of the canvas were required. For Background canvases the API had a couple of flaws, and it wasn&#8217;t clear how to use it either. Many of these things have been solved with the new API design. The Canvas class became an inner class implicitly created when making a new visualization. Width and height of the canvas are set to the container&#8217;s <em>offsetWidth</em> and <em>offsetHeight</em> if they&#8217;re not provided, and background canvases are easier to attach to the visualization.<br />
Most of all, there is now a single global object in the library: <b>$jit</b>. This declares the namespace for the library and makes sure you won&#8217;t have conflicts with <em>any other JavaScript library</em>.</p>
<h4>A new Website</h4>
<p>Last but not least, I worked on a <a href="http://thejit.org/">website redesign</a>, taking advantage of the new HTML5/CSS3 features supported by major browsers. There&#8217;s also a detailed <a href="http://thejit.org/docs/">documentation page</a> to get you started.</p>
<h4>It&#8217;s alpha</h4>
<p>Finally I&#8217;d like to say that this is an <em>alpha</em> version. There are lots of known bugs and <b>I&#8217;m counting on you</b> to <a href="http://github.com/philogb/jit">report bugs, send fixes, and collaborate in any aspect of the toolkit</a>.</p>
<h4>Thanks</h4>
<p>To <a href="http://quux.com.ar">Pablo Flouret</a> for contributing code to the toolkit, and to my wife, <a href="http://sourberries.tumblr.com/">Luz Caballero</a> for making me happy.</p>
<p>Now go get the <a href="http://thejit.org/">Toolkit</a>!</p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/L0wHryzew0Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/06/28/the-javascript-infovis-toolkit-2-0-is-out/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/06/28/the-javascript-infovis-toolkit-2-0-is-out/</feedburner:origLink></item>
		<item>
		<title>News from the JavaScript InfoVis Toolkit 2.0 World</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/SL4WAn1_g9w/</link>
		<comments>http://blog.thejit.org/2010/05/30/news-from-the-javascript-infovis-toolkit-2-0-world/#comments</comments>
		<pubDate>Sun, 30 May 2010 18:35:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript information visualization toolkit (JIT)]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[javascript infovis toolkit]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1476</guid>
		<description><![CDATA[We&#8217;re not that far. Not at all. I was actually going to write some completion percentage, but I think I&#8217;ll just leave that as a mystery and surprise you when the time comes. But until then&#8230; some videos from the 2.0 world!
Animated TreeMaps
In order to show some of the new features I&#8217;ve been writing a [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re not that far. Not at all. I was actually going to write some completion percentage, but I think I&#8217;ll just leave that as a mystery and surprise you when the time comes. But until then&#8230; some videos from the 2.0 world!</p>
<h4>Animated TreeMaps</h4>
<p>In order to show some of the new features I&#8217;ve been writing a simple example with TreeMap animations. TreeMap animations are integrated into the built-in classes of the Toolkit, but you can also create your own animations by altering either built-in Node/Edge params, or also canvas specific styles like shadows.</p>
<p>Here&#8217;s a short video of an Animated TreeMap, it also has animations when switching layouts. I think it&#8217;s better seen in fullscreen.</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/KaEvu5YRwLk&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/KaEvu5YRwLk&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<h4>Zooming and Panning</h4>
<p>The new Event system allows many customizations, such as Dragging and Dropping nodes, (right)clicking native Canvas nodes, etc. This will be the subject of a longer post, since there is a lot of machinery involving Native Canvas, SVG and HTML events, event delegation, etc. I&#8217;ve also been working in making a modular Canvas class enabling canvas background extensions.</p>
<p>Some of these changes had some desirable effects, such as enabling Panning and Zooming in a generic way, across all visualizations, as can be seen in this video:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/CpXpAiZT1n0&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/CpXpAiZT1n0&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<h4>A Force Directed Example</h4>
<p>These features can be combined into useful and interesting examples. This Force Directed example uses the new Event system, zooming, panning and animations to make a complete graph editing tool. These are some of the graph interactions that can be made with the JavaScript InfoVis Toolkit (also better seen in fullscreen):</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/gSdlgRSEy_s&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/gSdlgRSEy_s&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>I hope you liked it. I know I&#8217;m having a great time working in this project. </p>
<p>I&#8217;ll be back with more updates.</p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/SL4WAn1_g9w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/05/30/news-from-the-javascript-infovis-toolkit-2-0-world/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/05/30/news-from-the-javascript-infovis-toolkit-2-0-world/</feedburner:origLink></item>
		<item>
		<title>Browser Photo Mosaics</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/3nyGbTAHEzs/</link>
		<comments>http://blog.thejit.org/2010/05/20/browser-photo-mosaics/#comments</comments>
		<pubDate>Thu, 20 May 2010 18:12:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[exalead]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[mosaic]]></category>
		<category><![CDATA[photo mosaic]]></category>
		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1458</guid>
		<description><![CDATA[Update: I made a video showing the Photo Mosaic process + zoomable Canvas here:

Today, I started working at Exalead on a photo mosaic service that could take advantage of Exalead&#8217;s Search Engine. The service contains a bunch of indexed images from different sources. These images are categorized by color just like the images in our [...]]]></description>
			<content:encoded><![CDATA[<p><em>Update: I made a video showing the Photo Mosaic process + zoomable Canvas here:</em></p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/eJP_IgXEv6s&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/eJP_IgXEv6s&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>Today, I started working at <a href="http://exalead.com">Exalead</a> on a photo mosaic service that could take advantage of Exalead&#8217;s Search Engine. The service contains a bunch of indexed images from different sources. These images are categorized by color just like the images in our <a href="http://www.exalead.com/search/image/results/?q=exalead">public search service</a>, allowing us to easily find pictures by approximating colors.</p>
<p>I decided to run the web application into some browser logos to see what the results were. You can click the images to enlarge. </p>
<h4>Chrome</h4>
<p><a href="/wp-content/static/img/chrome1.png"><img  src="/wp-content/static/img/chrome1_500.png" style="border: 1px solid cyan; padding: 3px; margin: 0px 13px 5px 0;" /><br />
</a></p>
<h4>IE</h4>
<p><a href="/wp-content/static/img/ie.png"><img  src="/wp-content/static/img/ie_500.png" style="border: 1px solid cyan; padding: 3px; margin: 0px 13px 5px 0;" /><br />
</a></p>
<h4>Firefox</h4>
<p><a href="/wp-content/static/img/ff1.png"><img  src="/wp-content/static/img/ff1_500.png" style="border: 1px solid cyan; padding: 3px; margin: 0px 13px 5px 0;" /><br />
</a></p>
<h4>Opera</h4>
<p><a href="/wp-content/static/img/opera1.png"><img  src="/wp-content/static/img/opera1_500.png" style="border: 1px solid cyan; padding: 3px; margin: 0px 13px 5px 0;" /><br />
</a></p>
<h4>Safari</h4>
<p><a href="/wp-content/static/img/safari.png"><img  src="/wp-content/static/img/safari_500.png" style="border: 1px solid cyan; padding: 3px; margin: 0px 13px 5px 0;" /><br />
</a></p>
<p>Safari was kind of complicated because the logo has more details than the others. I also made a close up of the logo:<br />
<a href="/wp-content/static/img/safari2.png"><br />
<img  src="/wp-content/static/img/safari2_500.png" style="border: 1px solid cyan; padding: 3px; margin: 5px 13px 5px 0;" /><br />
</a></p>
<p>Which one do you like the most?</p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/3nyGbTAHEzs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/05/20/browser-photo-mosaics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/05/20/browser-photo-mosaics/</feedburner:origLink></item>
		<item>
		<title>Speaker at YOW! Australia 2010</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/NCyGe4B5j2M/</link>
		<comments>http://blog.thejit.org/2010/05/03/speaker-at-yow-australia-2010/#comments</comments>
		<pubDate>Mon, 03 May 2010 18:57:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1456</guid>
		<description><![CDATA[Just a quick post to tell you that I&#8217;ve been invited to speak at YOW! Australia Developer Conference in Brisbane and Melbourne in December. YOW! is the new name for the JAOO (a.k.a Java and OO) conferences that have been running for over 13 years around the world already. YOW! Australia 2010 will include talks [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post to tell you that I&#8217;ve been invited to speak at <a href="http://www.yowconference.com.au/">YOW! Australia Developer Conference</a> in Brisbane and Melbourne in December. YOW! is the new name for the <a href="http://jaoo.dk/">JAOO</a> (a.k.a Java and OO) conferences that have been running for over 13 years around the world already. <a href="http://www.yowconference.com.au/">YOW! Australia 2010</a> will include talks by <a href="http://www.yowconference.com.au/brisbane/speakers/details.html?speakerId=1616">Guy L. Steele, Jr.</a>, <a href="http://www.yowconference.com.au/brisbane/speakers/details.html?speakerId=1635">Erik Meijer</a> and me among others -yes, I can&#8217;t believe I just put myself in the same list as these people!.</p>
<p>Anyway, I&#8217;ll keep you updated.</p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/NCyGe4B5j2M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/05/03/speaker-at-yow-australia-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/05/03/speaker-at-yow-australia-2010/</feedburner:origLink></item>
		<item>
		<title>New JavaScript InfoVis Toolkit Visualizations</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/wl2k6Mn3ncA/</link>
		<comments>http://blog.thejit.org/2010/04/24/new-javascript-infovis-toolkit-visualizations/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 01:41:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript information visualization toolkit (JIT)]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1437</guid>
		<description><![CDATA[Today I&#8217;d like to announce the addition of three new components in the next version of the JavaScript InfoVis Toolkit: Area Charts, Bar Charts and Pie Charts. I hope these components will be widely used among the JIT user community.
All components support a simpler JSON format that I&#8217;ll describe later in this post. These components [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;d like to announce the addition of three new components in the next version of the <a href="http://thejit.org">JavaScript InfoVis Toolkit</a>: Area Charts, Bar Charts and Pie Charts. I hope these components will be widely used among the JIT user community.</p>
<p>All components support a simpler JSON format that I&#8217;ll describe later in this post. These components are easy-to-use, yet very powerful: they support live data updates and multi valued data as we will see next.</p>
<h4>Area Charts</h4>
<p>The Area Chart is a useful component to track the evolution of a bunch of categories at the same time. In addition, the aggregation of the values of all these categories is also presented in a meaningful way. This component supports live updates (as you&#8217;ll see in the first seconds of the video), filtering/restoring categories, tooltips and a legend. As usual this is all JavaScript:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/NcpFzSkIJOM&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/NcpFzSkIJOM&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>The visualization is instanciated this way:</p>
<pre name="code" class="js:nogutter:nocontrols">
var areaChart = new $jit.AreaChart({
    //id of the container
    injectInto: 'infovis',
    //set animations
    animate: true,
    //visualization 'padding'
    offset: 5,
    //labels 'margin'
    labelOffset:10,
    //show aggregated values
    showAggregates:true,
    //show labels
    showLabels:true,
    //use gradients for rendering
    type:'stacked:gradient',
    //label styling
    Label: {
      size: 13,
      family: 'Arial',
      color: 'white'
    },
    //enable tips
    Tips: {
      enable: true,
      onShow: function(tip, elem) {
         tip.innerHTML = "<b>" + elem.name + "</b>: " + elem.value;
      }
    },
    //add leftclick handler
    filterOnClick: true,
    //add rightclick handler
    restoreOnRightClick:true
});
</pre>
<p>Additionally this visualization allows programmatic category filtering, JSON updating, selecting you own colors, etc.</p>
<h4>Bar Charts</h4>
<p>Bar Charts are similar to Area Charts, but they support additional styling and positioning. You can use vertical or horizontal Bar Charts. Here&#8217;s an example:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/wkVBQvZ1LsM&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wkVBQvZ1LsM&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>This object is created the same way you create an AreaChart:</p>
<pre name="code" class="js:nogutter:nocontrols">
var barChart = new $jit.BarChart({
    injectInto: 'infovis',
    animate: true,
    //set orientation vertical or horizontal
    orientation: 'horizontal',
    //bar separation
    barsOffset: 20,
    offset:10,
    labelOffset:5,
    type:'stacked:gradient',
    showAggregates:true,
    showLabels:true,
    Label: {
      size: 13,
      family: 'Arial',
      color: 'white'
    },
    Tips: {
      'enable': true,
      'onShow': function(tip, elem) {
         tip.innerHTML = "<b>" + elem.name + "</b>: " + elem.value;
      }
    }
});
</pre>
<h4>Pie Charts / Rose Diagrams</h4>
<p>Finally there&#8217;s the Pie Chart. But this is no regular Pie Chart. It can support simple data as well as more complex data. You can add multiple categories to this Pie Chart, combining them into something more like a Stacked Rose Diagram. They also support live updates as you&#8217;ll see in the first seconds of the video:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/0bmWXM3j7Rs&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/0bmWXM3j7Rs&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<h4 id="json-data-format">JSON Data Format</h4>
<p>The JSON data format for these visualizations had to depict something like a contingency table, and so I decided to adopt something like this:</p>
<pre name="code" class="js:nogutter:nocontrols">
var json = {
    //category labels
    'label': ['label A', 'label B', 'label C', 'label D'],
    //each "stack" is described here
    'values': [
    {
      'label': 'date A',
      'values': [20, 40, 15, 5]
    },
    {
      'label': 'date B',
      'values': [30, 10, 45, 10]
    },
    {
      'label': 'date E',
      'values': [38, 20, 35, 17]
    },
    {
      'label': 'date F',
      'values': [58, 10, 35, 32]
    },
    {
      'label': 'date D',
      'values': [55, 60, 34, 38]
    },
    {
      'label': 'date C',
      'values': [26, 40, 25, 40]
    }]
};
</pre>
<p>I hope you find these visualizations useful, and if you can&#8217;t wait for the next version to come out to use these charts you can always build the project from <a href="http://github.com/philogb/jit">GitHub</a>. Here&#8217;s a <a href="http://wiki.github.com/philogb/jit/getting-started">wiki</a> with some instructions on how to make your own build of the library while you&#8217;re waiting for an official release. If you ever find bugs please use the <a href="http://github.com/philogb/jit/issues">issue tracker at GitHub</a>. If you need help or have any questions you can always go to the <a href="http://groups.google.com/group/javascript-information-visualization-toolkit/">Google Group</a>. Well, this got long enough. </p>
<p>Hope you enjoyed it!</p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/wl2k6Mn3ncA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/04/24/new-javascript-infovis-toolkit-visualizations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/04/24/new-javascript-infovis-toolkit-visualizations/</feedburner:origLink></item>
		<item>
		<title>JavaScript Animations</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/CXtc9to58Uw/</link>
		<comments>http://blog.thejit.org/2010/03/25/javascript-animations/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 20:44:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[animation]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1401</guid>
		<description><![CDATA[JavaScript animations are a key aspect of dynamic Web Sites and Application development. Moreover, most JavaScript Frameworks or Libraries provide APIs for dealing with at least three main things:

Advanced DOM manipulation
Ajax
Animations

When developing Web Sites most JavaScript effects involve rendered DOM Elements, but sometimes JavaScript animations are used in other contexts, like when using the Canvas. [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript animations are a key aspect of dynamic Web Sites and Application development. Moreover, most JavaScript Frameworks or Libraries provide APIs for dealing with at least three main things:</p>
<ul>
<li>Advanced DOM manipulation</li>
<li>Ajax</li>
<li>Animations</li>
</ul>
<p>When developing Web Sites most JavaScript effects involve rendered DOM Elements, but sometimes JavaScript animations are used in other contexts, like when using the Canvas. In the <a href="http://thejit.org">JavaScript InfoVis Toolkit</a> the main target of my animations are Graphs, and in the next version also Nodes and Edges as separate entities.</p>
<p>Today I&#8217;d like to describe how to create a generic animation class that can be used or extended for any purpose. I&#8217;ll try to be minimalistic and to present only the needed code for making animations. Then you might find useful to add some code to perform specific animation tasks targeting for example specific style properties of a DOM Element.</p>
<h4>Defining an Animation Class</h4>
<p>Before creating an Animation class we might want to consider what to expose as options to the user. The options I thought of are:</p>
<ul>
<li>The duration of the animation (in milliseconds)</li>
<li>The frames per second of the animation</li>
</ul>
<p>Additionally we&#8217;d like to add a couple of controllers, one when a step of the animation is executed and one when the animation has completed:</p>
<pre name="code" class="js:nogutter">
var options = {
  duration: 1000,
  fps: 40,
  onStep: function(delta) {},
  onComplete: function() {}
};
</pre>
<p><em>delta</em> gives us an idea of the <em>progress</em> of the animation. When the animation starts delta will be equal to zero. When the animation ends it&#8217;ll be equal to one.</p>
<p>We will also need a <em>start</em> method to trigger the animation and a <em>step</em> method that will compute <em>delta</em> at each step.</p>
<p>Now that we defined our options we can start thinking about our implementation.</p>
<h4>Implementing the Animation class</h4>
<p>Our Animation class will be a class constructor that sets all the options and properties that we defined before and a prototype with the methods <em>start</em> and <em>step</em>. The class could be used like this:</p>
<pre name="code" class="js:nogutter">
var fx = new Effect({
  duration: 1000,
  fps: 40,
  onStep: function(delta) {
    /* do stuff */
  },
  onComplete: function() {
    alert('done!');
  }
});
//start the animation
fx.start();
</pre>
<p>Here&#8217;s the code I came up with, inspired by the <a href="http://mootools.net">MooTools</a> Framework:</p>
<pre name="code" class="js:nogutter">
//define the class constructor
function Effect(opt) {
  this.opt = {
    duration: opt.duration || 1000,
    fps: opt.fps || 40,
    onStep: opt.onStep || function(){},
    onComplete: opt.onComplete || function(){}
  };
}

Effect.prototype = {
  //define how the animation starts
  start: function() {
    //return if we're currently performing an animation
    if(this.timer) return;
    //trigger the animation
    var that = this, fps = this.opt.fps;
    this.time = +new Date;
    this.timer = setInterval(function() { that.step(); },
                             Math.round(1000/fps));
  },
  //triggered at each interval step
  step: function() {
    var currentTime = +new Date, time = this.time, opt = this.opt;
   //check if the time interval already exceeds the duration
   if(currentTime < time + opt.duration) {
     //if not, calculate our animation progress
      var delta = (currentTime - time) / opt.duration;
      opt.onStep(delta);
    } else {
      //we already exceeded the duration, stop the effect
      //and call the onComplete callback
      this.timer = clearInterval(this.timer);
      opt.onStep(1);
      opt.onComplete();
    }
  }
};
</pre>
<p>One very common operation to do with delta is to change the interval [0, 1] of delta to our desired <em>from</em> and <em>to</em> values that we want to compute for our element. A clever thing to do would be to declare this method as a class method for Effect. We'll call it compute:</p>
<pre name="code" class="js:nogutter">
Effect.compute = function(from, to, delta) {
  return from + (to - from) * delta;
};
</pre>
<p>Now If we wanted for example to animate an element's width style from <em>0</em> to <em>10px</em> we could do:</p>
<pre name="code" class="js:nogutter">
var elem = document.getElementById("myElementId"),
    style = elem.style;
var fx = new Effect({
  duration: 500,
  onStep: function(delta) {
    style.width = Effect.compute(0, 10, delta) + 'px';
  }
});
fx.start();
</pre>
<h4>Extending the Effect class</h4>
<p>The animation code defined above could be extended in different ways. For example, this class could be slightly modified to accept a DOM element in its constructor and modify style properties of that element when performing an animation. The code could look like this:</p>
<pre name="code" class="js:nogutter">
var elem = document.getElementById("myElementId");
var fx = new Effect({
  element: elem,
  duration: 1000
});
fx.start({
  'width': [0, 20, 'px'],
  'height': [0, 5, 'em']
});
</pre>
<p>The code would now look more or less like this:</p>
<pre name="code" class="js:nogutter">
//define the class constructor
function Effect(opt) {
  this.opt = {
    element: opt.element,
    duration: opt.duration || 1000,
    fps: opt.fps || 40,
    onComplete: opt.onComplete || function(){}
  };
}

Effect.prototype = {
  //props contains a hash with style properties
  start: function(props) {
    if(this.timer) return;
    var that = this, fps = this.opt.fps;
    this.time = +new Date;
    this.timer = setInterval(function() { that.step(props); },
                             Math.round(1000/fps));
  },
  //triggered at each interval step
  step: function(props) {
     var currentTime = +new Date, time = this.time, opt = this.opt;
     if(currentTime < time + opt.duration) {
      var delta = (currentTime - time) / opt.duration;
     //set the element style properties
     this.setProps(opt.element, props, delta);
    } else {
      this.timer = clearInterval(this.timer);
      this.setProps(opt.element, props, 1);
      opt.onComplete();
    }
  },
  //set style properties. Properties must be
  //in camelcase format.
  setProps: function(elem, props, delta) {
    var style = elem.style;
    for(var prop in props) {
      var values = props[prop];
      style[prop] = Effect.compute(values[0], values[1], delta)
        + (values[2] || '');
    }
  }
};
</pre>
<p>Other extensions might involve normalizing style keywords, adding effect transitions, adding <em>pause</em> <em>resume</em> methods, and/or using more OO JS idioms when coding these classes.</p>
<p>I hope you got to know a little bit more about animation internals and please if you have any advice on this code, which as I told before is just for demonstration, I'll be pleased to hear you!</p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/CXtc9to58Uw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/03/25/javascript-animations/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/03/25/javascript-animations/</feedburner:origLink></item>
		<item>
		<title>JavaScript InfoVis Toolkit Customizations</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/dIWgG68TMn4/</link>
		<comments>http://blog.thejit.org/2010/02/24/javascript-infovis-toolkit-customizations/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 21:24:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[1.1]]></category>
		<category><![CDATA[JavaScript information visualization toolkit (JIT)]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1358</guid>
		<description><![CDATA[I had the chance to play with the JavaScript InfoVis Toolkit lately. It&#8217;s nice to be able to use the Toolkit instead of developing it. The main reason I built the Toolkit in the first place was to create specific visualizations I was needing for MusicTrails. At the end I got to code lots of [...]]]></description>
			<content:encoded><![CDATA[<p>I had the chance to play with the <a href="http://thejit.org">JavaScript InfoVis Toolkit</a> lately. It&#8217;s nice to be able to <em>use</em> the Toolkit instead of developing it. The main reason I built the Toolkit in the first place was to create specific visualizations I was needing for <a href="http://tree.musictrails.com.ar">MusicTrails</a>. At the end I got to code lots of features but didn&#8217;t have the chance to play with them for a long time.</p>
<p>I hope these examples can demonstrate that the Toolkit was really built upon the concepts of <em>Modularity</em>, <em>Extensibility</em> and <em>Composability</em>.</p>
<h4>Stacked Bar Charts</h4>
<p>One of the things I wanted to do for some time now was to adapt the <a href="http://thejit.org/Jit/Examples/Spacetree/example1.html">Spacetree</a> visualization to show Bar Charts.<br />
By watching <a href="http://thejit.org/Jit/Examples/Other/example1.html">this</a> example we can already tell that the Spacetree can be used to represent something similar to a Bar Chart. For the next example I created a BarChart class that uses a Spacetree with some special node rendering function to plot bars for each node:</p>
<p><img align="center" src="/wp-content/charts/bc1.png" style="border: 1px solid orange; margin: 5px auto; padding: 3px; width: 500px;" /></p>
<p>What&#8217;s also interesting about this widget is that the custom node implementation I made allows it to show stacked values:</p>
<p><img align="center" src="/wp-content/charts/bc3.png" style="border: 1px solid orange; margin: 5px auto; padding: 3px; width: 500px;" /></p>
<p>Stacked Bar Charts are useful when aggregated results are as meaninful information as knowing the specific value of each analyzed element. The JQuery team used these kind of charts for measuring performance in different browsers for different versions of JQuery. As you can a see in the next picture, the overall performance comparison is as useful as the specific browser performance improvements data.</p>
<p><img align="center" src="http://farm5.static.flickr.com/4015/4366089781_509c29aff8.jpg" style="border: 1px solid orange; margin: 5px auto; padding: 3px; width: 500px;" /></p>
<p><b>Implementation</b><br />
In order to make Stacked Bar Charts I stored multivalued information into the nodes&#8217; <em>data</em> property and then accessed it to render each node like this:</p>
<pre name="code" class="js:nogutter:nocontrols">
//Here we implement custom node rendering types for the ST
ST.Plot.NodeTypes.implement({
  'stacked': function(node, canvas) {
    var pos = node.pos.getc(true), nconfig = this.node, data = node.data;
    var cond = nconfig.overridable &#038;& data;
    var width  = cond &#038;&#038; data.$width || nconfig.width;
    var height = cond &#038;&#038; data.$height || nconfig.height;
    var algnPos = this.getAlignedPos(pos, width, height);
    var valueArray = data.valueArray;

    var ctx = canvas.getCtx();
    ctx.save();
    if(valueArray) {
     for(var i=0, l=valueArray.length, acum=0; i&lt;l; i++) {
      var rgb = valueArray[i].color.hexToRgb(true);
      var rgbdark = rgb.map(function(e) { return (e * .3) >> 0; });

      var lgradient = ctx.createLinearGradient(algnPos.x, algnPos.y + acum,
        algnPos.x + width -1, algnPos.y + acum + (valueArray[i].hvalue || 0));

      lgradient.addColorStop(0, rgb.rgbToHex());
      lgradient.addColorStop(0.5, rgb.rgbToHex());
      lgradient.addColorStop(1, rgbdark.rgbToHex());

      ctx.fillStyle = lgradient;
      ctx.fillRect(algnPos.x, algnPos.y + acum, width, valueArray[i].hvalue || 0);
    }
    ctx.restore();
  }
});
</pre>
<p>That code also uses linear gradients to render nice gradients for each stacked bar. </p>
<h4>Pie Charts + TreeMaps = Awesome TreeMaps</h4>
<p>When lots of elements need to be compared the Stacked Bar Chart visualization can be confusing. This is due to the fact that each bar gets thinner and the aspect ratio for each bar tends to be very high. I <a href="http://blog.thejit.org/2010/01/24/dom-vs-canvas-treemaps/">wrote</a> about the aspect ratio problem some time ago, and I also showed that it could be solved by using Squarified TreeMaps to show hierarchical structures in constrained space.<br />
This is OK for replacing Bar Charts, but what about <em>Stacked</em> Bar Charts? Should we subdivide each TreeMap cell into the number of stacked elements? I didn&#8217;t find that solution very appealing: for each TreeMap node its subnodes would have the same color, same name, but different values. It seems like redundant information.<br />
Instead, I opted to create Pie Charts inside each TreeMap node. Pie Charts are useful to compare values where the whole information also has a meaning.</p>
<p>Here&#8217;s an example I did with the same data collected from the second Stacked Bar Chart image (click on the image to enlarge):</p>
<p><a style="text-decoration:none;margin:0;padding:0;" href="/wp-content/charts/tmb1.png"><br />
<img align="center" src="/wp-content/charts/tms1.png" style="border: 1px solid orange; margin: 5px auto; padding: 3px; width: 500px;" /><br />
</a></p>
<p>Each TreeMap cell is proportional to the amount of aggregate information for each element. The Pie Chart compares the specific information of each element.<br />
While the previous example isn&#8217;t too useful, this next example collects more data and thus makes this visualization more suitable (also click to enlarge):</p>
<p><a style="text-decoration:none;margin:0;padding:0;" href="/wp-content/charts/tmb2.png"><br />
<img align="center" src="/wp-content/charts/tms2.png" style="border: 1px solid orange; margin: 5px auto; padding: 3px; width: 500px;" /><br />
</a></p>
<p><b>Implementation</b><br />
By taking a look at <a href="http://thejit.org/Jit/Examples/Other/example1.html">this example</a> we can see that we can make Pie Charts by using RGraphs and adding a special node rendering function. We also know that we can make Squarified TreeMaps by looking at <a href="http://thejit.org/Jit/Examples/Treemap/example2.html">this example</a>. </p>
<p>So how can we combine these two visualizations?</p>
<p>The TreeMap visualization accepts a <em>controller</em> method that is triggered on element creation. This means that for each created treemap node a callback is used that can post-process each TreeMap node. This method is called <em>onCreateElement</em> and I use it to append a pie chart for each TreeMap element like this:</p>
<pre name="code" class="js:nogutter:nocontrols">
onCreateElement: function(content, node, isLeaf, leaf) {
  if(isLeaf &#038;&#038; node.data.valueArray) {
    var w = leaf.offsetWidth, h = leaf.offsetHeight;
    //create a canvas with unique id
    //and append it to the leaf TreeMap element
    var c = new Canvas("piechartcanvas_" + TMPieWidget.count++, {
      injectInto: leaf,
      width: w,
      height: h - 2*tm.config.titleHeight
    });
    //create a RGraph with nodepie node rendering
    //function
    var rg = new RGraph(c, {
        Node: {
            'overridable': true,
             'type': 'nodepie'
        },
        Edge: {
            'overridable': true
        },
        //Parent-children distance
        levelDistance: ((w > h? h : w) / 2) - 2*tm.config.titleHeight,  

        //Add styles to node labels on label creation
        onCreateLabel: function(domElement, node){
            domElement.innerHTML = '';//node.name;
            if(node.data.$aw)
                domElement.innerHTML += " " + node.data.$aw;
            var style = domElement.style;
            style.fontSize = "0.8em";
            style.color = "#fff";
        },
        //Add some offset to the labels when placed.
        onPlaceLabel: function(domElement, node){
            var r = rg.graph.getNode(rg.root);
            var style = domElement.style;
            var dw = domElement.offsetWidth;
            if(r.data.count == 1) {
              var dh = domElement.offsetHeight;
              style.left = (w/2 - dw / 2) + 'px';
              style.top = (h/2 - dh) + 'px';
            } else {
              var left = parseInt(style.left);
              style.left = (left - dw / 2) + 'px';
            }
        }
    });
    rg.loadJSON(that.createJSONPie(node));
    rg.refresh();
  }
}
</pre>
<p>And that&#8217;s it!</p>
<p>I hope these customizations inspired you enough to create your own wacky visualizations with the <a href="http://thejit.org">JavaScript InfoVis Toolkit</a>. I honestly encourage all Toolkit users to try to extend the library with new crazy ideas and features; most of the library design was targeted at that!</p>
<p><em>PS: Some people posted a job offer at the <a href="http://groups.google.com/group/javascript-information-visualization-toolkit">JavaScript InfoVis Toolkit Google Group</a> that you might find useful. To check or post about job offerings related to visualization or the JavaScript InfoVis Toolkit please join the group!</em></p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/dIWgG68TMn4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/02/24/javascript-infovis-toolkit-customizations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/02/24/javascript-infovis-toolkit-customizations/</feedburner:origLink></item>
		<item>
		<title>Voronoi Tessellation</title>
		<link>http://feedproxy.google.com/~r/Noumena/~3/EU3Tx97R2gw/</link>
		<comments>http://blog.thejit.org/2010/02/12/voronoi-tessellation/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 21:19:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[visualization]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1332</guid>
		<description><![CDATA[This is going to be the first of a couple of posts related to Voronoi Tessellations, Centroidal Voronoi Tessellations and Voronoi TreeMaps. In this post I&#8217;ll explain what a Voronoi Tessellation is, what can it be used for, and also I&#8217;ll describe an interesting algorithm for creating a Voronoi Tessellation given a set of points [...]]]></description>
			<content:encoded><![CDATA[<p>This is going to be the first of a couple of posts related to Voronoi Tessellations, Centroidal Voronoi Tessellations and Voronoi TreeMaps. In this post I&#8217;ll explain what a Voronoi Tessellation is, what can it be used for, and also I&#8217;ll describe an interesting algorithm for creating a Voronoi Tessellation given a set of points (or sites as I&#8217;ll call them from now on).</p>
<h4>What is a Voronoi Tessellation?</h4>
<p><img src="/wp-content/voronoitessellation.png" style="border: 1px solid cyan; padding: 3px; margin: 5px 13px 5px 0pt; float: left;" /></p>
<p>Given a set <em>P := {p1, &#8230;, pn}</em> of sites, a Voronoi Tessellation is a subdivision of the space into <em>n cells</em>, one for each site in <em>P</em>, with the property that a point <em>q</em> lies in the cell corresponding to a site <em>pi</em> iff <em>d(pi, q) < d(pj, q)</em> for <em>i</em> distinct from <em>j</em>. The segments in a Voronoi Tessellation correspond to all points in the plane equidistant to the two nearest sites.<br />
Voronoi Tessellations have <a href="http://en.wikipedia.org/wiki/Voronoi_diagram#Applications">applications</a> in computer science, chemistry, etc. but I&#8217;m most interested in Voronoi Diagrams for constructing Voronoi TreeMaps (more on that in later posts).</p>
<h4>How do I create a Voronoi Tessellation?</h4>
<p>One algorithm for creating Voronoi Tessellations was discovered by <a href="http://ect.bell-labs.com/who/sjf/">Steven Fortune</a> in 1986. </p>
<p>This algorithm is described as a plane sweep algorithm. Fortune&#8217;s Algorithm maintains both a <em>sweep line</em> (in red) and a <em>beach line</em> (in black) which move through the plane as the algorithm progresses. </p>
<p><img src="/wp-content/Fortunes-algorithm.gif" style="border: 1px solid cyan; padding: 3px; margin-left:100px;" /></p>
<p>The structures used in this algorithm are an EventQueue, EdgeList and a binary Tree that tracks the state of the beach line.</p>
<p>The EventQueue stores two distinct type of events that are related to changes in the beach line. These events happen when:</p>
<ul>
<li>A site <em>s</em> crosses the sweep line: in this case a new parabola with minimum at <em>s</em> is added to the beach line. A Voronoi Edge is born.</li>
<li>A circle that touches three sites staying behind the sweep line is found and is tangent to the sweep line (see image below). A Voronoi Vertex is found.</li>
</ul>
<p><img src="/wp-content/fort2.png" style="border: 1px solid cyan; padding: 3px; margin: 7px auto; clear:both;" /></p>
<p>At each of these stages the EdgeList is updated until the algorithm is completed.</p>
<h4>Implementations</h4>
<p>I haven&#8217;t found any interesting implementation of this algorithm in JavaScript. Actually, I didn&#8217;t find a working implementation of this algorithm in JavaScript. There&#8217;s <a href="http://www.raymondhill.net/voronoi/voronoi.php">this version</a> of a JavaScript applet for making Voronoi Tessellations, but it doesn&#8217;t seem to work right (the corners of the image generally hold two or more sites in the same cell). Also, the code was based in a C# implementation and <a href="http://www.raymondhill.net/voronoi/voronoi.js">isn&#8217;t very pretty</a>. Then there&#8217;s <a href="http://jtauber.com/blog/2008/11/27/voronoi_canvas_tutorial_part_i/">this blog</a> that mentions the algorithm but there&#8217;s no visible implementation, just a JQuery demo that animates parabolas when a mouse crosses a site, but no Voronoi Diagram.</p>
<p>So I made my own implementation, which I tried to make as similar as possible to the original C implementation from Steven Fortune. If you click on the image you can <a href="/wp-content/voronoijs/voronoi.html">see it in action</a>. Just refresh the page for new Voronoi Tessellations of random positioned sites.</p>
<p><a href="/wp-content/voronoijs/voronoi.html" style="text-decoration:none;"><br />
<img src="/wp-content/voronoiimpl.png" style="border: 1px solid cyan; padding: 3px; margin: 7px auto; clear:both;" /><br />
</a> </p>
<p>Any comments or advices about how to make this implementation better are welcomed!</p>
<img src="http://feeds.feedburner.com/~r/Noumena/~4/EU3Tx97R2gw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/02/12/voronoi-tessellation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.thejit.org/2010/02/12/voronoi-tessellation/</feedburner:origLink></item>
	</channel>
</rss>
