Update all dependencies, remove d3 from the greenkeeper ignore list

Also add a few workarounds for a few weird rollup v0.36 issues
This commit is contained in:
Bryan Housel
2016-09-26 00:42:51 -04:00
parent b90c5459ab
commit e4509cc123
3 changed files with 27 additions and 13 deletions

View File

@@ -3,6 +3,13 @@ import _ from 'lodash';
import { euclideanDistance, interp } from '../geo/index';
import { Node } from '../core/index';
import {
polygonArea as d3polygonArea,
polygonHull as d3polygonHull,
polygonCentroid as d3polygonCentroid
} from 'd3-polygon';
export function Circularize(wayId
, projection, maxAngle) {
maxAngle = (maxAngle || 20) * Math.PI / 180;
@@ -18,9 +25,9 @@ export function Circularize(wayId
keyNodes = nodes.filter(function(n) { return graph.parentWays(n).length !== 1; }),
points = nodes.map(function(n) { return projection(n.loc); }),
keyPoints = keyNodes.map(function(n) { return projection(n.loc); }),
centroid = (points.length === 2) ? interp(points[0], points[1], 0.5) : d3.polygonCentroid(points),
centroid = (points.length === 2) ? interp(points[0], points[1], 0.5) : d3polygonCentroid(points),
radius = d3.median(points, function(p) { return euclideanDistance(centroid, p); }),
sign = d3.polygonArea(points) > 0 ? 1 : -1,
sign = d3polygonArea(points) > 0 ? 1 : -1,
ids;
// we need atleast two key nodes for the algorithm to work
@@ -152,8 +159,8 @@ export function Circularize(wayId
var way = graph.entity(wayId),
nodes = _.uniq(graph.childNodes(way)),
points = nodes.map(function(n) { return projection(n.loc); }),
sign = d3.polygonArea(points) > 0 ? 1 : -1,
hull = d3.polygonHull(points);
sign = d3polygonArea(points) > 0 ? 1 : -1,
hull = d3polygonHull(points);
// D3 convex hulls go counterclockwise..
if (sign === -1) {

View File

@@ -1,4 +1,5 @@
import * as d3 from 'd3';
import { transition as d3transition } from 'd3-transition';
import _ from 'lodash';
@@ -13,6 +14,13 @@ export function Breathe() {
timer;
// This is a workaround for a bug in rollup v0.36
// https://github.com/rollup/rollup/issues/984
// The symbol for this default export is not used anywhere, but it
// needs to be called in order to be included in the bundle.
var t = d3transition();
function ratchetyInterpolator(a, b, steps, units) {
a = parseFloat(a);
b = parseFloat(b);

View File

@@ -25,7 +25,7 @@
"license": "ISC",
"dependencies": {
"diacritics": "1.2.3",
"lodash": "4.13.1",
"lodash": "4.16.2",
"marked": "0.3.6",
"osm-auth": "0.2.9",
"rbush": "2.0.1",
@@ -40,8 +40,8 @@
"ecstatic": "~2.1.0",
"editor-layer-index": "git://github.com/osmlab/editor-layer-index.git#gh-pages",
"gaze": "~1.1.1",
"eslint": "~3.4.0",
"glob": "~7.0.5",
"eslint": "~3.6.0",
"glob": "~7.1.0",
"happen": "~0.3.1",
"js-yaml": "~3.6.1",
"jsonschema": "~1.1.0",
@@ -51,22 +51,21 @@
"mocha-phantomjs-core": "~2.0.1",
"name-suggestion-index": "0.1.1",
"phantomjs-prebuilt": "~2.1.11",
"request": "~2.73.0",
"rollup": "0.34.10",
"rollup-plugin-commonjs": "3.3.1",
"rollup-plugin-json": "2.0.1",
"request": "~2.75.0",
"rollup": "0.36.0",
"rollup-plugin-commonjs": "5.0.4",
"rollup-plugin-json": "2.0.2",
"rollup-plugin-node-resolve": "2.0.0",
"sinon": "~1.17.5",
"sinon-chai": "~2.8.0",
"smash": "0.0",
"svg-sprite": "1.3.3",
"svg-sprite": "1.3.6",
"uglify-js": "~2.7.0",
"xml2js": "~0.4.17",
"xmlbuilder": "~8.2.2"
},
"greenkeeper": {
"ignore": [
"d3",
"maki"
]
},