billboard.js 3.11.2 → 3.12.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/README.md +2 -6
- package/dist/billboard.css +5 -1
- package/dist/billboard.js +19431 -24292
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +26 -3
- package/dist/billboard.pkgd.js +22301 -29057
- package/dist/billboard.pkgd.min.js +33 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +77 -175
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -3
- package/dist/plugin/billboardjs-plugin-sparkline.js +423 -1134
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +660 -1524
- package/dist/plugin/billboardjs-plugin-stanford.min.js +15 -3
- package/dist/plugin/billboardjs-plugin-tableview.js +503 -1175
- package/dist/plugin/billboardjs-plugin-tableview.min.js +30 -3
- package/dist/plugin/billboardjs-plugin-textoverlap.js +351 -1055
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -3
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +339 -1324
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +5 -3
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +1701 -3424
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2385 -4462
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +18 -3
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +1783 -3467
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +33 -3
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2031 -3979
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -3
- package/dist/theme/dark.css +5 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +5 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +5 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +5 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +5 -1
- package/dist/theme/modern.min.css +3 -4
- package/dist-esm/billboard.js +9051 -8666
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +19 -25
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +149 -148
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +295 -286
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +235 -234
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +40 -41
- package/package.json +26 -46
- package/src/Chart/api/axis.ts +6 -13
- package/src/Chart/api/chart.ts +12 -11
- package/src/Chart/api/data.ts +8 -7
- package/src/Chart/api/export.ts +28 -21
- package/src/Chart/api/flow.ts +4 -2
- package/src/Chart/api/grid.ts +1 -5
- package/src/Chart/api/load.ts +2 -2
- package/src/Chart/api/regions.ts +29 -5
- package/src/Chart/api/selection.ts +2 -2
- package/src/Chart/api/show.ts +2 -3
- package/src/Chart/api/subchart.ts +2 -2
- package/src/Chart/api/tooltip.ts +5 -7
- package/src/Chart/api/x.ts +2 -2
- package/src/Chart/api/zoom.ts +2 -2
- package/src/ChartInternal/Axis/Axis.ts +119 -44
- package/src/ChartInternal/Axis/AxisRenderer.ts +53 -38
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +79 -51
- package/src/ChartInternal/data/IData.ts +22 -29
- package/src/ChartInternal/data/convert.helper.ts +66 -68
- package/src/ChartInternal/data/convert.ts +11 -11
- package/src/ChartInternal/data/data.ts +40 -23
- package/src/ChartInternal/data/load.ts +7 -6
- package/src/ChartInternal/interactions/drag.ts +2 -1
- package/src/ChartInternal/interactions/eventrect.ts +54 -25
- package/src/ChartInternal/interactions/flow.ts +14 -4
- package/src/ChartInternal/interactions/interaction.ts +34 -12
- package/src/ChartInternal/interactions/subchart.ts +27 -25
- package/src/ChartInternal/interactions/zoom.ts +29 -18
- package/src/ChartInternal/internals/category.ts +1 -1
- package/src/ChartInternal/internals/class.ts +5 -5
- package/src/ChartInternal/internals/clip.ts +9 -10
- package/src/ChartInternal/internals/color.ts +70 -42
- package/src/ChartInternal/internals/domain.ts +59 -28
- package/src/ChartInternal/internals/format.ts +5 -5
- package/src/ChartInternal/internals/grid.ts +130 -47
- package/src/ChartInternal/internals/legend.ts +99 -66
- package/src/ChartInternal/internals/redraw.ts +3 -2
- package/src/ChartInternal/internals/region.ts +5 -3
- package/src/ChartInternal/internals/scale.ts +28 -15
- package/src/ChartInternal/internals/selection.ts +14 -13
- package/src/ChartInternal/internals/size.axis.ts +18 -10
- package/src/ChartInternal/internals/size.ts +97 -66
- package/src/ChartInternal/internals/style.ts +21 -19
- package/src/ChartInternal/internals/text.ts +64 -39
- package/src/ChartInternal/internals/title.ts +2 -2
- package/src/ChartInternal/internals/tooltip.ts +83 -34
- package/src/ChartInternal/internals/transform.ts +2 -2
- package/src/ChartInternal/internals/type.ts +12 -12
- package/src/ChartInternal/shape/arc.ts +78 -44
- package/src/ChartInternal/shape/area.ts +19 -22
- package/src/ChartInternal/shape/bar.ts +41 -31
- package/src/ChartInternal/shape/bubble.ts +5 -5
- package/src/ChartInternal/shape/candlestick.ts +15 -13
- package/src/ChartInternal/shape/gauge.ts +16 -9
- package/src/ChartInternal/shape/line.ts +62 -46
- package/src/ChartInternal/shape/point.common.ts +1 -4
- package/src/ChartInternal/shape/point.ts +52 -32
- package/src/ChartInternal/shape/polar.ts +4 -2
- package/src/ChartInternal/shape/radar.ts +40 -22
- package/src/ChartInternal/shape/shape.ts +84 -58
- package/src/ChartInternal/shape/treemap.ts +29 -20
- package/src/Plugin/bubblecompare/index.ts +1 -3
- package/src/Plugin/sparkline/index.ts +3 -4
- package/src/Plugin/stanford/ColorScale.ts +3 -2
- package/src/Plugin/stanford/Elements.ts +15 -6
- package/src/Plugin/stanford/Options.ts +5 -5
- package/src/Plugin/stanford/index.ts +13 -9
- package/src/Plugin/tableview/Options.ts +1 -1
- package/src/Plugin/tableview/const.ts +1 -4
- package/src/Plugin/tableview/index.ts +11 -9
- package/src/Plugin/textoverlap/index.ts +4 -6
- package/src/config/Options/Options.ts +3 -3
- package/src/config/Options/axis/axis.ts +36 -0
- package/src/config/Options/axis/x.ts +12 -13
- package/src/config/Options/axis/y.ts +13 -13
- package/src/config/Options/axis/y2.ts +23 -10
- package/src/config/Options/common/color.ts +4 -4
- package/src/config/Options/common/grid.ts +4 -4
- package/src/config/Options/common/legend.ts +13 -14
- package/src/config/Options/common/main.ts +23 -23
- package/src/config/Options/common/point.ts +17 -18
- package/src/config/Options/common/title.ts +2 -2
- package/src/config/Options/common/tooltip.ts +13 -11
- package/src/config/Options/data/axis.ts +2 -2
- package/src/config/Options/data/data.ts +45 -45
- package/src/config/Options/interaction/interaction.ts +1 -1
- package/src/config/Options/interaction/subchart.ts +2 -2
- package/src/config/Options/interaction/zoom.ts +9 -9
- package/src/config/Options/shape/arc.ts +10 -13
- package/src/config/Options/shape/area.ts +5 -7
- package/src/config/Options/shape/bar.ts +8 -10
- package/src/config/Options/shape/bubble.ts +1 -1
- package/src/config/Options/shape/candlestick.ts +2 -2
- package/src/config/Options/shape/donut.ts +4 -4
- package/src/config/Options/shape/gauge.ts +6 -6
- package/src/config/Options/shape/line.ts +3 -3
- package/src/config/Options/shape/pie.ts +5 -5
- package/src/config/Options/shape/polar.ts +3 -3
- package/src/config/Options/shape/radar.ts +2 -2
- package/src/config/Options/shape/scatter.ts +1 -1
- package/src/config/Options/shape/treemap.ts +1 -1
- package/src/config/Store/Element.ts +8 -5
- package/src/config/Store/State.ts +19 -13
- package/src/config/classes.ts +6 -4
- package/src/config/config.ts +1 -1
- package/src/config/resolver/axis.ts +4 -4
- package/src/config/resolver/interaction.ts +3 -7
- package/src/config/resolver/shape.ts +11 -12
- package/src/core.ts +2 -3
- package/src/index.esm.ts +2 -6
- package/src/index.ts +2 -2
- package/src/module/Cache.ts +2 -3
- package/src/module/browser.ts +15 -10
- package/src/module/error.ts +9 -8
- package/src/module/generator.ts +3 -5
- package/src/module/util.ts +60 -37
- package/src/module/worker.ts +14 -11
- package/src/scss/billboard.scss +6 -0
- package/src/scss/theme/dark.scss +6 -0
- package/src/scss/theme/datalab.scss +6 -0
- package/src/scss/theme/graph.scss +6 -0
- package/src/scss/theme/insight.scss +6 -0
- package/src/scss/theme/modern.scss +6 -0
- package/types/axis.d.ts +7 -0
- package/types/options.d.ts +7 -0
- package/types/options.shape.d.ts +7 -0
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.12.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
import { interpolateHslLong } from 'd3-interpolate';
|
|
13
12
|
import { hsl } from 'd3-color';
|
|
13
|
+
import { interpolateHslLong } from 'd3-interpolate';
|
|
14
14
|
import { scaleSequential, scaleSymlog, scaleSequentialLog } from 'd3-scale';
|
|
15
15
|
import { axisRight } from 'd3-axis';
|
|
16
16
|
import { format } from 'd3-format';
|
|
@@ -28,45 +28,43 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
28
28
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
29
29
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
30
|
PERFORMANCE OF THIS SOFTWARE.
|
|
31
|
-
***************************************************************************** */
|
|
32
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
d
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
+
***************************************************************************** */
|
|
32
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
33
|
+
|
|
34
|
+
var extendStatics = function(d, b) {
|
|
35
|
+
extendStatics = Object.setPrototypeOf ||
|
|
36
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
37
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
38
|
+
return extendStatics(d, b);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function __extends(d, b) {
|
|
42
|
+
if (typeof b !== "function" && b !== null)
|
|
43
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
44
|
+
extendStatics(d, b);
|
|
45
|
+
function __() { this.constructor = d; }
|
|
46
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var __assign = function() {
|
|
50
|
+
__assign = Object.assign || function __assign(t) {
|
|
51
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
52
|
+
s = arguments[i];
|
|
53
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
};
|
|
57
|
+
return __assign.apply(this, arguments);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
function __spreadArray(to, from, pack) {
|
|
61
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
62
|
+
if (ar || !(i in from)) {
|
|
63
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
64
|
+
ar[i] = from[i];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
70
68
|
}
|
|
71
69
|
|
|
72
70
|
/**
|
|
@@ -107,7 +105,10 @@ var $AXIS = {
|
|
|
107
105
|
axisY: "bb-axis-y",
|
|
108
106
|
axisY2: "bb-axis-y2",
|
|
109
107
|
axisY2Label: "bb-axis-y2-label",
|
|
110
|
-
axisYLabel: "bb-axis-y-label"
|
|
108
|
+
axisYLabel: "bb-axis-y-label",
|
|
109
|
+
axisXTooltip: "bb-axis-x-tooltip",
|
|
110
|
+
axisYTooltip: "bb-axis-y-tooltip",
|
|
111
|
+
axisY2Tooltip: "bb-axis-y2-tooltip"
|
|
111
112
|
};
|
|
112
113
|
var $BAR = {
|
|
113
114
|
bar: "bb-bar",
|
|
@@ -162,7 +163,7 @@ var $EVENT = {
|
|
|
162
163
|
eventRect: "bb-event-rect",
|
|
163
164
|
eventRects: "bb-event-rects",
|
|
164
165
|
eventRectsMultiple: "bb-event-rects-multiple",
|
|
165
|
-
eventRectsSingle: "bb-event-rects-single"
|
|
166
|
+
eventRectsSingle: "bb-event-rects-single"
|
|
166
167
|
};
|
|
167
168
|
var $FOCUS = {
|
|
168
169
|
focused: "bb-focused",
|
|
@@ -198,7 +199,7 @@ var $SELECT = {
|
|
|
198
199
|
};
|
|
199
200
|
var $SHAPE = {
|
|
200
201
|
shape: "bb-shape",
|
|
201
|
-
shapes: "bb-shapes"
|
|
202
|
+
shapes: "bb-shapes"
|
|
202
203
|
};
|
|
203
204
|
var $SUBCHART = {
|
|
204
205
|
brush: "bb-brush",
|
|
@@ -226,7 +227,7 @@ var $ZOOM = {
|
|
|
226
227
|
buttonZoomReset: "bb-zoom-reset",
|
|
227
228
|
zoomBrush: "bb-zoom-brush"
|
|
228
229
|
};
|
|
229
|
-
|
|
230
|
+
__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, $COMMON), $ARC), $AREA), $AXIS), $BAR), $CANDLESTICK), $CIRCLE), $COLOR), $DRAG), $GAUGE), $LEGEND), $LINE), $EVENT), $FOCUS), $GRID), $RADAR), $REGION), $SELECT), $SHAPE), $SUBCHART), $TEXT), $TOOLTIP), $TREEMAP), $ZOOM);
|
|
230
231
|
|
|
231
232
|
/**
|
|
232
233
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -243,7 +244,8 @@ _assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(_assign(
|
|
|
243
244
|
* @private
|
|
244
245
|
*/
|
|
245
246
|
function getGlobal() {
|
|
246
|
-
return (typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object &&
|
|
247
|
+
return (typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object &&
|
|
248
|
+
globalThis) ||
|
|
247
249
|
(typeof global === "object" && global !== null && global.Object === Object && global) ||
|
|
248
250
|
(typeof self === "object" && self !== null && self.Object === Object && self) ||
|
|
249
251
|
Function("return this")();
|
|
@@ -299,8 +301,7 @@ function mergeObj(target) {
|
|
|
299
301
|
target[key] = mergeObj(target[key], value);
|
|
300
302
|
}
|
|
301
303
|
else {
|
|
302
|
-
target[key] = isArray(value) ?
|
|
303
|
-
value.concat() : value;
|
|
304
|
+
target[key] = isArray(value) ? value.concat() : value;
|
|
304
305
|
}
|
|
305
306
|
});
|
|
306
307
|
}
|
|
@@ -327,7 +328,12 @@ var getRange = function (start, end, step) {
|
|
|
327
328
|
({
|
|
328
329
|
mouse: (function () {
|
|
329
330
|
var getParams = function () { return ({
|
|
330
|
-
bubbles: false,
|
|
331
|
+
bubbles: false,
|
|
332
|
+
cancelable: false,
|
|
333
|
+
screenX: 0,
|
|
334
|
+
screenY: 0,
|
|
335
|
+
clientX: 0,
|
|
336
|
+
clientY: 0
|
|
331
337
|
}); };
|
|
332
338
|
try {
|
|
333
339
|
// eslint-disable-next-line no-new
|
|
@@ -397,10 +403,6 @@ function parseDate(date) {
|
|
|
397
403
|
return parsedDate;
|
|
398
404
|
}
|
|
399
405
|
|
|
400
|
-
/**
|
|
401
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
402
|
-
* billboard.js project is licensed under the MIT license
|
|
403
|
-
*/
|
|
404
406
|
/**
|
|
405
407
|
* Load configuration option
|
|
406
408
|
* @param {object} config User's generation config value
|
|
@@ -494,157 +496,11 @@ var Plugin = /** @class */ (function () {
|
|
|
494
496
|
delete _this[key];
|
|
495
497
|
});
|
|
496
498
|
};
|
|
497
|
-
Plugin.version = "3.
|
|
499
|
+
Plugin.version = "3.12.0-next.1";
|
|
498
500
|
return Plugin;
|
|
499
501
|
}());
|
|
500
502
|
var Plugin$1 = Plugin;
|
|
501
503
|
|
|
502
|
-
/**
|
|
503
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
504
|
-
* billboard.js project is licensed under the MIT license
|
|
505
|
-
*/
|
|
506
|
-
/**
|
|
507
|
-
* Stanford diagram plugin option class
|
|
508
|
-
* @class StanfordOptions
|
|
509
|
-
* @param {Options} options Stanford plugin options
|
|
510
|
-
* @augments Plugin
|
|
511
|
-
* @returns {StanfordOptions}
|
|
512
|
-
* @private
|
|
513
|
-
*/
|
|
514
|
-
var Options = /** @class */ (function () {
|
|
515
|
-
function Options() {
|
|
516
|
-
return {
|
|
517
|
-
/**
|
|
518
|
-
* Set the color of the color scale. This function receives a value between 0 and 1, and should return a color.
|
|
519
|
-
* @name colors
|
|
520
|
-
* @memberof plugin-stanford
|
|
521
|
-
* @type {Function}
|
|
522
|
-
* @default undefined
|
|
523
|
-
* @example
|
|
524
|
-
* colors: d3.interpolateHslLong(
|
|
525
|
-
* d3.hsl(250, 1, 0.5), d3.hsl(0, 1, 0.5)
|
|
526
|
-
* )
|
|
527
|
-
*/
|
|
528
|
-
colors: undefined,
|
|
529
|
-
/**
|
|
530
|
-
* Specify the key of epochs values in the data.
|
|
531
|
-
* @name epochs
|
|
532
|
-
* @memberof plugin-stanford
|
|
533
|
-
* @type {Array}
|
|
534
|
-
* @default []
|
|
535
|
-
* @example
|
|
536
|
-
* epochs: [ 1, 1, 2, 2, ... ]
|
|
537
|
-
*/
|
|
538
|
-
epochs: [],
|
|
539
|
-
/**
|
|
540
|
-
* Show additional lines anywhere on the chart.
|
|
541
|
-
* - Each line object should consist with following options:
|
|
542
|
-
*
|
|
543
|
-
* | Key | Type | Description |
|
|
544
|
-
* | --- | --- | --- |
|
|
545
|
-
* | x1 | Number | Starting position on the x axis |
|
|
546
|
-
* | y1 | Number | Starting position on the y axis |
|
|
547
|
-
* | x2 | Number | Ending position on the x axis |
|
|
548
|
-
* | y2 | Number | Ending position on the y axis |
|
|
549
|
-
* | class | String | Optional value. Set a custom css class to this line. |
|
|
550
|
-
* @type {Array}
|
|
551
|
-
* @memberof plugin-stanford
|
|
552
|
-
* @default []
|
|
553
|
-
* @example
|
|
554
|
-
* lines: [
|
|
555
|
-
* { x1: 0, y1: 0, x2: 65, y2: 65, class: "line1" },
|
|
556
|
-
* { x1: 0, x2: 65, y1: 40, y2: 40, class: "line2" }
|
|
557
|
-
* ]
|
|
558
|
-
*/
|
|
559
|
-
lines: [],
|
|
560
|
-
/**
|
|
561
|
-
* Set scale values
|
|
562
|
-
* @name scale
|
|
563
|
-
* @memberof plugin-stanford
|
|
564
|
-
* @type {object}
|
|
565
|
-
* @property {object} [scale] scale object
|
|
566
|
-
* @property {number} [scale.min=undefined] Minimum value of the color scale. Default: lowest value in epochs
|
|
567
|
-
* @property {number} [scale.max=undefined] Maximum value of the color scale. Default: highest value in epochs
|
|
568
|
-
* @property {number} [scale.width=20] Width of the color scale
|
|
569
|
-
* @property {string|Function} [scale.format=undefined] Format of the axis of the color scale. Use 'pow10' to format as powers of 10 or a custom function. Example: d3.format("d")
|
|
570
|
-
* @example
|
|
571
|
-
* scale: {
|
|
572
|
-
* max: 10000,
|
|
573
|
-
* min: 1,
|
|
574
|
-
* width: 500,
|
|
575
|
-
*
|
|
576
|
-
* // specify 'pow10' to format as powers of 10
|
|
577
|
-
* format: "pow10",
|
|
578
|
-
*
|
|
579
|
-
* // or specify a format function
|
|
580
|
-
* format: function(x) {
|
|
581
|
-
* return x +"%";
|
|
582
|
-
* }
|
|
583
|
-
* },
|
|
584
|
-
*/
|
|
585
|
-
scale_min: undefined,
|
|
586
|
-
scale_max: undefined,
|
|
587
|
-
scale_width: 20,
|
|
588
|
-
scale_format: undefined,
|
|
589
|
-
/**
|
|
590
|
-
* The padding for color scale element
|
|
591
|
-
* @name padding
|
|
592
|
-
* @memberof plugin-stanford
|
|
593
|
-
* @type {object}
|
|
594
|
-
* @property {object} [padding] padding object
|
|
595
|
-
* @property {number} [padding.top=0] Top padding value.
|
|
596
|
-
* @property {number} [padding.right=0] Right padding value.
|
|
597
|
-
* @property {number} [padding.bottom=0] Bottom padding value.
|
|
598
|
-
* @property {number} [padding.left=0] Left padding value.
|
|
599
|
-
* @example
|
|
600
|
-
* padding: {
|
|
601
|
-
* top: 15,
|
|
602
|
-
* right: 0,
|
|
603
|
-
* bottom: 0,
|
|
604
|
-
* left: 0
|
|
605
|
-
* },
|
|
606
|
-
*/
|
|
607
|
-
padding_top: 0,
|
|
608
|
-
padding_right: 0,
|
|
609
|
-
padding_bottom: 0,
|
|
610
|
-
padding_left: 0,
|
|
611
|
-
/**
|
|
612
|
-
* Show additional regions anywhere on the chart.
|
|
613
|
-
* - Each region object should consist with following options:
|
|
614
|
-
*
|
|
615
|
-
* | Key | Type | Default | Attributes | Description |
|
|
616
|
-
* | --- | --- | --- | --- | --- |
|
|
617
|
-
* | points | Array | | | Accepts a group of objects that has x and y.<br>These points should be added in a counter-clockwise fashion to make a closed polygon. |
|
|
618
|
-
* | opacity | Number | `0.2` | <optional> | Sets the opacity of the region as value between 0 and 1 |
|
|
619
|
-
* | text | Function | | <optional> | This function receives a value and percentage of the number of epochs in this region.<br>Return a string to place text in the middle of the region. |
|
|
620
|
-
* | class | String | | <optional> | Se a custom css class to this region, use the fill property in css to set a background color. |
|
|
621
|
-
* @name regions
|
|
622
|
-
* @memberof plugin-stanford
|
|
623
|
-
* @type {Array}
|
|
624
|
-
* @default []
|
|
625
|
-
* @example
|
|
626
|
-
* regions: [
|
|
627
|
-
* {
|
|
628
|
-
* points: [ // add points counter-clockwise
|
|
629
|
-
* { x: 0, y: 0 },
|
|
630
|
-
* { x: 40, y: 40 },
|
|
631
|
-
* { x: 0, y: 40 },
|
|
632
|
-
* ],
|
|
633
|
-
* text: function (value, percentage) {
|
|
634
|
-
* return `Normal Operations: ${value} (${percentage}%)`;
|
|
635
|
-
* },
|
|
636
|
-
* opacity: 0.2, // 0 to 1
|
|
637
|
-
* class: "test-polygon1"
|
|
638
|
-
* },
|
|
639
|
-
* ...
|
|
640
|
-
* ]
|
|
641
|
-
*/
|
|
642
|
-
regions: []
|
|
643
|
-
};
|
|
644
|
-
}
|
|
645
|
-
return Options;
|
|
646
|
-
}());
|
|
647
|
-
|
|
648
504
|
/**
|
|
649
505
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
650
506
|
* billboard.js project is licensed under the MIT license
|
|
@@ -752,6 +608,91 @@ function getCentroid(points) {
|
|
|
752
608
|
};
|
|
753
609
|
}
|
|
754
610
|
|
|
611
|
+
/**
|
|
612
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
613
|
+
* billboard.js project is licensed under the MIT license
|
|
614
|
+
*/
|
|
615
|
+
/**
|
|
616
|
+
* Stanford diagram plugin color scale class
|
|
617
|
+
* @class ColorScale
|
|
618
|
+
* @param {Stanford} owner Stanford instance
|
|
619
|
+
* @private
|
|
620
|
+
*/
|
|
621
|
+
var ColorScale = /** @class */ (function () {
|
|
622
|
+
function ColorScale(owner) {
|
|
623
|
+
this.owner = owner;
|
|
624
|
+
}
|
|
625
|
+
ColorScale.prototype.drawColorScale = function () {
|
|
626
|
+
var _a = this.owner, $$ = _a.$$, config = _a.config;
|
|
627
|
+
var target = $$.data.targets[0];
|
|
628
|
+
var height = $$.state.height - config.padding_bottom - config.padding_top;
|
|
629
|
+
var barWidth = config.scale_width;
|
|
630
|
+
var barHeight = 5;
|
|
631
|
+
var points = getRange(config.padding_bottom, height, barHeight);
|
|
632
|
+
var inverseScale = scaleSequential(target.colors)
|
|
633
|
+
.domain([points[points.length - 1], points[0]]);
|
|
634
|
+
if (this.colorScale) {
|
|
635
|
+
this.colorScale.remove();
|
|
636
|
+
}
|
|
637
|
+
this.colorScale = $$.$el.svg.append("g")
|
|
638
|
+
.attr("width", 50)
|
|
639
|
+
.attr("height", height)
|
|
640
|
+
.attr("class", CLASS.colorScale);
|
|
641
|
+
this.colorScale.append("g")
|
|
642
|
+
.attr("transform", "translate(0, ".concat(config.padding_top, ")"))
|
|
643
|
+
.selectAll("bars")
|
|
644
|
+
.data(points)
|
|
645
|
+
.enter()
|
|
646
|
+
.append("rect")
|
|
647
|
+
.attr("y", function (d, i) { return i * barHeight; })
|
|
648
|
+
.attr("x", 0)
|
|
649
|
+
.attr("width", barWidth)
|
|
650
|
+
.attr("height", barHeight)
|
|
651
|
+
.attr("fill", function (d) { return inverseScale(d); });
|
|
652
|
+
// Legend Axis
|
|
653
|
+
var axisScale = scaleSymlog()
|
|
654
|
+
.domain([target.minEpochs, target.maxEpochs])
|
|
655
|
+
.range([
|
|
656
|
+
points[0] + config.padding_top + points[points.length - 1] + barHeight - 1,
|
|
657
|
+
points[0] + config.padding_top
|
|
658
|
+
]);
|
|
659
|
+
var legendAxis = axisRight(axisScale);
|
|
660
|
+
var scaleFormat = config.scale_format;
|
|
661
|
+
if (scaleFormat === "pow10") {
|
|
662
|
+
legendAxis.tickValues([1, 10, 100, 1000, 10000, 100000, 1000000, 10000000]);
|
|
663
|
+
}
|
|
664
|
+
else if (isFunction(scaleFormat)) {
|
|
665
|
+
legendAxis.tickFormat(scaleFormat);
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
legendAxis.tickFormat(format("d"));
|
|
669
|
+
}
|
|
670
|
+
// Draw Axis
|
|
671
|
+
var axis = this.colorScale.append("g")
|
|
672
|
+
.attr("class", "legend axis")
|
|
673
|
+
.attr("transform", "translate(".concat(barWidth, ",0)"))
|
|
674
|
+
.call(legendAxis);
|
|
675
|
+
if (scaleFormat === "pow10") {
|
|
676
|
+
axis.selectAll(".tick text")
|
|
677
|
+
.text(null)
|
|
678
|
+
.filter(function (d) { return d / Math.pow(10, Math.ceil(Math.log(d) / Math.LN10 - 1e-12)) === 1; }) // Power of Ten
|
|
679
|
+
.text(10)
|
|
680
|
+
.append("tspan")
|
|
681
|
+
.attr("dy", "-.7em") // https://bl.ocks.org/mbostock/6738229
|
|
682
|
+
.text(function (d) { return Math.round(Math.log(d) / Math.LN10); });
|
|
683
|
+
}
|
|
684
|
+
this.colorScale.attr("transform", "translate(".concat($$.state.current.width - this.xForColorScale(), ", 0)"));
|
|
685
|
+
};
|
|
686
|
+
ColorScale.prototype.xForColorScale = function () {
|
|
687
|
+
return this.owner.config.padding_right +
|
|
688
|
+
this.colorScale.node().getBBox().width;
|
|
689
|
+
};
|
|
690
|
+
ColorScale.prototype.getColorScalePadding = function () {
|
|
691
|
+
return this.xForColorScale() + this.owner.config.padding_left + 20;
|
|
692
|
+
};
|
|
693
|
+
return ColorScale;
|
|
694
|
+
}());
|
|
695
|
+
|
|
755
696
|
/**
|
|
756
697
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
757
698
|
* billboard.js project is licensed under the MIT license
|
|
@@ -842,17 +783,25 @@ var Elements = /** @class */ (function () {
|
|
|
842
783
|
.select("polygon")
|
|
843
784
|
.transition()
|
|
844
785
|
.duration(duration)
|
|
845
|
-
.attr("points", function (d) {
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
786
|
+
.attr("points", function (d) {
|
|
787
|
+
return d.points.map(function (value) {
|
|
788
|
+
return [
|
|
789
|
+
isRotated ? yvCustom(value, "y") : xvCustom(value, "x"),
|
|
790
|
+
isRotated ? xvCustom(value, "x") : yvCustom(value, "y")
|
|
791
|
+
].join(",");
|
|
792
|
+
}).join(" ");
|
|
793
|
+
})
|
|
849
794
|
.transition()
|
|
850
795
|
.style("opacity", function (d) { return String(d.opacity ? d.opacity : 0.2); });
|
|
851
796
|
stanfordRegion.select("text")
|
|
852
797
|
.transition()
|
|
853
798
|
.duration(duration)
|
|
854
|
-
.attr("x", function (d) { return (isRotated ?
|
|
855
|
-
|
|
799
|
+
.attr("x", function (d) { return (isRotated ?
|
|
800
|
+
yvCustom(getCentroid(d.points), "y") :
|
|
801
|
+
xvCustom(getCentroid(d.points), "x")); })
|
|
802
|
+
.attr("y", function (d) { return (isRotated ?
|
|
803
|
+
xvCustom(getCentroid(d.points), "x") :
|
|
804
|
+
yvCustom(getCentroid(d.points), "y")); })
|
|
856
805
|
.text(function (d) {
|
|
857
806
|
if (d.text) {
|
|
858
807
|
var _a = countPointsInRegion(d.points), value = _a.value, percentage = _a.percentage;
|
|
@@ -896,84 +845,145 @@ var Elements = /** @class */ (function () {
|
|
|
896
845
|
* billboard.js project is licensed under the MIT license
|
|
897
846
|
*/
|
|
898
847
|
/**
|
|
899
|
-
* Stanford diagram plugin
|
|
900
|
-
* @class
|
|
901
|
-
* @param {
|
|
848
|
+
* Stanford diagram plugin option class
|
|
849
|
+
* @class StanfordOptions
|
|
850
|
+
* @param {Options} options Stanford plugin options
|
|
851
|
+
* @augments Plugin
|
|
852
|
+
* @returns {StanfordOptions}
|
|
902
853
|
* @private
|
|
903
854
|
*/
|
|
904
|
-
var
|
|
905
|
-
function
|
|
906
|
-
|
|
855
|
+
var Options = /** @class */ (function () {
|
|
856
|
+
function Options() {
|
|
857
|
+
return {
|
|
858
|
+
/**
|
|
859
|
+
* Set the color of the color scale. This function receives a value between 0 and 1, and should return a color.
|
|
860
|
+
* @name colors
|
|
861
|
+
* @memberof plugin-stanford
|
|
862
|
+
* @type {Function}
|
|
863
|
+
* @default undefined
|
|
864
|
+
* @example
|
|
865
|
+
* colors: d3.interpolateHslLong(
|
|
866
|
+
* d3.hsl(250, 1, 0.5), d3.hsl(0, 1, 0.5)
|
|
867
|
+
* )
|
|
868
|
+
*/
|
|
869
|
+
colors: undefined,
|
|
870
|
+
/**
|
|
871
|
+
* Specify the key of epochs values in the data.
|
|
872
|
+
* @name epochs
|
|
873
|
+
* @memberof plugin-stanford
|
|
874
|
+
* @type {Array}
|
|
875
|
+
* @default []
|
|
876
|
+
* @example
|
|
877
|
+
* epochs: [ 1, 1, 2, 2, ... ]
|
|
878
|
+
*/
|
|
879
|
+
epochs: [],
|
|
880
|
+
/**
|
|
881
|
+
* Show additional lines anywhere on the chart.
|
|
882
|
+
* - Each line object should consist with following options:
|
|
883
|
+
*
|
|
884
|
+
* | Key | Type | Description |
|
|
885
|
+
* | --- | --- | --- |
|
|
886
|
+
* | x1 | Number | Starting position on the x axis |
|
|
887
|
+
* | y1 | Number | Starting position on the y axis |
|
|
888
|
+
* | x2 | Number | Ending position on the x axis |
|
|
889
|
+
* | y2 | Number | Ending position on the y axis |
|
|
890
|
+
* | class | String | Optional value. Set a custom css class to this line. |
|
|
891
|
+
* @type {Array}
|
|
892
|
+
* @memberof plugin-stanford
|
|
893
|
+
* @default []
|
|
894
|
+
* @example
|
|
895
|
+
* lines: [
|
|
896
|
+
* { x1: 0, y1: 0, x2: 65, y2: 65, class: "line1" },
|
|
897
|
+
* { x1: 0, x2: 65, y1: 40, y2: 40, class: "line2" }
|
|
898
|
+
* ]
|
|
899
|
+
*/
|
|
900
|
+
lines: [],
|
|
901
|
+
/**
|
|
902
|
+
* Set scale values
|
|
903
|
+
* @name scale
|
|
904
|
+
* @memberof plugin-stanford
|
|
905
|
+
* @type {object}
|
|
906
|
+
* @property {object} [scale] scale object
|
|
907
|
+
* @property {number} [scale.min=undefined] Minimum value of the color scale. Default: lowest value in epochs
|
|
908
|
+
* @property {number} [scale.max=undefined] Maximum value of the color scale. Default: highest value in epochs
|
|
909
|
+
* @property {number} [scale.width=20] Width of the color scale
|
|
910
|
+
* @property {string|Function} [scale.format=undefined] Format of the axis of the color scale. Use 'pow10' to format as powers of 10 or a custom function. Example: d3.format("d")
|
|
911
|
+
* @example
|
|
912
|
+
* scale: {
|
|
913
|
+
* max: 10000,
|
|
914
|
+
* min: 1,
|
|
915
|
+
* width: 500,
|
|
916
|
+
*
|
|
917
|
+
* // specify 'pow10' to format as powers of 10
|
|
918
|
+
* format: "pow10",
|
|
919
|
+
*
|
|
920
|
+
* // or specify a format function
|
|
921
|
+
* format: function(x) {
|
|
922
|
+
* return x +"%";
|
|
923
|
+
* }
|
|
924
|
+
* },
|
|
925
|
+
*/
|
|
926
|
+
scale_min: undefined,
|
|
927
|
+
scale_max: undefined,
|
|
928
|
+
scale_width: 20,
|
|
929
|
+
scale_format: undefined,
|
|
930
|
+
/**
|
|
931
|
+
* The padding for color scale element
|
|
932
|
+
* @name padding
|
|
933
|
+
* @memberof plugin-stanford
|
|
934
|
+
* @type {object}
|
|
935
|
+
* @property {object} [padding] padding object
|
|
936
|
+
* @property {number} [padding.top=0] Top padding value.
|
|
937
|
+
* @property {number} [padding.right=0] Right padding value.
|
|
938
|
+
* @property {number} [padding.bottom=0] Bottom padding value.
|
|
939
|
+
* @property {number} [padding.left=0] Left padding value.
|
|
940
|
+
* @example
|
|
941
|
+
* padding: {
|
|
942
|
+
* top: 15,
|
|
943
|
+
* right: 0,
|
|
944
|
+
* bottom: 0,
|
|
945
|
+
* left: 0
|
|
946
|
+
* },
|
|
947
|
+
*/
|
|
948
|
+
padding_top: 0,
|
|
949
|
+
padding_right: 0,
|
|
950
|
+
padding_bottom: 0,
|
|
951
|
+
padding_left: 0,
|
|
952
|
+
/**
|
|
953
|
+
* Show additional regions anywhere on the chart.
|
|
954
|
+
* - Each region object should consist with following options:
|
|
955
|
+
*
|
|
956
|
+
* | Key | Type | Default | Attributes | Description |
|
|
957
|
+
* | --- | --- | --- | --- | --- |
|
|
958
|
+
* | points | Array | | | Accepts a group of objects that has x and y.<br>These points should be added in a counter-clockwise fashion to make a closed polygon. |
|
|
959
|
+
* | opacity | Number | `0.2` | <optional> | Sets the opacity of the region as value between 0 and 1 |
|
|
960
|
+
* | text | Function | | <optional> | This function receives a value and percentage of the number of epochs in this region.<br>Return a string to place text in the middle of the region. |
|
|
961
|
+
* | class | String | | <optional> | Se a custom css class to this region, use the fill property in css to set a background color. |
|
|
962
|
+
* @name regions
|
|
963
|
+
* @memberof plugin-stanford
|
|
964
|
+
* @type {Array}
|
|
965
|
+
* @default []
|
|
966
|
+
* @example
|
|
967
|
+
* regions: [
|
|
968
|
+
* {
|
|
969
|
+
* points: [ // add points counter-clockwise
|
|
970
|
+
* { x: 0, y: 0 },
|
|
971
|
+
* { x: 40, y: 40 },
|
|
972
|
+
* { x: 0, y: 40 },
|
|
973
|
+
* ],
|
|
974
|
+
* text: function (value, percentage) {
|
|
975
|
+
* return `Normal Operations: ${value} (${percentage}%)`;
|
|
976
|
+
* },
|
|
977
|
+
* opacity: 0.2, // 0 to 1
|
|
978
|
+
* class: "test-polygon1"
|
|
979
|
+
* },
|
|
980
|
+
* ...
|
|
981
|
+
* ]
|
|
982
|
+
*/
|
|
983
|
+
regions: []
|
|
984
|
+
};
|
|
907
985
|
}
|
|
908
|
-
|
|
909
|
-
var _a = this.owner, $$ = _a.$$, config = _a.config;
|
|
910
|
-
var target = $$.data.targets[0];
|
|
911
|
-
var height = $$.state.height - config.padding_bottom - config.padding_top;
|
|
912
|
-
var barWidth = config.scale_width;
|
|
913
|
-
var barHeight = 5;
|
|
914
|
-
var points = getRange(config.padding_bottom, height, barHeight);
|
|
915
|
-
var inverseScale = scaleSequential(target.colors)
|
|
916
|
-
.domain([points[points.length - 1], points[0]]);
|
|
917
|
-
if (this.colorScale) {
|
|
918
|
-
this.colorScale.remove();
|
|
919
|
-
}
|
|
920
|
-
this.colorScale = $$.$el.svg.append("g")
|
|
921
|
-
.attr("width", 50)
|
|
922
|
-
.attr("height", height)
|
|
923
|
-
.attr("class", CLASS.colorScale);
|
|
924
|
-
this.colorScale.append("g")
|
|
925
|
-
.attr("transform", "translate(0, ".concat(config.padding_top, ")"))
|
|
926
|
-
.selectAll("bars")
|
|
927
|
-
.data(points)
|
|
928
|
-
.enter()
|
|
929
|
-
.append("rect")
|
|
930
|
-
.attr("y", function (d, i) { return i * barHeight; })
|
|
931
|
-
.attr("x", 0)
|
|
932
|
-
.attr("width", barWidth)
|
|
933
|
-
.attr("height", barHeight)
|
|
934
|
-
.attr("fill", function (d) { return inverseScale(d); });
|
|
935
|
-
// Legend Axis
|
|
936
|
-
var axisScale = scaleSymlog()
|
|
937
|
-
.domain([target.minEpochs, target.maxEpochs])
|
|
938
|
-
.range([
|
|
939
|
-
points[0] + config.padding_top + points[points.length - 1] + barHeight - 1,
|
|
940
|
-
points[0] + config.padding_top
|
|
941
|
-
]);
|
|
942
|
-
var legendAxis = axisRight(axisScale);
|
|
943
|
-
var scaleFormat = config.scale_format;
|
|
944
|
-
if (scaleFormat === "pow10") {
|
|
945
|
-
legendAxis.tickValues([1, 10, 100, 1000, 10000, 100000, 1000000, 10000000]);
|
|
946
|
-
}
|
|
947
|
-
else if (isFunction(scaleFormat)) {
|
|
948
|
-
legendAxis.tickFormat(scaleFormat);
|
|
949
|
-
}
|
|
950
|
-
else {
|
|
951
|
-
legendAxis.tickFormat(format("d"));
|
|
952
|
-
}
|
|
953
|
-
// Draw Axis
|
|
954
|
-
var axis = this.colorScale.append("g")
|
|
955
|
-
.attr("class", "legend axis")
|
|
956
|
-
.attr("transform", "translate(".concat(barWidth, ",0)"))
|
|
957
|
-
.call(legendAxis);
|
|
958
|
-
if (scaleFormat === "pow10") {
|
|
959
|
-
axis.selectAll(".tick text")
|
|
960
|
-
.text(null)
|
|
961
|
-
.filter(function (d) { return d / Math.pow(10, Math.ceil(Math.log(d) / Math.LN10 - 1e-12)) === 1; }) // Power of Ten
|
|
962
|
-
.text(10)
|
|
963
|
-
.append("tspan")
|
|
964
|
-
.attr("dy", "-.7em") // https://bl.ocks.org/mbostock/6738229
|
|
965
|
-
.text(function (d) { return Math.round(Math.log(d) / Math.LN10); });
|
|
966
|
-
}
|
|
967
|
-
this.colorScale.attr("transform", "translate(".concat($$.state.current.width - this.xForColorScale(), ", 0)"));
|
|
968
|
-
};
|
|
969
|
-
ColorScale.prototype.xForColorScale = function () {
|
|
970
|
-
return this.owner.config.padding_right +
|
|
971
|
-
this.colorScale.node().getBBox().width;
|
|
972
|
-
};
|
|
973
|
-
ColorScale.prototype.getColorScalePadding = function () {
|
|
974
|
-
return this.xForColorScale() + this.owner.config.padding_left + 20;
|
|
975
|
-
};
|
|
976
|
-
return ColorScale;
|
|
986
|
+
return Options;
|
|
977
987
|
}());
|
|
978
988
|
|
|
979
989
|
/**
|
|
@@ -1052,7 +1062,7 @@ var ColorScale = /** @class */ (function () {
|
|
|
1052
1062
|
* ]
|
|
1053
1063
|
* });
|
|
1054
1064
|
* @example
|
|
1055
|
-
*
|
|
1065
|
+
* import {bb} from "billboard.js";
|
|
1056
1066
|
* import Stanford from "billboard.js/dist/billboardjs-plugin-stanford";
|
|
1057
1067
|
*
|
|
1058
1068
|
* bb.generate({
|
|
@@ -1129,7 +1139,8 @@ var Stanford = /** @class */ (function (_super) {
|
|
|
1129
1139
|
target.minEpochs = !isNaN(config.scale_min) ? config.scale_min : Math.min.apply(Math, epochs);
|
|
1130
1140
|
target.maxEpochs = !isNaN(config.scale_max) ? config.scale_max : Math.max.apply(Math, epochs);
|
|
1131
1141
|
target.colors = isFunction(config.colors) ?
|
|
1132
|
-
config.colors :
|
|
1142
|
+
config.colors :
|
|
1143
|
+
interpolateHslLong(hsl(250, 1, 0.5), hsl(0, 1, 0.5));
|
|
1133
1144
|
target.colorscale = scaleSequentialLog(target.colors)
|
|
1134
1145
|
.domain([target.minEpochs, target.maxEpochs]);
|
|
1135
1146
|
};
|
|
@@ -1154,9 +1165,7 @@ var Stanford = /** @class */ (function (_super) {
|
|
|
1154
1165
|
Stanford.prototype.countEpochsInRegion = function (region) {
|
|
1155
1166
|
var $$ = this;
|
|
1156
1167
|
var target = $$.data.targets[0];
|
|
1157
|
-
var total = target.values.reduce(function (accumulator, currentValue) {
|
|
1158
|
-
return accumulator + Number(currentValue.epochs);
|
|
1159
|
-
}, 0);
|
|
1168
|
+
var total = target.values.reduce(function (accumulator, currentValue) { return accumulator + Number(currentValue.epochs); }, 0);
|
|
1160
1169
|
var value = target.values.reduce(function (accumulator, currentValue) {
|
|
1161
1170
|
if (pointInRegion(currentValue, region)) {
|
|
1162
1171
|
return accumulator + Number(currentValue.epochs);
|