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);