Permalink
Browse files

website update

  • Loading branch information...
1 parent d1b4710 commit 707785614fc72cbeba3a3716b5d99a25bc94b541 @gka gka committed Feb 17, 2013
View
@@ -8,7 +8,7 @@
---
<div class="alert">
- Writing documentation (and keeping it up to date) is a lot of work. <b>You can help</b> improving this documentation by <a href="https://github.com/kartograph/kartograph.org/issues/new">submitting any bug</a> you encounter, or, even better, by patching
+ Writing documentation (and keeping it up to date) is a lot of work. <b>You can help</b> improving it by <a href="https://github.com/kartograph/kartograph.org/issues/new">submitting any bug</a> you encounter, or, even better, by directly patching
<a href="https://github.com/kartograph/kartograph.org/blob/master{{ page.url | replace:'html','md' }}">this page on Github</a>. Thanks!
</div>
@@ -17,6 +17,10 @@
- ['/showcase/eastcoast', 'High-res vector mapping']
---
+<script type="text/javascript" src="/js/jquery.min.js"></script>
+<script type="text/javascript" src="/js/raphael.min.js"></script>
+<script type="text/javascript" src="/js/kartograph.min.js"></script>
+
<h1>{{ page.title }}</h1>
{{ content }}
View
@@ -5747,7 +5747,14 @@ function kdtree() {
};
PieChart.prototype.nodes = function() {
- return [me.path.node];
+ var el, _i, _len, _ref6, _results;
+ _ref6 = me.chart;
+ _results = [];
+ for (_i = 0, _len = _ref6.length; _i < _len; _i++) {
+ el = _ref6[_i];
+ _results.push(el.node);
+ }
+ return _results;
};
return PieChart;
@@ -5820,55 +5827,6 @@ function kdtree() {
};
/*
-
- drawPieChart = function (cx, cy, r, values, labels, colors, stroke) {
- var paper = this,
- rad = Math.PI / 180,
- chart = this.set();
- function sector(cx, cy, r, startAngle, endAngle, params) {
- var x1 = cx + r * Math.cos(-startAngle * rad),
- x2 = cx + r * Math.cos(-endAngle * rad),
- y1 = cy + r * Math.sin(-startAngle * rad),
- y2 = cy + r * Math.sin(-endAngle * rad);
- return paper.path(["M", cx, cy, "L", x1, y1, "A", r, r, 0, +(endAngle - startAngle > 180), 0, x2, y2, "z"]).attr(params);
- }
- var angle = -270,
- total = 0,
- start = 1,
- process = function (j) {
- var value = values[j],
- angleplus = 360 * value / total,
- popangle = angle + (angleplus / 2),
- color = colors[j],
- ms = 500,
- delta = 30,
- bcolor = Raphael.hsb(start, .6, 1),
- p = sector(cx, cy, r, angle, angle + angleplus, {fill: color, stroke: stroke, "stroke-width": 1}),
- txt = paper.text(cx + (r*1.5) * Math.cos(-popangle * rad), cy + (r *1.5) * Math.sin(-popangle * rad), labels[j]).attr({fill: "#000", stroke: "none", opacity: 0, "font-size": 13});
- p.mouseover(function () {
- p.stop().animate({transform: "s1.1 1.1 " + cx + " " + cy}, ms, "elastic");
- txt.stop().animate({opacity: 1}, ms, "elastic");
- }).mouseout(function () {
- p.stop().animate({transform: ""}, ms, "elastic");
- txt.stop().animate({opacity: 0}, ms);
- });
- angle += angleplus;
- chart.push(p);
- chart.push(txt);
- start -= .4;
- };
- for (var i = 0, ii = values.length; i < ii; i++) {
- total += values[i];
- }
- for (i = ii-1; i >= 0; i--) {
- process(i);
- }
- return chart;
- };
- */
-
-
- /*
kartograph - a svg mapping library
Copyright (C) 2011,2012 Gregor Aisch
@@ -5935,14 +5893,14 @@ drawStackedBars = function (cx, cy, w, h, values, labels, colors, stroke) {
__extends(StackedBarChart, _super);
/*
- usage:
- new SymbolMap({
- map: map,
- radius: 10
- data: [25,75],
- colors: ['red', 'blue'],
- titles: ['red pie', 'blue pie']
- })
+ usage:
+ new SymbolMap({
+ map: map,
+ radius: 10
+ data: [25,75],
+ colors: ['red', 'blue'],
+ titles: ['red pie', 'blue pie']
+ })
*/
@@ -6025,9 +5983,15 @@ drawStackedBars = function (cx, cy, w, h, values, labels, colors, stroke) {
};
StackedBarChart.prototype.nodes = function() {
- var me;
+ var el, me, _i, _len, _ref6, _results;
me = this;
- return [me.path.node];
+ _ref6 = me.chart;
+ _results = [];
+ for (_i = 0, _len = _ref6.length; _i < _len; _i++) {
+ el = _ref6[_i];
+ _results.push(el.node);
+ }
+ return _results;
};
return StackedBarChart;
Oops, something went wrong.
@@ -1,14 +1,8 @@
---
layout: showcase
title: Animated Symbols
-prev: dotgrid
-next: 3d
---
-<script type="text/javascript" src="/js/jquery.min.js"></script>
-<script type="text/javascript" src="/js/raphael.min.js"></script>
-<script type="text/javascript" src="/js/kartograph.min.js"></script>
-
<script type="text/javascript">
$(function() {
@@ -1,94 +0,0 @@
----
-layout: showcase
-title: Bubble Map
-prev: dotgrid
-next: 3d
----
-
-<script type="text/javascript">
-$script.ready(['jquery', 'kartograph'], function() {
-
- $(function() {
- var map, c, scale, updateMap, symbols;
-
- c = $('#map');
- c.height(c.width()*.65);
-
- map = window.m = $K.map('#map');
-
- map.loadMap('map-usa.svg', function() {
- map.addLayer('usa');
-
- $.getJSON('us-crime-cities.json', function(crimeCities) {
-
- $.each(crimeCities, function(i,city) {
- $.each(['ViolentCrime','Rape','Murder'], function(i,prop) {
- $.each(['2011','2010'], function(i,yr) {
- city[prop+yr+'Rate'] = city[prop+yr] / city.Population;
- });
- });
- });
-
- updateMap = function() {
-
- var prop = $('.dataset.btn-primary').data('val')
- + $('.year.btn-primary').html()
- + $('.type.btn-primary').data('val'),
-
- maxRad = $('.type.btn-primary').data('maxrad');
-
- scale = $K.scale.linear(crimeCities, prop);
-
- if (symbols) symbols.remove();
-
- symbols = new $K.SymbolGroup({
- map: map,
- data: crimeCities,
- location: function(d) { return d.ll },
- type: $K.Bubble,
- radius: function(d) { return Math.sqrt(scale(d[prop]))*maxRad }
- });
- }
-
- updateMap();
-
- });
- });
-
- $('.btn').click(function(event) {
- var tgt = $(event.target), par = tgt.parent();
- $('.btn', par).removeClass('btn-primary');
- tgt.addClass('btn-primary');
- updateMap();
- });
- });
-});
-</script>
-<link href="style.css" rel="stylesheet" />
-<div class="row">
-
- <div class="span9">
- <div id="map"></div>
- </div>
-
- <div class="span3">
- <h1>Bubble Map</h1>
- <p>This map shows selected crime data in US cities. You can choose between showing actual quantities of incidents or the rates.</p>
- </p>
- <h3>Dataset</h3>
- <p>
- <a class="dataset btn btn-primary" data-val="ViolentCrime">Violence</a>
- <a class="dataset btn" data-val="Rape">Rape</a>
- <a class="dataset btn" data-val="Murder">Murder</a>
- </p>
- <p>
- <a class="year btn btn-primary">2011</a>
- <a class="year btn">2010</a>
- </p>
- <p>
- <a class="type btn btn-primary" data-val="" data-maxrad="50">Quantity</a>
- <a class="type btn" data-val="Rate" data-maxrad="20">Density</a>
- </p>
-
- </div>
-</div>
Oops, something went wrong.

0 comments on commit 7077856

Please sign in to comment.