├── src
├── js
│ └── components
│ │ ├── d3
│ │ ├── .gitmodules
│ │ ├── src
│ │ │ ├── geo
│ │ │ │ ├── geo.js
│ │ │ │ ├── albers.js
│ │ │ │ ├── compose.js
│ │ │ │ ├── equirectangular.js
│ │ │ │ ├── gnomonic.js
│ │ │ │ ├── orthographic.js
│ │ │ │ ├── spherical.js
│ │ │ │ ├── stereographic.js
│ │ │ │ ├── azimuthal-equal-area.js
│ │ │ │ ├── conic.js
│ │ │ │ ├── azimuthal-equidistant.js
│ │ │ │ ├── distance.js
│ │ │ │ ├── path-bounds.js
│ │ │ │ ├── azimuthal.js
│ │ │ │ ├── transverse-mercator.js
│ │ │ │ ├── index.js
│ │ │ │ ├── conic-equal-area.js
│ │ │ │ ├── conic-equidistant.js
│ │ │ │ ├── cartesian.js
│ │ │ │ ├── conic-conformal.js
│ │ │ │ ├── path-area.js
│ │ │ │ ├── greatArc.js
│ │ │ │ ├── interpolate.js
│ │ │ │ ├── path-context.js
│ │ │ │ ├── length.js
│ │ │ │ └── mercator.js
│ │ │ ├── svg
│ │ │ │ ├── svg.js
│ │ │ │ ├── index.js
│ │ │ │ ├── area-radial.js
│ │ │ │ ├── line-radial.js
│ │ │ │ ├── diagonal-radial.js
│ │ │ │ └── diagonal.js
│ │ │ ├── end.js
│ │ │ ├── geom
│ │ │ │ ├── geom.js
│ │ │ │ ├── index.js
│ │ │ │ └── delaunay.js
│ │ │ ├── core
│ │ │ │ ├── noop.js
│ │ │ │ ├── true.js
│ │ │ │ ├── identity.js
│ │ │ │ ├── index.js
│ │ │ │ ├── source.js
│ │ │ │ ├── target.js
│ │ │ │ ├── document.js
│ │ │ │ ├── functor.js
│ │ │ │ ├── class.js
│ │ │ │ ├── vendor.js
│ │ │ │ ├── ns.js
│ │ │ │ ├── rebind.js
│ │ │ │ └── array.js
│ │ │ ├── layout
│ │ │ │ ├── layout.js
│ │ │ │ ├── index.js
│ │ │ │ └── partition.js
│ │ │ ├── behavior
│ │ │ │ ├── behavior.js
│ │ │ │ └── index.js
│ │ │ ├── selection
│ │ │ │ ├── index.js
│ │ │ │ ├── empty.js
│ │ │ │ ├── size.js
│ │ │ │ ├── datum.js
│ │ │ │ ├── call.js
│ │ │ │ ├── remove.js
│ │ │ │ ├── node.js
│ │ │ │ ├── html.js
│ │ │ │ ├── text.js
│ │ │ │ ├── order.js
│ │ │ │ ├── each.js
│ │ │ │ ├── sort.js
│ │ │ │ ├── append.js
│ │ │ │ ├── transition.js
│ │ │ │ ├── insert.js
│ │ │ │ ├── filter.js
│ │ │ │ ├── selectAll.js
│ │ │ │ ├── enter-select.js
│ │ │ │ ├── enter.js
│ │ │ │ ├── select.js
│ │ │ │ └── property.js
│ │ │ ├── transition
│ │ │ │ ├── index.js
│ │ │ │ ├── remove.js
│ │ │ │ ├── text.js
│ │ │ │ ├── delay.js
│ │ │ │ ├── ease.js
│ │ │ │ ├── duration.js
│ │ │ │ ├── filter.js
│ │ │ │ ├── each.js
│ │ │ │ ├── subtransition.js
│ │ │ │ ├── tween.js
│ │ │ │ ├── select.js
│ │ │ │ └── selectAll.js
│ │ │ ├── compat
│ │ │ │ ├── index.js
│ │ │ │ ├── date.js
│ │ │ │ └── style.js
│ │ │ ├── math
│ │ │ │ ├── index.js
│ │ │ │ ├── number.js
│ │ │ │ ├── trigonometry.js
│ │ │ │ ├── random.js
│ │ │ │ └── adder.js
│ │ │ ├── dsv
│ │ │ │ ├── index.js
│ │ │ │ ├── csv.js
│ │ │ │ └── tsv.js
│ │ │ ├── start.js
│ │ │ ├── format
│ │ │ │ ├── collapse.js
│ │ │ │ ├── index.js
│ │ │ │ ├── format-localized.js
│ │ │ │ ├── round.js
│ │ │ │ ├── requote.js
│ │ │ │ ├── format-locale.js
│ │ │ │ └── formatPrefix.js
│ │ │ ├── xhr
│ │ │ │ ├── index.js
│ │ │ │ ├── text.js
│ │ │ │ ├── xml.js
│ │ │ │ ├── json.js
│ │ │ │ └── html.js
│ │ │ ├── arrays
│ │ │ │ ├── merge.js
│ │ │ │ ├── ascending.js
│ │ │ │ ├── descending.js
│ │ │ │ ├── transpose.js
│ │ │ │ ├── keys.js
│ │ │ │ ├── values.js
│ │ │ │ ├── entries.js
│ │ │ │ ├── permute.js
│ │ │ │ ├── shuffle.js
│ │ │ │ ├── quantile.js
│ │ │ │ ├── median.js
│ │ │ │ ├── sum.js
│ │ │ │ ├── zip.js
│ │ │ │ ├── mean.js
│ │ │ │ ├── index.js
│ │ │ │ ├── max.js
│ │ │ │ ├── min.js
│ │ │ │ ├── extent.js
│ │ │ │ ├── range.js
│ │ │ │ ├── bisect.js
│ │ │ │ ├── set.js
│ │ │ │ └── map.js
│ │ │ ├── event
│ │ │ │ ├── index.js
│ │ │ │ ├── touches.js
│ │ │ │ ├── drag.js
│ │ │ │ └── mouse.js
│ │ │ ├── color
│ │ │ │ ├── index.js
│ │ │ │ ├── color.js
│ │ │ │ ├── xyz.js
│ │ │ │ └── hcl.js
│ │ │ ├── scale
│ │ │ │ ├── sqrt.js
│ │ │ │ ├── bilinear.js
│ │ │ │ ├── index.js
│ │ │ │ ├── scale.js
│ │ │ │ ├── polylinear.js
│ │ │ │ ├── nice.js
│ │ │ │ ├── identity.js
│ │ │ │ ├── threshold.js
│ │ │ │ ├── quantize.js
│ │ │ │ ├── quantile.js
│ │ │ │ └── pow.js
│ │ │ ├── interpolate
│ │ │ │ ├── number.js
│ │ │ │ ├── round.js
│ │ │ │ ├── index.js
│ │ │ │ ├── uninterpolate.js
│ │ │ │ ├── lab.js
│ │ │ │ ├── rgb.js
│ │ │ │ ├── array.js
│ │ │ │ ├── object.js
│ │ │ │ ├── hcl.js
│ │ │ │ ├── hsl.js
│ │ │ │ └── interpolate.js
│ │ │ ├── time
│ │ │ │ ├── index.js
│ │ │ │ ├── format-locale.js
│ │ │ │ ├── month.js
│ │ │ │ ├── year.js
│ │ │ │ ├── minute.js
│ │ │ │ ├── second.js
│ │ │ │ ├── hour.js
│ │ │ │ ├── format-iso.js
│ │ │ │ ├── day.js
│ │ │ │ ├── format-utc.js
│ │ │ │ ├── format-localized.js
│ │ │ │ └── week.js
│ │ │ └── d3.js
│ │ ├── test
│ │ │ ├── data
│ │ │ │ ├── sample.txt
│ │ │ │ ├── sample.csv
│ │ │ │ ├── sample.tsv
│ │ │ │ ├── sample.json
│ │ │ │ ├── sample.html
│ │ │ │ └── sample.xml
│ │ │ ├── geo
│ │ │ │ ├── clip-view-mock.js
│ │ │ │ ├── area-benchmark.js
│ │ │ │ ├── point-in-polygon-mock.js
│ │ │ │ ├── distance-test.js
│ │ │ │ ├── interpolate-test.js
│ │ │ │ ├── projection-test-suite.js
│ │ │ │ ├── greatArc-test.js
│ │ │ │ └── rotation-test.js
│ │ │ ├── core
│ │ │ │ ├── version-test.js
│ │ │ │ └── functor-test.js
│ │ │ ├── time
│ │ │ │ ├── dayOfYear-test.js
│ │ │ │ ├── time.js
│ │ │ │ └── format-iso-test.js
│ │ │ ├── interpolate
│ │ │ │ ├── round-test.js
│ │ │ │ ├── number-test.js
│ │ │ │ ├── array-test.js
│ │ │ │ └── rgb-test.js
│ │ │ ├── event
│ │ │ │ ├── mouse-test.html
│ │ │ │ └── touch-test.html
│ │ │ ├── math
│ │ │ │ ├── transform-null-test.html
│ │ │ │ ├── transform-null-matrix-test.html
│ │ │ │ ├── random-test.js
│ │ │ │ └── transform-rotate-origin-test.html
│ │ │ ├── layout
│ │ │ │ ├── pie-test.js
│ │ │ │ ├── hierarchy-test.js
│ │ │ │ ├── tree-test.js
│ │ │ │ └── cluster-test.js
│ │ │ ├── transition
│ │ │ │ ├── transition-test-id.js
│ │ │ │ ├── transition-test-text.js
│ │ │ │ ├── transition-test-call.js
│ │ │ │ ├── transition-test-size.js
│ │ │ │ ├── transition-test-node.js
│ │ │ │ └── transition-test-time.js
│ │ │ ├── arrays
│ │ │ │ ├── keys-test.js
│ │ │ │ ├── merge-test.js
│ │ │ │ ├── values-test.js
│ │ │ │ ├── zip-test.js
│ │ │ │ ├── transpose-test.js
│ │ │ │ └── entries-test.js
│ │ │ ├── selection
│ │ │ │ ├── enter-test.js
│ │ │ │ ├── order-test.js
│ │ │ │ ├── remove-test.js
│ │ │ │ └── selection-test.js
│ │ │ ├── xhr
│ │ │ │ ├── html-test.js
│ │ │ │ ├── text-test.js
│ │ │ │ └── xml-test.js
│ │ │ └── XMLHttpRequest.js
│ │ ├── .gitignore
│ │ ├── .npmignore
│ │ ├── .travis.yml
│ │ ├── index-browserify.js
│ │ ├── bin
│ │ │ ├── start
│ │ │ ├── component
│ │ │ ├── uglify
│ │ │ └── locale
│ │ ├── lib
│ │ │ ├── science
│ │ │ │ ├── science.lin.min.js
│ │ │ │ ├── science.lin.js
│ │ │ │ └── LICENSE
│ │ │ ├── geographiclib
│ │ │ │ └── LICENSE
│ │ │ ├── jit
│ │ │ │ └── LICENSE
│ │ │ └── polymaps
│ │ │ │ └── LICENSE
│ │ ├── index.js
│ │ ├── README.md
│ │ ├── globals.js
│ │ ├── Makefile
│ │ ├── package.json
│ │ ├── component.json
│ │ └── LICENSE
│ │ └── topojson
│ │ ├── lib
│ │ └── topojson
│ │ │ ├── coordinate-systems.js
│ │ │ ├── hash.js
│ │ │ ├── bind.js
│ │ │ ├── cartesian.js
│ │ │ ├── hashtable.js
│ │ │ ├── clockwise.js
│ │ │ └── stitch-poles.js
│ │ ├── src
│ │ ├── component.js
│ │ └── package.js
│ │ ├── examples
│ │ └── README.md
│ │ ├── index.js
│ │ ├── test
│ │ ├── spherical-ringArea-test.js
│ │ ├── assert.js
│ │ ├── hash-test.js
│ │ └── bind-test.js
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── Makefile
│ │ └── LICENSE
├── examples
│ ├── data.csv
│ ├── data.json
│ ├── js
│ │ ├── main.js
│ │ └── app.js
│ ├── amd.html
│ ├── graticule.html
│ └── remote-data.html
├── tests
│ ├── spec
│ │ ├── ClobberSpec.js
│ │ └── PluginSpec.js
│ ├── components
│ │ └── jquery
│ │ │ ├── component.json
│ │ │ └── composer.json
│ ├── src
│ │ └── test.js
│ ├── lib
│ │ ├── runner.js
│ │ └── jasmine-1.2.0
│ │ │ └── MIT.LICENSE
│ ├── SpecRunner_AllGlobal.html
│ └── test_amd.html
├── test.html
└── labels.html
├── .travis.yml
├── .gitignore
├── package.json
├── bower.json
└── LICENSE
/src/js/components/d3/.gitmodules:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/geo.js:
--------------------------------------------------------------------------------
1 | d3.geo = {};
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/svg/svg.js:
--------------------------------------------------------------------------------
1 | d3.svg = {};
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/end.js:
--------------------------------------------------------------------------------
1 | return d3;
2 | })();
3 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geom/geom.js:
--------------------------------------------------------------------------------
1 | d3.geom = {};
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/noop.js:
--------------------------------------------------------------------------------
1 | function d3_noop() {}
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/layout/layout.js:
--------------------------------------------------------------------------------
1 | d3.layout = {};
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/data/sample.txt:
--------------------------------------------------------------------------------
1 | Hello, world!
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/behavior/behavior.js:
--------------------------------------------------------------------------------
1 | d3.behavior = {};
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/index.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/.gitignore:
--------------------------------------------------------------------------------
1 | _site
2 | node_modules
3 | .DS_Store
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/index.js:
--------------------------------------------------------------------------------
1 | import "transition";
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/.npmignore:
--------------------------------------------------------------------------------
1 | examples/
2 | test/
3 | lib/
4 | .DS_Store
5 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/data/sample.csv:
--------------------------------------------------------------------------------
1 | Hello,World
2 | 42,"""fish"""
3 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/data/sample.tsv:
--------------------------------------------------------------------------------
1 | Hello World
2 | 42 """fish"""
3 |
--------------------------------------------------------------------------------
/src/js/components/d3/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.10
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/compat/index.js:
--------------------------------------------------------------------------------
1 | import "date";
2 | import "style";
3 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/math/index.js:
--------------------------------------------------------------------------------
1 | import "random";
2 | import "transform";
3 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/data/sample.json:
--------------------------------------------------------------------------------
1 | [{"Hello": 42, "World": "\"fish\""}]
2 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/true.js:
--------------------------------------------------------------------------------
1 | function d3_true() {
2 | return true;
3 | }
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/identity.js:
--------------------------------------------------------------------------------
1 | function d3_identity(d) {
2 | return d;
3 | }
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/dsv/index.js:
--------------------------------------------------------------------------------
1 | import "dsv";
2 | import "csv";
3 | import "tsv";
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/index.js:
--------------------------------------------------------------------------------
1 | import "functor";
2 | import "ns";
3 | import "rebind";
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/source.js:
--------------------------------------------------------------------------------
1 | function d3_source(d) {
2 | return d.source;
3 | }
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/target.js:
--------------------------------------------------------------------------------
1 | function d3_target(d) {
2 | return d.target;
3 | }
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/dsv/csv.js:
--------------------------------------------------------------------------------
1 | import "dsv";
2 |
3 | d3.csv = d3.dsv(",", "text/csv");
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/behavior/index.js:
--------------------------------------------------------------------------------
1 | import "behavior";
2 | import "drag";
3 | import "zoom";
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/start.js:
--------------------------------------------------------------------------------
1 | d3 = (function(){
2 | var d3 = {version: "3.2.2"}; // semver
3 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/compat/date.js:
--------------------------------------------------------------------------------
1 | if (!Date.now) Date.now = function() {
2 | return +new Date;
3 | };
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/math/number.js:
--------------------------------------------------------------------------------
1 | function d3_number(x) {
2 | return x != null && !isNaN(x);
3 | }
4 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "0.8"
4 |
5 | before_script:
6 | - npm install -g grunt-cli
7 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/dsv/tsv.js:
--------------------------------------------------------------------------------
1 | import "dsv";
2 |
3 | d3.tsv = d3.dsv("\t", "text/tab-separated-values");
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/format/collapse.js:
--------------------------------------------------------------------------------
1 | function d3_collapse(s) {
2 | return s.trim().replace(/\s+/g, " ");
3 | }
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | npm-debug.log
3 | *.sublime-project
4 | *.sublime-workspace
5 | bower_components
6 | rel
7 | tmp
8 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/format/index.js:
--------------------------------------------------------------------------------
1 | import "format";
2 | import "formatPrefix";
3 | import "requote";
4 | import "round";
5 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/xhr/index.js:
--------------------------------------------------------------------------------
1 | import "xhr";
2 | import "text";
3 | import "json";
4 | import "html";
5 | import "xml";
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/merge.js:
--------------------------------------------------------------------------------
1 | d3.merge = function(arrays) {
2 | return Array.prototype.concat.apply([], arrays);
3 | };
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/data/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Hello & world!
5 |
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/data/sample.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/js/components/d3/index-browserify.js:
--------------------------------------------------------------------------------
1 | require("./d3");
2 | module.exports = d3;
3 | (function () { delete this.d3; })(); // unset global
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/ascending.js:
--------------------------------------------------------------------------------
1 | d3.ascending = function(a, b) {
2 | return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
3 | };
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/descending.js:
--------------------------------------------------------------------------------
1 | d3.descending = function(a, b) {
2 | return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
3 | };
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/event/index.js:
--------------------------------------------------------------------------------
1 | import "dispatch";
2 | import "event";
3 | import "mouse";
4 | import "touches";
5 | import "timer";
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/xhr/text.js:
--------------------------------------------------------------------------------
1 | import "xhr";
2 |
3 | d3.text = d3_xhrType(function(request) {
4 | return request.responseText;
5 | });
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/xhr/xml.js:
--------------------------------------------------------------------------------
1 | import "xhr";
2 |
3 | d3.xml = d3_xhrType(function(request) {
4 | return request.responseXML;
5 | });
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/transpose.js:
--------------------------------------------------------------------------------
1 | import "zip";
2 |
3 | d3.transpose = function(matrix) {
4 | return d3.zip.apply(d3, matrix);
5 | };
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/color/index.js:
--------------------------------------------------------------------------------
1 | import "color";
2 | import "rgb";
3 | import "hsl";
4 | import "hcl";
5 | import "lab";
6 | import "xyz";
7 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/empty.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.empty = function() {
4 | return !this.node();
5 | };
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/color/color.js:
--------------------------------------------------------------------------------
1 | function d3_Color() {}
2 |
3 | d3_Color.prototype.toString = function() {
4 | return this.rgb() + "";
5 | };
6 |
--------------------------------------------------------------------------------
/src/examples/data.csv:
--------------------------------------------------------------------------------
1 | id,fillKey,info
2 | NY,Visited,Born here
3 | CA,Visited,Here while writing this code
4 | TX,Visited,Live here
5 | USA,Visited,Home Country
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/keys.js:
--------------------------------------------------------------------------------
1 | d3.keys = function(map) {
2 | var keys = [];
3 | for (var key in map) keys.push(key);
4 | return keys;
5 | };
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/document.js:
--------------------------------------------------------------------------------
1 | var d3_document = document,
2 | d3_documentElement = d3_document.documentElement,
3 | d3_window = window;
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/scale/sqrt.js:
--------------------------------------------------------------------------------
1 | import "pow";
2 | import "scale";
3 |
4 | d3.scale.sqrt = function() {
5 | return d3.scale.pow().exponent(.5);
6 | };
7 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/geo/clip-view-mock.js:
--------------------------------------------------------------------------------
1 | import "../../src/geo/geo";
2 | import "../../src/geo/clip-view";
3 |
4 | d3.geo.clipView = d3_geo_clipView;
5 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geom/index.js:
--------------------------------------------------------------------------------
1 | import "geom";
2 | import "hull";
3 | import "polygon";
4 | import "voronoi";
5 | import "delaunay";
6 | import "quadtree";
7 |
--------------------------------------------------------------------------------
/src/js/components/topojson/lib/topojson/coordinate-systems.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | cartesian: require("./cartesian"),
3 | spherical: require("./spherical")
4 | };
5 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/values.js:
--------------------------------------------------------------------------------
1 | d3.values = function(map) {
2 | var values = [];
3 | for (var key in map) values.push(map[key]);
4 | return values;
5 | };
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/functor.js:
--------------------------------------------------------------------------------
1 | function d3_functor(v) {
2 | return typeof v === "function" ? v : function() { return v; };
3 | }
4 |
5 | d3.functor = d3_functor;
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/format/format-localized.js:
--------------------------------------------------------------------------------
1 | var d3_format_decimalPoint = ".",
2 | d3_format_thousandsSeparator = ",",
3 | d3_format_grouping = [3, 3];
4 |
5 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/format/round.js:
--------------------------------------------------------------------------------
1 | d3.round = function(x, n) {
2 | return n
3 | ? Math.round(x * (n = Math.pow(10, n))) / n
4 | : Math.round(x);
5 | };
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/bin/start:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | console.log("d3 = (function(){\n var d3 = {version: " + JSON.stringify(require("../package.json").version) + "}; // semver");
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/format/requote.js:
--------------------------------------------------------------------------------
1 | d3.requote = function(s) {
2 | return s.replace(d3_requote_re, "\\$&");
3 | };
4 |
5 | var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/entries.js:
--------------------------------------------------------------------------------
1 | d3.entries = function(map) {
2 | var entries = [];
3 | for (var key in map) entries.push({key: key, value: map[key]});
4 | return entries;
5 | };
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/format/format-locale.js:
--------------------------------------------------------------------------------
1 | var d3_format_decimalPoint = {decimal_point},
2 | d3_format_thousandsSeparator = {thousands_sep},
3 | d3_format_grouping = {grouping};
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/size.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.size = function() {
4 | var n = 0;
5 | this.each(function() { ++n; });
6 | return n;
7 | };
8 |
--------------------------------------------------------------------------------
/src/examples/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "NY": {"fillKey": "Visited", "info": "Born here"},
3 | "TX": {"fillKey": "Visited", "info": "Live here"},
4 | "CA": {"fillKey": "Visited", "info": "Here while writing this code"}
5 | }
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/number.js:
--------------------------------------------------------------------------------
1 | d3.interpolateNumber = d3_interpolateNumber;
2 |
3 | function d3_interpolateNumber(a, b) {
4 | b -= a = +a;
5 | return function(t) { return a + b * t; };
6 | }
7 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/round.js:
--------------------------------------------------------------------------------
1 | d3.interpolateRound = d3_interpolateRound;
2 |
3 | function d3_interpolateRound(a, b) {
4 | b -= a;
5 | return function(t) { return Math.round(a + b * t); };
6 | }
7 |
--------------------------------------------------------------------------------
/src/js/components/topojson/src/component.js:
--------------------------------------------------------------------------------
1 | require("../topojson");
2 |
3 | console.log(JSON.stringify({
4 | "name": "topojson",
5 | "version": topojson.version,
6 | "main": "./topojson.js"
7 | }, null, 2));
8 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/permute.js:
--------------------------------------------------------------------------------
1 | d3.permute = function(array, indexes) {
2 | var permutes = [],
3 | i = -1,
4 | n = indexes.length;
5 | while (++i < n) permutes[i] = array[indexes[i]];
6 | return permutes;
7 | };
8 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/datum.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.datum = function(value) {
4 | return arguments.length
5 | ? this.property("__data__", value)
6 | : this.property("__data__");
7 | };
8 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/shuffle.js:
--------------------------------------------------------------------------------
1 | d3.shuffle = function(array) {
2 | var m = array.length, t, i;
3 | while (m) {
4 | i = Math.random() * m-- | 0;
5 | t = array[m], array[m] = array[i], array[i] = t;
6 | }
7 | return array;
8 | };
9 |
--------------------------------------------------------------------------------
/src/tests/spec/ClobberSpec.js:
--------------------------------------------------------------------------------
1 | describe("Clobber", function() {
2 |
3 | var PAGE_BB_VERSION = "0.5.3";
4 | it("shouldn't alter version of preview Backbone", function() {
5 | expect(window.Backbone.VERSION).toEqual(PAGE_BB_VERSION);
6 | });
7 | });
--------------------------------------------------------------------------------
/src/js/components/d3/lib/science/science.lin.min.js:
--------------------------------------------------------------------------------
1 | (function(){science.lin={},science.lin.tridag=function(a,b,c,d,e,f){var g,h;for(g=1;g=0;g--)e[g]=(d[g]-c[g]*e[g+1])/b[g]}})()
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/call.js:
--------------------------------------------------------------------------------
1 | import "../core/array";
2 | import "selection";
3 |
4 | d3_selectionPrototype.call = function(callback) {
5 | var args = d3_array(arguments);
6 | callback.apply(args[0] = this, args);
7 | return this;
8 | };
9 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/xhr/json.js:
--------------------------------------------------------------------------------
1 | import "xhr";
2 |
3 | d3.json = function(url, callback) {
4 | return d3_xhr(url, "application/json", d3_json, callback);
5 | };
6 |
7 | function d3_json(request) {
8 | return JSON.parse(request.responseText);
9 | }
10 |
--------------------------------------------------------------------------------
/src/js/components/d3/bin/component:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | console.log(JSON.stringify({
4 | "name": "d3",
5 | "version": require("../package.json").version,
6 | "main": "index-browserify.js",
7 | "scripts": ["index-browserify.js", "d3.js"]
8 | }, null, 2));
9 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/color/xyz.js:
--------------------------------------------------------------------------------
1 | function d3_xyz_lab(x) {
2 | return x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;
3 | }
4 |
5 | function d3_xyz_rgb(r) {
6 | return Math.round(255 * (r <= 0.00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - 0.055));
7 | }
8 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/scale/bilinear.js:
--------------------------------------------------------------------------------
1 | function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {
2 | var u = uninterpolate(domain[0], domain[1]),
3 | i = interpolate(range[0], range[1]);
4 | return function(x) {
5 | return i(u(x));
6 | };
7 | }
8 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/scale/index.js:
--------------------------------------------------------------------------------
1 | import "scale";
2 | import "linear";
3 | import "log";
4 | import "pow";
5 | import "sqrt";
6 | import "ordinal";
7 | import "category";
8 | import "quantile";
9 | import "quantize";
10 | import "threshold";
11 | import "identity";
12 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/remove.js:
--------------------------------------------------------------------------------
1 | import "transition";
2 |
3 | d3_transitionPrototype.remove = function() {
4 | return this.each("end.transition", function() {
5 | var p;
6 | if (!this.__transition__ && (p = this.parentNode)) p.removeChild(this);
7 | });
8 | };
9 |
--------------------------------------------------------------------------------
/src/js/components/topojson/lib/topojson/hash.js:
--------------------------------------------------------------------------------
1 | // Note: requires that size is a power of two!
2 | module.exports = function(size) {
3 | var mask = size - 1;
4 | return function(point) {
5 | var key = (point[0] + 31 * point[1]) | 0;
6 | return (key < 0 ? ~key : key) & mask;
7 | };
8 | };
9 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/svg/index.js:
--------------------------------------------------------------------------------
1 | import "svg";
2 | import "arc";
3 | import "line";
4 | import "line-radial";
5 | import "area";
6 | import "area-radial";
7 | import "chord";
8 | import "diagonal";
9 | import "diagonal-radial";
10 | import "symbol";
11 | import "axis";
12 | import "brush";
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/quantile.js:
--------------------------------------------------------------------------------
1 | // R-7 per
2 | d3.quantile = function(values, p) {
3 | var H = (values.length - 1) * p + 1,
4 | h = Math.floor(H),
5 | v = +values[h - 1],
6 | e = H - h;
7 | return e ? v + e * (values[h] - v) : v;
8 | };
9 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/albers.js:
--------------------------------------------------------------------------------
1 | import "conic-equal-area";
2 | import "geo";
3 |
4 | // ESRI:102003
5 | d3.geo.albers = function() {
6 | return d3.geo.conicEqualArea()
7 | .rotate([96, 0])
8 | .center([-.6, 38.7])
9 | .parallels([29.5, 45.5])
10 | .scale(1070);
11 | };
12 |
--------------------------------------------------------------------------------
/src/js/components/topojson/examples/README.md:
--------------------------------------------------------------------------------
1 | # TopoJSON Examples
2 |
3 | These examples are built by the [World Atlas](https://github.com/mbostock/world-atlas) and [U.S. Atlas](https://github.com/mbostock/us-atlas) projects; please see the makefiles there for details on the data sources and to customize generation.
4 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/layout/index.js:
--------------------------------------------------------------------------------
1 | import "layout";
2 | import "bundle";
3 | import "chord";
4 | import "force";
5 | import "partition";
6 | import "pie";
7 | import "stack";
8 | import "histogram";
9 | import "hierarchy";
10 | import "pack";
11 | import "cluster";
12 | import "tree";
13 | import "treemap";
14 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/index.js:
--------------------------------------------------------------------------------
1 | import "array";
2 | import "ease";
3 | import "hcl";
4 | import "hsl";
5 | import "interpolate";
6 | import "lab";
7 | import "number";
8 | import "object";
9 | import "rgb";
10 | import "round";
11 | import "string";
12 | import "transform";
13 | import "uninterpolate";
14 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/median.js:
--------------------------------------------------------------------------------
1 | import "../math/number";
2 | import "ascending";
3 | import "quantile";
4 |
5 | d3.median = function(array, f) {
6 | if (arguments.length > 1) array = array.map(f);
7 | array = array.filter(d3_number);
8 | return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined;
9 | };
10 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/compose.js:
--------------------------------------------------------------------------------
1 | function d3_geo_compose(a, b) {
2 |
3 | function compose(x, y) {
4 | return x = a(x, y), b(x[0], x[1]);
5 | }
6 |
7 | if (a.invert && b.invert) compose.invert = function(x, y) {
8 | return x = b.invert(x, y), x && a.invert(x[0], x[1]);
9 | };
10 |
11 | return compose;
12 | }
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/equirectangular.js:
--------------------------------------------------------------------------------
1 | import "geo";
2 | import "projection";
3 |
4 | function d3_geo_equirectangular(λ, φ) {
5 | return [λ, φ];
6 | }
7 |
8 | (d3.geo.equirectangular = function() {
9 | return d3_geo_projection(d3_geo_equirectangular);
10 | }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular;
11 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/remove.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | // TODO remove(selector)?
4 | // TODO remove(node)?
5 | // TODO remove(function)?
6 | d3_selectionPrototype.remove = function() {
7 | return this.each(function() {
8 | var parent = this.parentNode;
9 | if (parent) parent.removeChild(this);
10 | });
11 | };
12 |
--------------------------------------------------------------------------------
/src/examples/js/main.js:
--------------------------------------------------------------------------------
1 | define(function(require) {
2 | var d3 = require('d3');
3 | var topojson = require('topojson');
4 | var Datamap = require('datamaps');
5 | console.log('woah');
6 | console.log(d3, topojson);
7 | // Begin drawing for SVG map
8 | var map = new Datamap({element: document.getElementById('container')});
9 |
10 | });
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/class.js:
--------------------------------------------------------------------------------
1 | function d3_class(ctor, properties) {
2 | try {
3 | for (var key in properties) {
4 | Object.defineProperty(ctor.prototype, key, {
5 | value: properties[key],
6 | enumerable: false
7 | });
8 | }
9 | } catch (e) {
10 | ctor.prototype = properties;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/gnomonic.js:
--------------------------------------------------------------------------------
1 | import "azimuthal";
2 | import "geo";
3 | import "projection";
4 |
5 | var d3_geo_gnomonic = d3_geo_azimuthal(
6 | function(cosλcosφ) { return 1 / cosλcosφ; },
7 | Math.atan
8 | );
9 |
10 | (d3.geo.gnomonic = function() {
11 | return d3_geo_projection(d3_geo_gnomonic);
12 | }).raw = d3_geo_gnomonic;
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/node.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.node = function() {
4 | for (var j = 0, m = this.length; j < m; j++) {
5 | for (var group = this[j], i = 0, n = group.length; i < n; i++) {
6 | var node = group[i];
7 | if (node) return node;
8 | }
9 | }
10 | return null;
11 | };
12 |
--------------------------------------------------------------------------------
/src/examples/amd.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Testing
6 | Testing the page
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/orthographic.js:
--------------------------------------------------------------------------------
1 | import "azimuthal";
2 | import "geo";
3 | import "projection";
4 |
5 | var d3_geo_orthographic = d3_geo_azimuthal(
6 | function() { return 1; },
7 | Math.asin
8 | );
9 |
10 | (d3.geo.orthographic = function() {
11 | return d3_geo_projection(d3_geo_orthographic);
12 | }).raw = d3_geo_orthographic;
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/spherical.js:
--------------------------------------------------------------------------------
1 | import "../math/trigonometry";
2 |
3 | function d3_geo_spherical(cartesian) {
4 | return [
5 | Math.atan2(cartesian[1], cartesian[0]),
6 | d3_asin(cartesian[2])
7 | ];
8 | }
9 |
10 | function d3_geo_sphericalEqual(a, b) {
11 | return Math.abs(a[0] - b[0]) < ε && Math.abs(a[1] - b[1]) < ε;
12 | }
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/text.js:
--------------------------------------------------------------------------------
1 | import "transition";
2 | import "tween";
3 |
4 | d3_transitionPrototype.text = function(value) {
5 | return d3_transition_tween(this, "text", value, d3_transition_text);
6 | };
7 |
8 | function d3_transition_text(b) {
9 | if (b == null) b = "";
10 | return function() { this.textContent = b; };
11 | }
12 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/scale/scale.js:
--------------------------------------------------------------------------------
1 | d3.scale = {};
2 |
3 | function d3_scaleExtent(domain) {
4 | var start = domain[0], stop = domain[domain.length - 1];
5 | return start < stop ? [start, stop] : [stop, start];
6 | }
7 |
8 | function d3_scaleRange(scale) {
9 | return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
10 | }
11 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/uninterpolate.js:
--------------------------------------------------------------------------------
1 | function d3_uninterpolateNumber(a, b) {
2 | b = b - (a = +a) ? 1 / (b - a) : 0;
3 | return function(x) { return (x - a) * b; };
4 | }
5 |
6 | function d3_uninterpolateClamp(a, b) {
7 | b = b - (a = +a) ? 1 / (b - a) : 0;
8 | return function(x) { return Math.max(0, Math.min(1, (x - a) * b)); };
9 | }
10 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/index.js:
--------------------------------------------------------------------------------
1 | import "time";
2 | import "format-localized";
3 | import "format";
4 | import "format-utc";
5 | import "format-iso";
6 | import "interval";
7 | import "second";
8 | import "minute";
9 | import "hour";
10 | import "day";
11 | import "week";
12 | import "month";
13 | import "year";
14 | import "scale";
15 | import "scale-utc";
16 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/sum.js:
--------------------------------------------------------------------------------
1 | d3.sum = function(array, f) {
2 | var s = 0,
3 | n = array.length,
4 | a,
5 | i = -1;
6 |
7 | if (arguments.length === 1) {
8 | while (++i < n) if (!isNaN(a = +array[i])) s += a;
9 | } else {
10 | while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a;
11 | }
12 |
13 | return s;
14 | };
15 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/geo/area-benchmark.js:
--------------------------------------------------------------------------------
1 | var d3 = require("../../");
2 |
3 | var formatNumber = d3.format(",.02r"),
4 | o = d3.geo.circle().angle(30).precision(.1)(),
5 | n = 1e3,
6 | then = Date.now();
7 |
8 | for (var i = 0; i < n; i++) {
9 | d3.geo.area(o);
10 | }
11 |
12 | console.log("circle.angle(30°): " + formatNumber((Date.now() - then) / i) + "ms/op.");
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/xhr/html.js:
--------------------------------------------------------------------------------
1 | import "../core/document";
2 | import "xhr";
3 |
4 | d3.html = function(url, callback) {
5 | return d3_xhr(url, "text/html", d3_html, callback);
6 | };
7 |
8 | function d3_html(request) {
9 | var range = d3_document.createRange();
10 | range.selectNode(d3_document.body);
11 | return range.createContextualFragment(request.responseText);
12 | }
13 |
--------------------------------------------------------------------------------
/src/tests/components/jquery/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jquery",
3 | "version": "1.8.3",
4 | "main": "./jquery.js",
5 | "dependencies": {},
6 | "_id": "jquery@1.8.3",
7 | "readme": "ERROR: No README.md file found!",
8 | "description": "ERROR: No README.md file found!",
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/components/jquery.git"
12 | }
13 | }
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/stereographic.js:
--------------------------------------------------------------------------------
1 | import "azimuthal";
2 | import "geo";
3 | import "projection";
4 |
5 | var d3_geo_stereographic = d3_geo_azimuthal(
6 | function(cosλcosφ) { return 1 / (1 + cosλcosφ); },
7 | function(ρ) { return 2 * Math.atan(ρ); }
8 | );
9 |
10 | (d3.geo.stereographic = function() {
11 | return d3_geo_projection(d3_geo_stereographic);
12 | }).raw = d3_geo_stereographic;
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/index.js:
--------------------------------------------------------------------------------
1 | var globals = ["document", "window", "d3"],
2 | globalValues = {};
3 |
4 | globals.forEach(function(g) {
5 | if (g in global) globalValues[g] = global[g];
6 | });
7 |
8 | require("./globals");
9 | require("./d3");
10 |
11 | module.exports = d3;
12 |
13 | globals.forEach(function(g) {
14 | if (g in globalValues) global[g] = globalValues[g];
15 | else delete global[g];
16 | });
17 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/event/touches.js:
--------------------------------------------------------------------------------
1 | import "../core/array";
2 | import "event";
3 | import "mouse";
4 |
5 | d3.touches = function(container, touches) {
6 | if (arguments.length < 2) touches = d3_eventSource().touches;
7 | return touches ? d3_array(touches).map(function(touch) {
8 | var point = d3_mousePoint(container, touch);
9 | point.identifier = touch.identifier;
10 | return point;
11 | }) : [];
12 | };
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/format-locale.js:
--------------------------------------------------------------------------------
1 | // The date and time format (%c), date format (%x) and time format (%X).
2 | var d3_time_formatDateTime = {d_t_fmt},
3 | d3_time_formatDate = {d_fmt},
4 | d3_time_formatTime = {t_fmt};
5 |
6 | // The weekday and month names.
7 | var d3_time_days = {day},
8 | d3_time_dayAbbreviations = {abday},
9 | d3_time_months = {mon},
10 | d3_time_monthAbbreviations = {abmon};
11 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/zip.js:
--------------------------------------------------------------------------------
1 | import "min";
2 |
3 | d3.zip = function() {
4 | if (!(n = arguments.length)) return [];
5 | for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m;) {
6 | for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n;) {
7 | zip[j] = arguments[j][i];
8 | }
9 | }
10 | return zips;
11 | };
12 |
13 | function d3_zipLength(d) {
14 | return d.length;
15 | }
16 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/delay.js:
--------------------------------------------------------------------------------
1 | import "../selection/each";
2 | import "transition";
3 |
4 | d3_transitionPrototype.delay = function(value) {
5 | var id = this.id;
6 | return d3_selection_each(this, typeof value === "function"
7 | ? function(node, i, j) { node.__transition__[id].delay = value.call(node, node.__data__, i, j) | 0; }
8 | : (value |= 0, function(node) { node.__transition__[id].delay = value; }));
9 | };
10 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/azimuthal-equal-area.js:
--------------------------------------------------------------------------------
1 | import "azimuthal";
2 | import "geo";
3 | import "projection";
4 |
5 | var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(
6 | function(cosλcosφ) { return Math.sqrt(2 / (1 + cosλcosφ)); },
7 | function(ρ) { return 2 * Math.asin(ρ / 2); }
8 | );
9 |
10 | (d3.geo.azimuthalEqualArea = function() {
11 | return d3_geo_projection(d3_geo_azimuthalEqualArea);
12 | }).raw = d3_geo_azimuthalEqualArea;
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/lab.js:
--------------------------------------------------------------------------------
1 | import "../color/lab";
2 |
3 | d3.interpolateLab = d3_interpolateLab;
4 |
5 | function d3_interpolateLab(a, b) {
6 | a = d3.lab(a);
7 | b = d3.lab(b);
8 | var al = a.l,
9 | aa = a.a,
10 | ab = a.b,
11 | bl = b.l - al,
12 | ba = b.a - aa,
13 | bb = b.b - ab;
14 | return function(t) {
15 | return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + "";
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/html.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.html = function(value) {
4 | return arguments.length
5 | ? this.each(typeof value === "function"
6 | ? function() { var v = value.apply(this, arguments); this.innerHTML = v == null ? "" : v; } : value == null
7 | ? function() { this.innerHTML = ""; }
8 | : function() { this.innerHTML = value; })
9 | : this.node().innerHTML;
10 | };
11 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/conic.js:
--------------------------------------------------------------------------------
1 | import "../math/trigonometry";
2 | import "projection";
3 |
4 | function d3_geo_conic(projectAt) {
5 | var φ0 = 0,
6 | φ1 = π / 3,
7 | m = d3_geo_projectionMutator(projectAt),
8 | p = m(φ0, φ1);
9 |
10 | p.parallels = function(_) {
11 | if (!arguments.length) return [φ0 / π * 180, φ1 / π * 180];
12 | return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180);
13 | };
14 |
15 | return p;
16 | }
17 |
--------------------------------------------------------------------------------
/src/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/mean.js:
--------------------------------------------------------------------------------
1 | import "../math/number";
2 |
3 | d3.mean = function(array, f) {
4 | var n = array.length,
5 | a,
6 | m = 0,
7 | i = -1,
8 | j = 0;
9 | if (arguments.length === 1) {
10 | while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j;
11 | } else {
12 | while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j;
13 | }
14 | return j ? m : undefined;
15 | };
16 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/text.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.text = function(value) {
4 | return arguments.length
5 | ? this.each(typeof value === "function"
6 | ? function() { var v = value.apply(this, arguments); this.textContent = v == null ? "" : v; } : value == null
7 | ? function() { this.textContent = ""; }
8 | : function() { this.textContent = value; })
9 | : this.node().textContent;
10 | };
11 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/ease.js:
--------------------------------------------------------------------------------
1 | import "../interpolate/ease";
2 | import "../selection/each";
3 | import "transition";
4 |
5 | d3_transitionPrototype.ease = function(value) {
6 | var id = this.id;
7 | if (arguments.length < 1) return this.node().__transition__[id].ease;
8 | if (typeof value !== "function") value = d3.ease.apply(d3, arguments);
9 | return d3_selection_each(this, function(node) { node.__transition__[id].ease = value; });
10 | };
11 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/order.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.order = function() {
4 | for (var j = -1, m = this.length; ++j < m;) {
5 | for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0;) {
6 | if (node = group[i]) {
7 | if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
8 | next = node;
9 | }
10 | }
11 | }
12 | return this;
13 | };
14 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/month.js:
--------------------------------------------------------------------------------
1 | import "day";
2 | import "interval";
3 | import "time";
4 |
5 | d3.time.month = d3_time_interval(function(date) {
6 | date = d3.time.day(date);
7 | date.setDate(1);
8 | return date;
9 | }, function(date, offset) {
10 | date.setMonth(date.getMonth() + offset);
11 | }, function(date) {
12 | return date.getMonth();
13 | });
14 |
15 | d3.time.months = d3.time.month.range;
16 | d3.time.months.utc = d3.time.month.utc.range;
17 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/compat/style.js:
--------------------------------------------------------------------------------
1 | import "../core/document";
2 |
3 | try {
4 | d3_document.createElement("div").style.setProperty("opacity", 0, "");
5 | } catch (error) {
6 | var d3_style_prototype = d3_window.CSSStyleDeclaration.prototype,
7 | d3_style_setProperty = d3_style_prototype.setProperty;
8 | d3_style_prototype.setProperty = function(name, value, priority) {
9 | d3_style_setProperty.call(this, name, value + "", priority);
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/vendor.js:
--------------------------------------------------------------------------------
1 | import "document";
2 |
3 | function d3_vendorSymbol(object, name) {
4 | if (name in object) return name;
5 | name = name.charAt(0).toUpperCase() + name.substring(1);
6 | for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) {
7 | var prefixName = d3_vendorPrefixes[i] + name;
8 | if (prefixName in object) return prefixName;
9 | }
10 | }
11 |
12 | var d3_vendorPrefixes = ["webkit", "ms", "moz", "Moz", "o", "O"];
13 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/year.js:
--------------------------------------------------------------------------------
1 | import "day";
2 | import "interval";
3 | import "time";
4 |
5 | d3.time.year = d3_time_interval(function(date) {
6 | date = d3.time.day(date);
7 | date.setMonth(0, 1);
8 | return date;
9 | }, function(date, offset) {
10 | date.setFullYear(date.getFullYear() + offset);
11 | }, function(date) {
12 | return date.getFullYear();
13 | });
14 |
15 | d3.time.years = d3.time.year.range;
16 | d3.time.years.utc = d3.time.year.utc.range;
17 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/core/version-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | load = require("../load"),
3 | assert = require("../assert");
4 |
5 | var suite = vows.describe("d3.version");
6 |
7 | suite.addBatch({
8 | "version": {
9 | topic: load().expression("d3.version"),
10 | "has the form major.minor.patch": function(version) {
11 | assert.match(version, /^[0-9]+\.[0-9]+\.[0-9]+/);
12 | }
13 | }
14 | });
15 |
16 | suite.export(module);
17 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/azimuthal-equidistant.js:
--------------------------------------------------------------------------------
1 | import "../core/identity";
2 | import "azimuthal";
3 | import "geo";
4 | import "projection";
5 |
6 | var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(
7 | function(cosλcosφ) { var c = Math.acos(cosλcosφ); return c && c / Math.sin(c); },
8 | d3_identity
9 | );
10 |
11 | (d3.geo.azimuthalEquidistant = function() {
12 | return d3_geo_projection(d3_geo_azimuthalEquidistant);
13 | }).raw = d3_geo_azimuthalEquidistant;
14 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/minute.js:
--------------------------------------------------------------------------------
1 | import "interval";
2 | import "time";
3 |
4 | d3.time.minute = d3_time_interval(function(date) {
5 | return new d3_time(Math.floor(date / 6e4) * 6e4);
6 | }, function(date, offset) {
7 | date.setTime(date.getTime() + Math.floor(offset) * 6e4); // DST breaks setMinutes
8 | }, function(date) {
9 | return date.getMinutes();
10 | });
11 |
12 | d3.time.minutes = d3.time.minute.range;
13 | d3.time.minutes.utc = d3.time.minute.utc.range;
14 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/second.js:
--------------------------------------------------------------------------------
1 | import "interval";
2 | import "time";
3 |
4 | d3.time.second = d3_time_interval(function(date) {
5 | return new d3_time(Math.floor(date / 1e3) * 1e3);
6 | }, function(date, offset) {
7 | date.setTime(date.getTime() + Math.floor(offset) * 1e3); // DST breaks setSeconds
8 | }, function(date) {
9 | return date.getSeconds();
10 | });
11 |
12 | d3.time.seconds = d3.time.second.range;
13 | d3.time.seconds.utc = d3.time.second.utc.range;
14 |
--------------------------------------------------------------------------------
/src/tests/src/test.js:
--------------------------------------------------------------------------------
1 | require(
2 | {
3 | paths: {
4 | 'd3': '../../js/components/d3/d3.v2',
5 | 'underscore': '../../js/components/underscore-amd/underscore',
6 | 'jquery': '../../js/components/zepto/dist/zepto',
7 | 'zepto': '../../js/components/zepto/dist/zepto',
8 | 'backbone': '../../js/components/backbone-amd/backbone'
9 | }
10 | },
11 | [
12 | '../../../dist/datamaps'
13 | ], function(Map) {
14 | console.log(Map, 'hola');
15 | });
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/duration.js:
--------------------------------------------------------------------------------
1 | import "../selection/each";
2 | import "transition";
3 |
4 | d3_transitionPrototype.duration = function(value) {
5 | var id = this.id;
6 | return d3_selection_each(this, typeof value === "function"
7 | ? function(node, i, j) { node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j) | 0); }
8 | : (value = Math.max(1, value | 0), function(node) { node.__transition__[id].duration = value; }));
9 | };
10 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/d3.js:
--------------------------------------------------------------------------------
1 | import "start";
2 | import "compat/";
3 |
4 | import "arrays/";
5 | import "behavior/";
6 | import "color/";
7 | import "core/";
8 | import "dsv/";
9 | import "event/";
10 | import "format/";
11 | import "geo/";
12 | import "geom/";
13 | import "interpolate/";
14 | import "layout/";
15 | import "math/";
16 | import "scale/";
17 | import "selection/";
18 | import "svg/";
19 | import "time/";
20 | import "transition/";
21 | import "xhr/";
22 |
23 | import "end";
24 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/index.js:
--------------------------------------------------------------------------------
1 | import "ascending";
2 | import "descending";
3 | import "min";
4 | import "max";
5 | import "extent";
6 | import "sum";
7 | import "mean";
8 | import "median";
9 | import "quantile";
10 | import "bisect";
11 | import "shuffle";
12 | import "permute";
13 | import "zip";
14 | import "transpose";
15 | import "keys";
16 | import "values";
17 | import "entries";
18 | import "merge";
19 | import "range";
20 | import "nest";
21 | import "map";
22 | import "set";
23 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/svg/area-radial.js:
--------------------------------------------------------------------------------
1 | import "area";
2 | import "svg";
3 | import "line-radial";
4 |
5 | d3.svg.area.radial = function() {
6 | var area = d3_svg_area(d3_svg_lineRadial);
7 | area.radius = area.x, delete area.x;
8 | area.innerRadius = area.x0, delete area.x0;
9 | area.outerRadius = area.x1, delete area.x1;
10 | area.angle = area.y, delete area.y;
11 | area.startAngle = area.y0, delete area.y0;
12 | area.endAngle = area.y1, delete area.y1;
13 | return area;
14 | };
15 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/time/dayOfYear-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | load = require("../load"),
3 | assert = require("../assert");
4 |
5 | var suite = vows.describe("d3.time.dayOfYear");
6 |
7 | suite.addBatch({
8 | "dayOfYear": {
9 | topic: load("time/day").expression("d3.time.dayOfYear"),
10 | "no floating-point rounding error": function(dayOfYear) {
11 | assert.equal(dayOfYear(new Date(2011, 4, 9)), 128);
12 | }
13 | }
14 | });
15 |
16 | suite.export(module);
17 |
--------------------------------------------------------------------------------
/src/js/components/topojson/index.js:
--------------------------------------------------------------------------------
1 | var fs = require("fs");
2 |
3 | var topojson = module.exports = new Function("topojson", "return " + fs.readFileSync(__dirname + "/topojson.js", "utf8"))();
4 | topojson.topology = require("./lib/topojson/topology");
5 | topojson.simplify = require("./lib/topojson/simplify");
6 | topojson.clockwise = require("./lib/topojson/clockwise");
7 | topojson.filter = require("./lib/topojson/filter");
8 | topojson.prune = require("./lib/topojson/prune");
9 | topojson.bind = require("./lib/topojson/bind");
10 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/each.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.each = function(callback) {
4 | return d3_selection_each(this, function(node, i, j) {
5 | callback.call(node, node.__data__, i, j);
6 | });
7 | };
8 |
9 | function d3_selection_each(groups, callback) {
10 | for (var j = 0, m = groups.length; j < m; j++) {
11 | for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) {
12 | if (node = group[i]) callback(node, i, j);
13 | }
14 | }
15 | return groups;
16 | }
17 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/hour.js:
--------------------------------------------------------------------------------
1 | import "interval";
2 | import "time";
3 |
4 | d3.time.hour = d3_time_interval(function(date) {
5 | var timezone = date.getTimezoneOffset() / 60;
6 | return new d3_time((Math.floor(date / 36e5 - timezone) + timezone) * 36e5);
7 | }, function(date, offset) {
8 | date.setTime(date.getTime() + Math.floor(offset) * 36e5); // DST breaks setHours
9 | }, function(date) {
10 | return date.getHours();
11 | });
12 |
13 | d3.time.hours = d3.time.hour.range;
14 | d3.time.hours.utc = d3.time.hour.utc.range;
15 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/max.js:
--------------------------------------------------------------------------------
1 | d3.max = function(array, f) {
2 | var i = -1,
3 | n = array.length,
4 | a,
5 | b;
6 | if (arguments.length === 1) {
7 | while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined;
8 | while (++i < n) if ((b = array[i]) != null && b > a) a = b;
9 | } else {
10 | while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
11 | while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
12 | }
13 | return a;
14 | };
15 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/min.js:
--------------------------------------------------------------------------------
1 | d3.min = function(array, f) {
2 | var i = -1,
3 | n = array.length,
4 | a,
5 | b;
6 | if (arguments.length === 1) {
7 | while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined;
8 | while (++i < n) if ((b = array[i]) != null && a > b) a = b;
9 | } else {
10 | while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
11 | while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
12 | }
13 | return a;
14 | };
15 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/rgb.js:
--------------------------------------------------------------------------------
1 | import "../color/rgb";
2 |
3 | d3.interpolateRgb = d3_interpolateRgb;
4 |
5 | function d3_interpolateRgb(a, b) {
6 | a = d3.rgb(a);
7 | b = d3.rgb(b);
8 | var ar = a.r,
9 | ag = a.g,
10 | ab = a.b,
11 | br = b.r - ar,
12 | bg = b.g - ag,
13 | bb = b.b - ab;
14 | return function(t) {
15 | return "#"
16 | + d3_rgb_hex(Math.round(ar + br * t))
17 | + d3_rgb_hex(Math.round(ag + bg * t))
18 | + d3_rgb_hex(Math.round(ab + bb * t));
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/sort.js:
--------------------------------------------------------------------------------
1 | import "../arrays/ascending";
2 | import "selection";
3 |
4 | d3_selectionPrototype.sort = function(comparator) {
5 | comparator = d3_selection_sortComparator.apply(this, arguments);
6 | for (var j = -1, m = this.length; ++j < m;) this[j].sort(comparator);
7 | return this.order();
8 | };
9 |
10 | function d3_selection_sortComparator(comparator) {
11 | if (!arguments.length) comparator = d3.ascending;
12 | return function(a, b) {
13 | return (!a - !b) || comparator(a.__data__, b.__data__);
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/geo/point-in-polygon-mock.js:
--------------------------------------------------------------------------------
1 | import "../../src/geo/point-in-polygon";
2 | import "../../src/math/trigonometry";
3 |
4 | d3.geo.pointInPolygon = function(polygon) {
5 | polygon = polygon.map(function(ring) {
6 | ring = ring.map(pointRadians);
7 | ring.pop();
8 | return ring;
9 | });
10 |
11 | return function(point) {
12 | return d3_geo_pointInPolygon(pointRadians(point), polygon);
13 | };
14 |
15 | function pointRadians(point) {
16 | return [point[0] * d3_radians, point[1] * d3_radians];
17 | }
18 | };
19 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/array.js:
--------------------------------------------------------------------------------
1 | import "interpolate";
2 |
3 | d3.interpolateArray = d3_interpolateArray;
4 |
5 | function d3_interpolateArray(a, b) {
6 | var x = [],
7 | c = [],
8 | na = a.length,
9 | nb = b.length,
10 | n0 = Math.min(a.length, b.length),
11 | i;
12 | for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));
13 | for (; i < na; ++i) c[i] = a[i];
14 | for (; i < nb; ++i) c[i] = b[i];
15 | return function(t) {
16 | for (i = 0; i < n0; ++i) c[i] = x[i](t);
17 | return c;
18 | };
19 | }
20 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/object.js:
--------------------------------------------------------------------------------
1 | import "interpolate";
2 |
3 | d3.interpolateObject = d3_interpolateObject;
4 |
5 | function d3_interpolateObject(a, b) {
6 | var i = {},
7 | c = {},
8 | k;
9 | for (k in a) {
10 | if (k in b) {
11 | i[k] = d3_interpolateByName(k)(a[k], b[k]);
12 | } else {
13 | c[k] = a[k];
14 | }
15 | }
16 | for (k in b) {
17 | if (!(k in a)) {
18 | c[k] = b[k];
19 | }
20 | }
21 | return function(t) {
22 | for (k in i) c[k] = i[k](t);
23 | return c;
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/interpolate/round-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | load = require("../load"),
3 | assert = require("../assert");
4 |
5 | var suite = vows.describe("d3.interpolateRound");
6 |
7 | suite.addBatch({
8 | "interpolateRound": {
9 | topic: load("interpolate/round").expression("d3.interpolateRound"),
10 | "interpolates integers": function(interpolate) {
11 | assert.strictEqual(interpolate(2, 12)(.456), 7);
12 | assert.strictEqual(interpolate(2, 12)(.678), 9);
13 | }
14 | }
15 | });
16 |
17 | suite.export(module);
18 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/event/mouse-test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | HTML Mouse Test
4 |
5 |
6 |
23 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/append.js:
--------------------------------------------------------------------------------
1 | import "../core/document";
2 | import "../core/ns";
3 | import "selection";
4 |
5 | // TODO append(node)?
6 | // TODO append(function)?
7 | d3_selectionPrototype.append = function(name) {
8 | name = d3.ns.qualify(name);
9 |
10 | function append() {
11 | return this.appendChild(d3_document.createElementNS(this.namespaceURI, name));
12 | }
13 |
14 | function appendNS() {
15 | return this.appendChild(d3_document.createElementNS(name.space, name.local));
16 | }
17 |
18 | return this.select(name.local ? appendNS : append);
19 | };
20 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "datamaps",
3 | "description": "datamaps with d3.js",
4 | "version": "0.3.4",
5 | "author": "Mark DiMarco",
6 | "scripts": {
7 | "test": "grunt jasmine"
8 | },
9 | "dependencies": {},
10 | "devDependencies": {
11 | "grunt-replace": "~0.4.4",
12 | "grunt": "~0.4.1",
13 | "grunt-contrib-jasmine": "~0.5.2",
14 | "grunt-text-replace": "~0.3.6",
15 | "grunt-contrib-uglify": "~0.2.2",
16 | "grunt-contrib-watch": "~0.4.4",
17 | "grunt-contrib-copy": "~0.4.1",
18 | "grunt-contrib-clean": "~0.5.0"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/examples/js/app.js:
--------------------------------------------------------------------------------
1 | requirejs.config({
2 | 'baseUrl': 'js',
3 | 'paths': {
4 | 'app': '../app',
5 | 'datamaps': '../../rel/datamaps.all',
6 | 'topojson': 'https://rawgithub.com/mbostock/topojson/master/topojson',
7 | 'd3': 'http://rawgithub.com/mbostock/d3/master/d3'
8 | },
9 | shim: {
10 | d3: {
11 | exports: 'd3'
12 | },
13 | topojson: {
14 | deps: ['d3'],
15 | exports: 'topojson'
16 | },
17 | datamaps: {
18 | deps: ['d3', 'topojson']
19 | }
20 | }
21 |
22 | });
23 |
24 | /** Load main module to start app **/
25 | requirejs(["./main"]);
26 |
--------------------------------------------------------------------------------
/src/js/components/d3/README.md:
--------------------------------------------------------------------------------
1 | # Data-Driven Documents
2 |
3 | **D3.js** is a JavaScript library for manipulating documents based on data. **D3** helps you bring data to life using HTML, SVG and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.
4 |
5 | Want to learn more? [See the wiki.](https://github.com/mbostock/d3/wiki)
6 |
7 | For examples, [see the gallery](https://github.com/mbostock/d3/wiki/Gallery) and [mbostock’s bl.ocks](http://bl.ocks.org/mbostock).
8 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/distance.js:
--------------------------------------------------------------------------------
1 | import "../math/trigonometry";
2 | import "geo";
3 |
4 | // Length returned in radians; multiply by radius for distance.
5 | d3.geo.distance = function(a, b) {
6 | var Δλ = (b[0] - a[0]) * d3_radians,
7 | φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians,
8 | sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ),
9 | sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0),
10 | sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1),
11 | t;
12 | return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);
13 | };
14 |
--------------------------------------------------------------------------------
/src/js/components/d3/globals.js:
--------------------------------------------------------------------------------
1 | var document = global.document = require("jsdom").jsdom(""),
2 | window = global.window = document.createWindow();
3 |
4 | // https://github.com/chad3814/CSSStyleDeclaration/issues/3
5 | var CSSStyleDeclaration_prototype = window.CSSStyleDeclaration.prototype,
6 | CSSStyleDeclaration_setProperty = CSSStyleDeclaration_prototype.setProperty;
7 | CSSStyleDeclaration_prototype.setProperty = function(name, value, priority) {
8 | return CSSStyleDeclaration_setProperty.call(this, name + "", value == null ? null : value + "", priority == null ? null : priority + "");
9 | };
10 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/hcl.js:
--------------------------------------------------------------------------------
1 | import "../color/hcl";
2 |
3 | d3.interpolateHcl = d3_interpolateHcl;
4 |
5 | function d3_interpolateHcl(a, b) {
6 | a = d3.hcl(a);
7 | b = d3.hcl(b);
8 | var ah = a.h,
9 | ac = a.c,
10 | al = a.l,
11 | bh = b.h - ah,
12 | bc = b.c - ac,
13 | bl = b.l - al;
14 | if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac;
15 | if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah;
16 | else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; // shortest path
17 | return function(t) {
18 | return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + "";
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/format-iso.js:
--------------------------------------------------------------------------------
1 | import "format";
2 | import "format-utc";
3 | import "time";
4 |
5 | var d3_time_formatIso = d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");
6 |
7 | d3.time.format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z")
8 | ? d3_time_formatIsoNative
9 | : d3_time_formatIso;
10 |
11 | function d3_time_formatIsoNative(date) {
12 | return date.toISOString();
13 | }
14 |
15 | d3_time_formatIsoNative.parse = function(string) {
16 | var date = new Date(string);
17 | return isNaN(date) ? null : date;
18 | };
19 |
20 | d3_time_formatIsoNative.toString = d3_time_formatIso.toString;
21 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/svg/line-radial.js:
--------------------------------------------------------------------------------
1 | import "arc";
2 | import "line";
3 | import "svg";
4 |
5 | d3.svg.line.radial = function() {
6 | var line = d3_svg_line(d3_svg_lineRadial);
7 | line.radius = line.x, delete line.x;
8 | line.angle = line.y, delete line.y;
9 | return line;
10 | };
11 |
12 | function d3_svg_lineRadial(points) {
13 | var point,
14 | i = -1,
15 | n = points.length,
16 | r,
17 | a;
18 | while (++i < n) {
19 | point = points[i];
20 | r = point[0];
21 | a = point[1] + d3_svg_arcOffset;
22 | point[0] = r * Math.cos(a);
23 | point[1] = r * Math.sin(a);
24 | }
25 | return points;
26 | }
27 |
--------------------------------------------------------------------------------
/src/tests/lib/runner.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var jasmineEnv = jasmine.getEnv();
3 | jasmineEnv.updateInterval = 1000;
4 | var htmlReporter = new jasmine.HtmlReporter();
5 |
6 | jasmineEnv.addReporter(htmlReporter);
7 |
8 | jasmineEnv.specFilter = function(spec) {
9 | return htmlReporter.specFilter(spec);
10 | };
11 |
12 | var currentWindowOnload = window.onload;
13 |
14 | window.onload = function() {
15 | if (currentWindowOnload) {
16 | currentWindowOnload();
17 | }
18 | execJasmine();
19 | };
20 |
21 | function execJasmine() {
22 | jasmineEnv.execute();
23 | }
24 |
25 | })();
26 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/path-bounds.js:
--------------------------------------------------------------------------------
1 | import "../core/noop";
2 |
3 | var d3_geo_pathBoundsX0,
4 | d3_geo_pathBoundsY0,
5 | d3_geo_pathBoundsX1,
6 | d3_geo_pathBoundsY1;
7 |
8 | var d3_geo_pathBounds = {
9 | point: d3_geo_pathBoundsPoint,
10 | lineStart: d3_noop,
11 | lineEnd: d3_noop,
12 | polygonStart: d3_noop,
13 | polygonEnd: d3_noop
14 | };
15 |
16 | function d3_geo_pathBoundsPoint(x, y) {
17 | if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;
18 | if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;
19 | if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;
20 | if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;
21 | }
22 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/math/trigonometry.js:
--------------------------------------------------------------------------------
1 | var π = Math.PI,
2 | ε = 1e-6,
3 | ε2 = ε * ε,
4 | d3_radians = π / 180,
5 | d3_degrees = 180 / π;
6 |
7 | function d3_sgn(x) {
8 | return x > 0 ? 1 : x < 0 ? -1 : 0;
9 | }
10 |
11 | function d3_acos(x) {
12 | return x > 1 ? 0 : x < -1 ? π : Math.acos(x);
13 | }
14 |
15 | function d3_asin(x) {
16 | return x > 1 ? π / 2 : x < -1 ? -π / 2 : Math.asin(x);
17 | }
18 |
19 | function d3_sinh(x) {
20 | return (Math.exp(x) - Math.exp(-x)) / 2;
21 | }
22 |
23 | function d3_cosh(x) {
24 | return (Math.exp(x) + Math.exp(-x)) / 2;
25 | }
26 |
27 | function d3_haversin(x) {
28 | return (x = Math.sin(x / 2)) * x;
29 | }
30 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/ns.js:
--------------------------------------------------------------------------------
1 | var d3_nsPrefix = {
2 | svg: "http://www.w3.org/2000/svg",
3 | xhtml: "http://www.w3.org/1999/xhtml",
4 | xlink: "http://www.w3.org/1999/xlink",
5 | xml: "http://www.w3.org/XML/1998/namespace",
6 | xmlns: "http://www.w3.org/2000/xmlns/"
7 | };
8 |
9 | d3.ns = {
10 | prefix: d3_nsPrefix,
11 | qualify: function(name) {
12 | var i = name.indexOf(":"),
13 | prefix = name;
14 | if (i >= 0) {
15 | prefix = name.substring(0, i);
16 | name = name.substring(i + 1);
17 | }
18 | return d3_nsPrefix.hasOwnProperty(prefix)
19 | ? {space: d3_nsPrefix[prefix], local: name}
20 | : name;
21 | }
22 | };
23 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/azimuthal.js:
--------------------------------------------------------------------------------
1 | // Abstract azimuthal projection.
2 | function d3_geo_azimuthal(scale, angle) {
3 | function azimuthal(λ, φ) {
4 | var cosλ = Math.cos(λ),
5 | cosφ = Math.cos(φ),
6 | k = scale(cosλ * cosφ);
7 | return [
8 | k * cosφ * Math.sin(λ),
9 | k * Math.sin(φ)
10 | ];
11 | }
12 |
13 | azimuthal.invert = function(x, y) {
14 | var ρ = Math.sqrt(x * x + y * y),
15 | c = angle(ρ),
16 | sinc = Math.sin(c),
17 | cosc = Math.cos(c);
18 | return [
19 | Math.atan2(x * sinc, ρ * cosc),
20 | Math.asin(ρ && y * sinc / ρ)
21 | ];
22 | };
23 |
24 | return azimuthal;
25 | }
26 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/extent.js:
--------------------------------------------------------------------------------
1 | d3.extent = function(array, f) {
2 | var i = -1,
3 | n = array.length,
4 | a,
5 | b,
6 | c;
7 | if (arguments.length === 1) {
8 | while (++i < n && !((a = c = array[i]) != null && a <= a)) a = c = undefined;
9 | while (++i < n) if ((b = array[i]) != null) {
10 | if (a > b) a = b;
11 | if (c < b) c = b;
12 | }
13 | } else {
14 | while (++i < n && !((a = c = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
15 | while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
16 | if (a > b) a = b;
17 | if (c < b) c = b;
18 | }
19 | }
20 | return [a, c];
21 | };
22 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/core/rebind.js:
--------------------------------------------------------------------------------
1 | // Copies a variable number of methods from source to target.
2 | d3.rebind = function(target, source) {
3 | var i = 1, n = arguments.length, method;
4 | while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
5 | return target;
6 | };
7 |
8 | // Method is assumed to be a standard D3 getter-setter:
9 | // If passed with no arguments, gets the value.
10 | // If passed with arguments, sets the value and returns the target.
11 | function d3_rebind(target, source, method) {
12 | return function() {
13 | var value = method.apply(source, arguments);
14 | return value === source ? target : value;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/transverse-mercator.js:
--------------------------------------------------------------------------------
1 | import "../math/trigonometry";
2 | import "geo";
3 | import "mercator";
4 | import "projection";
5 |
6 | function d3_geo_transverseMercator(λ, φ) {
7 | var B = Math.cos(φ) * Math.sin(λ);
8 | return [
9 | Math.log((1 + B) / (1 - B)) / 2,
10 | Math.atan2(Math.tan(φ), Math.cos(λ))
11 | ];
12 | }
13 |
14 | d3_geo_transverseMercator.invert = function(x, y) {
15 | return [
16 | Math.atan2(d3_sinh(x), Math.cos(y)),
17 | d3_asin(Math.sin(y) / d3_cosh(x))
18 | ];
19 | };
20 |
21 | (d3.geo.transverseMercator = function() {
22 | return d3_geo_mercatorProjection(d3_geo_transverseMercator);
23 | }).raw = d3_geo_transverseMercator;
24 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/transition.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.transition = function() {
4 | var id = d3_transitionInheritId || ++d3_transitionId,
5 | subgroups = [],
6 | subgroup,
7 | node,
8 | transition = Object.create(d3_transitionInherit);
9 |
10 | transition.time = Date.now();
11 |
12 | for (var j = -1, m = this.length; ++j < m;) {
13 | subgroups.push(subgroup = []);
14 | for (var group = this[j], i = -1, n = group.length; ++i < n;) {
15 | if (node = group[i]) d3_transitionNode(node, i, id, transition);
16 | subgroup.push(node);
17 | }
18 | }
19 |
20 | return d3_transition(subgroups, id);
21 | };
22 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/interpolate/number-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | load = require("../load"),
3 | assert = require("../assert");
4 |
5 | var suite = vows.describe("d3.interpolateNumber");
6 |
7 | suite.addBatch({
8 | "interpolateNumber": {
9 | topic: load("interpolate/number").expression("d3.interpolateNumber"),
10 | "interpolates numbers": function(interpolate) {
11 | assert.strictEqual(interpolate(2, 12)(.4), 6);
12 | assert.strictEqual(interpolate(2, 12)(.6), 8);
13 | },
14 | "coerces strings to numbers": function(interpolate) {
15 | assert.strictEqual(interpolate("2", "12")(.4), 6);
16 | }
17 | }
18 | });
19 |
20 | suite.export(module);
21 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/scale/polylinear.js:
--------------------------------------------------------------------------------
1 | import "../arrays/bisect";
2 |
3 | function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
4 | var u = [],
5 | i = [],
6 | j = 0,
7 | k = Math.min(domain.length, range.length) - 1;
8 |
9 | // Handle descending domains.
10 | if (domain[k] < domain[0]) {
11 | domain = domain.slice().reverse();
12 | range = range.slice().reverse();
13 | }
14 |
15 | while (++j <= k) {
16 | u.push(uninterpolate(domain[j - 1], domain[j]));
17 | i.push(interpolate(range[j - 1], range[j]));
18 | }
19 |
20 | return function(x) {
21 | var j = d3.bisect(domain, x, 1, k) - 1;
22 | return i[j](u[j](x));
23 | };
24 | }
25 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/day.js:
--------------------------------------------------------------------------------
1 | import "interval";
2 | import "time";
3 | import "year";
4 |
5 | d3.time.day = d3_time_interval(function(date) {
6 | var day = new d3_time(2000, 0);
7 | day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
8 | return day;
9 | }, function(date, offset) {
10 | date.setDate(date.getDate() + offset);
11 | }, function(date) {
12 | return date.getDate() - 1;
13 | });
14 |
15 | d3.time.days = d3.time.day.range;
16 | d3.time.days.utc = d3.time.day.utc.range;
17 |
18 | d3.time.dayOfYear = function(date) {
19 | var year = d3.time.year(date);
20 | return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);
21 | };
22 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/filter.js:
--------------------------------------------------------------------------------
1 | import "../selection/filter";
2 | import "transition";
3 |
4 | d3_transitionPrototype.filter = function(filter) {
5 | var subgroups = [],
6 | subgroup,
7 | group,
8 | node;
9 |
10 | if (typeof filter !== "function") filter = d3_selection_filter(filter);
11 |
12 | for (var j = 0, m = this.length; j < m; j++) {
13 | subgroups.push(subgroup = []);
14 | for (var group = this[j], i = 0, n = group.length; i < n; i++) {
15 | if ((node = group[i]) && filter.call(node, node.__data__, i)) {
16 | subgroup.push(node);
17 | }
18 | }
19 | }
20 |
21 | return d3_transition(subgroups, this.id, this.time).ease(this.ease());
22 | };
23 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/geo/distance-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | load = require("../load"),
3 | assert = require("assert");
4 |
5 | var suite = vows.describe("d3.geo.distance");
6 |
7 | suite.addBatch({
8 | "distance": {
9 | topic: load("geo/distance").expression("d3.geo.distance"),
10 | "computes the great-arc distance": function(distance) {
11 | assert.equal(distance([0, 0], [0, 0]), 0);
12 | assert.inDelta(distance([118 + 24 / 60, 33 + 57 / 60], [ 73 + 47 / 60, 40 + 38 / 60]), 3973 / 6371, .5);
13 | },
14 | "small distance": function(distance) {
15 | assert.isTrue(distance([0, 0], [0, 1e-12]) > 0);
16 | }
17 | }
18 | });
19 |
20 | suite.export(module);
21 |
--------------------------------------------------------------------------------
/src/tests/components/jquery/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "components/jquery",
3 | "description": "jQuery JavaScript Library",
4 | "type": "component",
5 | "homepage": "http://jquery.com",
6 | "license": "MIT",
7 | "support": {
8 | "irc": "irc://irc.freenode.org/jquery",
9 | "issues": "http://bugs.jquery.com",
10 | "forum": "http://forum.jquery.com",
11 | "wiki": "http://docs.jquery.com/",
12 | "source": "https://github.com/jquery/jquery"
13 | },
14 | "authors": [
15 | {
16 | "name": "John Resig",
17 | "email": "jeresig@gmail.com"
18 | }
19 | ],
20 | "extra": {
21 | "js": "jquery.js"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/interpolate/hsl.js:
--------------------------------------------------------------------------------
1 | import "../color/hsl";
2 |
3 | d3.interpolateHsl = d3_interpolateHsl;
4 |
5 | // interpolates HSL space, but outputs RGB string (for compatibility)
6 |
7 | function d3_interpolateHsl(a, b) {
8 | a = d3.hsl(a);
9 | b = d3.hsl(b);
10 | var ah = a.h,
11 | as = a.s,
12 | al = a.l,
13 | bh = b.h - ah,
14 | bs = b.s - as,
15 | bl = b.l - al;
16 | if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as;
17 | if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah;
18 | else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; // shortest path
19 | return function(t) {
20 | return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + "";
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/format-utc.js:
--------------------------------------------------------------------------------
1 | import "format";
2 | import "time";
3 |
4 | d3.time.format.utc = function(template) {
5 | var local = d3.time.format(template);
6 |
7 | function format(date) {
8 | try {
9 | d3_time = d3_time_utc;
10 | var utc = new d3_time();
11 | utc._ = date;
12 | return local(utc);
13 | } finally {
14 | d3_time = Date;
15 | }
16 | }
17 |
18 | format.parse = function(string) {
19 | try {
20 | d3_time = d3_time_utc;
21 | var date = local.parse(string);
22 | return date && date._;
23 | } finally {
24 | d3_time = Date;
25 | }
26 | };
27 |
28 | format.toString = local.toString;
29 |
30 | return format;
31 | };
32 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/insert.js:
--------------------------------------------------------------------------------
1 | import "../core/document";
2 | import "../core/ns";
3 | import "selection";
4 |
5 | d3_selectionPrototype.insert = function(name, before) {
6 | name = d3.ns.qualify(name);
7 |
8 | if (typeof before !== "function") before = d3_selection_selector(before);
9 |
10 | function insert(d, i) {
11 | return this.insertBefore(
12 | d3_document.createElementNS(this.namespaceURI, name),
13 | before.call(this, d, i));
14 | }
15 |
16 | function insertNS(d, i) {
17 | return this.insertBefore(
18 | d3_document.createElementNS(name.space, name.local),
19 | before.call(this, d, i));
20 | }
21 |
22 | return this.select(name.local ? insertNS : insert);
23 | };
24 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/math/transform-null-test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
27 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/scale/nice.js:
--------------------------------------------------------------------------------
1 | function d3_scale_nice(domain, nice) {
2 | var i0 = 0,
3 | i1 = domain.length - 1,
4 | x0 = domain[i0],
5 | x1 = domain[i1],
6 | dx;
7 |
8 | if (x1 < x0) {
9 | dx = i0, i0 = i1, i1 = dx;
10 | dx = x0, x0 = x1, x1 = dx;
11 | }
12 |
13 | domain[i0] = nice.floor(x0);
14 | domain[i1] = nice.ceil(x1);
15 | return domain;
16 | }
17 |
18 | function d3_scale_niceStep(step) {
19 | return step ? {
20 | floor: function(x) { return Math.floor(x / step) * step; },
21 | ceil: function(x) { return Math.ceil(x / step) * step; }
22 | } : d3_scale_niceIdentity;
23 | }
24 |
25 | var d3_scale_niceIdentity = {
26 | floor: d3_identity,
27 | ceil: d3_identity
28 | };
29 |
--------------------------------------------------------------------------------
/src/js/components/d3/lib/science/science.lin.js:
--------------------------------------------------------------------------------
1 | (function(){science.lin = {};
2 | /**
3 | * Solves tridiagonal systems of linear equations.
4 | *
5 | * Source: http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
6 | *
7 | * @param {number[]} a
8 | * @param {number[]} b
9 | * @param {number[]} c
10 | * @param {number[]} d
11 | * @param {number[]} x
12 | * @param {number} n
13 | */
14 | science.lin.tridag = function(a, b, c, d, x, n) {
15 | var i,
16 | m;
17 | for (i = 1; i < n; i++) {
18 | m = a[i] / b[i - 1];
19 | b[i] -= m * c[i - 1];
20 | d[i] -= m * d[i - 1];
21 | }
22 | x[n - 1] = d[n - 1] / b[n - 1];
23 | for (i = n - 2; i >= 0; i--) {
24 | x[i] = (d[i] - c[i] * x[i + 1]) / b[i];
25 | }
26 | };
27 | })()
--------------------------------------------------------------------------------
/src/js/components/d3/src/time/format-localized.js:
--------------------------------------------------------------------------------
1 | // The date and time format (%c), date format (%x) and time format (%X).
2 | var d3_time_formatDateTime = "%a %b %e %X %Y",
3 | d3_time_formatDate = "%m/%d/%Y",
4 | d3_time_formatTime = "%H:%M:%S";
5 |
6 | // The weekday and month names.
7 | var d3_time_days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
8 | d3_time_dayAbbreviations = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
9 | d3_time_months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
10 | d3_time_monthAbbreviations = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
11 |
12 |
--------------------------------------------------------------------------------
/src/js/components/topojson/test/spherical-ringArea-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | assert = require("assert"),
3 | spherical = require("../lib/topojson/spherical");
4 |
5 | var suite = vows.describe("topojson.spherical.ringArea");
6 |
7 | suite.addBatch({
8 | "ringArea": {
9 | topic: function() {
10 | return spherical.ringArea;
11 | },
12 | "small clockwise area": function(area) {
13 | assert.inDelta(area([[0, -.5], [0, .5], [1, .5], [1, -.5], [0, -.5]]), 0.0003046212, 1e-10);
14 | },
15 | "small counterclockwise area": function(area) {
16 | assert.inDelta(area([[0, -.5], [1, -.5], [1, .5], [0, .5], [0, -.5]]), -0.0003046212, 1e-10);
17 | }
18 | }
19 | });
20 |
21 | suite.export(module);
22 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/math/transform-null-matrix-test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
27 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/arrays/range.js:
--------------------------------------------------------------------------------
1 | d3.range = function(start, stop, step) {
2 | if (arguments.length < 3) {
3 | step = 1;
4 | if (arguments.length < 2) {
5 | stop = start;
6 | start = 0;
7 | }
8 | }
9 | if ((stop - start) / step === Infinity) throw new Error("infinite range");
10 | var range = [],
11 | k = d3_range_integerScale(Math.abs(step)),
12 | i = -1,
13 | j;
14 | start *= k, stop *= k, step *= k;
15 | if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k);
16 | else while ((j = start + step * ++i) < stop) range.push(j / k);
17 | return range;
18 | };
19 |
20 | function d3_range_integerScale(x) {
21 | var k = 1;
22 | while (x * k % 1) k *= 10;
23 | return k;
24 | }
25 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/layout/pie-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | load = require("../load"),
3 | assert = require("../assert");
4 |
5 | var suite = vows.describe("d3.layout.pie");
6 |
7 | suite.addBatch({
8 | "pie": {
9 | topic: load("layout/pie").expression("d3.layout.pie"),
10 | "arcs are in same order as original data": function(pie) {
11 | var p = pie();
12 | assert.deepEqual(p([5, 30, 15]).map(function(d) { return d.data; }), [
13 | 5, 30, 15
14 | ]);
15 | assert.deepEqual(p([
16 | 84, 90, 48, 61, 58, 8, 6, 31, 45, 18
17 | ]).map(function(d) { return d.data; }), [
18 | 84, 90, 48, 61, 58, 8, 6, 31, 45, 18
19 | ]);
20 | }
21 | }
22 | });
23 |
24 | suite.export(module);
25 |
--------------------------------------------------------------------------------
/src/js/components/topojson/README.md:
--------------------------------------------------------------------------------
1 | # TopoJSON
2 |
3 | **TopoJSON** is an extension of GeoJSON that encodes topology. Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called *arcs*. TopoJSON eliminates redundancy, offering much more compact representations of geometry than with GeoJSON; typical TopoJSON files are 80% smaller than their GeoJSON equivalents. In addition, TopoJSON facilitates applications that use topology, such as [topology-preserving shape simplification](http://bost.ocks.org/mike/simplify/), [automatic map coloring](http://bl.ocks.org/4188334), and [cartograms](http://prag.ma/code/d3-cartogram/).
4 |
5 | Want to learn more? [See the wiki.](https://github.com/mbostock/topojson/wiki)
6 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/each.js:
--------------------------------------------------------------------------------
1 | import "../selection/each";
2 | import "transition";
3 |
4 | d3_transitionPrototype.each = function(type, listener) {
5 | var id = this.id;
6 | if (arguments.length < 2) {
7 | var inherit = d3_transitionInherit,
8 | inheritId = d3_transitionInheritId;
9 | d3_transitionInheritId = id;
10 | d3_selection_each(this, function(node, i, j) {
11 | d3_transitionInherit = node.__transition__[id];
12 | type.call(node, node.__data__, i, j);
13 | });
14 | d3_transitionInherit = inherit;
15 | d3_transitionInheritId = inheritId;
16 | } else {
17 | d3_selection_each(this, function(node) {
18 | node.__transition__[id].event.on(type, listener);
19 | });
20 | }
21 | return this;
22 | };
23 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/svg/diagonal-radial.js:
--------------------------------------------------------------------------------
1 | import "arc";
2 | import "diagonal";
3 | import "svg";
4 |
5 | d3.svg.diagonal.radial = function() {
6 | var diagonal = d3.svg.diagonal(),
7 | projection = d3_svg_diagonalProjection,
8 | projection_ = diagonal.projection;
9 |
10 | diagonal.projection = function(x) {
11 | return arguments.length
12 | ? projection_(d3_svg_diagonalRadialProjection(projection = x))
13 | : projection;
14 | };
15 |
16 | return diagonal;
17 | };
18 |
19 | function d3_svg_diagonalRadialProjection(projection) {
20 | return function() {
21 | var d = projection.apply(this, arguments),
22 | r = d[0],
23 | a = d[1] + d3_svg_arcOffset;
24 | return [r * Math.cos(a), r * Math.sin(a)];
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/subtransition.js:
--------------------------------------------------------------------------------
1 | import "transition";
2 |
3 | d3_transitionPrototype.transition = function() {
4 | var id0 = this.id,
5 | id1 = ++d3_transitionId,
6 | subgroups = [],
7 | subgroup,
8 | group,
9 | node,
10 | transition;
11 |
12 | for (var j = 0, m = this.length; j < m; j++) {
13 | subgroups.push(subgroup = []);
14 | for (var group = this[j], i = 0, n = group.length; i < n; i++) {
15 | if (node = group[i]) {
16 | transition = Object.create(node.__transition__[id0]);
17 | transition.delay += transition.duration;
18 | d3_transitionNode(node, i, id1, transition);
19 | }
20 | subgroup.push(node);
21 | }
22 | }
23 |
24 | return d3_transition(subgroups, id1);
25 | };
26 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "datamaps",
3 | "version": "0.1.0",
4 | "homepage": "https://github.com/markmarkoh/datamaps",
5 | "authors": [
6 | "Mark DiMarco"
7 | ],
8 | "contributors": [
9 | "Dave Long (dave@davejlong.com)"
10 | ],
11 | "description": "Interactive maps for data visualizations. Bundled into a single Javascript file.",
12 | "main": "dist/datamaps.all.js",
13 | "keywords": [
14 | "USA",
15 | "World",
16 | "Map",
17 | "Visualization"
18 | ],
19 | "license": "MIT",
20 | "ignore": [
21 | "**/.*",
22 | "node_modules",
23 | "bower_components",
24 | "test",
25 | "tests",
26 | "public"
27 | ],
28 | "dependencies": {
29 | "d3": "d3#>=3.4.11",
30 | "topojson": "topojson#>=1.6.18"
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/transition/transition-test-id.js:
--------------------------------------------------------------------------------
1 | var assert = require("../assert");
2 |
3 | module.exports = {
4 | topic: function(d3) {
5 | return d3; // bug in vows where topic is not propagated automatically
6 | },
7 | "on a new transition": {
8 | topic: function(d3) {
9 | return d3.select("body").append("div").transition();
10 | },
11 | "has a positive integer id": function(transition) {
12 | var id = transition.id;
13 | assert.isTrue(id > 0);
14 | assert.equal(~~id, id);
15 | }
16 | },
17 | "increases monotonically across transitions": function(d3) {
18 | var t0 = d3.select("body").append("div").transition(),
19 | t1 = d3.select("body").append("div").transition();
20 | assert.isTrue(t1.id > t0.id);
21 | }
22 | };
23 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/math/random.js:
--------------------------------------------------------------------------------
1 | d3.random = {
2 | normal: function(µ, σ) {
3 | var n = arguments.length;
4 | if (n < 2) σ = 1;
5 | if (n < 1) µ = 0;
6 | return function() {
7 | var x, y, r;
8 | do {
9 | x = Math.random() * 2 - 1;
10 | y = Math.random() * 2 - 1;
11 | r = x * x + y * y;
12 | } while (!r || r > 1);
13 | return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
14 | };
15 | },
16 | logNormal: function() {
17 | var random = d3.random.normal.apply(d3, arguments);
18 | return function() {
19 | return Math.exp(random());
20 | };
21 | },
22 | irwinHall: function(m) {
23 | return function() {
24 | for (var s = 0, j = 0; j < m; j++) s += Math.random();
25 | return s / m;
26 | };
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/geo/interpolate-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | load = require("../load"),
3 | assert = require("../assert");
4 |
5 | var suite = vows.describe("d3.geo.interpolate");
6 |
7 | suite.addBatch({
8 | "interpolate": {
9 | topic: load("geo/interpolate").expression("d3.geo.interpolate"),
10 | "zero distance": function(interpolate) {
11 | assert.deepEqual(interpolate([140.63289, -29.95101], [140.63289, -29.95101])(.5), [140.63289, -29.95101]);
12 | },
13 | "equator": function(interpolate) {
14 | assert.inDelta(interpolate([10, 0], [20, 0])(.5), [15, 0], 1e-6);
15 | },
16 | "meridian": function(interpolate) {
17 | assert.inDelta(interpolate([10, -20], [10, 40])(.5), [10, 10], 1e-6);
18 | }
19 | }
20 | });
21 |
22 | suite.export(module);
23 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/filter.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 |
3 | d3_selectionPrototype.filter = function(filter) {
4 | var subgroups = [],
5 | subgroup,
6 | group,
7 | node;
8 |
9 | if (typeof filter !== "function") filter = d3_selection_filter(filter);
10 |
11 | for (var j = 0, m = this.length; j < m; j++) {
12 | subgroups.push(subgroup = []);
13 | subgroup.parentNode = (group = this[j]).parentNode;
14 | for (var i = 0, n = group.length; i < n; i++) {
15 | if ((node = group[i]) && filter.call(node, node.__data__, i)) {
16 | subgroup.push(node);
17 | }
18 | }
19 | }
20 |
21 | return d3_selection(subgroups);
22 | };
23 |
24 | function d3_selection_filter(selector) {
25 | return function() {
26 | return d3_selectMatches(this, selector);
27 | };
28 | }
29 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/selectAll.js:
--------------------------------------------------------------------------------
1 | import "../core/array";
2 | import "selection";
3 |
4 | d3_selectionPrototype.selectAll = function(selector) {
5 | var subgroups = [],
6 | subgroup,
7 | node;
8 |
9 | if (typeof selector !== "function") selector = d3_selection_selectorAll(selector);
10 |
11 | for (var j = -1, m = this.length; ++j < m;) {
12 | for (var group = this[j], i = -1, n = group.length; ++i < n;) {
13 | if (node = group[i]) {
14 | subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i)));
15 | subgroup.parentNode = node;
16 | }
17 | }
18 | }
19 |
20 | return d3_selection(subgroups);
21 | };
22 |
23 | function d3_selection_selectorAll(selector) {
24 | return function() {
25 | return d3_selectAll(selector, this);
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/scale/identity.js:
--------------------------------------------------------------------------------
1 | import "linear";
2 | import "scale";
3 |
4 | d3.scale.identity = function() {
5 | return d3_scale_identity([0, 1]);
6 | };
7 |
8 | function d3_scale_identity(domain) {
9 |
10 | function identity(x) { return +x; }
11 |
12 | identity.invert = identity;
13 |
14 | identity.domain = identity.range = function(x) {
15 | if (!arguments.length) return domain;
16 | domain = x.map(identity);
17 | return identity;
18 | };
19 |
20 | identity.ticks = function(m) {
21 | return d3_scale_linearTicks(domain, m);
22 | };
23 |
24 | identity.tickFormat = function(m, format) {
25 | return d3_scale_linearTickFormat(domain, m, format);
26 | };
27 |
28 | identity.copy = function() {
29 | return d3_scale_identity(domain);
30 | };
31 |
32 | return identity;
33 | }
34 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/enter-select.js:
--------------------------------------------------------------------------------
1 | import "selection";
2 | import "enter";
3 |
4 | d3_selection_enterPrototype.select = function(selector) {
5 | var subgroups = [],
6 | subgroup,
7 | subnode,
8 | upgroup,
9 | group,
10 | node;
11 |
12 | for (var j = -1, m = this.length; ++j < m;) {
13 | upgroup = (group = this[j]).update;
14 | subgroups.push(subgroup = []);
15 | subgroup.parentNode = group.parentNode;
16 | for (var i = -1, n = group.length; ++i < n;) {
17 | if (node = group[i]) {
18 | subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i));
19 | subnode.__data__ = node.__data__;
20 | } else {
21 | subgroup.push(null);
22 | }
23 | }
24 | }
25 |
26 | return d3_selection(subgroups);
27 | };
28 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/format/formatPrefix.js:
--------------------------------------------------------------------------------
1 | import "format";
2 |
3 | var d3_formatPrefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix);
4 |
5 | d3.formatPrefix = function(value, precision) {
6 | var i = 0;
7 | if (value) {
8 | if (value < 0) value *= -1;
9 | if (precision) value = d3.round(value, d3_format_precision(value, precision));
10 | i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
11 | i = Math.max(-24, Math.min(24, Math.floor((i <= 0 ? i + 1 : i - 1) / 3) * 3));
12 | }
13 | return d3_formatPrefixes[8 + i / 3];
14 | };
15 |
16 | function d3_formatPrefix(d, i) {
17 | var k = Math.pow(10, Math.abs(8 - i) * 3);
18 | return {
19 | scale: i > 8 ? function(d) { return d / k; } : function(d) { return d * k; },
20 | symbol: d
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/selection/enter.js:
--------------------------------------------------------------------------------
1 | import "../core/array";
2 | import "selection";
3 |
4 | function d3_selection_enter(selection) {
5 | d3_arraySubclass(selection, d3_selection_enterPrototype);
6 | return selection;
7 | }
8 |
9 | var d3_selection_enterPrototype = [];
10 |
11 | d3.selection.enter = d3_selection_enter;
12 | d3.selection.enter.prototype = d3_selection_enterPrototype;
13 |
14 | d3_selection_enterPrototype.append = d3_selectionPrototype.append;
15 | d3_selection_enterPrototype.insert = d3_selectionPrototype.insert;
16 | d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;
17 | d3_selection_enterPrototype.node = d3_selectionPrototype.node;
18 | d3_selection_enterPrototype.call = d3_selectionPrototype.call;
19 | d3_selection_enterPrototype.size = d3_selectionPrototype.size;
20 |
21 | import "enter-select";
22 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/geo/index.js:
--------------------------------------------------------------------------------
1 | import "geo";
2 | import "area";
3 | import "bounds";
4 | import "centroid";
5 | import "circle";
6 | import "distance";
7 | import "graticule";
8 | import "greatArc";
9 | import "interpolate";
10 | import "length";
11 | import "path";
12 | import "path-area";
13 | import "path-buffer";
14 | import "path-centroid";
15 | import "path-context";
16 | import "projection";
17 | import "rotation";
18 | import "stream";
19 | import "albers";
20 | import "albers-usa";
21 | import "azimuthal";
22 | import "azimuthal-equal-area";
23 | import "azimuthal-equidistant";
24 | import "conic-conformal";
25 | import "conic-equal-area";
26 | import "conic-equidistant";
27 | import "equirectangular";
28 | import "gnomonic";
29 | import "mercator";
30 | import "orthographic";
31 | import "stereographic";
32 | import "transverse-mercator";
33 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/core/functor-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | load = require("../load"),
3 | assert = require("../assert");
4 |
5 | var suite = vows.describe("d3.functor");
6 |
7 | suite.addBatch({
8 | "functor": {
9 | topic: load("core/functor").expression("d3.functor"),
10 | "when passed a function, returns the function": function(functor) {
11 | function foo() {}
12 | assert.strictEqual(functor(foo), foo);
13 | },
14 | "when passed a non-function, returns a wrapper function": function(functor) {
15 | var a = {};
16 | assert.isNull(functor(null)());
17 | assert.isUndefined(functor(undefined)());
18 | assert.strictEqual(functor(a)(), a);
19 | assert.strictEqual(functor(1)(), 1);
20 | assert.deepEqual(functor([1])(), [1]);
21 | }
22 | }
23 | });
24 |
25 | suite.export(module);
26 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/scale/threshold.js:
--------------------------------------------------------------------------------
1 | import "../arrays/bisect";
2 | import "scale";
3 |
4 | d3.scale.threshold = function() {
5 | return d3_scale_threshold([.5], [0, 1]);
6 | };
7 |
8 | function d3_scale_threshold(domain, range) {
9 |
10 | function scale(x) {
11 | if (x <= x) return range[d3.bisect(domain, x)];
12 | }
13 |
14 | scale.domain = function(_) {
15 | if (!arguments.length) return domain;
16 | domain = _;
17 | return scale;
18 | };
19 |
20 | scale.range = function(_) {
21 | if (!arguments.length) return range;
22 | range = _;
23 | return scale;
24 | };
25 |
26 | scale.invertExtent = function(y) {
27 | y = range.indexOf(y);
28 | return [domain[y - 1], domain[y]];
29 | };
30 |
31 | scale.copy = function() {
32 | return d3_scale_threshold(domain, range);
33 | };
34 |
35 | return scale;
36 | };
37 |
--------------------------------------------------------------------------------
/src/js/components/d3/src/transition/tween.js:
--------------------------------------------------------------------------------
1 | import "../selection/each";
2 | import "transition";
3 |
4 | d3_transitionPrototype.tween = function(name, tween) {
5 | var id = this.id;
6 | if (arguments.length < 2) return this.node().__transition__[id].tween.get(name);
7 | return d3_selection_each(this, tween == null
8 | ? function(node) { node.__transition__[id].tween.remove(name); }
9 | : function(node) { node.__transition__[id].tween.set(name, tween); });
10 | };
11 |
12 | function d3_transition_tween(groups, name, value, tween) {
13 | var id = groups.id;
14 | return d3_selection_each(groups, typeof value === "function"
15 | ? function(node, i, j) { node.__transition__[id].tween.set(name, tween(value.call(node, node.__data__, i, j))); }
16 | : (value = tween(value), function(node) { node.__transition__[id].tween.set(name, value); }));
17 | }
18 |
--------------------------------------------------------------------------------
/src/js/components/d3/test/arrays/keys-test.js:
--------------------------------------------------------------------------------
1 | var vows = require("vows"),
2 | load = require("../load"),
3 | assert = require("../assert");
4 |
5 | var suite = vows.describe("d3.keys");
6 |
7 | suite.addBatch({
8 | "keys": {
9 | topic: load("arrays/keys").expression("d3.keys"),
10 | "enumerates every defined key": function(keys) {
11 | assert.deepEqual(keys({a: 1, b: 1}), ["a", "b"]);
12 | },
13 | "includes keys defined on prototypes": function(keys) {
14 | function abc() {
15 | this.a = 1;
16 | this.b = 2;
17 | }
18 | abc.prototype.c = 3;
19 | assert.deepEqual(keys(new abc()), ["a", "b", "c"]);
20 | },
21 | "includes keys with null or undefined values": function(keys) {
22 | assert.deepEqual(keys({a: undefined, b: null, c: NaN}), ["a", "b", "c"]);
23 | }
24 | }
25 | });
26 |
27 | suite.export(module);
28 |
--------------------------------------------------------------------------------
/src/tests/spec/PluginSpec.js:
--------------------------------------------------------------------------------
1 | describe("Plugin", function() {
2 |
3 | var $el = $("#container1");
4 |
5 | it("should add a 'datamaps' function to $.prototype", function() {
6 | expect($.fn.datamap).toBeDefined();
7 | });
8 |
9 | describe("Rendering elements", function() {
10 | beforeEach(function() {
11 | $el.datamap();
12 | });
13 |
14 | afterEach(function() {
15 | $el.html("");
16 | });
17 |
18 | it("should insert an