1. Sumin Byeon
  2. finance

Commits

Sumin Byeon  committed ce61802

Wider zoom range. Default colors.

  • Participants
  • Parent commits 3c67eb4
  • Branches default

Comments (0)

Files changed (1)

File map.html

View file
  • Ignore whitespace
     <script type="text/javascript+protovis">
 
     var colors = {
-      "Food & Dining": { light: "rgba(217, 0, 0, .8)", dark: "rgb(163, 0, 0)" },
+      "Food & Dining": { light: "rgba(225, 0, 0, .8)", dark: "rgb(255, 0, 0)" },
       "Shopping": { light: "rgba(35, 150, 94, .8)", dark: "rgb(26, 112, 70)" },
       "Grocery": { light: "rgba(52, 137, 186, .8)", dark: "rgb(39, 103, 139)" },
       "Telecommunication": { light: "rgba(178, 48, 206, .8)", dark: "rgb(168, 38, 196)" },
       "Transportation": { light: "rgba(40, 40, 40, .8)", dark: "rgb(30, 30, 30)" },
-      "Entertainment": { light: "rgba(229, 231, 51, .8)", dark: "rgb(219, 221, 21)" },
+      "Entertainment": { light: "rgba(180, 0, 255, .8)", dark: "rgb(170, 0, 245)" },
       "Housing": { light: "rgba(52, 137, 186, .8)", dark: "rgb(39, 103, 139)" },
       "Utilities" : { light: "rgba(52, 137, 186, .8)", dark: "rgb(39, 103, 139)" },
+      "Default" : { light: "rgba(160, 160, 160, .8)", dark: "rgb(150, 150, 150)" },
     };
     
     function Canvas(data) {
         .add(pv.Dot)
           .left(function() pixels[this.parent.index].x)
           .top(function() pixels[this.parent.index].y)
-          .strokeStyle(function(x, d) colors[d.category].dark)
-          .fillStyle(function(x, d) colors[d.category].light)
+          .strokeStyle(function(x, d) { if(colors[d.category]) return colors[d.category].dark; else return colors['Default'].dark; } )
+          .fillStyle(function(x, d) { if(colors[d.category] != null) return colors[d.category].light; else return colors['Default'].light; } )
           .size(function(x, d) Math.abs(d.amount)/5+15)
         .anchor("center").add(pv.Label)
           .textStyle("white")
     };
     
     /* Restrict minimum and maximum zoom levels. */
-    G_NORMAL_MAP.getMinimumResolution = function() 11;
-    G_NORMAL_MAP.getMaximumResolution = function() 14;
+    G_NORMAL_MAP.getMinimumResolution = function() 2;
+    G_NORMAL_MAP.getMaximumResolution = function() 17;
     
     var map = new GMap2(document.getElementById("map"));
     map.setCenter(new GLatLng(32.237198,-110.926208), 12);