Commit d50f6c5a authored by Mike Bostock's avatar Mike Bostock

Merge branch '4'

parents 1813b15d a155af92
d3.js -diff merge=ours
d3.min.js -diff merge=ours
_site
node_modules
*.sublime-workspace
.DS_Store
d3.zip
build/
node_modules
npm-debug.log
examples/
*.sublime-*
build/*.zip
test/
lib/
.DS_Store
_site
d3.zip
bin
lib
src
test
# Contributing
**Important:** these GitHub issues are for *bug reports and feature requests only*. Please use [StackOverflow](http://stackoverflow.com/questions/tagged/d3.js) or the [d3-js Google group](https://groups.google.com/d/forum/d3-js) for general help.
If you’re looking for ways to contribute, please [peruse open issues](https://github.com/mbostock/d3/issues?milestone=&page=1&state=open). The icebox is a good place to find ideas that are not currently in development. If you already have an idea, please check past issues to see whether your idea or a similar one was previously discussed.
Before submitting a pull request, consider implementing a live example first, say using [bl.ocks.org](http://bl.ocks.org). Real-world use cases go a long way to demonstrating the usefulness of a proposed feature. The more complex a feature’s implementation, the more usefulness it should provide. Share your demo using the #d3js tag on Twitter or by sending it to the [d3-js Google group](https://groups.google.com/d/forum/d3-js).
If your proposed feature does not involve changing core functionality, consider submitting it instead as a [D3 plugin](https://github.com/d3/d3-plugins). New core features should be for general use, whereas plugins are suitable for more specialized use cases. When in doubt, it’s easier to start with a plugin before “graduating” to core.
To contribute new documentation or add examples to the gallery, just [edit the Wiki](https://github.com/mbostock/d3/wiki)!
## How to Submit a Pull Request
1. Click the “Fork” button to create your personal fork of the D3 repository.
2. After cloning your fork of the D3 repository in the terminal, run `npm install` to install D3’s dependencies.
3. Create a new branch for your new feature. For example: `git checkout -b my-awesome-feature`. A dedicated branch for your pull request means you can develop multiple features at the same time, and ensures that your pull request is stable even if you later decide to develop an unrelated feature.
4. The `d3.js` and `d3.min.js` files are built from source files in the `src` directory. _Do not edit `d3.js` directly._ Instead, edit the source files, and then run `make` to build the generated files.
5. Use `make test` to run tests and verify your changes. If you are adding a new feature, you should add new tests! If you are changing existing functionality, make sure the existing tests run, or update them as appropriate.
6. Sign D3’s [Individual Contributor License Agreement](https://docs.google.com/forms/d/1CzjdBKtDuA8WeuFJinadx956xLQ4Xriv7-oDvXnZMaI/viewform). Unless you are submitting a trivial patch (such as fixing a typo), this form is needed to verify that you are able to contribute.
7. Submit your pull request, and good luck!
Copyright (c) 2010-2016, Michael Bostock
Copyright 2010-2016 Mike Bostock
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
......@@ -11,16 +11,17 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name Michael Bostock may not be used to endorse or promote products
derived from this software without specific prior written permission.
* Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This diff is collapsed.
#!/usr/bin/env node
var fs = require("fs"),
package = require("../package.json");
console.log(
"// Package metadata for Meteor.js.\n" +
"\n" +
"Package.describe({\n" +
" name: \"d3js:d3\", // http://atmospherejs.com/d3js/d3\n" +
" summary: \"D3 (official): " + package.description + "\",\n" +
" version: \"" + package.version + "\",\n" +
" git: \"https://github.com/mbostock/d3.git\"\n" +
"});\n" +
"\n" +
"Package.onUse(function(api) {\n" +
" api.versionsFrom([\"METEOR@1.0\"]);\n" +
" api.addFiles(\"d3.js\", \"client\");\n" +
"});"
);
#!/usr/bin/env node
var rollup = require("rollup"),
nodeResolve = require("rollup-plugin-node-resolve");
rollup.rollup({
entry: "index.js",
plugins: [nodeResolve({jsnext: true})]
}).then(function(bundle) {
return bundle.write({
format: "umd",
moduleName: "d3",
dest: "build/d3.js"
});
}).then(function() {
console.warn("↳ build/d3.js");
}).catch(abort);
function abort(error) {
console.error(error.stack);
}
#!/usr/bin/env node
var fs = require("fs"),
rollup = require("rollup"),
dependencies = require("../package.json").dependencies;
rollup.rollup({
entry: "index.js",
external: Object.keys(dependencies)
}).then(function(bundle) {
var code = bundle.generate({
format: "cjs"
}).code.replace(
/^exports\.event = (.*);$/m,
"Object.defineProperty(exports, \"event\", {get: function() { return $1; }});"
);
return new Promise(function(resolve, reject) {
fs.writeFile("build/d3.node.js", code, "utf8", function(error) {
if (error) return reject(error);
else resolve();
});
});
}).then(function() {
console.warn("↳ build/d3.node.js");
}).catch(abort);
function abort(error) {
console.error(error.stack);
}
#!/usr/bin/env node
console.log("!function(){\n var d3 = {version: " + JSON.stringify(require("../package.json").version) + "}; // semver");
#!/usr/bin/env node
var fs = require("fs"),
uglify = require("uglify-js");
var filename = process.argv[2],
toplevel = uglify.parse(fs.readFileSync(filename, "utf8"), {filename: filename}),
output = uglify.OutputStream({ascii_only: true}),
compressor = uglify.Compressor(true),
warn = uglify.AST_Node.warn;
uglify.AST_Node.warn = function(s, o) {
if (o.msg === "Accidental global?" && o.name === "d3" && o.line === 1 && !o.col) return;
warn.apply(this, arguments);
};
toplevel.figure_out_scope();
toplevel.scope_warnings({
undeclared: false,
unreferenced: false,
assign_to_global: true,
func_arguments: false,
nested_defuns: false,
eval: false
});
toplevel = toplevel.transform(compressor);
toplevel.figure_out_scope();
toplevel.compute_char_frequency(true);
toplevel.mangle_names(true);
toplevel.print(output);
process.stdout.write(output.get());
{
"name": "mbostock/d3",
"description": "A JavaScript visualization library for HTML and SVG.",
"keywords": [
"dom",
"w3c",
"visualization",
"svg",
"animation",
"canvas"
],
"homepage": "http://d3js.org/",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Mike Bostock",
"homepage": "http://bost.ocks.org/mike"
}
],
"support": {
"issues": "https://github.com/mbostock/d3/issues",
"wiki": "https://github.com/mbostock/d3/wiki",
"API": "https://github.com/mbostock/d3/wiki/API-Reference",
"source": "https://github.com/mbostock/d3"
}
}
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"folders": [
{
"path": ".",
"file_exclude_patterns": [
"*.sublime-workspace"
],
"folder_exclude_patterns": [
"build"
]
}
]
}
export {
version
} from "./build/package";
export {
bisect,
bisectRight,
bisectLeft,
ascending,
bisector,
descending,
deviation,
extent,
histogram,
thresholdFreedmanDiaconis,
thresholdScott,
thresholdSturges,
max,
mean,
median,
merge,
min,
pairs,
permute,
quantile,
range,
scan,
shuffle,
sum,
ticks,
transpose,
variance,
zip
} from "d3-array";
export {
entries,
keys,
values,
map,
set,
nest
} from "d3-collection";
export {
randomUniform,
randomNormal,
randomLogNormal,
randomBates,
randomIrwinHall,
randomExponential
} from "d3-random";
export {
easeLinear,
easeQuad,
easeQuadIn,
easeQuadOut,
easeQuadInOut,
easeCubic,
easeCubicIn,
easeCubicOut,
easeCubicInOut,
easePoly,
easePolyIn,
easePolyOut,
easePolyInOut,
easeSin,
easeSinIn,
easeSinOut,
easeSinInOut,
easeExp,
easeExpIn,
easeExpOut,
easeExpInOut,
easeCircle,
easeCircleIn,
easeCircleOut,
easeCircleInOut,
easeBounce,
easeBounceIn,
easeBounceOut,
easeBounceInOut,
easeBack,
easeBackIn,
easeBackOut,
easeBackInOut,
easeElastic,
easeElasticIn,
easeElasticOut,
easeElasticInOut
} from "d3-ease";
export {
polygonArea,
polygonCentroid,
polygonHull,
polygonContains,
polygonLength
} from "d3-polygon";
export {
path
} from "d3-path";
export {
quadtree
} from "d3-quadtree";
export {
queue
} from "d3-queue";
export {
arc,
area,
line,
pie,
radialArea,
radialLine,
symbol,
symbols,
symbolCircle,
symbolCross,
symbolDiamond,
symbolSquare,
symbolStar,
symbolTriangle,
symbolWye,
curveBasisClosed,
curveBasisOpen,
curveBasis,
curveBundle,
curveCardinalClosed,
curveCardinalOpen,
curveCardinal,
curveCatmullRomClosed,
curveCatmullRomOpen,
curveCatmullRom,
curveLinearClosed,
curveLinear,
curveMonotoneX,
curveMonotoneY,
curveNatural,
curveStep,
curveStepAfter,
curveStepBefore,
stack,
stackOffsetExpand,
stackOffsetNone,
stackOffsetSilhouette,
stackOffsetWiggle,
stackOrderAscending,
stackOrderDescending,
stackOrderInsideOut,
stackOrderNone,
stackOrderReverse
} from "d3-shape"
export {
color,
rgb,
hsl,
lab,
hcl,
cubehelix
} from "d3-color";
export {
interpolate,
interpolateArray,
interpolateNumber,
interpolateObject,
interpolateRound,
interpolateString,
interpolateTransformCss,
interpolateTransformSvg,
interpolateZoom,
interpolateRgb,
interpolateHsl,
interpolateHslLong,
interpolateLab,
interpolateHcl,
interpolateHclLong,
interpolateCubehelix,
interpolateCubehelixLong
} from "d3-interpolate";
export {
dispatch
} from "d3-dispatch";
export {
dsvFormat,
csvParse,
csvParseRows,
csvFormat,
csvFormatRows,
tsvParse,
tsvParseRows,
tsvFormat,
tsvFormatRows
} from "d3-dsv";
export {
request,
html,
json,
text,
xml,
csv,
tsv
} from "d3-request";
export {
now,
timer,
timerFlush,
timeout,
interval
} from "d3-timer";
export {
timeInterval,
timeMillisecond,
timeMilliseconds,
timeSecond,
timeSeconds,
timeMinute,
timeMinutes,
timeHour,
timeHours,
timeDay,
timeDays,
timeWeek,
timeWeeks,
timeSunday,
timeSundays,
timeMonday,
timeMondays,