<?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>Overfloater &#187; 1.1</title>
	<atom:link href="http://blog.thejit.org/category/11/feed/" rel="self" type="application/rss+xml" />
	<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>
			<item>
		<title>JavaScript InfoVis Toolkit Customizations</title>
		<link>http://blog.thejit.org/2010/02/24/javascript-infovis-toolkit-customizations/</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>
]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2010/02/24/javascript-infovis-toolkit-customizations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version 1.1.3</title>
		<link>http://blog.thejit.org/2009/08/24/version-113/</link>
		<comments>http://blog.thejit.org/2009/08/24/version-113/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 17:44:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[1.1]]></category>
		<category><![CDATA[JavaScript information visualization toolkit (JIT)]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[1.1.3]]></category>
		<category><![CDATA[JIT]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=1065</guid>
		<description><![CDATA[I just tagged the JavaScript InfoVis Toolkit with version 1.1.3. It&#8217;s been some time since the last release, and I wanted to use this post to make a summary of the changes and to describe some of the new features that have been added to the library.
I&#8217;ll start with the new features:
SpaceTree: SwitchAlignment
I added some [...]]]></description>
			<content:encoded><![CDATA[<p>I just <a href="http://github.com/philogb/jit">tagged</a> the <a href="http://thejit.org">JavaScript InfoVis Toolkit</a> with version 1.1.3. It&#8217;s been some time since the last release, and I wanted to use this post to make a summary of the changes and to describe some of the new features that have been added to the library.</p>
<p>I&#8217;ll start with the new features:</p>
<h4 id="spacetree-switchalignment">SpaceTree: SwitchAlignment</h4>
<p>I added some new global configuration properties to the SpaceTree: <em>align</em> and <em>indent</em>.</p>
<p><em>Align</em> sets the alignment of the tree to <em>center</em>, <em>left</em> and <em>right</em>:</p>
<p><img src="/wp-content/spacetree-center.png" style="border: 1px solid cyan; margin: 7px auto; padding: 1px;" /><br />
<img src="/wp-content/spacetree-left.png" style="border: 1px solid cyan; margin: 7px auto; padding: 1px;" /><br />
<img src="/wp-content/spacetree-right.png" style="border: 1px solid cyan; margin: 7px auto; padding: 1px;" /></p>
<p>The <em>indent</em> parameter sets an offset between a parent and its children when the alignment is <em>left</em> or <em>right</em>. You can also use the <a href="http://thejit.org/docs/files/Spacetree-js.html#ST.switchAlignment">switchAlignment</a> method for changing the alignment of the tree with an animation.</p>
<h4 id="spacetree-multiple-nodes">SpaceTree: Multiple nodes in path</h4>
<p>I added two new methods to the SpaceTree: <a href="http://thejit.org/docs/files/Spacetree-js.html#ST.addNodeInPath">addNodeInPath</a> and <a href="http://thejit.org/docs/files/Spacetree-js.html#ST.clearNodesInPath">clearNodesInPath</a>.<br />
These two methods allow you to add a node to the &#8220;selected-nodes&#8221; path. When a node belongs to the &#8220;selected-nodes&#8221; path it remains always visible (as in always expanded).</p>
<p>I made this small video to show the feature:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/wGwyQVFYeV4&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wGwyQVFYeV4&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<h4 id="spacetree-multitree">SpaceTree: MultiTree</h4>
<p>I added a SpaceTree configuration property called <em>multitree</em>.<br />
If <em>multitree=true</em>, the visualization will search for the <em>$orn</em> data property in each node and display the subtrees according to their orientation.</p>
<p>In this example I set <em>multitree=true</em> and set <em>$orn=&#8217;left&#8217;</em> for some nodes and <em>$orn=&#8217;right&#8217;</em> for others. This way I create a partition of the tree:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/6BxJDfJ3w2o&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/6BxJDfJ3w2o&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>I also use the <a href="http://thejit.org/docs/files/Spacetree-js.html#ST.setRoot">setRoot</a> method to set the clicked node as root for the visualization. This way the clicked node is centered and a centrifugal view from that node is drawn.</p>
<h4>Bug Fixes</h4>
<p>I&#8217;ve been fixing a couple of bugs also, most of them have to do with Treemaps:</p>
<ul>
<li><a href="http://github.com/philogb/jit/issues/closed#issue/8">Refreshing treemaps keeps old tooltips over</a> <em>(Thanks <a href="http://github.com/arielkempf">Ariel Kempf</a>)</em></li>
<li><a href="http://github.com/philogb/jit/issues/closed#issue/6">Treemap: change box filling order from towards top right, to towards bottom right</a> <em>(Thanks <a href="http://github.com/timbunce">Tim Bunce</a>)</em></li>
<li><a href="http://github.com/philogb/jit/issues/closed#issue/5">Treemap: patch to fix gaps between boxes</a> <em>(Thanks <a href="http://github.com/timbunce">Tim Bunce</a>)</em></li>
<li><a href="http://github.com/philogb/jit/issues/closed#issue/4">Treemap: avoid creating boxes too small to see</a> <em>(Thanks <a href="http://github.com/timbunce">Tim Bunce</a>)</em></li>
<li><a href="http://github.com/philogb/jit/issues/closed#issue/3">Add a boolean to the fx.clearLabels method for clearing all labels regardless of any condition.</a></li>
</ul>
<p>I also want to thank <a href="http://weltermann17.wordpress.com/">Guido Schmidt</a> for his interest in the library and work on the GWT JIT component.</p>
<p>There&#8217;s also been some JIT development for <a href="http://grails.org/plugin/jit">Grails</a> done by <a href="http://www.odelia-technologies.com/">Bertrand Goetzmann</a>.</p>
<p>Anyway, things are looking good! <img src='http://blog.thejit.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2009/08/24/version-113/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The JavaScript InfoVis Toolkit 1.1 is Out!</title>
		<link>http://blog.thejit.org/2009/06/02/the-javascript-infovis-toolkit-11-is-out/</link>
		<comments>http://blog.thejit.org/2009/06/02/the-javascript-infovis-toolkit-11-is-out/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 22:53:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[1.1]]></category>
		<category><![CDATA[JavaScript information visualization toolkit (JIT)]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[information visualization]]></category>
		<category><![CDATA[JIT]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.thejit.org/?p=891</guid>
		<description><![CDATA[After several months of hard work I can finally announce version 1.1 of the JavaScript InfoVis Toolkit.
What&#8217;s the JavaScript InfoVis Toolkit?
The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web.
What&#8217;s new in this version?

A new project page where you can access all things related to this library: documentation, demos, tutorials, this [...]]]></description>
			<content:encoded><![CDATA[<p>After several months of hard work I can finally announce version 1.1 of the <a href="http://thejit.org">JavaScript InfoVis Toolkit</a>.</p>
<h4>What&#8217;s the JavaScript InfoVis Toolkit?</h4>
<p>The <a href="http://thejit.org">JavaScript InfoVis Toolkit</a> provides tools for creating Interactive Data Visualizations for the Web.</p>
<h4>What&#8217;s new in this version?</h4>
<ul>
<li>A new <a href="http://thejit.org">project page</a> where you can access all things related to this library: <a href="http://thejit.org/docs/files/Core-js.html">documentation</a>, <a href="http://thejit.org">demos</a>, tutorials, <a href="http://blog.thejit.org">this blog</a>, etc.</li>
<li>A complete <a href="http://thejit.org/docs/files/Core-js.html">API documentation</a> generated with Natural Docs, with some Narrative Documentation and Syntax Highlighted Code Examples.</li>
<li>A <a href="http://thejit.org/demos">Demos</a> page where you can find some interactive library examples and you can browse through the examples code.</li>
<li>The <a href="http://thejit.org">JavaScript InfoVis Toolkit</a> is now hosted at <a href="http://github.com/philogb/jit/tree/master">GitHub</a>, so you can fork it and do whatever you like with it. You can also report bugs with the new <a href="http://github.com/philogb/jit/issues">issue tracker.</a></li>
</ul>
<p><b>Code-Related</b></p>
<ul>
<li>The library has been split into <a href="http://github.com/philogb/jit/tree/85ffb5383a3d1adf675e62d139011f96a1793999/Source"><b>modules</b></a> for code reuse.</li>
<li>All visualizations are packaged in the same file. You can create multiple instances of any visualization. Moreover, you can <b>combine</b> and <b>compose</b> visualizations. If you want to know more take a look at the <em>Advanced</em> <a href="http://thejit.org/demos">Demos</a>.</li>
<li>
This Toolkit is <b>library agnostic</b>. This means that you can combine this toolkit with your favorite DOM/Events/Ajax framework such as Prototype, MooTools, ExtJS, YUI, JQuery, etc.
</li>
<li>
You can <b>extend</b> this library in many ways by adding or overriding class methods. The JavaScript InfoVis Toolkit has a robust (and private) class system, heavily inspired by MooTools&#8217;, that allows you to implement new methods in the same class without having to define any new Class extension. By creating mutable classes you can add new custom Node and Edge rendering functions pretty easily.
</li>
<li>
<b>Custom</b> visualizations are created by adding or changing Node/Edge colors, shapes, rendering functions, etc. You can also implement many controller methods that are triggered at different stages of the animation, like <em>onBefore/AfterPlotLine</em>, <em>onBefore/AfterCompute</em>, <em>onBefore/AfterPlotNode</em>, <em>request</em>, etc.<br />
You can also add new Animation transitions like <em>Elastic</em> or <em>Back</em> with <em>easeIn/Out</em> transitions.<br />
If you want to know more about these features please take a look at the <a href="http://thejit.org/demos">Demos</a> code.
</li>
</ul>
<p>As you can see, this new version has been built with four concepts/goals in mind: Modularity, Customization, Composition and Extensibility. I already explained some of these things in the <a href="http://blog.thejit.org/2009/05/21/more-about-the-javascript-infovis-toolkit-11/">previous post</a>.</p>
<p>Hope you enjoy it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thejit.org/2009/06/02/the-javascript-infovis-toolkit-11-is-out/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>
