d3-rails 4.9.1 → 4.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/app/assets/javascripts/d3.js +419 -375
- data/app/assets/javascripts/d3.min.js +2 -8
- data/app/assets/javascripts/d3.v4.js +419 -375
- data/app/assets/javascripts/d3.v4.min.js +2 -8
- data/lib/d3/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1f9acb8b1a2f3d52ce52e05b338878f77dab8d3
|
4
|
+
data.tar.gz: 2a8aef7962aa0f9bc1db17a084287c09ee24e28b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 202a7e91968c3c237d738d797030d536375348cd79d1b39a7329c28024b2cfe618415dc83ff36a24783897aec631418a4f1cfed05d202bb4da5fbd9ac0147b27
|
7
|
+
data.tar.gz: 1a3a8b24e2ac2b47c871754719719d87484deaff3b7e698ebf9464c98a557881e140dcd3e9fd9896c1deecd37e92dfae34f890c5a5b0bd302f2c4b88e87a4af7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,7 +8,7 @@ d3-rails provides D3 for Rails 3.1 and higher.
|
|
8
8
|
|
9
9
|
## Version
|
10
10
|
|
11
|
-
d3-rails comes with version 4.
|
11
|
+
d3-rails comes with version 4.10.0 of D3.js. The d3-rails version will
|
12
12
|
always mirror the version of D3. If you need a newer version of
|
13
13
|
d3-rails, see section Development (below).
|
14
14
|
|
@@ -1,11 +1,11 @@
|
|
1
|
-
// https://d3js.org Version 4.
|
1
|
+
// https://d3js.org Version 4.10.0. Copyright 2017 Mike Bostock.
|
2
2
|
(function (global, factory) {
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
5
5
|
(factory((global.d3 = global.d3 || {})));
|
6
6
|
}(this, (function (exports) { 'use strict';
|
7
7
|
|
8
|
-
var version = "4.
|
8
|
+
var version = "4.10.0";
|
9
9
|
|
10
10
|
var ascending = function(a, b) {
|
11
11
|
return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
@@ -574,11 +574,17 @@ function translateY(y) {
|
|
574
574
|
return "translate(0," + (y + 0.5) + ")";
|
575
575
|
}
|
576
576
|
|
577
|
+
function number$1(scale) {
|
578
|
+
return function(d) {
|
579
|
+
return +scale(d);
|
580
|
+
};
|
581
|
+
}
|
582
|
+
|
577
583
|
function center(scale) {
|
578
584
|
var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.
|
579
585
|
if (scale.round()) offset = Math.round(offset);
|
580
586
|
return function(d) {
|
581
|
-
return scale(d) + offset;
|
587
|
+
return +scale(d) + offset;
|
582
588
|
};
|
583
589
|
}
|
584
590
|
|
@@ -602,9 +608,9 @@ function axis(orient, scale) {
|
|
602
608
|
format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity$1) : tickFormat,
|
603
609
|
spacing = Math.max(tickSizeInner, 0) + tickPadding,
|
604
610
|
range = scale.range(),
|
605
|
-
range0 = range[0] + 0.5,
|
606
|
-
range1 = range[range.length - 1] + 0.5,
|
607
|
-
position = (scale.bandwidth ? center :
|
611
|
+
range0 = +range[0] + 0.5,
|
612
|
+
range1 = +range[range.length - 1] + 0.5,
|
613
|
+
position = (scale.bandwidth ? center : number$1)(scale.copy()),
|
608
614
|
selection = context.selection ? context.selection() : context,
|
609
615
|
path = selection.selectAll(".domain").data([null]),
|
610
616
|
tick = selection.selectAll(".tick").data(values, scale).order(),
|
@@ -1244,9 +1250,9 @@ var selection_exit = function() {
|
|
1244
1250
|
return new Selection(this._exit || this._groups.map(sparse), this._parents);
|
1245
1251
|
};
|
1246
1252
|
|
1247
|
-
var selection_merge = function(selection) {
|
1253
|
+
var selection_merge = function(selection$$1) {
|
1248
1254
|
|
1249
|
-
for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
1255
|
+
for (var groups0 = this._groups, groups1 = selection$$1._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
1250
1256
|
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
|
1251
1257
|
if (node = group0[i] || group1[i]) {
|
1252
1258
|
merge[i] = node;
|
@@ -1830,6 +1836,10 @@ function defaultSubject(d) {
|
|
1830
1836
|
return d == null ? {x: exports.event.x, y: exports.event.y} : d;
|
1831
1837
|
}
|
1832
1838
|
|
1839
|
+
function touchable() {
|
1840
|
+
return "ontouchstart" in this;
|
1841
|
+
}
|
1842
|
+
|
1833
1843
|
var drag = function() {
|
1834
1844
|
var filter = defaultFilter$1,
|
1835
1845
|
container = defaultContainer,
|
@@ -1843,12 +1853,14 @@ var drag = function() {
|
|
1843
1853
|
touchending,
|
1844
1854
|
clickDistance2 = 0;
|
1845
1855
|
|
1846
|
-
function drag(selection
|
1847
|
-
selection
|
1856
|
+
function drag(selection) {
|
1857
|
+
selection
|
1848
1858
|
.on("mousedown.drag", mousedowned)
|
1859
|
+
.filter(touchable)
|
1849
1860
|
.on("touchstart.drag", touchstarted)
|
1850
1861
|
.on("touchmove.drag", touchmoved)
|
1851
1862
|
.on("touchend.drag touchcancel.drag", touchended)
|
1863
|
+
.style("touch-action", "none")
|
1852
1864
|
.style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
1853
1865
|
}
|
1854
1866
|
|
@@ -2539,7 +2551,7 @@ function nogamma(a, b) {
|
|
2539
2551
|
return d ? linear(a, d) : constant$3(isNaN(a) ? b : a);
|
2540
2552
|
}
|
2541
2553
|
|
2542
|
-
var interpolateRgb = (
|
2554
|
+
var interpolateRgb = (function rgbGamma(y) {
|
2543
2555
|
var color$$1 = gamma(y);
|
2544
2556
|
|
2545
2557
|
function rgb$$1(start, end) {
|
@@ -2559,7 +2571,7 @@ var interpolateRgb = ((function rgbGamma(y) {
|
|
2559
2571
|
rgb$$1.gamma = rgbGamma;
|
2560
2572
|
|
2561
2573
|
return rgb$$1;
|
2562
|
-
})
|
2574
|
+
})(1);
|
2563
2575
|
|
2564
2576
|
function rgbSpline(spline) {
|
2565
2577
|
return function(colors) {
|
@@ -2994,7 +3006,7 @@ var clockLast = 0;
|
|
2994
3006
|
var clockNow = 0;
|
2995
3007
|
var clockSkew = 0;
|
2996
3008
|
var clock = typeof performance === "object" && performance.now ? performance : Date;
|
2997
|
-
var setFrame = typeof
|
3009
|
+
var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };
|
2998
3010
|
|
2999
3011
|
function now() {
|
3000
3012
|
return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
@@ -3272,7 +3284,7 @@ function create(node, id, self) {
|
|
3272
3284
|
|
3273
3285
|
var interrupt = function(node, name) {
|
3274
3286
|
var schedules = node.__transition,
|
3275
|
-
schedule,
|
3287
|
+
schedule$$1,
|
3276
3288
|
active,
|
3277
3289
|
empty = true,
|
3278
3290
|
i;
|
@@ -3282,11 +3294,11 @@ var interrupt = function(node, name) {
|
|
3282
3294
|
name = name == null ? null : name + "";
|
3283
3295
|
|
3284
3296
|
for (i in schedules) {
|
3285
|
-
if ((schedule = schedules[i]).name !== name) { empty = false; continue; }
|
3286
|
-
active = schedule.state > STARTING && schedule.state < ENDING;
|
3287
|
-
schedule.state = ENDED;
|
3288
|
-
schedule.timer.stop();
|
3289
|
-
if (active) schedule.on.call("interrupt", node, node.__data__, schedule.index, schedule.group);
|
3297
|
+
if ((schedule$$1 = schedules[i]).name !== name) { empty = false; continue; }
|
3298
|
+
active = schedule$$1.state > STARTING && schedule$$1.state < ENDING;
|
3299
|
+
schedule$$1.state = ENDED;
|
3300
|
+
schedule$$1.timer.stop();
|
3301
|
+
if (active) schedule$$1.on.call("interrupt", node, node.__data__, schedule$$1.index, schedule$$1.group);
|
3290
3302
|
delete schedules[i];
|
3291
3303
|
}
|
3292
3304
|
|
@@ -3302,8 +3314,8 @@ var selection_interrupt = function(name) {
|
|
3302
3314
|
function tweenRemove(id, name) {
|
3303
3315
|
var tween0, tween1;
|
3304
3316
|
return function() {
|
3305
|
-
var schedule = set$1(this, id),
|
3306
|
-
tween = schedule.tween;
|
3317
|
+
var schedule$$1 = set$1(this, id),
|
3318
|
+
tween = schedule$$1.tween;
|
3307
3319
|
|
3308
3320
|
// If this node shared tween with the previous node,
|
3309
3321
|
// just assign the updated shared tween and we’re done!
|
@@ -3319,7 +3331,7 @@ function tweenRemove(id, name) {
|
|
3319
3331
|
}
|
3320
3332
|
}
|
3321
3333
|
|
3322
|
-
schedule.tween = tween1;
|
3334
|
+
schedule$$1.tween = tween1;
|
3323
3335
|
};
|
3324
3336
|
}
|
3325
3337
|
|
@@ -3327,8 +3339,8 @@ function tweenFunction(id, name, value) {
|
|
3327
3339
|
var tween0, tween1;
|
3328
3340
|
if (typeof value !== "function") throw new Error;
|
3329
3341
|
return function() {
|
3330
|
-
var schedule = set$1(this, id),
|
3331
|
-
tween = schedule.tween;
|
3342
|
+
var schedule$$1 = set$1(this, id),
|
3343
|
+
tween = schedule$$1.tween;
|
3332
3344
|
|
3333
3345
|
// If this node shared tween with the previous node,
|
3334
3346
|
// just assign the updated shared tween and we’re done!
|
@@ -3344,7 +3356,7 @@ function tweenFunction(id, name, value) {
|
|
3344
3356
|
if (i === n) tween1.push(t);
|
3345
3357
|
}
|
3346
3358
|
|
3347
|
-
schedule.tween = tween1;
|
3359
|
+
schedule$$1.tween = tween1;
|
3348
3360
|
};
|
3349
3361
|
}
|
3350
3362
|
|
@@ -3370,8 +3382,8 @@ function tweenValue(transition, name, value) {
|
|
3370
3382
|
var id = transition._id;
|
3371
3383
|
|
3372
3384
|
transition.each(function() {
|
3373
|
-
var schedule = set$1(this, id);
|
3374
|
-
(schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
|
3385
|
+
var schedule$$1 = set$1(this, id);
|
3386
|
+
(schedule$$1.value || (schedule$$1.value = {}))[name] = value.apply(this, arguments);
|
3375
3387
|
});
|
3376
3388
|
|
3377
3389
|
return function(node) {
|
@@ -3379,7 +3391,7 @@ function tweenValue(transition, name, value) {
|
|
3379
3391
|
};
|
3380
3392
|
}
|
3381
3393
|
|
3382
|
-
var interpolate
|
3394
|
+
var interpolate = function(a, b) {
|
3383
3395
|
var c;
|
3384
3396
|
return (typeof b === "number" ? reinterpolate
|
3385
3397
|
: b instanceof color ? interpolateRgb
|
@@ -3450,7 +3462,7 @@ function attrFunctionNS$1(fullname, interpolate$$1, value) {
|
|
3450
3462
|
}
|
3451
3463
|
|
3452
3464
|
var transition_attr = function(name, value) {
|
3453
|
-
var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate
|
3465
|
+
var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate;
|
3454
3466
|
return this.attrTween(name, typeof value === "function"
|
3455
3467
|
? (fullname.local ? attrFunctionNS$1 : attrFunction$1)(fullname, i, tweenValue(this, "attr." + name, value))
|
3456
3468
|
: value == null ? (fullname.local ? attrRemoveNS$1 : attrRemove$1)(fullname)
|
@@ -3561,10 +3573,10 @@ var transition_filter = function(match) {
|
|
3561
3573
|
return new Transition(subgroups, this._parents, this._name, this._id);
|
3562
3574
|
};
|
3563
3575
|
|
3564
|
-
var transition_merge = function(transition) {
|
3565
|
-
if (transition._id !== this._id) throw new Error;
|
3576
|
+
var transition_merge = function(transition$$1) {
|
3577
|
+
if (transition$$1._id !== this._id) throw new Error;
|
3566
3578
|
|
3567
|
-
for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
3579
|
+
for (var groups0 = this._groups, groups1 = transition$$1._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
|
3568
3580
|
for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
|
3569
3581
|
if (node = group0[i] || group1[i]) {
|
3570
3582
|
merge[i] = node;
|
@@ -3590,15 +3602,15 @@ function start(name) {
|
|
3590
3602
|
function onFunction(id, name, listener) {
|
3591
3603
|
var on0, on1, sit = start(name) ? init : set$1;
|
3592
3604
|
return function() {
|
3593
|
-
var schedule = sit(this, id),
|
3594
|
-
on = schedule.on;
|
3605
|
+
var schedule$$1 = sit(this, id),
|
3606
|
+
on = schedule$$1.on;
|
3595
3607
|
|
3596
3608
|
// If this node shared a dispatch with the previous node,
|
3597
3609
|
// just assign the updated shared dispatch and we’re done!
|
3598
3610
|
// Otherwise, copy-on-write.
|
3599
3611
|
if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
|
3600
3612
|
|
3601
|
-
schedule.on = on1;
|
3613
|
+
schedule$$1.on = on1;
|
3602
3614
|
};
|
3603
3615
|
}
|
3604
3616
|
|
@@ -3670,7 +3682,7 @@ var transition_selection = function() {
|
|
3670
3682
|
return new Selection$1(this._groups, this._parents);
|
3671
3683
|
};
|
3672
3684
|
|
3673
|
-
function styleRemove$1(name, interpolate$$
|
3685
|
+
function styleRemove$1(name, interpolate$$1) {
|
3674
3686
|
var value00,
|
3675
3687
|
value10,
|
3676
3688
|
interpolate0;
|
@@ -3679,7 +3691,7 @@ function styleRemove$1(name, interpolate$$2) {
|
|
3679
3691
|
value1 = (this.style.removeProperty(name), styleValue(this, name));
|
3680
3692
|
return value0 === value1 ? null
|
3681
3693
|
: value0 === value00 && value1 === value10 ? interpolate0
|
3682
|
-
: interpolate0 = interpolate$$
|
3694
|
+
: interpolate0 = interpolate$$1(value00 = value0, value10 = value1);
|
3683
3695
|
};
|
3684
3696
|
}
|
3685
3697
|
|
@@ -3689,18 +3701,18 @@ function styleRemoveEnd(name) {
|
|
3689
3701
|
};
|
3690
3702
|
}
|
3691
3703
|
|
3692
|
-
function styleConstant$1(name, interpolate$$
|
3704
|
+
function styleConstant$1(name, interpolate$$1, value1) {
|
3693
3705
|
var value00,
|
3694
3706
|
interpolate0;
|
3695
3707
|
return function() {
|
3696
3708
|
var value0 = styleValue(this, name);
|
3697
3709
|
return value0 === value1 ? null
|
3698
3710
|
: value0 === value00 ? interpolate0
|
3699
|
-
: interpolate0 = interpolate$$
|
3711
|
+
: interpolate0 = interpolate$$1(value00 = value0, value1);
|
3700
3712
|
};
|
3701
3713
|
}
|
3702
3714
|
|
3703
|
-
function styleFunction$1(name, interpolate$$
|
3715
|
+
function styleFunction$1(name, interpolate$$1, value) {
|
3704
3716
|
var value00,
|
3705
3717
|
value10,
|
3706
3718
|
interpolate0;
|
@@ -3710,12 +3722,12 @@ function styleFunction$1(name, interpolate$$2, value) {
|
|
3710
3722
|
if (value1 == null) value1 = (this.style.removeProperty(name), styleValue(this, name));
|
3711
3723
|
return value0 === value1 ? null
|
3712
3724
|
: value0 === value00 && value1 === value10 ? interpolate0
|
3713
|
-
: interpolate0 = interpolate$$
|
3725
|
+
: interpolate0 = interpolate$$1(value00 = value0, value10 = value1);
|
3714
3726
|
};
|
3715
3727
|
}
|
3716
3728
|
|
3717
3729
|
var transition_style = function(name, value, priority) {
|
3718
|
-
var i = (name += "") === "transform" ? interpolateTransformCss : interpolate
|
3730
|
+
var i = (name += "") === "transform" ? interpolateTransformCss : interpolate;
|
3719
3731
|
return value == null ? this
|
3720
3732
|
.styleTween(name, styleRemove$1(name, i))
|
3721
3733
|
.on("end.style." + name, styleRemoveEnd(name))
|
@@ -4086,13 +4098,13 @@ var root$1 = [null];
|
|
4086
4098
|
|
4087
4099
|
var active = function(node, name) {
|
4088
4100
|
var schedules = node.__transition,
|
4089
|
-
schedule,
|
4101
|
+
schedule$$1,
|
4090
4102
|
i;
|
4091
4103
|
|
4092
4104
|
if (schedules) {
|
4093
4105
|
name = name == null ? null : name + "";
|
4094
4106
|
for (i in schedules) {
|
4095
|
-
if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) {
|
4107
|
+
if ((schedule$$1 = schedules[i]).state > SCHEDULED && schedule$$1.name === name) {
|
4096
4108
|
return new Transition([[node]], root$1, name, +i);
|
4097
4109
|
}
|
4098
4110
|
}
|
@@ -4301,7 +4313,7 @@ function brush$1(dim) {
|
|
4301
4313
|
.on("mousedown.brush touchstart.brush", started);
|
4302
4314
|
}
|
4303
4315
|
|
4304
|
-
brush.move = function(group, selection
|
4316
|
+
brush.move = function(group, selection) {
|
4305
4317
|
if (group.selection) {
|
4306
4318
|
group
|
4307
4319
|
.on("start.brush", function() { emitter(this, arguments).beforestart().start(); })
|
@@ -4311,7 +4323,7 @@ function brush$1(dim) {
|
|
4311
4323
|
state = that.__brush,
|
4312
4324
|
emit = emitter(that, arguments),
|
4313
4325
|
selection0 = state.selection,
|
4314
|
-
selection1 = dim.input(typeof selection
|
4326
|
+
selection1 = dim.input(typeof selection === "function" ? selection.apply(this, arguments) : selection, state.extent),
|
4315
4327
|
i = interpolateValue(selection0, selection1);
|
4316
4328
|
|
4317
4329
|
function tween(t) {
|
@@ -4328,7 +4340,7 @@ function brush$1(dim) {
|
|
4328
4340
|
var that = this,
|
4329
4341
|
args = arguments,
|
4330
4342
|
state = that.__brush,
|
4331
|
-
selection1 = dim.input(typeof selection
|
4343
|
+
selection1 = dim.input(typeof selection === "function" ? selection.apply(that, args) : selection, state.extent),
|
4332
4344
|
emit = emitter(that, args).beforestart();
|
4333
4345
|
|
4334
4346
|
interrupt(that);
|
@@ -4341,22 +4353,22 @@ function brush$1(dim) {
|
|
4341
4353
|
|
4342
4354
|
function redraw() {
|
4343
4355
|
var group = select(this),
|
4344
|
-
selection
|
4356
|
+
selection = local$$1(this).selection;
|
4345
4357
|
|
4346
|
-
if (selection
|
4358
|
+
if (selection) {
|
4347
4359
|
group.selectAll(".selection")
|
4348
4360
|
.style("display", null)
|
4349
|
-
.attr("x", selection
|
4350
|
-
.attr("y", selection
|
4351
|
-
.attr("width", selection
|
4352
|
-
.attr("height", selection
|
4361
|
+
.attr("x", selection[0][0])
|
4362
|
+
.attr("y", selection[0][1])
|
4363
|
+
.attr("width", selection[1][0] - selection[0][0])
|
4364
|
+
.attr("height", selection[1][1] - selection[0][1]);
|
4353
4365
|
|
4354
4366
|
group.selectAll(".handle")
|
4355
4367
|
.style("display", null)
|
4356
|
-
.attr("x", function(d) { return d.type[d.type.length - 1] === "e" ? selection
|
4357
|
-
.attr("y", function(d) { return d.type[0] === "s" ? selection
|
4358
|
-
.attr("width", function(d) { return d.type === "n" || d.type === "s" ? selection
|
4359
|
-
.attr("height", function(d) { return d.type === "e" || d.type === "w" ? selection
|
4368
|
+
.attr("x", function(d) { return d.type[d.type.length - 1] === "e" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; })
|
4369
|
+
.attr("y", function(d) { return d.type[0] === "s" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; })
|
4370
|
+
.attr("width", function(d) { return d.type === "n" || d.type === "s" ? selection[1][0] - selection[0][0] + handleSize : handleSize; })
|
4371
|
+
.attr("height", function(d) { return d.type === "e" || d.type === "w" ? selection[1][1] - selection[0][1] + handleSize : handleSize; });
|
4360
4372
|
}
|
4361
4373
|
|
4362
4374
|
else {
|
@@ -4414,7 +4426,7 @@ function brush$1(dim) {
|
|
4414
4426
|
signY = dim === X ? null : signsY[type],
|
4415
4427
|
state = local$$1(that),
|
4416
4428
|
extent = state.extent,
|
4417
|
-
selection
|
4429
|
+
selection = state.selection,
|
4418
4430
|
W = extent[0][0], w0, w1,
|
4419
4431
|
N = extent[0][1], n0, n1,
|
4420
4432
|
E = extent[1][0], e0, e1,
|
@@ -4430,15 +4442,15 @@ function brush$1(dim) {
|
|
4430
4442
|
emit = emitter(that, arguments).beforestart();
|
4431
4443
|
|
4432
4444
|
if (type === "overlay") {
|
4433
|
-
state.selection = selection
|
4445
|
+
state.selection = selection = [
|
4434
4446
|
[w0 = dim === Y ? W : point0[0], n0 = dim === X ? N : point0[1]],
|
4435
4447
|
[e0 = dim === Y ? E : w0, s0 = dim === X ? S : n0]
|
4436
4448
|
];
|
4437
4449
|
} else {
|
4438
|
-
w0 = selection
|
4439
|
-
n0 = selection
|
4440
|
-
e0 = selection
|
4441
|
-
s0 = selection
|
4450
|
+
w0 = selection[0][0];
|
4451
|
+
n0 = selection[0][1];
|
4452
|
+
e0 = selection[1][0];
|
4453
|
+
s0 = selection[1][1];
|
4442
4454
|
}
|
4443
4455
|
|
4444
4456
|
w1 = w0;
|
@@ -4524,14 +4536,14 @@ function brush$1(dim) {
|
|
4524
4536
|
if (type in flipY) overlay.attr("cursor", cursors[type = flipY[type]]);
|
4525
4537
|
}
|
4526
4538
|
|
4527
|
-
if (state.selection) selection
|
4528
|
-
if (lockX) w1 = selection
|
4529
|
-
if (lockY) n1 = selection
|
4539
|
+
if (state.selection) selection = state.selection; // May be set by brush.move!
|
4540
|
+
if (lockX) w1 = selection[0][0], e1 = selection[1][0];
|
4541
|
+
if (lockY) n1 = selection[0][1], s1 = selection[1][1];
|
4530
4542
|
|
4531
|
-
if (selection
|
4532
|
-
|| selection
|
4533
|
-
|| selection
|
4534
|
-
|| selection
|
4543
|
+
if (selection[0][0] !== w1
|
4544
|
+
|| selection[0][1] !== n1
|
4545
|
+
|| selection[1][0] !== e1
|
4546
|
+
|| selection[1][1] !== s1) {
|
4535
4547
|
state.selection = [[w1, n1], [e1, s1]];
|
4536
4548
|
redraw.call(that);
|
4537
4549
|
emit.brush();
|
@@ -4551,8 +4563,8 @@ function brush$1(dim) {
|
|
4551
4563
|
}
|
4552
4564
|
group.attr("pointer-events", "all");
|
4553
4565
|
overlay.attr("cursor", cursors.overlay);
|
4554
|
-
if (state.selection) selection
|
4555
|
-
if (empty(selection
|
4566
|
+
if (state.selection) selection = state.selection; // May be set by brush.move (on start)!
|
4567
|
+
if (empty(selection)) state.selection = null, redraw.call(that);
|
4556
4568
|
emit.end();
|
4557
4569
|
}
|
4558
4570
|
|
@@ -5081,10 +5093,10 @@ var nest = function() {
|
|
5081
5093
|
nest;
|
5082
5094
|
|
5083
5095
|
function apply(array, depth, createResult, setResult) {
|
5084
|
-
if (depth >= keys.length)
|
5085
|
-
|
5086
|
-
|
5087
|
-
|
5096
|
+
if (depth >= keys.length) {
|
5097
|
+
if (sortValues != null) array.sort(sortValues);
|
5098
|
+
return rollup != null ? rollup(array) : array;
|
5099
|
+
}
|
5088
5100
|
|
5089
5101
|
var i = -1,
|
5090
5102
|
n = array.length,
|
@@ -6189,17 +6201,17 @@ var manyBody = function() {
|
|
6189
6201
|
}
|
6190
6202
|
|
6191
6203
|
function accumulate(quad) {
|
6192
|
-
var strength = 0, q, c, x
|
6204
|
+
var strength = 0, q, c, x, y, i;
|
6193
6205
|
|
6194
6206
|
// For internal nodes, accumulate forces from child quadrants.
|
6195
6207
|
if (quad.length) {
|
6196
|
-
for (x
|
6208
|
+
for (x = y = i = 0; i < 4; ++i) {
|
6197
6209
|
if ((q = quad[i]) && (c = q.value)) {
|
6198
|
-
strength += c, x
|
6210
|
+
strength += c, x += c * q.x, y += c * q.y;
|
6199
6211
|
}
|
6200
6212
|
}
|
6201
|
-
quad.x = x
|
6202
|
-
quad.y = y
|
6213
|
+
quad.x = x / strength;
|
6214
|
+
quad.y = y / strength;
|
6203
6215
|
}
|
6204
6216
|
|
6205
6217
|
// For leaf nodes, accumulate forces from coincident quadrants.
|
@@ -6217,20 +6229,20 @@ var manyBody = function() {
|
|
6217
6229
|
function apply(quad, x1, _, x2) {
|
6218
6230
|
if (!quad.value) return true;
|
6219
6231
|
|
6220
|
-
var x
|
6221
|
-
y
|
6232
|
+
var x = quad.x - node.x,
|
6233
|
+
y = quad.y - node.y,
|
6222
6234
|
w = x2 - x1,
|
6223
|
-
l = x
|
6235
|
+
l = x * x + y * y;
|
6224
6236
|
|
6225
6237
|
// Apply the Barnes-Hut approximation if possible.
|
6226
6238
|
// Limit forces for very close nodes; randomize direction if coincident.
|
6227
6239
|
if (w * w / theta2 < l) {
|
6228
6240
|
if (l < distanceMax2) {
|
6229
|
-
if (x
|
6230
|
-
if (y
|
6241
|
+
if (x === 0) x = jiggle(), l += x * x;
|
6242
|
+
if (y === 0) y = jiggle(), l += y * y;
|
6231
6243
|
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
|
6232
|
-
node.vx += x
|
6233
|
-
node.vy += y
|
6244
|
+
node.vx += x * quad.value * alpha / l;
|
6245
|
+
node.vy += y * quad.value * alpha / l;
|
6234
6246
|
}
|
6235
6247
|
return true;
|
6236
6248
|
}
|
@@ -6240,15 +6252,15 @@ var manyBody = function() {
|
|
6240
6252
|
|
6241
6253
|
// Limit forces for very close nodes; randomize direction if coincident.
|
6242
6254
|
if (quad.data !== node || quad.next) {
|
6243
|
-
if (x
|
6244
|
-
if (y
|
6255
|
+
if (x === 0) x = jiggle(), l += x * x;
|
6256
|
+
if (y === 0) y = jiggle(), l += y * y;
|
6245
6257
|
if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
|
6246
6258
|
}
|
6247
6259
|
|
6248
6260
|
do if (quad.data !== node) {
|
6249
6261
|
w = strengths[quad.data.index] * alpha / l;
|
6250
|
-
node.vx += x
|
6251
|
-
node.vy += y
|
6262
|
+
node.vx += x * w;
|
6263
|
+
node.vy += y * w;
|
6252
6264
|
} while (quad = quad.next);
|
6253
6265
|
}
|
6254
6266
|
|
@@ -9485,7 +9497,7 @@ function scaleTranslate(kx, ky, tx, ty) {
|
|
9485
9497
|
}
|
9486
9498
|
|
9487
9499
|
var identity$5 = function() {
|
9488
|
-
var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, transform = identity$4, // scale, translate and reflect
|
9500
|
+
var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, transform$$1 = identity$4, // scale, translate and reflect
|
9489
9501
|
x0 = null, y0, x1, y1, clip = identity$4, // clip extent
|
9490
9502
|
cache,
|
9491
9503
|
cacheStream,
|
@@ -9498,22 +9510,22 @@ var identity$5 = function() {
|
|
9498
9510
|
|
9499
9511
|
return projection = {
|
9500
9512
|
stream: function(stream) {
|
9501
|
-
return cache && cacheStream === stream ? cache : cache = transform(clip(cacheStream = stream));
|
9513
|
+
return cache && cacheStream === stream ? cache : cache = transform$$1(clip(cacheStream = stream));
|
9502
9514
|
},
|
9503
9515
|
clipExtent: function(_) {
|
9504
9516
|
return arguments.length ? (clip = _ == null ? (x0 = y0 = x1 = y1 = null, identity$4) : clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];
|
9505
9517
|
},
|
9506
9518
|
scale: function(_) {
|
9507
|
-
return arguments.length ? (transform = scaleTranslate((k = +_) * sx, k * sy, tx, ty), reset()) : k;
|
9519
|
+
return arguments.length ? (transform$$1 = scaleTranslate((k = +_) * sx, k * sy, tx, ty), reset()) : k;
|
9508
9520
|
},
|
9509
9521
|
translate: function(_) {
|
9510
|
-
return arguments.length ? (transform = scaleTranslate(k * sx, k * sy, tx = +_[0], ty = +_[1]), reset()) : [tx, ty];
|
9522
|
+
return arguments.length ? (transform$$1 = scaleTranslate(k * sx, k * sy, tx = +_[0], ty = +_[1]), reset()) : [tx, ty];
|
9511
9523
|
},
|
9512
9524
|
reflectX: function(_) {
|
9513
|
-
return arguments.length ? (transform = scaleTranslate(k * (sx = _ ? -1 : 1), k * sy, tx, ty), reset()) : sx < 0;
|
9525
|
+
return arguments.length ? (transform$$1 = scaleTranslate(k * (sx = _ ? -1 : 1), k * sy, tx, ty), reset()) : sx < 0;
|
9514
9526
|
},
|
9515
9527
|
reflectY: function(_) {
|
9516
|
-
return arguments.length ? (transform = scaleTranslate(k * sx, k * (sy = _ ? -1 : 1), tx, ty), reset()) : sy < 0;
|
9528
|
+
return arguments.length ? (transform$$1 = scaleTranslate(k * sx, k * (sy = _ ? -1 : 1), tx, ty), reset()) : sy < 0;
|
9517
9529
|
},
|
9518
9530
|
fitExtent: function(extent, object) {
|
9519
9531
|
return fitExtent(projection, extent, object);
|
@@ -9866,83 +9878,92 @@ Node.prototype = hierarchy.prototype = {
|
|
9866
9878
|
copy: node_copy
|
9867
9879
|
};
|
9868
9880
|
|
9869
|
-
|
9870
|
-
this._ = value;
|
9871
|
-
this.next = null;
|
9872
|
-
}
|
9881
|
+
var slice$3 = Array.prototype.slice;
|
9873
9882
|
|
9874
|
-
|
9875
|
-
var
|
9876
|
-
|
9877
|
-
|
9878
|
-
node = head;
|
9883
|
+
function shuffle$1(array) {
|
9884
|
+
var m = array.length,
|
9885
|
+
t,
|
9886
|
+
i;
|
9879
9887
|
|
9880
|
-
while (
|
9881
|
-
|
9882
|
-
|
9883
|
-
|
9884
|
-
array[i] =
|
9888
|
+
while (m) {
|
9889
|
+
i = Math.random() * m-- | 0;
|
9890
|
+
t = array[m];
|
9891
|
+
array[m] = array[i];
|
9892
|
+
array[i] = t;
|
9885
9893
|
}
|
9886
9894
|
|
9887
|
-
return
|
9888
|
-
|
9889
|
-
tail: node
|
9890
|
-
};
|
9891
|
-
};
|
9895
|
+
return array;
|
9896
|
+
}
|
9892
9897
|
|
9893
9898
|
var enclose = function(circles) {
|
9894
|
-
|
9899
|
+
var i = 0, n = (circles = shuffle$1(slice$3.call(circles))).length, B = [], p, e;
|
9900
|
+
|
9901
|
+
while (i < n) {
|
9902
|
+
p = circles[i];
|
9903
|
+
if (e && enclosesWeak(e, p)) ++i;
|
9904
|
+
else e = encloseBasis(B = extendBasis(B, p)), i = 0;
|
9905
|
+
}
|
9906
|
+
|
9907
|
+
return e;
|
9895
9908
|
};
|
9896
9909
|
|
9897
|
-
function
|
9898
|
-
var
|
9899
|
-
dy = b.y - a.y,
|
9900
|
-
dr = a.r - b.r;
|
9901
|
-
return dr * dr + 1e-6 > dx * dx + dy * dy;
|
9902
|
-
}
|
9910
|
+
function extendBasis(B, p) {
|
9911
|
+
var i, j;
|
9903
9912
|
|
9904
|
-
|
9905
|
-
function encloseN(L, B) {
|
9906
|
-
var circle,
|
9907
|
-
l0 = null,
|
9908
|
-
l1 = L.head,
|
9909
|
-
l2,
|
9910
|
-
p1;
|
9913
|
+
if (enclosesWeakAll(p, B)) return [p];
|
9911
9914
|
|
9912
|
-
|
9913
|
-
|
9914
|
-
|
9915
|
-
|
9915
|
+
// If we get here then B must have at least one element.
|
9916
|
+
for (i = 0; i < B.length; ++i) {
|
9917
|
+
if (enclosesNot(p, B[i])
|
9918
|
+
&& enclosesWeakAll(encloseBasis2(B[i], p), B)) {
|
9919
|
+
return [B[i], p];
|
9920
|
+
}
|
9916
9921
|
}
|
9917
9922
|
|
9918
|
-
|
9919
|
-
|
9920
|
-
|
9923
|
+
// If we get here then B must have at least two elements.
|
9924
|
+
for (i = 0; i < B.length - 1; ++i) {
|
9925
|
+
for (j = i + 1; j < B.length; ++j) {
|
9926
|
+
if (enclosesNot(encloseBasis2(B[i], B[j]), p)
|
9927
|
+
&& enclosesNot(encloseBasis2(B[i], p), B[j])
|
9928
|
+
&& enclosesNot(encloseBasis2(B[j], p), B[i])
|
9929
|
+
&& enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {
|
9930
|
+
return [B[i], B[j], p];
|
9931
|
+
}
|
9932
|
+
}
|
9933
|
+
}
|
9921
9934
|
|
9922
|
-
|
9923
|
-
|
9924
|
-
|
9935
|
+
// If we get here then something is very wrong.
|
9936
|
+
throw new Error;
|
9937
|
+
}
|
9925
9938
|
|
9926
|
-
|
9927
|
-
|
9928
|
-
|
9939
|
+
function enclosesNot(a, b) {
|
9940
|
+
var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;
|
9941
|
+
return dr < 0 || dr * dr < dx * dx + dy * dy;
|
9942
|
+
}
|
9929
9943
|
|
9930
|
-
|
9931
|
-
|
9932
|
-
|
9933
|
-
|
9944
|
+
function enclosesWeak(a, b) {
|
9945
|
+
var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y;
|
9946
|
+
return dr > 0 && dr * dr > dx * dx + dy * dy;
|
9947
|
+
}
|
9934
9948
|
|
9935
|
-
|
9936
|
-
|
9949
|
+
function enclosesWeakAll(a, B) {
|
9950
|
+
for (var i = 0; i < B.length; ++i) {
|
9951
|
+
if (!enclosesWeak(a, B[i])) {
|
9952
|
+
return false;
|
9937
9953
|
}
|
9938
|
-
l1 = l2;
|
9939
9954
|
}
|
9955
|
+
return true;
|
9956
|
+
}
|
9940
9957
|
|
9941
|
-
|
9942
|
-
|
9958
|
+
function encloseBasis(B) {
|
9959
|
+
switch (B.length) {
|
9960
|
+
case 1: return encloseBasis1(B[0]);
|
9961
|
+
case 2: return encloseBasis2(B[0], B[1]);
|
9962
|
+
case 3: return encloseBasis3(B[0], B[1], B[2]);
|
9963
|
+
}
|
9943
9964
|
}
|
9944
9965
|
|
9945
|
-
function
|
9966
|
+
function encloseBasis1(a) {
|
9946
9967
|
return {
|
9947
9968
|
x: a.x,
|
9948
9969
|
y: a.y,
|
@@ -9950,7 +9971,7 @@ function enclose1(a) {
|
|
9950
9971
|
};
|
9951
9972
|
}
|
9952
9973
|
|
9953
|
-
function
|
9974
|
+
function encloseBasis2(a, b) {
|
9954
9975
|
var x1 = a.x, y1 = a.y, r1 = a.r,
|
9955
9976
|
x2 = b.x, y2 = b.y, r2 = b.r,
|
9956
9977
|
x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,
|
@@ -9962,30 +9983,31 @@ function enclose2(a, b) {
|
|
9962
9983
|
};
|
9963
9984
|
}
|
9964
9985
|
|
9965
|
-
function
|
9986
|
+
function encloseBasis3(a, b, c) {
|
9966
9987
|
var x1 = a.x, y1 = a.y, r1 = a.r,
|
9967
9988
|
x2 = b.x, y2 = b.y, r2 = b.r,
|
9968
9989
|
x3 = c.x, y3 = c.y, r3 = c.r,
|
9969
|
-
a2 =
|
9970
|
-
|
9971
|
-
|
9972
|
-
|
9973
|
-
|
9974
|
-
|
9975
|
-
|
9976
|
-
|
9990
|
+
a2 = x1 - x2,
|
9991
|
+
a3 = x1 - x3,
|
9992
|
+
b2 = y1 - y2,
|
9993
|
+
b3 = y1 - y3,
|
9994
|
+
c2 = r2 - r1,
|
9995
|
+
c3 = r3 - r1,
|
9996
|
+
d1 = x1 * x1 + y1 * y1 - r1 * r1,
|
9997
|
+
d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,
|
9998
|
+
d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,
|
9977
9999
|
ab = a3 * b2 - a2 * b3,
|
9978
|
-
xa = (b2 * d3 - b3 * d2) / ab - x1,
|
10000
|
+
xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,
|
9979
10001
|
xb = (b3 * c2 - b2 * c3) / ab,
|
9980
|
-
ya = (a3 * d2 - a2 * d3) / ab - y1,
|
10002
|
+
ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,
|
9981
10003
|
yb = (a2 * c3 - a3 * c2) / ab,
|
9982
10004
|
A = xb * xb + yb * yb - 1,
|
9983
|
-
B = 2 * (xa * xb + ya * yb
|
10005
|
+
B = 2 * (r1 + xa * xb + ya * yb),
|
9984
10006
|
C = xa * xa + ya * ya - r1 * r1,
|
9985
|
-
r = (
|
10007
|
+
r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);
|
9986
10008
|
return {
|
9987
|
-
x: xa + xb * r
|
9988
|
-
y: ya + yb * r
|
10009
|
+
x: x1 + xa + xb * r,
|
10010
|
+
y: y1 + ya + yb * r,
|
9989
10011
|
r: r
|
9990
10012
|
};
|
9991
10013
|
}
|
@@ -10016,12 +10038,12 @@ function intersects(a, b) {
|
|
10016
10038
|
return dr * dr - 1e-6 > dx * dx + dy * dy;
|
10017
10039
|
}
|
10018
10040
|
|
10019
|
-
function
|
10041
|
+
function score(node) {
|
10020
10042
|
var a = node._,
|
10021
10043
|
b = node.next._,
|
10022
10044
|
ab = a.r + b.r,
|
10023
|
-
dx = (a.x * b.r + b.x * a.r) / ab
|
10024
|
-
dy = (a.y * b.r + b.y * a.r) / ab
|
10045
|
+
dx = (a.x * b.r + b.x * a.r) / ab,
|
10046
|
+
dy = (a.y * b.r + b.y * a.r) / ab;
|
10025
10047
|
return dx * dx + dy * dy;
|
10026
10048
|
}
|
10027
10049
|
|
@@ -10034,7 +10056,7 @@ function Node$1(circle) {
|
|
10034
10056
|
function packEnclose(circles) {
|
10035
10057
|
if (!(n = circles.length)) return 0;
|
10036
10058
|
|
10037
|
-
var a, b, c, n;
|
10059
|
+
var a, b, c, n, aa, ca, i, j, k, sj, sk;
|
10038
10060
|
|
10039
10061
|
// Place the first circle.
|
10040
10062
|
a = circles[0], a.x = 0, a.y = 0;
|
@@ -10047,15 +10069,6 @@ function packEnclose(circles) {
|
|
10047
10069
|
// Place the third circle.
|
10048
10070
|
place(b, a, c = circles[2]);
|
10049
10071
|
|
10050
|
-
// Initialize the weighted centroid.
|
10051
|
-
var aa = a.r * a.r,
|
10052
|
-
ba = b.r * b.r,
|
10053
|
-
ca = c.r * c.r,
|
10054
|
-
oa = aa + ba + ca,
|
10055
|
-
ox = aa * a.x + ba * b.x + ca * c.x,
|
10056
|
-
oy = aa * a.y + ba * b.y + ca * c.y,
|
10057
|
-
cx, cy, i, j, k, sj, sk;
|
10058
|
-
|
10059
10072
|
// Initialize the front-chain using the first three circles a, b and c.
|
10060
10073
|
a = new Node$1(a), b = new Node$1(b), c = new Node$1(c);
|
10061
10074
|
a.next = c.previous = b;
|
@@ -10089,15 +10102,10 @@ function packEnclose(circles) {
|
|
10089
10102
|
// Success! Insert the new circle c between a and b.
|
10090
10103
|
c.previous = a, c.next = b, a.next = b.previous = b = c;
|
10091
10104
|
|
10092
|
-
// Update the weighted centroid.
|
10093
|
-
oa += ca = c._.r * c._.r;
|
10094
|
-
ox += ca * c._.x;
|
10095
|
-
oy += ca * c._.y;
|
10096
|
-
|
10097
10105
|
// Compute the new closest circle pair to the centroid.
|
10098
|
-
aa =
|
10106
|
+
aa = score(a);
|
10099
10107
|
while ((c = c.next) !== b) {
|
10100
|
-
if ((ca =
|
10108
|
+
if ((ca = score(c)) < aa) {
|
10101
10109
|
a = c, aa = ca;
|
10102
10110
|
}
|
10103
10111
|
}
|
@@ -10654,7 +10662,7 @@ function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
|
|
10654
10662
|
return rows;
|
10655
10663
|
}
|
10656
10664
|
|
10657
|
-
var squarify = (
|
10665
|
+
var squarify = (function custom(ratio) {
|
10658
10666
|
|
10659
10667
|
function squarify(parent, x0, y0, x1, y1) {
|
10660
10668
|
squarifyRatio(ratio, parent, x0, y0, x1, y1);
|
@@ -10665,7 +10673,7 @@ var squarify = ((function custom(ratio) {
|
|
10665
10673
|
};
|
10666
10674
|
|
10667
10675
|
return squarify;
|
10668
|
-
})
|
10676
|
+
})(phi);
|
10669
10677
|
|
10670
10678
|
var index$3 = function() {
|
10671
10679
|
var tile = squarify,
|
@@ -10808,7 +10816,7 @@ var sliceDice = function(parent, x0, y0, x1, y1) {
|
|
10808
10816
|
(parent.depth & 1 ? treemapSlice : treemapDice)(parent, x0, y0, x1, y1);
|
10809
10817
|
};
|
10810
10818
|
|
10811
|
-
var resquarify = (
|
10819
|
+
var resquarify = (function custom(ratio) {
|
10812
10820
|
|
10813
10821
|
function resquarify(parent, x0, y0, x1, y1) {
|
10814
10822
|
if ((rows = parent._squarify) && (rows.ratio === ratio)) {
|
@@ -10839,7 +10847,7 @@ var resquarify = ((function custom(ratio) {
|
|
10839
10847
|
};
|
10840
10848
|
|
10841
10849
|
return resquarify;
|
10842
|
-
})
|
10850
|
+
})(phi);
|
10843
10851
|
|
10844
10852
|
var area$1 = function(polygon) {
|
10845
10853
|
var i = -1,
|
@@ -10975,7 +10983,7 @@ var length$2 = function(polygon) {
|
|
10975
10983
|
return perimeter;
|
10976
10984
|
};
|
10977
10985
|
|
10978
|
-
var slice$
|
10986
|
+
var slice$4 = [].slice;
|
10979
10987
|
|
10980
10988
|
var noabort = {};
|
10981
10989
|
|
@@ -10997,7 +11005,7 @@ Queue.prototype = queue.prototype = {
|
|
10997
11005
|
if (typeof callback !== "function") throw new Error("invalid callback");
|
10998
11006
|
if (this._call) throw new Error("defer after await");
|
10999
11007
|
if (this._error != null) return this;
|
11000
|
-
var t = slice$
|
11008
|
+
var t = slice$4.call(arguments, 1);
|
11001
11009
|
t.push(callback);
|
11002
11010
|
++this._waiting, this._tasks.push(t);
|
11003
11011
|
poke$1(this);
|
@@ -11101,7 +11109,7 @@ var defaultSource$1 = function() {
|
|
11101
11109
|
return Math.random();
|
11102
11110
|
};
|
11103
11111
|
|
11104
|
-
var uniform = (
|
11112
|
+
var uniform = (function sourceRandomUniform(source) {
|
11105
11113
|
function randomUniform(min, max) {
|
11106
11114
|
min = min == null ? 0 : +min;
|
11107
11115
|
max = max == null ? 1 : +max;
|
@@ -11115,9 +11123,9 @@ var uniform = ((function sourceRandomUniform(source) {
|
|
11115
11123
|
randomUniform.source = sourceRandomUniform;
|
11116
11124
|
|
11117
11125
|
return randomUniform;
|
11118
|
-
})
|
11126
|
+
})(defaultSource$1);
|
11119
11127
|
|
11120
|
-
var normal = (
|
11128
|
+
var normal = (function sourceRandomNormal(source) {
|
11121
11129
|
function randomNormal(mu, sigma) {
|
11122
11130
|
var x, r;
|
11123
11131
|
mu = mu == null ? 0 : +mu;
|
@@ -11142,9 +11150,9 @@ var normal = ((function sourceRandomNormal(source) {
|
|
11142
11150
|
randomNormal.source = sourceRandomNormal;
|
11143
11151
|
|
11144
11152
|
return randomNormal;
|
11145
|
-
})
|
11153
|
+
})(defaultSource$1);
|
11146
11154
|
|
11147
|
-
var logNormal = (
|
11155
|
+
var logNormal = (function sourceRandomLogNormal(source) {
|
11148
11156
|
function randomLogNormal() {
|
11149
11157
|
var randomNormal = normal.source(source).apply(this, arguments);
|
11150
11158
|
return function() {
|
@@ -11155,9 +11163,9 @@ var logNormal = ((function sourceRandomLogNormal(source) {
|
|
11155
11163
|
randomLogNormal.source = sourceRandomLogNormal;
|
11156
11164
|
|
11157
11165
|
return randomLogNormal;
|
11158
|
-
})
|
11166
|
+
})(defaultSource$1);
|
11159
11167
|
|
11160
|
-
var irwinHall = (
|
11168
|
+
var irwinHall = (function sourceRandomIrwinHall(source) {
|
11161
11169
|
function randomIrwinHall(n) {
|
11162
11170
|
return function() {
|
11163
11171
|
for (var sum = 0, i = 0; i < n; ++i) sum += source();
|
@@ -11168,9 +11176,9 @@ var irwinHall = ((function sourceRandomIrwinHall(source) {
|
|
11168
11176
|
randomIrwinHall.source = sourceRandomIrwinHall;
|
11169
11177
|
|
11170
11178
|
return randomIrwinHall;
|
11171
|
-
})
|
11179
|
+
})(defaultSource$1);
|
11172
11180
|
|
11173
|
-
var bates = (
|
11181
|
+
var bates = (function sourceRandomBates(source) {
|
11174
11182
|
function randomBates(n) {
|
11175
11183
|
var randomIrwinHall = irwinHall.source(source)(n);
|
11176
11184
|
return function() {
|
@@ -11181,9 +11189,9 @@ var bates = ((function sourceRandomBates(source) {
|
|
11181
11189
|
randomBates.source = sourceRandomBates;
|
11182
11190
|
|
11183
11191
|
return randomBates;
|
11184
|
-
})
|
11192
|
+
})(defaultSource$1);
|
11185
11193
|
|
11186
|
-
var exponential$1 = (
|
11194
|
+
var exponential$1 = (function sourceRandomExponential(source) {
|
11187
11195
|
function randomExponential(lambda) {
|
11188
11196
|
return function() {
|
11189
11197
|
return -Math.log(1 - source()) / lambda;
|
@@ -11193,7 +11201,7 @@ var exponential$1 = ((function sourceRandomExponential(source) {
|
|
11193
11201
|
randomExponential.source = sourceRandomExponential;
|
11194
11202
|
|
11195
11203
|
return randomExponential;
|
11196
|
-
})
|
11204
|
+
})(defaultSource$1);
|
11197
11205
|
|
11198
11206
|
var request = function(url, callback) {
|
11199
11207
|
var request,
|
@@ -11396,7 +11404,7 @@ var tsv$1 = dsv$1("text/tab-separated-values", tsvParse);
|
|
11396
11404
|
var array$2 = Array.prototype;
|
11397
11405
|
|
11398
11406
|
var map$3 = array$2.map;
|
11399
|
-
var slice$
|
11407
|
+
var slice$5 = array$2.slice;
|
11400
11408
|
|
11401
11409
|
var implicit = {name: "implicit"};
|
11402
11410
|
|
@@ -11405,7 +11413,7 @@ function ordinal(range) {
|
|
11405
11413
|
domain = [],
|
11406
11414
|
unknown = implicit;
|
11407
11415
|
|
11408
|
-
range = range == null ? [] : slice$
|
11416
|
+
range = range == null ? [] : slice$5.call(range);
|
11409
11417
|
|
11410
11418
|
function scale(d) {
|
11411
11419
|
var key = d + "", i = index.get(key);
|
@@ -11425,7 +11433,7 @@ function ordinal(range) {
|
|
11425
11433
|
};
|
11426
11434
|
|
11427
11435
|
scale.range = function(_) {
|
11428
|
-
return arguments.length ? (range = slice$
|
11436
|
+
return arguments.length ? (range = slice$5.call(_), scale) : range.slice();
|
11429
11437
|
};
|
11430
11438
|
|
11431
11439
|
scale.unknown = function(_) {
|
@@ -11446,7 +11454,7 @@ function band() {
|
|
11446
11454
|
var scale = ordinal().unknown(undefined),
|
11447
11455
|
domain = scale.domain,
|
11448
11456
|
ordinalRange = scale.range,
|
11449
|
-
range
|
11457
|
+
range = [0, 1],
|
11450
11458
|
step,
|
11451
11459
|
bandwidth,
|
11452
11460
|
round = false,
|
@@ -11458,9 +11466,9 @@ function band() {
|
|
11458
11466
|
|
11459
11467
|
function rescale() {
|
11460
11468
|
var n = domain().length,
|
11461
|
-
reverse = range
|
11462
|
-
start = range
|
11463
|
-
stop = range
|
11469
|
+
reverse = range[1] < range[0],
|
11470
|
+
start = range[reverse - 0],
|
11471
|
+
stop = range[1 - reverse];
|
11464
11472
|
step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
|
11465
11473
|
if (round) step = Math.floor(step);
|
11466
11474
|
start += (stop - start - step * (n - paddingInner)) * align;
|
@@ -11475,11 +11483,11 @@ function band() {
|
|
11475
11483
|
};
|
11476
11484
|
|
11477
11485
|
scale.range = function(_) {
|
11478
|
-
return arguments.length ? (range
|
11486
|
+
return arguments.length ? (range = [+_[0], +_[1]], rescale()) : range.slice();
|
11479
11487
|
};
|
11480
11488
|
|
11481
11489
|
scale.rangeRound = function(_) {
|
11482
|
-
return range
|
11490
|
+
return range = [+_[0], +_[1]], round = true, rescale();
|
11483
11491
|
};
|
11484
11492
|
|
11485
11493
|
scale.bandwidth = function() {
|
@@ -11513,7 +11521,7 @@ function band() {
|
|
11513
11521
|
scale.copy = function() {
|
11514
11522
|
return band()
|
11515
11523
|
.domain(domain())
|
11516
|
-
.range(range
|
11524
|
+
.range(range)
|
11517
11525
|
.round(round)
|
11518
11526
|
.paddingInner(paddingInner)
|
11519
11527
|
.paddingOuter(paddingOuter)
|
@@ -11547,7 +11555,7 @@ var constant$9 = function(x) {
|
|
11547
11555
|
};
|
11548
11556
|
};
|
11549
11557
|
|
11550
|
-
var number$
|
11558
|
+
var number$2 = function(x) {
|
11551
11559
|
return +x;
|
11552
11560
|
};
|
11553
11561
|
|
@@ -11566,22 +11574,22 @@ function deinterpolateClamp(deinterpolate) {
|
|
11566
11574
|
};
|
11567
11575
|
}
|
11568
11576
|
|
11569
|
-
function reinterpolateClamp(reinterpolate) {
|
11577
|
+
function reinterpolateClamp(reinterpolate$$1) {
|
11570
11578
|
return function(a, b) {
|
11571
|
-
var r = reinterpolate(a = +a, b = +b);
|
11579
|
+
var r = reinterpolate$$1(a = +a, b = +b);
|
11572
11580
|
return function(t) { return t <= 0 ? a : t >= 1 ? b : r(t); };
|
11573
11581
|
};
|
11574
11582
|
}
|
11575
11583
|
|
11576
|
-
function bimap(domain, range
|
11577
|
-
var d0 = domain[0], d1 = domain[1], r0 = range
|
11578
|
-
if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate(r1, r0);
|
11579
|
-
else d0 = deinterpolate(d0, d1), r0 = reinterpolate(r0, r1);
|
11584
|
+
function bimap(domain, range, deinterpolate, reinterpolate$$1) {
|
11585
|
+
var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
|
11586
|
+
if (d1 < d0) d0 = deinterpolate(d1, d0), r0 = reinterpolate$$1(r1, r0);
|
11587
|
+
else d0 = deinterpolate(d0, d1), r0 = reinterpolate$$1(r0, r1);
|
11580
11588
|
return function(x) { return r0(d0(x)); };
|
11581
11589
|
}
|
11582
11590
|
|
11583
|
-
function polymap(domain, range
|
11584
|
-
var j = Math.min(domain.length, range
|
11591
|
+
function polymap(domain, range, deinterpolate, reinterpolate$$1) {
|
11592
|
+
var j = Math.min(domain.length, range.length) - 1,
|
11585
11593
|
d = new Array(j),
|
11586
11594
|
r = new Array(j),
|
11587
11595
|
i = -1;
|
@@ -11589,12 +11597,12 @@ function polymap(domain, range$$1, deinterpolate, reinterpolate) {
|
|
11589
11597
|
// Reverse descending domains.
|
11590
11598
|
if (domain[j] < domain[0]) {
|
11591
11599
|
domain = domain.slice().reverse();
|
11592
|
-
range
|
11600
|
+
range = range.slice().reverse();
|
11593
11601
|
}
|
11594
11602
|
|
11595
11603
|
while (++i < j) {
|
11596
11604
|
d[i] = deinterpolate(domain[i], domain[i + 1]);
|
11597
|
-
r[i] = reinterpolate(range
|
11605
|
+
r[i] = reinterpolate$$1(range[i], range[i + 1]);
|
11598
11606
|
}
|
11599
11607
|
|
11600
11608
|
return function(x) {
|
@@ -11613,39 +11621,39 @@ function copy(source, target) {
|
|
11613
11621
|
|
11614
11622
|
// deinterpolate(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
|
11615
11623
|
// reinterpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding domain value x in [a,b].
|
11616
|
-
function continuous(deinterpolate, reinterpolate) {
|
11624
|
+
function continuous(deinterpolate, reinterpolate$$1) {
|
11617
11625
|
var domain = unit,
|
11618
|
-
range
|
11619
|
-
interpolate
|
11626
|
+
range = unit,
|
11627
|
+
interpolate = interpolateValue,
|
11620
11628
|
clamp = false,
|
11621
11629
|
piecewise,
|
11622
11630
|
output,
|
11623
11631
|
input;
|
11624
11632
|
|
11625
11633
|
function rescale() {
|
11626
|
-
piecewise = Math.min(domain.length, range
|
11634
|
+
piecewise = Math.min(domain.length, range.length) > 2 ? polymap : bimap;
|
11627
11635
|
output = input = null;
|
11628
11636
|
return scale;
|
11629
11637
|
}
|
11630
11638
|
|
11631
11639
|
function scale(x) {
|
11632
|
-
return (output || (output = piecewise(domain, range
|
11640
|
+
return (output || (output = piecewise(domain, range, clamp ? deinterpolateClamp(deinterpolate) : deinterpolate, interpolate)))(+x);
|
11633
11641
|
}
|
11634
11642
|
|
11635
11643
|
scale.invert = function(y) {
|
11636
|
-
return (input || (input = piecewise(range
|
11644
|
+
return (input || (input = piecewise(range, domain, deinterpolateLinear, clamp ? reinterpolateClamp(reinterpolate$$1) : reinterpolate$$1)))(+y);
|
11637
11645
|
};
|
11638
11646
|
|
11639
11647
|
scale.domain = function(_) {
|
11640
|
-
return arguments.length ? (domain = map$3.call(_, number$
|
11648
|
+
return arguments.length ? (domain = map$3.call(_, number$2), rescale()) : domain.slice();
|
11641
11649
|
};
|
11642
11650
|
|
11643
11651
|
scale.range = function(_) {
|
11644
|
-
return arguments.length ? (range
|
11652
|
+
return arguments.length ? (range = slice$5.call(_), rescale()) : range.slice();
|
11645
11653
|
};
|
11646
11654
|
|
11647
11655
|
scale.rangeRound = function(_) {
|
11648
|
-
return range
|
11656
|
+
return range = slice$5.call(_), interpolate = interpolateRound, rescale();
|
11649
11657
|
};
|
11650
11658
|
|
11651
11659
|
scale.clamp = function(_) {
|
@@ -11653,7 +11661,7 @@ function continuous(deinterpolate, reinterpolate) {
|
|
11653
11661
|
};
|
11654
11662
|
|
11655
11663
|
scale.interpolate = function(_) {
|
11656
|
-
return arguments.length ? (interpolate
|
11664
|
+
return arguments.length ? (interpolate = _, rescale()) : interpolate;
|
11657
11665
|
};
|
11658
11666
|
|
11659
11667
|
return rescale();
|
@@ -11763,7 +11771,7 @@ function identity$6() {
|
|
11763
11771
|
scale.invert = scale;
|
11764
11772
|
|
11765
11773
|
scale.domain = scale.range = function(_) {
|
11766
|
-
return arguments.length ? (domain = map$3.call(_, number$
|
11774
|
+
return arguments.length ? (domain = map$3.call(_, number$2), scale) : domain.slice();
|
11767
11775
|
};
|
11768
11776
|
|
11769
11777
|
scale.copy = function() {
|
@@ -11950,24 +11958,24 @@ function sqrt$1() {
|
|
11950
11958
|
return pow$1().exponent(0.5);
|
11951
11959
|
}
|
11952
11960
|
|
11953
|
-
function quantile
|
11961
|
+
function quantile() {
|
11954
11962
|
var domain = [],
|
11955
|
-
range
|
11963
|
+
range = [],
|
11956
11964
|
thresholds = [];
|
11957
11965
|
|
11958
11966
|
function rescale() {
|
11959
|
-
var i = 0, n = Math.max(1, range
|
11967
|
+
var i = 0, n = Math.max(1, range.length);
|
11960
11968
|
thresholds = new Array(n - 1);
|
11961
11969
|
while (++i < n) thresholds[i - 1] = threshold(domain, i / n);
|
11962
11970
|
return scale;
|
11963
11971
|
}
|
11964
11972
|
|
11965
11973
|
function scale(x) {
|
11966
|
-
if (!isNaN(x = +x)) return range
|
11974
|
+
if (!isNaN(x = +x)) return range[bisectRight(thresholds, x)];
|
11967
11975
|
}
|
11968
11976
|
|
11969
11977
|
scale.invertExtent = function(y) {
|
11970
|
-
var i = range
|
11978
|
+
var i = range.indexOf(y);
|
11971
11979
|
return i < 0 ? [NaN, NaN] : [
|
11972
11980
|
i > 0 ? thresholds[i - 1] : domain[0],
|
11973
11981
|
i < thresholds.length ? thresholds[i] : domain[domain.length - 1]
|
@@ -11983,7 +11991,7 @@ function quantile$$1() {
|
|
11983
11991
|
};
|
11984
11992
|
|
11985
11993
|
scale.range = function(_) {
|
11986
|
-
return arguments.length ? (range
|
11994
|
+
return arguments.length ? (range = slice$5.call(_), rescale()) : range.slice();
|
11987
11995
|
};
|
11988
11996
|
|
11989
11997
|
scale.quantiles = function() {
|
@@ -11991,9 +11999,9 @@ function quantile$$1() {
|
|
11991
11999
|
};
|
11992
12000
|
|
11993
12001
|
scale.copy = function() {
|
11994
|
-
return quantile
|
12002
|
+
return quantile()
|
11995
12003
|
.domain(domain)
|
11996
|
-
.range(range
|
12004
|
+
.range(range);
|
11997
12005
|
};
|
11998
12006
|
|
11999
12007
|
return scale;
|
@@ -12004,10 +12012,10 @@ function quantize$1() {
|
|
12004
12012
|
x1 = 1,
|
12005
12013
|
n = 1,
|
12006
12014
|
domain = [0.5],
|
12007
|
-
range
|
12015
|
+
range = [0, 1];
|
12008
12016
|
|
12009
12017
|
function scale(x) {
|
12010
|
-
if (x <= x) return range
|
12018
|
+
if (x <= x) return range[bisectRight(domain, x, 0, n)];
|
12011
12019
|
}
|
12012
12020
|
|
12013
12021
|
function rescale() {
|
@@ -12022,11 +12030,11 @@ function quantize$1() {
|
|
12022
12030
|
};
|
12023
12031
|
|
12024
12032
|
scale.range = function(_) {
|
12025
|
-
return arguments.length ? (n = (range
|
12033
|
+
return arguments.length ? (n = (range = slice$5.call(_)).length - 1, rescale()) : range.slice();
|
12026
12034
|
};
|
12027
12035
|
|
12028
12036
|
scale.invertExtent = function(y) {
|
12029
|
-
var i = range
|
12037
|
+
var i = range.indexOf(y);
|
12030
12038
|
return i < 0 ? [NaN, NaN]
|
12031
12039
|
: i < 1 ? [x0, domain[0]]
|
12032
12040
|
: i >= n ? [domain[n - 1], x1]
|
@@ -12036,7 +12044,7 @@ function quantize$1() {
|
|
12036
12044
|
scale.copy = function() {
|
12037
12045
|
return quantize$1()
|
12038
12046
|
.domain([x0, x1])
|
12039
|
-
.range(range
|
12047
|
+
.range(range);
|
12040
12048
|
};
|
12041
12049
|
|
12042
12050
|
return linearish(scale);
|
@@ -12044,30 +12052,30 @@ function quantize$1() {
|
|
12044
12052
|
|
12045
12053
|
function threshold$1() {
|
12046
12054
|
var domain = [0.5],
|
12047
|
-
range
|
12055
|
+
range = [0, 1],
|
12048
12056
|
n = 1;
|
12049
12057
|
|
12050
12058
|
function scale(x) {
|
12051
|
-
if (x <= x) return range
|
12059
|
+
if (x <= x) return range[bisectRight(domain, x, 0, n)];
|
12052
12060
|
}
|
12053
12061
|
|
12054
12062
|
scale.domain = function(_) {
|
12055
|
-
return arguments.length ? (domain = slice$
|
12063
|
+
return arguments.length ? (domain = slice$5.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();
|
12056
12064
|
};
|
12057
12065
|
|
12058
12066
|
scale.range = function(_) {
|
12059
|
-
return arguments.length ? (range
|
12067
|
+
return arguments.length ? (range = slice$5.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();
|
12060
12068
|
};
|
12061
12069
|
|
12062
12070
|
scale.invertExtent = function(y) {
|
12063
|
-
var i = range
|
12071
|
+
var i = range.indexOf(y);
|
12064
12072
|
return [domain[i - 1], domain[i]];
|
12065
12073
|
};
|
12066
12074
|
|
12067
12075
|
scale.copy = function() {
|
12068
12076
|
return threshold$1()
|
12069
12077
|
.domain(domain)
|
12070
|
-
.range(range
|
12078
|
+
.range(range);
|
12071
12079
|
};
|
12072
12080
|
|
12073
12081
|
return scale;
|
@@ -12111,7 +12119,13 @@ function newInterval(floori, offseti, count, field) {
|
|
12111
12119
|
return newInterval(function(date) {
|
12112
12120
|
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
12113
12121
|
}, function(date, step) {
|
12114
|
-
if (date >= date)
|
12122
|
+
if (date >= date) {
|
12123
|
+
if (step < 0) while (++step <= 0) {
|
12124
|
+
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
12125
|
+
} else while (--step >= 0) {
|
12126
|
+
while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
|
12127
|
+
}
|
12128
|
+
}
|
12115
12129
|
});
|
12116
12130
|
};
|
12117
12131
|
|
@@ -12964,7 +12978,7 @@ function date$1(t) {
|
|
12964
12978
|
return new Date(t);
|
12965
12979
|
}
|
12966
12980
|
|
12967
|
-
function number$
|
12981
|
+
function number$3(t) {
|
12968
12982
|
return t instanceof Date ? +t : +new Date(+t);
|
12969
12983
|
}
|
12970
12984
|
|
@@ -13003,39 +13017,39 @@ function calendar(year$$1, month$$1, week, day$$1, hour$$1, minute$$1, second$$1
|
|
13003
13017
|
[ year$$1, 1, durationYear ]
|
13004
13018
|
];
|
13005
13019
|
|
13006
|
-
function tickFormat(date) {
|
13007
|
-
return (second$$1(date) < date ? formatMillisecond
|
13008
|
-
: minute$$1(date) < date ? formatSecond
|
13009
|
-
: hour$$1(date) < date ? formatMinute
|
13010
|
-
: day$$1(date) < date ? formatHour
|
13011
|
-
: month$$1(date) < date ? (week(date) < date ? formatDay : formatWeek)
|
13012
|
-
: year$$1(date) < date ? formatMonth
|
13013
|
-
: formatYear)(date);
|
13020
|
+
function tickFormat(date$$1) {
|
13021
|
+
return (second$$1(date$$1) < date$$1 ? formatMillisecond
|
13022
|
+
: minute$$1(date$$1) < date$$1 ? formatSecond
|
13023
|
+
: hour$$1(date$$1) < date$$1 ? formatMinute
|
13024
|
+
: day$$1(date$$1) < date$$1 ? formatHour
|
13025
|
+
: month$$1(date$$1) < date$$1 ? (week(date$$1) < date$$1 ? formatDay : formatWeek)
|
13026
|
+
: year$$1(date$$1) < date$$1 ? formatMonth
|
13027
|
+
: formatYear)(date$$1);
|
13014
13028
|
}
|
13015
13029
|
|
13016
|
-
function tickInterval(interval, start, stop, step) {
|
13017
|
-
if (interval == null) interval = 10;
|
13030
|
+
function tickInterval(interval$$1, start, stop, step) {
|
13031
|
+
if (interval$$1 == null) interval$$1 = 10;
|
13018
13032
|
|
13019
13033
|
// If a desired tick count is specified, pick a reasonable tick interval
|
13020
13034
|
// based on the extent of the domain and a rough estimate of tick size.
|
13021
13035
|
// Otherwise, assume interval is already a time interval and use it.
|
13022
|
-
if (typeof interval === "number") {
|
13023
|
-
var target = Math.abs(stop - start) / interval,
|
13036
|
+
if (typeof interval$$1 === "number") {
|
13037
|
+
var target = Math.abs(stop - start) / interval$$1,
|
13024
13038
|
i = bisector(function(i) { return i[2]; }).right(tickIntervals, target);
|
13025
13039
|
if (i === tickIntervals.length) {
|
13026
|
-
step = tickStep(start / durationYear, stop / durationYear, interval);
|
13027
|
-
interval = year$$1;
|
13040
|
+
step = tickStep(start / durationYear, stop / durationYear, interval$$1);
|
13041
|
+
interval$$1 = year$$1;
|
13028
13042
|
} else if (i) {
|
13029
13043
|
i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
|
13030
13044
|
step = i[1];
|
13031
|
-
interval = i[0];
|
13045
|
+
interval$$1 = i[0];
|
13032
13046
|
} else {
|
13033
|
-
step = tickStep(start, stop, interval);
|
13034
|
-
interval = millisecond$$1;
|
13047
|
+
step = tickStep(start, stop, interval$$1);
|
13048
|
+
interval$$1 = millisecond$$1;
|
13035
13049
|
}
|
13036
13050
|
}
|
13037
13051
|
|
13038
|
-
return step == null ? interval : interval.every(step);
|
13052
|
+
return step == null ? interval$$1 : interval$$1.every(step);
|
13039
13053
|
}
|
13040
13054
|
|
13041
13055
|
scale.invert = function(y) {
|
@@ -13043,17 +13057,17 @@ function calendar(year$$1, month$$1, week, day$$1, hour$$1, minute$$1, second$$1
|
|
13043
13057
|
};
|
13044
13058
|
|
13045
13059
|
scale.domain = function(_) {
|
13046
|
-
return arguments.length ? domain(map$3.call(_, number$
|
13060
|
+
return arguments.length ? domain(map$3.call(_, number$3)) : domain().map(date$1);
|
13047
13061
|
};
|
13048
13062
|
|
13049
|
-
scale.ticks = function(interval, step) {
|
13063
|
+
scale.ticks = function(interval$$1, step) {
|
13050
13064
|
var d = domain(),
|
13051
13065
|
t0 = d[0],
|
13052
13066
|
t1 = d[d.length - 1],
|
13053
13067
|
r = t1 < t0,
|
13054
13068
|
t;
|
13055
13069
|
if (r) t = t0, t0 = t1, t1 = t;
|
13056
|
-
t = tickInterval(interval, t0, t1, step);
|
13070
|
+
t = tickInterval(interval$$1, t0, t1, step);
|
13057
13071
|
t = t ? t.range(t0, t1 + 1) : []; // inclusive stop
|
13058
13072
|
return r ? t.reverse() : t;
|
13059
13073
|
};
|
@@ -13062,10 +13076,10 @@ function calendar(year$$1, month$$1, week, day$$1, hour$$1, minute$$1, second$$1
|
|
13062
13076
|
return specifier == null ? tickFormat : format(specifier);
|
13063
13077
|
};
|
13064
13078
|
|
13065
|
-
scale.nice = function(interval, step) {
|
13079
|
+
scale.nice = function(interval$$1, step) {
|
13066
13080
|
var d = domain();
|
13067
|
-
return (interval = tickInterval(interval, d[0], d[d.length - 1], step))
|
13068
|
-
? domain(nice(d, interval))
|
13081
|
+
return (interval$$1 = tickInterval(interval$$1, d[0], d[d.length - 1], step))
|
13082
|
+
? domain(nice(d, interval$$1))
|
13069
13083
|
: scale;
|
13070
13084
|
};
|
13071
13085
|
|
@@ -13483,8 +13497,8 @@ function y$3(p) {
|
|
13483
13497
|
}
|
13484
13498
|
|
13485
13499
|
var line = function() {
|
13486
|
-
var x
|
13487
|
-
y
|
13500
|
+
var x = x$3,
|
13501
|
+
y = y$3,
|
13488
13502
|
defined = constant$10(true),
|
13489
13503
|
context = null,
|
13490
13504
|
curve = curveLinear,
|
@@ -13504,18 +13518,18 @@ var line = function() {
|
|
13504
13518
|
if (defined0 = !defined0) output.lineStart();
|
13505
13519
|
else output.lineEnd();
|
13506
13520
|
}
|
13507
|
-
if (defined0) output.point(+x
|
13521
|
+
if (defined0) output.point(+x(d, i, data), +y(d, i, data));
|
13508
13522
|
}
|
13509
13523
|
|
13510
13524
|
if (buffer) return output = null, buffer + "" || null;
|
13511
13525
|
}
|
13512
13526
|
|
13513
13527
|
line.x = function(_) {
|
13514
|
-
return arguments.length ? (x
|
13528
|
+
return arguments.length ? (x = typeof _ === "function" ? _ : constant$10(+_), line) : x;
|
13515
13529
|
};
|
13516
13530
|
|
13517
13531
|
line.y = function(_) {
|
13518
|
-
return arguments.length ? (y
|
13532
|
+
return arguments.length ? (y = typeof _ === "function" ? _ : constant$10(+_), line) : y;
|
13519
13533
|
};
|
13520
13534
|
|
13521
13535
|
line.defined = function(_) {
|
@@ -13755,7 +13769,7 @@ function curveRadial(curve) {
|
|
13755
13769
|
return radial;
|
13756
13770
|
}
|
13757
13771
|
|
13758
|
-
function
|
13772
|
+
function lineRadial(l) {
|
13759
13773
|
var c = l.curve;
|
13760
13774
|
|
13761
13775
|
l.angle = l.x, delete l.x;
|
@@ -13768,11 +13782,11 @@ function radialLine(l) {
|
|
13768
13782
|
return l;
|
13769
13783
|
}
|
13770
13784
|
|
13771
|
-
var
|
13772
|
-
return
|
13785
|
+
var lineRadial$1 = function() {
|
13786
|
+
return lineRadial(line().curve(curveRadialLinear));
|
13773
13787
|
};
|
13774
13788
|
|
13775
|
-
var
|
13789
|
+
var areaRadial = function() {
|
13776
13790
|
var a = area$2().curve(curveRadialLinear),
|
13777
13791
|
c = a.curve,
|
13778
13792
|
x0 = a.lineX0,
|
@@ -13786,10 +13800,10 @@ var radialArea = function() {
|
|
13786
13800
|
a.radius = a.y, delete a.y;
|
13787
13801
|
a.innerRadius = a.y0, delete a.y0;
|
13788
13802
|
a.outerRadius = a.y1, delete a.y1;
|
13789
|
-
a.lineStartAngle = function() { return
|
13790
|
-
a.lineEndAngle = function() { return
|
13791
|
-
a.lineInnerRadius = function() { return
|
13792
|
-
a.lineOuterRadius = function() { return
|
13803
|
+
a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;
|
13804
|
+
a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;
|
13805
|
+
a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;
|
13806
|
+
a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;
|
13793
13807
|
|
13794
13808
|
a.curve = function(_) {
|
13795
13809
|
return arguments.length ? c(curveRadial(_)) : c()._curve;
|
@@ -13798,12 +13812,12 @@ var radialArea = function() {
|
|
13798
13812
|
return a;
|
13799
13813
|
};
|
13800
13814
|
|
13801
|
-
var
|
13802
|
-
|
13803
|
-
var radialPoint = function(x, y) {
|
13815
|
+
var pointRadial = function(x, y) {
|
13804
13816
|
return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];
|
13805
13817
|
};
|
13806
13818
|
|
13819
|
+
var slice$6 = Array.prototype.slice;
|
13820
|
+
|
13807
13821
|
function linkSource(d) {
|
13808
13822
|
return d.source;
|
13809
13823
|
}
|
@@ -13815,14 +13829,14 @@ function linkTarget(d) {
|
|
13815
13829
|
function link$2(curve) {
|
13816
13830
|
var source = linkSource,
|
13817
13831
|
target = linkTarget,
|
13818
|
-
x
|
13819
|
-
y
|
13832
|
+
x = x$3,
|
13833
|
+
y = y$3,
|
13820
13834
|
context = null;
|
13821
13835
|
|
13822
13836
|
function link() {
|
13823
|
-
var buffer, argv = slice$
|
13837
|
+
var buffer, argv = slice$6.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);
|
13824
13838
|
if (!context) context = buffer = path();
|
13825
|
-
curve(context, +x
|
13839
|
+
curve(context, +x.apply(this, (argv[0] = s, argv)), +y.apply(this, argv), +x.apply(this, (argv[0] = t, argv)), +y.apply(this, argv));
|
13826
13840
|
if (buffer) return context = null, buffer + "" || null;
|
13827
13841
|
}
|
13828
13842
|
|
@@ -13835,11 +13849,11 @@ function link$2(curve) {
|
|
13835
13849
|
};
|
13836
13850
|
|
13837
13851
|
link.x = function(_) {
|
13838
|
-
return arguments.length ? (x
|
13852
|
+
return arguments.length ? (x = typeof _ === "function" ? _ : constant$10(+_), link) : x;
|
13839
13853
|
};
|
13840
13854
|
|
13841
13855
|
link.y = function(_) {
|
13842
|
-
return arguments.length ? (y
|
13856
|
+
return arguments.length ? (y = typeof _ === "function" ? _ : constant$10(+_), link) : y;
|
13843
13857
|
};
|
13844
13858
|
|
13845
13859
|
link.context = function(_) {
|
@@ -13860,10 +13874,10 @@ function curveVertical(context, x0, y0, x1, y1) {
|
|
13860
13874
|
}
|
13861
13875
|
|
13862
13876
|
function curveRadial$1(context, x0, y0, x1, y1) {
|
13863
|
-
var p0 =
|
13864
|
-
p1 =
|
13865
|
-
p2 =
|
13866
|
-
p3 =
|
13877
|
+
var p0 = pointRadial(x0, y0),
|
13878
|
+
p1 = pointRadial(x0, y0 = (y0 + y1) / 2),
|
13879
|
+
p2 = pointRadial(x1, y0),
|
13880
|
+
p3 = pointRadial(x1, y1);
|
13867
13881
|
context.moveTo(p0[0], p0[1]);
|
13868
13882
|
context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);
|
13869
13883
|
}
|
@@ -14216,7 +14230,7 @@ Bundle.prototype = {
|
|
14216
14230
|
}
|
14217
14231
|
};
|
14218
14232
|
|
14219
|
-
var bundle = (
|
14233
|
+
var bundle = (function custom(beta) {
|
14220
14234
|
|
14221
14235
|
function bundle(context) {
|
14222
14236
|
return beta === 1 ? new Basis(context) : new Bundle(context, beta);
|
@@ -14227,7 +14241,7 @@ var bundle = ((function custom(beta) {
|
|
14227
14241
|
};
|
14228
14242
|
|
14229
14243
|
return bundle;
|
14230
|
-
})
|
14244
|
+
})(0.85);
|
14231
14245
|
|
14232
14246
|
function point$3(that, x, y) {
|
14233
14247
|
that._context.bezierCurveTo(
|
@@ -14278,7 +14292,7 @@ Cardinal.prototype = {
|
|
14278
14292
|
}
|
14279
14293
|
};
|
14280
14294
|
|
14281
|
-
var cardinal = (
|
14295
|
+
var cardinal = (function custom(tension) {
|
14282
14296
|
|
14283
14297
|
function cardinal(context) {
|
14284
14298
|
return new Cardinal(context, tension);
|
@@ -14289,7 +14303,7 @@ var cardinal = ((function custom(tension) {
|
|
14289
14303
|
};
|
14290
14304
|
|
14291
14305
|
return cardinal;
|
14292
|
-
})
|
14306
|
+
})(0);
|
14293
14307
|
|
14294
14308
|
function CardinalClosed(context, tension) {
|
14295
14309
|
this._context = context;
|
@@ -14337,18 +14351,18 @@ CardinalClosed.prototype = {
|
|
14337
14351
|
}
|
14338
14352
|
};
|
14339
14353
|
|
14340
|
-
var cardinalClosed = (
|
14354
|
+
var cardinalClosed = (function custom(tension) {
|
14341
14355
|
|
14342
|
-
function cardinal(context) {
|
14356
|
+
function cardinal$$1(context) {
|
14343
14357
|
return new CardinalClosed(context, tension);
|
14344
14358
|
}
|
14345
14359
|
|
14346
|
-
cardinal.tension = function(tension) {
|
14360
|
+
cardinal$$1.tension = function(tension) {
|
14347
14361
|
return custom(+tension);
|
14348
14362
|
};
|
14349
14363
|
|
14350
|
-
return cardinal;
|
14351
|
-
})
|
14364
|
+
return cardinal$$1;
|
14365
|
+
})(0);
|
14352
14366
|
|
14353
14367
|
function CardinalOpen(context, tension) {
|
14354
14368
|
this._context = context;
|
@@ -14385,18 +14399,18 @@ CardinalOpen.prototype = {
|
|
14385
14399
|
}
|
14386
14400
|
};
|
14387
14401
|
|
14388
|
-
var cardinalOpen = (
|
14402
|
+
var cardinalOpen = (function custom(tension) {
|
14389
14403
|
|
14390
|
-
function cardinal(context) {
|
14404
|
+
function cardinal$$1(context) {
|
14391
14405
|
return new CardinalOpen(context, tension);
|
14392
14406
|
}
|
14393
14407
|
|
14394
|
-
cardinal.tension = function(tension) {
|
14408
|
+
cardinal$$1.tension = function(tension) {
|
14395
14409
|
return custom(+tension);
|
14396
14410
|
};
|
14397
14411
|
|
14398
|
-
return cardinal;
|
14399
|
-
})
|
14412
|
+
return cardinal$$1;
|
14413
|
+
})(0);
|
14400
14414
|
|
14401
14415
|
function point$4(that, x, y) {
|
14402
14416
|
var x1 = that._x1,
|
@@ -14471,7 +14485,7 @@ CatmullRom.prototype = {
|
|
14471
14485
|
}
|
14472
14486
|
};
|
14473
14487
|
|
14474
|
-
var catmullRom = (
|
14488
|
+
var catmullRom = (function custom(alpha) {
|
14475
14489
|
|
14476
14490
|
function catmullRom(context) {
|
14477
14491
|
return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
|
@@ -14482,7 +14496,7 @@ var catmullRom = ((function custom(alpha) {
|
|
14482
14496
|
};
|
14483
14497
|
|
14484
14498
|
return catmullRom;
|
14485
|
-
})
|
14499
|
+
})(0.5);
|
14486
14500
|
|
14487
14501
|
function CatmullRomClosed(context, alpha) {
|
14488
14502
|
this._context = context;
|
@@ -14542,18 +14556,18 @@ CatmullRomClosed.prototype = {
|
|
14542
14556
|
}
|
14543
14557
|
};
|
14544
14558
|
|
14545
|
-
var catmullRomClosed = (
|
14559
|
+
var catmullRomClosed = (function custom(alpha) {
|
14546
14560
|
|
14547
|
-
function catmullRom(context) {
|
14561
|
+
function catmullRom$$1(context) {
|
14548
14562
|
return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
|
14549
14563
|
}
|
14550
14564
|
|
14551
|
-
catmullRom.alpha = function(alpha) {
|
14565
|
+
catmullRom$$1.alpha = function(alpha) {
|
14552
14566
|
return custom(+alpha);
|
14553
14567
|
};
|
14554
14568
|
|
14555
|
-
return catmullRom;
|
14556
|
-
})
|
14569
|
+
return catmullRom$$1;
|
14570
|
+
})(0.5);
|
14557
14571
|
|
14558
14572
|
function CatmullRomOpen(context, alpha) {
|
14559
14573
|
this._context = context;
|
@@ -14602,18 +14616,18 @@ CatmullRomOpen.prototype = {
|
|
14602
14616
|
}
|
14603
14617
|
};
|
14604
14618
|
|
14605
|
-
var catmullRomOpen = (
|
14619
|
+
var catmullRomOpen = (function custom(alpha) {
|
14606
14620
|
|
14607
|
-
function catmullRom(context) {
|
14621
|
+
function catmullRom$$1(context) {
|
14608
14622
|
return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
|
14609
14623
|
}
|
14610
14624
|
|
14611
|
-
catmullRom.alpha = function(alpha) {
|
14625
|
+
catmullRom$$1.alpha = function(alpha) {
|
14612
14626
|
return custom(+alpha);
|
14613
14627
|
};
|
14614
14628
|
|
14615
|
-
return catmullRom;
|
14616
|
-
})
|
14629
|
+
return catmullRom$$1;
|
14630
|
+
})(0.5);
|
14617
14631
|
|
14618
14632
|
function LinearClosed(context) {
|
14619
14633
|
this._context = context;
|
@@ -14915,7 +14929,7 @@ var stack = function() {
|
|
14915
14929
|
}
|
14916
14930
|
|
14917
14931
|
stack.keys = function(_) {
|
14918
|
-
return arguments.length ? (keys = typeof _ === "function" ? _ : constant$10(slice$
|
14932
|
+
return arguments.length ? (keys = typeof _ === "function" ? _ : constant$10(slice$6.call(_)), stack) : keys;
|
14919
14933
|
};
|
14920
14934
|
|
14921
14935
|
stack.value = function(_) {
|
@@ -14923,7 +14937,7 @@ var stack = function() {
|
|
14923
14937
|
};
|
14924
14938
|
|
14925
14939
|
stack.order = function(_) {
|
14926
|
-
return arguments.length ? (order = _ == null ? none$2 : typeof _ === "function" ? _ : constant$10(slice$
|
14940
|
+
return arguments.length ? (order = _ == null ? none$2 : typeof _ === "function" ? _ : constant$10(slice$6.call(_)), stack) : order;
|
14927
14941
|
};
|
14928
14942
|
|
14929
14943
|
stack.offset = function(_) {
|
@@ -15976,13 +15990,13 @@ Diagram.prototype = {
|
|
15976
15990
|
};
|
15977
15991
|
|
15978
15992
|
var voronoi = function() {
|
15979
|
-
var x
|
15980
|
-
y
|
15993
|
+
var x = x$4,
|
15994
|
+
y = y$4,
|
15981
15995
|
extent = null;
|
15982
15996
|
|
15983
15997
|
function voronoi(data) {
|
15984
15998
|
return new Diagram(data.map(function(d, i) {
|
15985
|
-
var s = [Math.round(x
|
15999
|
+
var s = [Math.round(x(d, i, data) / epsilon$4) * epsilon$4, Math.round(y(d, i, data) / epsilon$4) * epsilon$4];
|
15986
16000
|
s.index = i;
|
15987
16001
|
s.data = d;
|
15988
16002
|
return s;
|
@@ -16002,11 +16016,11 @@ var voronoi = function() {
|
|
16002
16016
|
};
|
16003
16017
|
|
16004
16018
|
voronoi.x = function(_) {
|
16005
|
-
return arguments.length ? (x
|
16019
|
+
return arguments.length ? (x = typeof _ === "function" ? _ : constant$11(+_), voronoi) : x;
|
16006
16020
|
};
|
16007
16021
|
|
16008
16022
|
voronoi.y = function(_) {
|
16009
|
-
return arguments.length ? (y
|
16023
|
+
return arguments.length ? (y = typeof _ === "function" ? _ : constant$11(+_), voronoi) : y;
|
16010
16024
|
};
|
16011
16025
|
|
16012
16026
|
voronoi.extent = function(_) {
|
@@ -16114,9 +16128,18 @@ function defaultTransform() {
|
|
16114
16128
|
return this.__zoom || identity$8;
|
16115
16129
|
}
|
16116
16130
|
|
16131
|
+
function defaultWheelDelta() {
|
16132
|
+
return -exports.event.deltaY * (exports.event.deltaMode ? 120 : 1) / 500;
|
16133
|
+
}
|
16134
|
+
|
16135
|
+
function touchable$1() {
|
16136
|
+
return "ontouchstart" in this;
|
16137
|
+
}
|
16138
|
+
|
16117
16139
|
var zoom = function() {
|
16118
16140
|
var filter = defaultFilter$2,
|
16119
16141
|
extent = defaultExtent$1,
|
16142
|
+
wheelDelta = defaultWheelDelta,
|
16120
16143
|
k0 = 0,
|
16121
16144
|
k1 = Infinity,
|
16122
16145
|
x0 = -k1,
|
@@ -16124,7 +16147,7 @@ var zoom = function() {
|
|
16124
16147
|
y0 = x0,
|
16125
16148
|
y1 = x1,
|
16126
16149
|
duration = 250,
|
16127
|
-
interpolate
|
16150
|
+
interpolate = interpolateZoom,
|
16128
16151
|
gestures = [],
|
16129
16152
|
listeners = dispatch("start", "zoom", "end"),
|
16130
16153
|
touchstarting,
|
@@ -16135,26 +16158,28 @@ var zoom = function() {
|
|
16135
16158
|
|
16136
16159
|
function zoom(selection$$1) {
|
16137
16160
|
selection$$1
|
16161
|
+
.property("__zoom", defaultTransform)
|
16138
16162
|
.on("wheel.zoom", wheeled)
|
16139
16163
|
.on("mousedown.zoom", mousedowned)
|
16140
16164
|
.on("dblclick.zoom", dblclicked)
|
16165
|
+
.filter(touchable$1)
|
16141
16166
|
.on("touchstart.zoom", touchstarted)
|
16142
16167
|
.on("touchmove.zoom", touchmoved)
|
16143
16168
|
.on("touchend.zoom touchcancel.zoom", touchended)
|
16144
|
-
.style("-
|
16145
|
-
.
|
16169
|
+
.style("touch-action", "none")
|
16170
|
+
.style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
16146
16171
|
}
|
16147
16172
|
|
16148
|
-
zoom.transform = function(collection, transform) {
|
16173
|
+
zoom.transform = function(collection, transform$$1) {
|
16149
16174
|
var selection$$1 = collection.selection ? collection.selection() : collection;
|
16150
16175
|
selection$$1.property("__zoom", defaultTransform);
|
16151
16176
|
if (collection !== selection$$1) {
|
16152
|
-
schedule(collection, transform);
|
16177
|
+
schedule(collection, transform$$1);
|
16153
16178
|
} else {
|
16154
16179
|
selection$$1.interrupt().each(function() {
|
16155
16180
|
gesture(this, arguments)
|
16156
16181
|
.start()
|
16157
|
-
.zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform)
|
16182
|
+
.zoom(null, typeof transform$$1 === "function" ? transform$$1.apply(this, arguments) : transform$$1)
|
16158
16183
|
.end();
|
16159
16184
|
});
|
16160
16185
|
}
|
@@ -16188,22 +16213,34 @@ var zoom = function() {
|
|
16188
16213
|
});
|
16189
16214
|
};
|
16190
16215
|
|
16191
|
-
function
|
16216
|
+
zoom.translateTo = function(selection$$1, x, y) {
|
16217
|
+
zoom.transform(selection$$1, function() {
|
16218
|
+
var e = extent.apply(this, arguments),
|
16219
|
+
t = this.__zoom,
|
16220
|
+
p = centroid(e);
|
16221
|
+
return constrain(identity$8.translate(p[0], p[1]).scale(t.k).translate(
|
16222
|
+
typeof x === "function" ? -x.apply(this, arguments) : -x,
|
16223
|
+
typeof y === "function" ? -y.apply(this, arguments) : -y
|
16224
|
+
), e);
|
16225
|
+
});
|
16226
|
+
};
|
16227
|
+
|
16228
|
+
function scale(transform$$1, k) {
|
16192
16229
|
k = Math.max(k0, Math.min(k1, k));
|
16193
|
-
return k === transform.k ? transform : new Transform(k, transform.x, transform.y);
|
16230
|
+
return k === transform$$1.k ? transform$$1 : new Transform(k, transform$$1.x, transform$$1.y);
|
16194
16231
|
}
|
16195
16232
|
|
16196
|
-
function translate(transform, p0, p1) {
|
16197
|
-
var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;
|
16198
|
-
return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);
|
16233
|
+
function translate(transform$$1, p0, p1) {
|
16234
|
+
var x = p0[0] - p1[0] * transform$$1.k, y = p0[1] - p1[1] * transform$$1.k;
|
16235
|
+
return x === transform$$1.x && y === transform$$1.y ? transform$$1 : new Transform(transform$$1.k, x, y);
|
16199
16236
|
}
|
16200
16237
|
|
16201
|
-
function constrain(transform, extent) {
|
16202
|
-
var dx0 = transform.invertX(extent[0][0]) - x0,
|
16203
|
-
dx1 = transform.invertX(extent[1][0]) - x1,
|
16204
|
-
dy0 = transform.invertY(extent[0][1]) - y0,
|
16205
|
-
dy1 = transform.invertY(extent[1][1]) - y1;
|
16206
|
-
return transform.translate(
|
16238
|
+
function constrain(transform$$1, extent) {
|
16239
|
+
var dx0 = transform$$1.invertX(extent[0][0]) - x0,
|
16240
|
+
dx1 = transform$$1.invertX(extent[1][0]) - x1,
|
16241
|
+
dy0 = transform$$1.invertY(extent[0][1]) - y0,
|
16242
|
+
dy1 = transform$$1.invertY(extent[1][1]) - y1;
|
16243
|
+
return transform$$1.translate(
|
16207
16244
|
dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
|
16208
16245
|
dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
|
16209
16246
|
);
|
@@ -16213,7 +16250,7 @@ var zoom = function() {
|
|
16213
16250
|
return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];
|
16214
16251
|
}
|
16215
16252
|
|
16216
|
-
function schedule(transition$$1, transform, center) {
|
16253
|
+
function schedule(transition$$1, transform$$1, center) {
|
16217
16254
|
transition$$1
|
16218
16255
|
.on("start.zoom", function() { gesture(this, arguments).start(); })
|
16219
16256
|
.on("interrupt.zoom end.zoom", function() { gesture(this, arguments).end(); })
|
@@ -16225,8 +16262,8 @@ var zoom = function() {
|
|
16225
16262
|
p = center || centroid(e),
|
16226
16263
|
w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),
|
16227
16264
|
a = that.__zoom,
|
16228
|
-
b = typeof transform === "function" ? transform.apply(that, args) : transform,
|
16229
|
-
i = interpolate
|
16265
|
+
b = typeof transform$$1 === "function" ? transform$$1.apply(that, args) : transform$$1,
|
16266
|
+
i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));
|
16230
16267
|
return function(t) {
|
16231
16268
|
if (t === 1) t = b; // Avoid rounding error on end.
|
16232
16269
|
else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }
|
@@ -16260,11 +16297,11 @@ var zoom = function() {
|
|
16260
16297
|
}
|
16261
16298
|
return this;
|
16262
16299
|
},
|
16263
|
-
zoom: function(key, transform) {
|
16264
|
-
if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]);
|
16265
|
-
if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]);
|
16266
|
-
if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]);
|
16267
|
-
this.that.__zoom = transform;
|
16300
|
+
zoom: function(key, transform$$1) {
|
16301
|
+
if (this.mouse && key !== "mouse") this.mouse[1] = transform$$1.invert(this.mouse[0]);
|
16302
|
+
if (this.touch0 && key !== "touch") this.touch0[1] = transform$$1.invert(this.touch0[0]);
|
16303
|
+
if (this.touch1 && key !== "touch") this.touch1[1] = transform$$1.invert(this.touch1[0]);
|
16304
|
+
this.that.__zoom = transform$$1;
|
16268
16305
|
this.emit("zoom");
|
16269
16306
|
return this;
|
16270
16307
|
},
|
@@ -16285,7 +16322,7 @@ var zoom = function() {
|
|
16285
16322
|
if (!filter.apply(this, arguments)) return;
|
16286
16323
|
var g = gesture(this, arguments),
|
16287
16324
|
t = this.__zoom,
|
16288
|
-
k = Math.max(k0, Math.min(k1, t.k * Math.pow(2,
|
16325
|
+
k = Math.max(k0, Math.min(k1, t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),
|
16289
16326
|
p = mouse(this);
|
16290
16327
|
|
16291
16328
|
// If the mouse is in the same location as before, reuse it.
|
@@ -16439,6 +16476,10 @@ var zoom = function() {
|
|
16439
16476
|
else g.end();
|
16440
16477
|
}
|
16441
16478
|
|
16479
|
+
zoom.wheelDelta = function(_) {
|
16480
|
+
return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant$12(+_), zoom) : wheelDelta;
|
16481
|
+
};
|
16482
|
+
|
16442
16483
|
zoom.filter = function(_) {
|
16443
16484
|
return arguments.length ? (filter = typeof _ === "function" ? _ : constant$12(!!_), zoom) : filter;
|
16444
16485
|
};
|
@@ -16460,7 +16501,7 @@ var zoom = function() {
|
|
16460
16501
|
};
|
16461
16502
|
|
16462
16503
|
zoom.interpolate = function(_) {
|
16463
|
-
return arguments.length ? (interpolate
|
16504
|
+
return arguments.length ? (interpolate = _, zoom) : interpolate;
|
16464
16505
|
};
|
16465
16506
|
|
16466
16507
|
zoom.on = function() {
|
@@ -16471,7 +16512,7 @@ var zoom = function() {
|
|
16471
16512
|
zoom.clickDistance = function(_) {
|
16472
16513
|
return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);
|
16473
16514
|
};
|
16474
|
-
|
16515
|
+
|
16475
16516
|
return zoom;
|
16476
16517
|
};
|
16477
16518
|
|
@@ -16702,7 +16743,7 @@ exports.scaleOrdinal = ordinal;
|
|
16702
16743
|
exports.scaleImplicit = implicit;
|
16703
16744
|
exports.scalePow = pow$1;
|
16704
16745
|
exports.scaleSqrt = sqrt$1;
|
16705
|
-
exports.scaleQuantile = quantile
|
16746
|
+
exports.scaleQuantile = quantile;
|
16706
16747
|
exports.scaleQuantize = quantize$1;
|
16707
16748
|
exports.scaleThreshold = threshold$1;
|
16708
16749
|
exports.scaleTime = time;
|
@@ -16740,8 +16781,11 @@ exports.arc = arc;
|
|
16740
16781
|
exports.area = area$2;
|
16741
16782
|
exports.line = line;
|
16742
16783
|
exports.pie = pie;
|
16743
|
-
exports.
|
16744
|
-
exports.
|
16784
|
+
exports.areaRadial = areaRadial;
|
16785
|
+
exports.radialArea = areaRadial;
|
16786
|
+
exports.lineRadial = lineRadial$1;
|
16787
|
+
exports.radialLine = lineRadial$1;
|
16788
|
+
exports.pointRadial = pointRadial;
|
16745
16789
|
exports.linkHorizontal = linkHorizontal;
|
16746
16790
|
exports.linkVertical = linkVertical;
|
16747
16791
|
exports.linkRadial = linkRadial;
|