billboard.js 3.4.1 → 3.5.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +3283 -1110
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +7416 -4949
- package/dist/billboard.pkgd.min.js +3 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +29 -13
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +259 -89
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +329 -106
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +223 -71
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +219 -72
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +3940 -3793
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +4219 -3882
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +4392 -3930
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +4187 -3868
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +4195 -3872
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist-esm/billboard.js +206 -41
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +47 -75
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +66 -85
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +50 -76
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +47 -75
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +47 -75
- package/package.json +34 -34
- package/src/Chart/api/data.ts +2 -2
- package/src/ChartInternal/Axis/AxisRenderer.ts +29 -3
- package/src/ChartInternal/ChartInternal.ts +8 -1
- package/src/ChartInternal/interactions/zoom.ts +17 -4
- package/src/ChartInternal/internals/color.ts +3 -2
- package/src/ChartInternal/internals/grid.ts +5 -3
- package/src/ChartInternal/internals/redraw.ts +5 -2
- package/src/ChartInternal/internals/scale.ts +3 -1
- package/src/ChartInternal/internals/size.axis.ts +5 -2
- package/src/ChartInternal/internals/text.ts +115 -15
- package/src/ChartInternal/shape/bar.ts +12 -5
- package/src/Plugin/sparkline/index.ts +22 -11
- package/src/Plugin/stanford/index.ts +10 -7
- package/src/config/Options/common/main.ts +15 -1
- package/src/config/Options/common/tooltip.ts +1 -1
- package/src/config/Options/data/data.ts +11 -3
- package/src/module/generator.ts +12 -5
- package/types/chart.d.ts +2 -2
- package/types/options.d.ts +21 -8
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.5.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -121,6 +121,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
121
121
|
"default": function() { return /* binding */ Stanford; }
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/newArrowCheck.js
|
|
125
|
+
function _newArrowCheck(innerThis, boundThis) {
|
|
126
|
+
if (innerThis !== boundThis) {
|
|
127
|
+
throw new TypeError("Cannot instantiate an arrow function");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
124
130
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
|
125
131
|
function _assertThisInitialized(self) {
|
|
126
132
|
if (self === void 0) {
|
|
@@ -131,11 +137,10 @@ function _assertThisInitialized(self) {
|
|
|
131
137
|
}
|
|
132
138
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
|
133
139
|
function _setPrototypeOf(o, p) {
|
|
134
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
140
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
135
141
|
o.__proto__ = p;
|
|
136
142
|
return o;
|
|
137
143
|
};
|
|
138
|
-
|
|
139
144
|
return _setPrototypeOf(o, p);
|
|
140
145
|
}
|
|
141
146
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
|
@@ -334,6 +339,10 @@ var external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_
|
|
|
334
339
|
// EXTERNAL MODULE: external {"commonjs":"d3-brush","commonjs2":"d3-brush","amd":"d3-brush","root":"d3"}
|
|
335
340
|
var external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_ = __webpack_require__(3);
|
|
336
341
|
;// CONCATENATED MODULE: ./src/module/browser.ts
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
var _this = undefined;
|
|
345
|
+
|
|
337
346
|
/**
|
|
338
347
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
339
348
|
* billboard.js project is licensed under the MIT license
|
|
@@ -348,25 +357,34 @@ var external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_ = __webp
|
|
|
348
357
|
|
|
349
358
|
|
|
350
359
|
var win = function () {
|
|
360
|
+
_newArrowCheck(this, _this);
|
|
361
|
+
|
|
351
362
|
var root = typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object && globalThis || typeof global === "object" && global !== null && global.Object === Object && global || typeof self === "object" && self !== null && self.Object === Object && self;
|
|
352
363
|
return root || Function("return this")();
|
|
353
|
-
}();
|
|
364
|
+
}.bind(undefined)();
|
|
354
365
|
/* eslint-enable no-new-func, no-undef */
|
|
355
366
|
// fallback for non-supported environments
|
|
356
367
|
|
|
357
368
|
|
|
358
369
|
win.requestIdleCallback = win.requestIdleCallback || function (cb) {
|
|
370
|
+
_newArrowCheck(this, _this);
|
|
371
|
+
|
|
359
372
|
return setTimeout(cb, 1);
|
|
360
|
-
};
|
|
373
|
+
}.bind(undefined);
|
|
361
374
|
|
|
362
375
|
win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
|
|
376
|
+
_newArrowCheck(this, _this);
|
|
377
|
+
|
|
363
378
|
return clearTimeout(id);
|
|
364
|
-
};
|
|
379
|
+
}.bind(undefined);
|
|
365
380
|
|
|
366
381
|
var doc = win == null ? void 0 : win.document;
|
|
367
382
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
368
383
|
|
|
369
384
|
|
|
385
|
+
|
|
386
|
+
var util_this = undefined;
|
|
387
|
+
|
|
370
388
|
function util_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
371
389
|
|
|
372
390
|
function util_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? util_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : util_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -382,50 +400,80 @@ function util_objectSpread(target) { for (var i = 1, source; i < arguments.lengt
|
|
|
382
400
|
|
|
383
401
|
|
|
384
402
|
var isValue = function (v) {
|
|
403
|
+
_newArrowCheck(this, util_this);
|
|
404
|
+
|
|
385
405
|
return v || v === 0;
|
|
386
|
-
},
|
|
406
|
+
}.bind(undefined),
|
|
387
407
|
isFunction = function (v) {
|
|
408
|
+
_newArrowCheck(this, util_this);
|
|
409
|
+
|
|
388
410
|
return typeof v === "function";
|
|
389
|
-
},
|
|
411
|
+
}.bind(undefined),
|
|
390
412
|
isString = function (v) {
|
|
413
|
+
_newArrowCheck(this, util_this);
|
|
414
|
+
|
|
391
415
|
return typeof v === "string";
|
|
392
|
-
},
|
|
416
|
+
}.bind(undefined),
|
|
393
417
|
isNumber = function (v) {
|
|
418
|
+
_newArrowCheck(this, util_this);
|
|
419
|
+
|
|
394
420
|
return typeof v === "number";
|
|
395
|
-
},
|
|
421
|
+
}.bind(undefined),
|
|
396
422
|
isUndefined = function (v) {
|
|
423
|
+
_newArrowCheck(this, util_this);
|
|
424
|
+
|
|
397
425
|
return typeof v === "undefined";
|
|
398
|
-
},
|
|
426
|
+
}.bind(undefined),
|
|
399
427
|
isDefined = function (v) {
|
|
428
|
+
_newArrowCheck(this, util_this);
|
|
429
|
+
|
|
400
430
|
return typeof v !== "undefined";
|
|
401
|
-
},
|
|
431
|
+
}.bind(undefined),
|
|
402
432
|
isboolean = function (v) {
|
|
433
|
+
_newArrowCheck(this, util_this);
|
|
434
|
+
|
|
403
435
|
return typeof v === "boolean";
|
|
404
|
-
},
|
|
436
|
+
}.bind(undefined),
|
|
405
437
|
ceil10 = function (v) {
|
|
438
|
+
_newArrowCheck(this, util_this);
|
|
439
|
+
|
|
406
440
|
return Math.ceil(v / 10) * 10;
|
|
407
|
-
},
|
|
441
|
+
}.bind(undefined),
|
|
408
442
|
asHalfPixel = function (n) {
|
|
443
|
+
_newArrowCheck(this, util_this);
|
|
444
|
+
|
|
409
445
|
return Math.ceil(n) + .5;
|
|
410
|
-
},
|
|
446
|
+
}.bind(undefined),
|
|
411
447
|
diffDomain = function (d) {
|
|
448
|
+
_newArrowCheck(this, util_this);
|
|
449
|
+
|
|
412
450
|
return d[1] - d[0];
|
|
413
|
-
},
|
|
451
|
+
}.bind(undefined),
|
|
414
452
|
isObjectType = function (v) {
|
|
453
|
+
_newArrowCheck(this, util_this);
|
|
454
|
+
|
|
415
455
|
return typeof v === "object";
|
|
416
|
-
},
|
|
456
|
+
}.bind(undefined),
|
|
417
457
|
isEmpty = function (o) {
|
|
458
|
+
_newArrowCheck(this, util_this);
|
|
459
|
+
|
|
418
460
|
return isUndefined(o) || o === null || isString(o) && o.length === 0 || isObjectType(o) && !(o instanceof Date) && Object.keys(o).length === 0 || isNumber(o) && isNaN(o);
|
|
419
|
-
},
|
|
461
|
+
}.bind(undefined),
|
|
420
462
|
notEmpty = function (o) {
|
|
463
|
+
_newArrowCheck(this, util_this);
|
|
464
|
+
|
|
421
465
|
return !isEmpty(o);
|
|
422
|
-
},
|
|
466
|
+
}.bind(undefined),
|
|
423
467
|
isArray = function (arr) {
|
|
468
|
+
_newArrowCheck(this, util_this);
|
|
469
|
+
|
|
424
470
|
return Array.isArray(arr);
|
|
425
|
-
},
|
|
471
|
+
}.bind(undefined),
|
|
426
472
|
isObject = function (obj) {
|
|
473
|
+
_newArrowCheck(this, util_this);
|
|
474
|
+
|
|
427
475
|
return obj && !(obj != null && obj.nodeType) && isObjectType(obj) && !isArray(obj);
|
|
428
|
-
};
|
|
476
|
+
}.bind(undefined);
|
|
429
477
|
|
|
430
478
|
/**
|
|
431
479
|
* Get specified key value from object
|
|
@@ -449,10 +497,14 @@ function getOption(options, key, defaultValue) {
|
|
|
449
497
|
|
|
450
498
|
|
|
451
499
|
function hasValue(dict, value) {
|
|
452
|
-
var
|
|
500
|
+
var _this2 = this,
|
|
501
|
+
found = !1;
|
|
502
|
+
|
|
453
503
|
Object.keys(dict).forEach(function (key) {
|
|
504
|
+
_newArrowCheck(this, _this2);
|
|
505
|
+
|
|
454
506
|
return dict[key] === value && (found = !0);
|
|
455
|
-
});
|
|
507
|
+
}.bind(this));
|
|
456
508
|
return found;
|
|
457
509
|
}
|
|
458
510
|
/**
|
|
@@ -482,7 +534,8 @@ function callFn(fn, thisArg) {
|
|
|
482
534
|
|
|
483
535
|
|
|
484
536
|
function endall(transition, cb) {
|
|
485
|
-
var
|
|
537
|
+
var _this3 = this,
|
|
538
|
+
n = 0,
|
|
486
539
|
end = function () {
|
|
487
540
|
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
488
541
|
args[_key2] = arguments[_key2];
|
|
@@ -494,8 +547,10 @@ function endall(transition, cb) {
|
|
|
494
547
|
// if is transition selection
|
|
495
548
|
if ("duration" in transition) {
|
|
496
549
|
transition.each(function () {
|
|
550
|
+
_newArrowCheck(this, _this3);
|
|
551
|
+
|
|
497
552
|
return ++n;
|
|
498
|
-
}).on("end", end);
|
|
553
|
+
}.bind(this)).on("end", end);
|
|
499
554
|
} else {
|
|
500
555
|
++n;
|
|
501
556
|
transition.call(end);
|
|
@@ -523,6 +578,8 @@ function sanitise(str) {
|
|
|
523
578
|
|
|
524
579
|
|
|
525
580
|
function setTextValue(node, text, dy, toMiddle) {
|
|
581
|
+
var _this4 = this;
|
|
582
|
+
|
|
526
583
|
if (dy === void 0) {
|
|
527
584
|
dy = [-1, 1];
|
|
528
585
|
}
|
|
@@ -539,8 +596,10 @@ function setTextValue(node, text, dy, toMiddle) {
|
|
|
539
596
|
node.text(text);
|
|
540
597
|
} else {
|
|
541
598
|
var diff = [node.text(), text].map(function (v) {
|
|
599
|
+
_newArrowCheck(this, _this4);
|
|
600
|
+
|
|
542
601
|
return v.replace(/[\s\n]/g, "");
|
|
543
|
-
});
|
|
602
|
+
}.bind(this));
|
|
544
603
|
|
|
545
604
|
if (diff[0] !== diff[1]) {
|
|
546
605
|
var multiline = text.split("\n"),
|
|
@@ -548,8 +607,10 @@ function setTextValue(node, text, dy, toMiddle) {
|
|
|
548
607
|
// reset possible text
|
|
549
608
|
node.html("");
|
|
550
609
|
multiline.forEach(function (v, i) {
|
|
610
|
+
_newArrowCheck(this, _this4);
|
|
611
|
+
|
|
551
612
|
node.append("tspan").attr("x", 0).attr("dy", (i === 0 ? dy[0] * len : dy[1]) + "em").text(v);
|
|
552
|
-
});
|
|
613
|
+
}.bind(this));
|
|
553
614
|
}
|
|
554
615
|
}
|
|
555
616
|
}
|
|
@@ -628,11 +689,14 @@ function getPathBox(path) {
|
|
|
628
689
|
function getPointer(event, element) {
|
|
629
690
|
var _ref,
|
|
630
691
|
touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
|
|
631
|
-
pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element)
|
|
692
|
+
pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element),
|
|
693
|
+
_this5 = this;
|
|
632
694
|
|
|
633
695
|
return pointer.map(function (v) {
|
|
696
|
+
_newArrowCheck(this, _this5);
|
|
697
|
+
|
|
634
698
|
return isNaN(v) ? 0 : v;
|
|
635
|
-
});
|
|
699
|
+
}.bind(this));
|
|
636
700
|
}
|
|
637
701
|
/**
|
|
638
702
|
* Return brush selection array
|
|
@@ -759,7 +823,9 @@ function brushEmpty(ctx) {
|
|
|
759
823
|
|
|
760
824
|
|
|
761
825
|
function deepClone() {
|
|
762
|
-
for (var clone = function (v) {
|
|
826
|
+
for (var _this6 = this, clone = function (v) {
|
|
827
|
+
_newArrowCheck(this, _this6);
|
|
828
|
+
|
|
763
829
|
if (isObject(v) && v.constructor) {
|
|
764
830
|
var r = new v.constructor();
|
|
765
831
|
|
|
@@ -771,15 +837,19 @@ function deepClone() {
|
|
|
771
837
|
}
|
|
772
838
|
|
|
773
839
|
return v;
|
|
774
|
-
}, _len3 = arguments.length, objectN = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
840
|
+
}.bind(this), _len3 = arguments.length, objectN = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
775
841
|
objectN[_key3] = arguments[_key3];
|
|
776
842
|
}
|
|
777
843
|
|
|
778
844
|
return objectN.map(function (v) {
|
|
845
|
+
_newArrowCheck(this, _this6);
|
|
846
|
+
|
|
779
847
|
return clone(v);
|
|
780
|
-
}).reduce(function (a, c) {
|
|
848
|
+
}.bind(this)).reduce(function (a, c) {
|
|
849
|
+
_newArrowCheck(this, _this6);
|
|
850
|
+
|
|
781
851
|
return util_objectSpread(util_objectSpread({}, a), c);
|
|
782
|
-
});
|
|
852
|
+
}.bind(this));
|
|
783
853
|
}
|
|
784
854
|
/**
|
|
785
855
|
* Extend target from source object
|
|
@@ -791,14 +861,18 @@ function deepClone() {
|
|
|
791
861
|
|
|
792
862
|
|
|
793
863
|
function extend(target, source) {
|
|
864
|
+
var _this7 = this;
|
|
865
|
+
|
|
794
866
|
if (target === void 0) {
|
|
795
867
|
target = {};
|
|
796
868
|
}
|
|
797
869
|
|
|
798
870
|
if (isArray(source)) {
|
|
799
871
|
source.forEach(function (v) {
|
|
872
|
+
_newArrowCheck(this, _this7);
|
|
873
|
+
|
|
800
874
|
return extend(target, v);
|
|
801
|
-
});
|
|
875
|
+
}.bind(this));
|
|
802
876
|
} // exclude name with only numbers
|
|
803
877
|
|
|
804
878
|
|
|
@@ -821,8 +895,10 @@ function extend(target, source) {
|
|
|
821
895
|
|
|
822
896
|
|
|
823
897
|
var capitalize = function (str) {
|
|
898
|
+
_newArrowCheck(this, util_this);
|
|
899
|
+
|
|
824
900
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
825
|
-
};
|
|
901
|
+
}.bind(undefined);
|
|
826
902
|
/**
|
|
827
903
|
* Camelize from kebob style string
|
|
828
904
|
* @param {string} str Target string
|
|
@@ -833,13 +909,17 @@ var capitalize = function (str) {
|
|
|
833
909
|
|
|
834
910
|
|
|
835
911
|
function camelize(str, separator) {
|
|
912
|
+
var _this8 = this;
|
|
913
|
+
|
|
836
914
|
if (separator === void 0) {
|
|
837
915
|
separator = "-";
|
|
838
916
|
}
|
|
839
917
|
|
|
840
918
|
return str.split(separator).map(function (v, i) {
|
|
919
|
+
_newArrowCheck(this, _this8);
|
|
920
|
+
|
|
841
921
|
return i ? v.charAt(0).toUpperCase() + v.slice(1).toLowerCase() : v.toLowerCase();
|
|
842
|
-
}).join("");
|
|
922
|
+
}.bind(this)).join("");
|
|
843
923
|
}
|
|
844
924
|
/**
|
|
845
925
|
* Convert to array
|
|
@@ -850,8 +930,10 @@ function camelize(str, separator) {
|
|
|
850
930
|
|
|
851
931
|
|
|
852
932
|
var toArray = function (v) {
|
|
933
|
+
_newArrowCheck(this, util_this);
|
|
934
|
+
|
|
853
935
|
return [].slice.call(v);
|
|
854
|
-
};
|
|
936
|
+
}.bind(undefined);
|
|
855
937
|
/**
|
|
856
938
|
* Get css rules for specified stylesheets
|
|
857
939
|
* @param {Array} styleSheets The stylesheets to get the rules from
|
|
@@ -861,8 +943,12 @@ var toArray = function (v) {
|
|
|
861
943
|
|
|
862
944
|
|
|
863
945
|
function getCssRules(styleSheets) {
|
|
864
|
-
var
|
|
946
|
+
var _this9 = this,
|
|
947
|
+
rules = [];
|
|
948
|
+
|
|
865
949
|
styleSheets.forEach(function (sheet) {
|
|
950
|
+
_newArrowCheck(this, _this9);
|
|
951
|
+
|
|
866
952
|
try {
|
|
867
953
|
if (sheet.cssRules && sheet.cssRules.length) {
|
|
868
954
|
rules = rules.concat(toArray(sheet.cssRules));
|
|
@@ -870,7 +956,7 @@ function getCssRules(styleSheets) {
|
|
|
870
956
|
} catch (e) {
|
|
871
957
|
console.error("Error while reading rules from " + sheet.href + ": " + e.toString());
|
|
872
958
|
}
|
|
873
|
-
});
|
|
959
|
+
}.bind(this));
|
|
874
960
|
return rules;
|
|
875
961
|
}
|
|
876
962
|
/**
|
|
@@ -902,13 +988,19 @@ function getTranslation(node) {
|
|
|
902
988
|
|
|
903
989
|
|
|
904
990
|
function getUnique(data) {
|
|
905
|
-
var
|
|
991
|
+
var _this10 = this,
|
|
992
|
+
isDate = data[0] instanceof Date,
|
|
906
993
|
d = (isDate ? data.map(Number) : data).filter(function (v, i, self) {
|
|
994
|
+
_newArrowCheck(this, _this10);
|
|
995
|
+
|
|
907
996
|
return self.indexOf(v) === i;
|
|
908
|
-
});
|
|
997
|
+
}.bind(this));
|
|
998
|
+
|
|
909
999
|
return isDate ? d.map(function (v) {
|
|
1000
|
+
_newArrowCheck(this, _this10);
|
|
1001
|
+
|
|
910
1002
|
return new Date(v);
|
|
911
|
-
}) : d;
|
|
1003
|
+
}.bind(this)) : d;
|
|
912
1004
|
}
|
|
913
1005
|
/**
|
|
914
1006
|
* Merge array
|
|
@@ -919,9 +1011,13 @@ function getUnique(data) {
|
|
|
919
1011
|
|
|
920
1012
|
|
|
921
1013
|
function mergeArray(arr) {
|
|
1014
|
+
var _this11 = this;
|
|
1015
|
+
|
|
922
1016
|
return arr && arr.length ? arr.reduce(function (p, c) {
|
|
1017
|
+
_newArrowCheck(this, _this11);
|
|
1018
|
+
|
|
923
1019
|
return p.concat(c);
|
|
924
|
-
}) : [];
|
|
1020
|
+
}.bind(this)) : [];
|
|
925
1021
|
}
|
|
926
1022
|
/**
|
|
927
1023
|
* Merge object returning new object
|
|
@@ -933,7 +1029,7 @@ function mergeArray(arr) {
|
|
|
933
1029
|
|
|
934
1030
|
|
|
935
1031
|
function mergeObj(target) {
|
|
936
|
-
for (var _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
1032
|
+
for (var _this12 = this, _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
937
1033
|
objectN[_key4 - 1] = arguments[_key4];
|
|
938
1034
|
}
|
|
939
1035
|
|
|
@@ -945,6 +1041,8 @@ function mergeObj(target) {
|
|
|
945
1041
|
|
|
946
1042
|
if (isObject(target) && isObject(source)) {
|
|
947
1043
|
Object.keys(source).forEach(function (key) {
|
|
1044
|
+
_newArrowCheck(this, _this12);
|
|
1045
|
+
|
|
948
1046
|
var value = source[key];
|
|
949
1047
|
|
|
950
1048
|
if (isObject(value)) {
|
|
@@ -953,7 +1051,7 @@ function mergeObj(target) {
|
|
|
953
1051
|
} else {
|
|
954
1052
|
target[key] = isArray(value) ? value.concat() : value;
|
|
955
1053
|
}
|
|
956
|
-
});
|
|
1054
|
+
}.bind(this));
|
|
957
1055
|
}
|
|
958
1056
|
|
|
959
1057
|
return mergeObj.apply(void 0, [target].concat(objectN));
|
|
@@ -968,6 +1066,8 @@ function mergeObj(target) {
|
|
|
968
1066
|
|
|
969
1067
|
|
|
970
1068
|
function sortValue(data, isAsc) {
|
|
1069
|
+
var _this13 = this;
|
|
1070
|
+
|
|
971
1071
|
if (isAsc === void 0) {
|
|
972
1072
|
isAsc = !0;
|
|
973
1073
|
}
|
|
@@ -976,19 +1076,27 @@ function sortValue(data, isAsc) {
|
|
|
976
1076
|
|
|
977
1077
|
if (data[0] instanceof Date) {
|
|
978
1078
|
fn = isAsc ? function (a, b) {
|
|
1079
|
+
_newArrowCheck(this, _this13);
|
|
1080
|
+
|
|
979
1081
|
return a - b;
|
|
980
|
-
} : function (a, b) {
|
|
1082
|
+
}.bind(this) : function (a, b) {
|
|
1083
|
+
_newArrowCheck(this, _this13);
|
|
1084
|
+
|
|
981
1085
|
return b - a;
|
|
982
|
-
};
|
|
1086
|
+
}.bind(this);
|
|
983
1087
|
} else {
|
|
984
1088
|
if (isAsc && !data.every(isNaN)) {
|
|
985
1089
|
fn = function (a, b) {
|
|
1090
|
+
_newArrowCheck(this, _this13);
|
|
1091
|
+
|
|
986
1092
|
return a - b;
|
|
987
|
-
};
|
|
1093
|
+
}.bind(this);
|
|
988
1094
|
} else if (!isAsc) {
|
|
989
1095
|
fn = function (a, b) {
|
|
1096
|
+
_newArrowCheck(this, _this13);
|
|
1097
|
+
|
|
990
1098
|
return a > b && -1 || a < b && 1 || a === b && 0;
|
|
991
|
-
};
|
|
1099
|
+
}.bind(this);
|
|
992
1100
|
}
|
|
993
1101
|
}
|
|
994
1102
|
|
|
@@ -1004,9 +1112,12 @@ function sortValue(data, isAsc) {
|
|
|
1004
1112
|
|
|
1005
1113
|
|
|
1006
1114
|
function getMinMax(type, data) {
|
|
1007
|
-
var
|
|
1115
|
+
var _this14 = this,
|
|
1116
|
+
res = data.filter(function (v) {
|
|
1117
|
+
_newArrowCheck(this, _this14);
|
|
1118
|
+
|
|
1008
1119
|
return notEmpty(v);
|
|
1009
|
-
});
|
|
1120
|
+
}.bind(this));
|
|
1010
1121
|
|
|
1011
1122
|
if (res.length) {
|
|
1012
1123
|
if (isNumber(res[0])) {
|
|
@@ -1035,6 +1146,8 @@ var getRange = function (start, end, step) {
|
|
|
1035
1146
|
step = 1;
|
|
1036
1147
|
}
|
|
1037
1148
|
|
|
1149
|
+
_newArrowCheck(this, util_this);
|
|
1150
|
+
|
|
1038
1151
|
var res = [],
|
|
1039
1152
|
n = Math.max(0, Math.ceil((end - start) / step)) | 0;
|
|
1040
1153
|
|
|
@@ -1043,10 +1156,16 @@ var getRange = function (start, end, step) {
|
|
|
1043
1156
|
}
|
|
1044
1157
|
|
|
1045
1158
|
return res;
|
|
1046
|
-
},
|
|
1159
|
+
}.bind(undefined),
|
|
1047
1160
|
emulateEvent = {
|
|
1048
1161
|
mouse: function () {
|
|
1162
|
+
var _this15 = this;
|
|
1163
|
+
|
|
1164
|
+
_newArrowCheck(this, util_this);
|
|
1165
|
+
|
|
1049
1166
|
var getParams = function () {
|
|
1167
|
+
_newArrowCheck(this, _this15);
|
|
1168
|
+
|
|
1050
1169
|
return {
|
|
1051
1170
|
bubbles: !1,
|
|
1052
1171
|
cancelable: !1,
|
|
@@ -1055,7 +1174,7 @@ var getRange = function (start, end, step) {
|
|
|
1055
1174
|
clientX: 0,
|
|
1056
1175
|
clientY: 0
|
|
1057
1176
|
};
|
|
1058
|
-
};
|
|
1177
|
+
}.bind(this);
|
|
1059
1178
|
|
|
1060
1179
|
try {
|
|
1061
1180
|
// eslint-disable-next-line no-new
|
|
@@ -1065,8 +1184,10 @@ var getRange = function (start, end, step) {
|
|
|
1065
1184
|
params = getParams();
|
|
1066
1185
|
}
|
|
1067
1186
|
|
|
1187
|
+
_newArrowCheck(this, _this15);
|
|
1188
|
+
|
|
1068
1189
|
el.dispatchEvent(new MouseEvent(eventType, params));
|
|
1069
|
-
};
|
|
1190
|
+
}.bind(this);
|
|
1070
1191
|
} catch (e) {
|
|
1071
1192
|
// Polyfills DOM4 MouseEvent
|
|
1072
1193
|
return function (el, eventType, params) {
|
|
@@ -1074,15 +1195,19 @@ var getRange = function (start, end, step) {
|
|
|
1074
1195
|
params = getParams();
|
|
1075
1196
|
}
|
|
1076
1197
|
|
|
1198
|
+
_newArrowCheck(this, _this15);
|
|
1199
|
+
|
|
1077
1200
|
var mouseEvent = doc.createEvent("MouseEvent"); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
|
|
1078
1201
|
|
|
1079
1202
|
mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0, // the event's mouse click count
|
|
1080
1203
|
params.screenX, params.screenY, params.clientX, params.clientY, !1, !1, !1, !1, 0, null);
|
|
1081
1204
|
el.dispatchEvent(mouseEvent);
|
|
1082
|
-
};
|
|
1205
|
+
}.bind(this);
|
|
1083
1206
|
}
|
|
1084
|
-
}(),
|
|
1207
|
+
}.bind(undefined)(),
|
|
1085
1208
|
touch: function touch(el, eventType, params) {
|
|
1209
|
+
_newArrowCheck(this, util_this);
|
|
1210
|
+
|
|
1086
1211
|
var touchObj = new Touch(mergeObj({
|
|
1087
1212
|
identifier: Date.now(),
|
|
1088
1213
|
target: el,
|
|
@@ -1099,7 +1224,7 @@ var getRange = function (start, end, step) {
|
|
|
1099
1224
|
targetTouches: [],
|
|
1100
1225
|
changedTouches: [touchObj]
|
|
1101
1226
|
}));
|
|
1102
|
-
}
|
|
1227
|
+
}.bind(undefined)
|
|
1103
1228
|
}; // emulate event
|
|
1104
1229
|
|
|
1105
1230
|
|
|
@@ -1171,7 +1296,8 @@ function isTabVisible() {
|
|
|
1171
1296
|
|
|
1172
1297
|
|
|
1173
1298
|
function convertInputType(mouse, touch) {
|
|
1174
|
-
var
|
|
1299
|
+
var _this16 = this,
|
|
1300
|
+
DocumentTouch = win.DocumentTouch,
|
|
1175
1301
|
matchMedia = win.matchMedia,
|
|
1176
1302
|
navigator = win.navigator,
|
|
1177
1303
|
hasTouch = !1;
|
|
@@ -1199,12 +1325,16 @@ function convertInputType(mouse, touch) {
|
|
|
1199
1325
|
|
|
1200
1326
|
|
|
1201
1327
|
var hasMouse = mouse && ["any-hover:hover", "any-pointer:fine"].some(function (v) {
|
|
1328
|
+
_newArrowCheck(this, _this16);
|
|
1329
|
+
|
|
1202
1330
|
return matchMedia == null ? void 0 : matchMedia("(" + v + ")").matches;
|
|
1203
|
-
}); // fallback to 'mouse' if no input type is detected.
|
|
1331
|
+
}.bind(this)); // fallback to 'mouse' if no input type is detected.
|
|
1204
1332
|
|
|
1205
1333
|
return hasMouse && "mouse" || hasTouch && "touch" || "mouse";
|
|
1206
1334
|
}
|
|
1207
1335
|
;// CONCATENATED MODULE: ./src/config/config.ts
|
|
1336
|
+
|
|
1337
|
+
|
|
1208
1338
|
/**
|
|
1209
1339
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
1210
1340
|
* billboard.js project is licensed under the MIT license
|
|
@@ -1217,11 +1347,14 @@ function convertInputType(mouse, touch) {
|
|
|
1217
1347
|
* @private
|
|
1218
1348
|
*/
|
|
1219
1349
|
function loadConfig(config) {
|
|
1220
|
-
var
|
|
1350
|
+
var _this = this,
|
|
1351
|
+
thisConfig = this.config,
|
|
1221
1352
|
target,
|
|
1222
1353
|
keys,
|
|
1223
1354
|
read,
|
|
1224
1355
|
find = function () {
|
|
1356
|
+
_newArrowCheck(this, _this);
|
|
1357
|
+
|
|
1225
1358
|
var key = keys.shift();
|
|
1226
1359
|
|
|
1227
1360
|
if (key && target && isObjectType(target) && key in target) {
|
|
@@ -1232,9 +1365,11 @@ function loadConfig(config) {
|
|
|
1232
1365
|
}
|
|
1233
1366
|
|
|
1234
1367
|
return undefined;
|
|
1235
|
-
};
|
|
1368
|
+
}.bind(this);
|
|
1236
1369
|
|
|
1237
1370
|
Object.keys(thisConfig).forEach(function (key) {
|
|
1371
|
+
_newArrowCheck(this, _this);
|
|
1372
|
+
|
|
1238
1373
|
target = config;
|
|
1239
1374
|
keys = key.split("_");
|
|
1240
1375
|
read = find();
|
|
@@ -1242,9 +1377,11 @@ function loadConfig(config) {
|
|
|
1242
1377
|
if (isDefined(read)) {
|
|
1243
1378
|
thisConfig[key] = read;
|
|
1244
1379
|
}
|
|
1245
|
-
});
|
|
1380
|
+
}.bind(this));
|
|
1246
1381
|
}
|
|
1247
1382
|
;// CONCATENATED MODULE: ./src/Plugin/Plugin.ts
|
|
1383
|
+
|
|
1384
|
+
|
|
1248
1385
|
/**
|
|
1249
1386
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
1250
1387
|
* billboard.js project is licensed under the MIT license
|
|
@@ -1319,15 +1456,17 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
1319
1456
|
var _this = this;
|
|
1320
1457
|
|
|
1321
1458
|
Object.keys(this).forEach(function (key) {
|
|
1322
|
-
_this
|
|
1323
|
-
|
|
1324
|
-
|
|
1459
|
+
_newArrowCheck(this, _this);
|
|
1460
|
+
|
|
1461
|
+
this[key] = null;
|
|
1462
|
+
delete this[key];
|
|
1463
|
+
}.bind(this));
|
|
1325
1464
|
};
|
|
1326
1465
|
|
|
1327
1466
|
return Plugin;
|
|
1328
1467
|
}();
|
|
1329
1468
|
|
|
1330
|
-
Plugin.version = "3.
|
|
1469
|
+
Plugin.version = "3.5.0-next.1";
|
|
1331
1470
|
|
|
1332
1471
|
;// CONCATENATED MODULE: ./src/Plugin/stanford/Options.ts
|
|
1333
1472
|
/**
|
|
@@ -1609,6 +1748,8 @@ function getCentroid(points) {
|
|
|
1609
1748
|
|
|
1610
1749
|
|
|
1611
1750
|
;// CONCATENATED MODULE: ./src/Plugin/stanford/Elements.ts
|
|
1751
|
+
|
|
1752
|
+
|
|
1612
1753
|
/**
|
|
1613
1754
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
1614
1755
|
* billboard.js project is licensed under the MIT license
|
|
@@ -1636,33 +1777,46 @@ var Elements = /*#__PURE__*/function () {
|
|
|
1636
1777
|
var _proto = Elements.prototype;
|
|
1637
1778
|
|
|
1638
1779
|
_proto.updateStanfordLines = function updateStanfordLines(duration) {
|
|
1639
|
-
var
|
|
1780
|
+
var _this = this,
|
|
1781
|
+
$$ = this.owner.$$,
|
|
1640
1782
|
config = $$.config,
|
|
1641
1783
|
main = $$.$el.main,
|
|
1642
1784
|
isRotated = config.axis_rotated,
|
|
1643
1785
|
xvCustom = this.xvCustom.bind($$),
|
|
1644
1786
|
yvCustom = this.yvCustom.bind($$),
|
|
1645
1787
|
stanfordLine = main.select("." + stanford_classes.stanfordLines).style("shape-rendering", "geometricprecision").selectAll("." + stanford_classes.stanfordLine).data(this.owner.config.lines);
|
|
1788
|
+
|
|
1646
1789
|
// exit
|
|
1647
1790
|
stanfordLine.exit().transition().duration(duration).style("opacity", "0").remove(); // enter
|
|
1648
1791
|
|
|
1649
1792
|
var stanfordLineEnter = stanfordLine.enter().append("g");
|
|
1650
1793
|
stanfordLineEnter.append("line").style("opacity", "0");
|
|
1651
1794
|
stanfordLineEnter.merge(stanfordLine).attr("class", function (d) {
|
|
1795
|
+
_newArrowCheck(this, _this);
|
|
1796
|
+
|
|
1652
1797
|
return stanford_classes.stanfordLine + (d.class ? " " + d.class : "");
|
|
1653
|
-
}).select("line").transition().duration(duration).attr("x1", function (d) {
|
|
1798
|
+
}.bind(this)).select("line").transition().duration(duration).attr("x1", function (d) {
|
|
1799
|
+
_newArrowCheck(this, _this);
|
|
1800
|
+
|
|
1654
1801
|
return isRotated ? yvCustom(d, "y1") : xvCustom(d, "x1");
|
|
1655
|
-
}).attr("x2", function (d) {
|
|
1802
|
+
}.bind(this)).attr("x2", function (d) {
|
|
1803
|
+
_newArrowCheck(this, _this);
|
|
1804
|
+
|
|
1656
1805
|
return isRotated ? yvCustom(d, "y2") : xvCustom(d, "x2");
|
|
1657
|
-
}).attr("y1", function (d) {
|
|
1806
|
+
}.bind(this)).attr("y1", function (d) {
|
|
1807
|
+
_newArrowCheck(this, _this);
|
|
1808
|
+
|
|
1658
1809
|
return isRotated ? xvCustom(d, "x1") : yvCustom(d, "y1");
|
|
1659
|
-
}).attr("y2", function (d) {
|
|
1810
|
+
}.bind(this)).attr("y2", function (d) {
|
|
1811
|
+
_newArrowCheck(this, _this);
|
|
1812
|
+
|
|
1660
1813
|
return isRotated ? xvCustom(d, "x2") : yvCustom(d, "y2");
|
|
1661
|
-
}).transition().style("opacity", null);
|
|
1814
|
+
}.bind(this)).transition().style("opacity", null);
|
|
1662
1815
|
};
|
|
1663
1816
|
|
|
1664
1817
|
_proto.updateStanfordRegions = function updateStanfordRegions(duration) {
|
|
1665
|
-
var
|
|
1818
|
+
var _this2 = this,
|
|
1819
|
+
$$ = this.owner.$$,
|
|
1666
1820
|
config = $$.config,
|
|
1667
1821
|
main = $$.$el.main,
|
|
1668
1822
|
isRotated = config.axis_rotated,
|
|
@@ -1670,6 +1824,7 @@ var Elements = /*#__PURE__*/function () {
|
|
|
1670
1824
|
yvCustom = this.yvCustom.bind($$),
|
|
1671
1825
|
countPointsInRegion = this.owner.countEpochsInRegion.bind($$),
|
|
1672
1826
|
stanfordRegion = main.select("." + stanford_classes.stanfordRegions).selectAll("." + stanford_classes.stanfordRegion).data(this.owner.config.regions);
|
|
1827
|
+
|
|
1673
1828
|
// exit
|
|
1674
1829
|
stanfordRegion.exit().transition().duration(duration).style("opacity", "0").remove(); // enter
|
|
1675
1830
|
|
|
@@ -1679,19 +1834,35 @@ var Elements = /*#__PURE__*/function () {
|
|
|
1679
1834
|
stanfordRegion = stanfordRegionEnter.merge(stanfordRegion); // update
|
|
1680
1835
|
|
|
1681
1836
|
stanfordRegion.attr("class", function (d) {
|
|
1837
|
+
_newArrowCheck(this, _this2);
|
|
1838
|
+
|
|
1682
1839
|
return stanford_classes.stanfordRegion + (d.class ? " " + d.class : "");
|
|
1683
|
-
}).select("polygon").transition().duration(duration).attr("points", function (d) {
|
|
1840
|
+
}.bind(this)).select("polygon").transition().duration(duration).attr("points", function (d) {
|
|
1841
|
+
var _this3 = this;
|
|
1842
|
+
|
|
1843
|
+
_newArrowCheck(this, _this2);
|
|
1844
|
+
|
|
1684
1845
|
return d.points.map(function (value) {
|
|
1846
|
+
_newArrowCheck(this, _this3);
|
|
1847
|
+
|
|
1685
1848
|
return [isRotated ? yvCustom(value, "y") : xvCustom(value, "x"), isRotated ? xvCustom(value, "x") : yvCustom(value, "y")].join(",");
|
|
1686
|
-
}).join(" ");
|
|
1687
|
-
}).transition().style("opacity", function (d) {
|
|
1849
|
+
}.bind(this)).join(" ");
|
|
1850
|
+
}.bind(this)).transition().style("opacity", function (d) {
|
|
1851
|
+
_newArrowCheck(this, _this2);
|
|
1852
|
+
|
|
1688
1853
|
return (d.opacity ? d.opacity : .2) + "";
|
|
1689
|
-
});
|
|
1854
|
+
}.bind(this));
|
|
1690
1855
|
stanfordRegion.select("text").transition().duration(duration).attr("x", function (d) {
|
|
1856
|
+
_newArrowCheck(this, _this2);
|
|
1857
|
+
|
|
1691
1858
|
return isRotated ? yvCustom(getCentroid(d.points), "y") : xvCustom(getCentroid(d.points), "x");
|
|
1692
|
-
}).attr("y", function (d) {
|
|
1859
|
+
}.bind(this)).attr("y", function (d) {
|
|
1860
|
+
_newArrowCheck(this, _this2);
|
|
1861
|
+
|
|
1693
1862
|
return isRotated ? xvCustom(getCentroid(d.points), "x") : yvCustom(getCentroid(d.points), "y");
|
|
1694
|
-
}).text(function (d) {
|
|
1863
|
+
}.bind(this)).text(function (d) {
|
|
1864
|
+
_newArrowCheck(this, _this2);
|
|
1865
|
+
|
|
1695
1866
|
if (d.text) {
|
|
1696
1867
|
var _countPointsInRegion = countPointsInRegion(d.points),
|
|
1697
1868
|
value = _countPointsInRegion.value,
|
|
@@ -1701,7 +1872,7 @@ var Elements = /*#__PURE__*/function () {
|
|
|
1701
1872
|
}
|
|
1702
1873
|
|
|
1703
1874
|
return "";
|
|
1704
|
-
}).attr("text-anchor", "middle").attr("dominant-baseline", "middle").transition().style("opacity", null);
|
|
1875
|
+
}.bind(this)).attr("text-anchor", "middle").attr("dominant-baseline", "middle").transition().style("opacity", null);
|
|
1705
1876
|
};
|
|
1706
1877
|
|
|
1707
1878
|
_proto.updateStanfordElements = function updateStanfordElements(duration) {
|
|
@@ -1744,6 +1915,8 @@ var external_commonjs_d3_axis_commonjs2_d3_axis_amd_d3_axis_root_d3_ = __webpack
|
|
|
1744
1915
|
// EXTERNAL MODULE: external {"commonjs":"d3-format","commonjs2":"d3-format","amd":"d3-format","root":"d3"}
|
|
1745
1916
|
var external_commonjs_d3_format_commonjs2_d3_format_amd_d3_format_root_d3_ = __webpack_require__(9);
|
|
1746
1917
|
;// CONCATENATED MODULE: ./src/Plugin/stanford/ColorScale.ts
|
|
1918
|
+
|
|
1919
|
+
|
|
1747
1920
|
/**
|
|
1748
1921
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
1749
1922
|
* billboard.js project is licensed under the MIT license
|
|
@@ -1770,14 +1943,14 @@ var ColorScale = /*#__PURE__*/function () {
|
|
|
1770
1943
|
var _proto = ColorScale.prototype;
|
|
1771
1944
|
|
|
1772
1945
|
_proto.drawColorScale = function drawColorScale() {
|
|
1773
|
-
var _this
|
|
1946
|
+
var _this = this,
|
|
1947
|
+
_this$owner = this.owner,
|
|
1774
1948
|
$$ = _this$owner.$$,
|
|
1775
1949
|
config = _this$owner.config,
|
|
1776
1950
|
target = $$.data.targets[0],
|
|
1777
1951
|
height = $$.state.height - config.padding_bottom - config.padding_top,
|
|
1778
1952
|
barWidth = config.scale_width,
|
|
1779
|
-
|
|
1780
|
-
points = getRange(config.padding_bottom, height, barHeight),
|
|
1953
|
+
points = getRange(config.padding_bottom, height, 5),
|
|
1781
1954
|
inverseScale = (0,external_commonjs_d3_scale_commonjs2_d3_scale_amd_d3_scale_root_d3_.scaleSequential)(target.colors).domain([points[points.length - 1], points[0]]);
|
|
1782
1955
|
|
|
1783
1956
|
if (this.colorScale) {
|
|
@@ -1786,12 +1959,16 @@ var ColorScale = /*#__PURE__*/function () {
|
|
|
1786
1959
|
|
|
1787
1960
|
this.colorScale = $$.$el.svg.append("g").attr("width", 50).attr("height", height).attr("class", stanford_classes.colorScale);
|
|
1788
1961
|
this.colorScale.append("g").attr("transform", "translate(0, " + config.padding_top + ")").selectAll("bars").data(points).enter().append("rect").attr("y", function (d, i) {
|
|
1789
|
-
|
|
1790
|
-
|
|
1962
|
+
_newArrowCheck(this, _this);
|
|
1963
|
+
|
|
1964
|
+
return i * 5;
|
|
1965
|
+
}.bind(this)).attr("x", 0).attr("width", barWidth).attr("height", 5).attr("fill", function (d) {
|
|
1966
|
+
_newArrowCheck(this, _this);
|
|
1967
|
+
|
|
1791
1968
|
return inverseScale(d);
|
|
1792
|
-
}); // Legend Axis
|
|
1969
|
+
}.bind(this)); // Legend Axis
|
|
1793
1970
|
|
|
1794
|
-
var axisScale = (0,external_commonjs_d3_scale_commonjs2_d3_scale_amd_d3_scale_root_d3_.scaleLog)().domain([target.minEpochs, target.maxEpochs]).range([points[0] + config.padding_top + points[points.length - 1] +
|
|
1971
|
+
var axisScale = (0,external_commonjs_d3_scale_commonjs2_d3_scale_amd_d3_scale_root_d3_.scaleLog)().domain([target.minEpochs, target.maxEpochs]).range([points[0] + config.padding_top + points[points.length - 1] + 5 - 1, points[0] + config.padding_top]),
|
|
1795
1972
|
legendAxis = (0,external_commonjs_d3_axis_commonjs2_d3_axis_amd_d3_axis_root_d3_.axisRight)(axisScale),
|
|
1796
1973
|
scaleFormat = config.scale_format;
|
|
1797
1974
|
|
|
@@ -1808,12 +1985,16 @@ var ColorScale = /*#__PURE__*/function () {
|
|
|
1808
1985
|
|
|
1809
1986
|
if (scaleFormat === "pow10") {
|
|
1810
1987
|
axis.selectAll(".tick text").text(null).filter(function (d) {
|
|
1988
|
+
_newArrowCheck(this, _this);
|
|
1989
|
+
|
|
1811
1990
|
return d / Math.pow(10, Math.ceil(Math.log(d) / Math.LN10 - 1e-12)) === 1;
|
|
1812
|
-
}) // Power of Ten
|
|
1991
|
+
}.bind(this)) // Power of Ten
|
|
1813
1992
|
.text(10).append("tspan").attr("dy", "-.7em") // https://bl.ocks.org/mbostock/6738229
|
|
1814
1993
|
.text(function (d) {
|
|
1994
|
+
_newArrowCheck(this, _this);
|
|
1995
|
+
|
|
1815
1996
|
return Math.round(Math.log(d) / Math.LN10);
|
|
1816
|
-
});
|
|
1997
|
+
}.bind(this));
|
|
1817
1998
|
}
|
|
1818
1999
|
|
|
1819
2000
|
this.colorScale.attr("transform", "translate(" + ($$.state.current.width - this.xForColorScale()) + ", 0)");
|
|
@@ -1835,6 +2016,7 @@ var ColorScale = /*#__PURE__*/function () {
|
|
|
1835
2016
|
|
|
1836
2017
|
|
|
1837
2018
|
|
|
2019
|
+
|
|
1838
2020
|
/**
|
|
1839
2021
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
1840
2022
|
* billboard.js project is licensed under the MIT license
|
|
@@ -1959,24 +2141,34 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
1959
2141
|
$$.config.data_xSort = !1;
|
|
1960
2142
|
|
|
1961
2143
|
$$.isMultipleX = function () {
|
|
2144
|
+
_newArrowCheck(this, _this2);
|
|
2145
|
+
|
|
1962
2146
|
return !0;
|
|
1963
|
-
};
|
|
2147
|
+
}.bind(this);
|
|
1964
2148
|
|
|
1965
|
-
$$.showGridFocus = function () {
|
|
2149
|
+
$$.showGridFocus = function () {
|
|
2150
|
+
_newArrowCheck(this, _this2);
|
|
2151
|
+
}.bind(this);
|
|
1966
2152
|
|
|
1967
2153
|
$$.labelishData = function (d) {
|
|
2154
|
+
_newArrowCheck(this, _this2);
|
|
2155
|
+
|
|
1968
2156
|
return d.values;
|
|
1969
|
-
};
|
|
2157
|
+
}.bind(this);
|
|
1970
2158
|
|
|
1971
2159
|
$$.opacityForCircle = function () {
|
|
2160
|
+
_newArrowCheck(this, _this2);
|
|
2161
|
+
|
|
1972
2162
|
return 1;
|
|
1973
|
-
};
|
|
2163
|
+
}.bind(this);
|
|
1974
2164
|
|
|
1975
2165
|
var getCurrentPaddingRight = $$.getCurrentPaddingRight.bind($$);
|
|
1976
2166
|
|
|
1977
2167
|
$$.getCurrentPaddingRight = function () {
|
|
1978
|
-
|
|
1979
|
-
|
|
2168
|
+
_newArrowCheck(this, _this2);
|
|
2169
|
+
|
|
2170
|
+
return getCurrentPaddingRight() + (this.colorScale ? this.colorScale.getColorScalePadding() : 0);
|
|
2171
|
+
}.bind(this);
|
|
1980
2172
|
};
|
|
1981
2173
|
|
|
1982
2174
|
_proto.$init = function $init() {
|
|
@@ -2004,17 +2196,25 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
2004
2196
|
};
|
|
2005
2197
|
|
|
2006
2198
|
_proto.convertData = function convertData() {
|
|
2007
|
-
var
|
|
2199
|
+
var _this3 = this,
|
|
2200
|
+
data = this.$$.data.targets,
|
|
2008
2201
|
epochs = this.options.epochs;
|
|
2202
|
+
|
|
2009
2203
|
data.forEach(function (d) {
|
|
2204
|
+
var _this4 = this;
|
|
2205
|
+
|
|
2206
|
+
_newArrowCheck(this, _this3);
|
|
2207
|
+
|
|
2010
2208
|
d.values.forEach(function (v, i) {
|
|
2209
|
+
_newArrowCheck(this, _this4);
|
|
2210
|
+
|
|
2011
2211
|
v.epochs = epochs[i];
|
|
2012
|
-
});
|
|
2212
|
+
}.bind(this));
|
|
2013
2213
|
d.minEpochs = undefined;
|
|
2014
2214
|
d.maxEpochs = undefined;
|
|
2015
2215
|
d.colors = undefined;
|
|
2016
2216
|
d.colorscale = undefined;
|
|
2017
|
-
});
|
|
2217
|
+
}.bind(this));
|
|
2018
2218
|
};
|
|
2019
2219
|
|
|
2020
2220
|
_proto.xvCustom = function xvCustom(d, xyValue) {
|
|
@@ -2041,15 +2241,19 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
2041
2241
|
};
|
|
2042
2242
|
|
|
2043
2243
|
_proto.initStanfordData = function initStanfordData() {
|
|
2044
|
-
var
|
|
2244
|
+
var _this5 = this,
|
|
2245
|
+
config = this.config,
|
|
2045
2246
|
target = this.$$.data.targets[0];
|
|
2247
|
+
|
|
2046
2248
|
// TODO STANFORD see if (data.js -> orderTargets)+ can be used instead
|
|
2047
2249
|
// Make larger values appear on top
|
|
2048
2250
|
target.values.sort(compareEpochs); // Get array of epochs
|
|
2049
2251
|
|
|
2050
2252
|
var epochs = target.values.map(function (a) {
|
|
2253
|
+
_newArrowCheck(this, _this5);
|
|
2254
|
+
|
|
2051
2255
|
return a.epochs;
|
|
2052
|
-
});
|
|
2256
|
+
}.bind(this));
|
|
2053
2257
|
target.minEpochs = !isNaN(config.scale_min) ? config.scale_min : Math.min.apply(Math, epochs);
|
|
2054
2258
|
target.maxEpochs = !isNaN(config.scale_max) ? config.scale_max : Math.max.apply(Math, epochs);
|
|
2055
2259
|
target.colors = isFunction(config.colors) ? config.colors : (0,external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate_root_d3_.interpolateHslLong)((0,external_commonjs_d3_color_commonjs2_d3_color_amd_d3_color_root_d3_.hsl)(250, 1, .5), (0,external_commonjs_d3_color_commonjs2_d3_color_amd_d3_color_root_d3_.hsl)(0, 1, .5));
|
|
@@ -2066,28 +2270,47 @@ var Stanford = /*#__PURE__*/function (_Plugin) {
|
|
|
2066
2270
|
|
|
2067
2271
|
if (isEmpty(config.tooltip_contents)) {
|
|
2068
2272
|
config.tooltip_contents = function (d, defaultTitleFormat, defaultValueFormat, color) {
|
|
2069
|
-
var
|
|
2273
|
+
var _this6 = this,
|
|
2274
|
+
data_x = config.data_x,
|
|
2275
|
+
html = "<table class=\"" + $TOOLTIP.tooltip + "\"><tbody>";
|
|
2276
|
+
|
|
2070
2277
|
d.forEach(function (v) {
|
|
2071
|
-
|
|
2072
|
-
|
|
2278
|
+
_newArrowCheck(this, _this6);
|
|
2279
|
+
|
|
2280
|
+
var _v$id = v.id,
|
|
2281
|
+
id = _v$id === void 0 ? "" : _v$id,
|
|
2282
|
+
_v$value = v.value,
|
|
2283
|
+
value = _v$value === void 0 ? 0 : _v$value,
|
|
2284
|
+
_v$epochs = v.epochs,
|
|
2285
|
+
epochs = _v$epochs === void 0 ? 0 : _v$epochs,
|
|
2286
|
+
_v$x = v.x,
|
|
2287
|
+
x = _v$x === void 0 ? "" : _v$x;
|
|
2288
|
+
html += "<tr>\n\t\t\t\t\t\t\t<th>" + (data_x || "") + "</th>\n\t\t\t\t\t\t\t<th class=\"value\">" + defaultTitleFormat(x) + "</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>" + v.id + "</th>\n\t\t\t\t\t\t\t<th class=\"value\">" + defaultValueFormat(value) + "</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"" + $TOOLTIP.tooltipName + "-" + id + "\">\n\t\t\t\t\t\t\t<td class=\"name\"><span style=\"background-color:" + color(v) + "\"></span>Epochs</td>\n\t\t\t\t\t\t\t<td class=\"value\">" + defaultValueFormat(epochs) + "</td>\n\t\t\t\t\t\t</tr>";
|
|
2289
|
+
}.bind(this));
|
|
2073
2290
|
return html + "</tbody></table>";
|
|
2074
2291
|
};
|
|
2075
2292
|
}
|
|
2076
2293
|
};
|
|
2077
2294
|
|
|
2078
2295
|
_proto.countEpochsInRegion = function countEpochsInRegion(region) {
|
|
2079
|
-
var
|
|
2296
|
+
var _this7 = this,
|
|
2297
|
+
$$ = this,
|
|
2080
2298
|
target = $$.data.targets[0],
|
|
2081
2299
|
total = target.values.reduce(function (accumulator, currentValue) {
|
|
2300
|
+
_newArrowCheck(this, _this7);
|
|
2301
|
+
|
|
2082
2302
|
return accumulator + +currentValue.epochs;
|
|
2083
|
-
}, 0),
|
|
2303
|
+
}.bind(this), 0),
|
|
2084
2304
|
value = target.values.reduce(function (accumulator, currentValue) {
|
|
2305
|
+
_newArrowCheck(this, _this7);
|
|
2306
|
+
|
|
2085
2307
|
if (pointInRegion(currentValue, region)) {
|
|
2086
2308
|
return accumulator + +currentValue.epochs;
|
|
2087
2309
|
}
|
|
2088
2310
|
|
|
2089
2311
|
return accumulator;
|
|
2090
|
-
}, 0);
|
|
2312
|
+
}.bind(this), 0);
|
|
2313
|
+
|
|
2091
2314
|
return {
|
|
2092
2315
|
value: value,
|
|
2093
2316
|
percentage: value !== 0 ? +(value / total * 100).toFixed(1) : 0
|