Permalink
Browse files

fix ordering to look more like old flame graphs

brighten colors
  • Loading branch information...
1 parent 3196ec5 commit 37d85ed8edc0da2316aa163b0051c51265bedffa @davepacheco davepacheco committed May 7, 2012
Showing with 11 additions and 3 deletions.
  1. +11 −3 lib/www/icicle.js
View
14 lib/www/icicle.js
@@ -11,7 +11,7 @@ var svCornerPixels = 5; /* radius of rounded corners */
var svTextPaddingLeft = 5; /* padding-left on rectangle labels */
var svTextPaddingRight = 10; /* pading-right on rectangle labels */
var svTextPaddingTop = '1.2em'; /* padding-top on rectangle labels */
-var svColorMode = 'flame'; /* coloring mode */
+var svColorMode = 'bymodule'; /* coloring mode */
var svMaxDepth = 0; /* maximum depth of data object */
var svDepthSamples = []; /* # of samples at each depth */
@@ -55,7 +55,15 @@ function svInit()
svPartition = d3.layout.partition().children(function (d) {
var rv = d3.entries(d.value.svChildren);
return (rv);
- }).value(function (d) { return (d.value.svTotal); });
+ })
+ .value(function (d) { return (d.value.svTotal); })
+ .sort(function (d1, d2) {
+ if (d1.data.key < d2.data.key)
+ return (-1);
+ if (d1.data.key > d2.data.key)
+ return (1);
+ return (0);
+ });
if (svColorMode == 'random') {
svColorScale = d3.scale.category20c();
@@ -183,7 +191,7 @@ function svColorFlame(d)
{
var h = 0, hplus = 60;
var s = 30, splus = 70;
- var v = 80, vplus = 20;
+ var v = 95, vplus = 5;
var depth = d.depth;
var hratio = depth / svMaxDepth;

0 comments on commit 37d85ed

Please sign in to comment.