@hpcc-js/other 2.17.0 → 2.17.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/index.es6.js +394 -380
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +393 -379
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +6 -6
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.es6.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLWidget, Utility,
|
|
1
|
+
import { HTMLWidget, Utility, timeParse, format, select, map, extent, range, Palette, CanvasWidget, SVGWidget, Entity, d3Event, Widget, Platform, selectAll, PropertyExt, local } from '@hpcc-js/common';
|
|
2
2
|
import { HorizontalList, VerticalList, Grid } from '@hpcc-js/layout';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -17,8 +17,8 @@ function _mergeNamespaces(n, m) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
var PKG_NAME = "@hpcc-js/other";
|
|
20
|
-
var PKG_VERSION = "2.17.
|
|
21
|
-
var BUILD_VERSION = "2.
|
|
20
|
+
var PKG_VERSION = "2.17.1";
|
|
21
|
+
var BUILD_VERSION = "2.108.2";
|
|
22
22
|
|
|
23
23
|
/******************************************************************************
|
|
24
24
|
Copyright (c) Microsoft Corporation.
|
|
@@ -250,247 +250,254 @@ var autoComplete$1 = {exports: {}};
|
|
|
250
250
|
License: http://www.opensource.org/licenses/mit-license.php
|
|
251
251
|
*/
|
|
252
252
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
253
|
+
var hasRequiredAutoComplete;
|
|
254
|
+
|
|
255
|
+
function requireAutoComplete () {
|
|
256
|
+
if (hasRequiredAutoComplete) return autoComplete$1.exports;
|
|
257
|
+
hasRequiredAutoComplete = 1;
|
|
258
|
+
(function (module) {
|
|
259
|
+
var autoComplete = (function(){
|
|
260
|
+
// "use strict";
|
|
261
|
+
function autoComplete(options){
|
|
262
|
+
if (!document.querySelector) return;
|
|
263
|
+
|
|
264
|
+
// helpers
|
|
265
|
+
function hasClass(el, className){ return el.classList ? el.classList.contains(className) : new RegExp('\\b'+ className+'\\b').test(el.className); }
|
|
266
|
+
|
|
267
|
+
function addEvent(el, type, handler){
|
|
268
|
+
if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler);
|
|
269
|
+
}
|
|
270
|
+
function removeEvent(el, type, handler){
|
|
271
|
+
// if (el.removeEventListener) not working in IE11
|
|
272
|
+
if (el.detachEvent) el.detachEvent('on'+type, handler); else el.removeEventListener(type, handler);
|
|
273
|
+
}
|
|
274
|
+
function live(elClass, event, cb, context){
|
|
275
|
+
addEvent(context || document, event, function(e){
|
|
276
|
+
var found, el = e.target || e.srcElement;
|
|
277
|
+
while (el && !(found = hasClass(el, elClass))) el = el.parentElement;
|
|
278
|
+
if (found) cb.call(el, e);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
var o = {
|
|
283
|
+
selector: 0,
|
|
284
|
+
source: 0,
|
|
285
|
+
minChars: 3,
|
|
286
|
+
delay: 150,
|
|
287
|
+
offsetLeft: 0,
|
|
288
|
+
offsetTop: 1,
|
|
289
|
+
cache: 1,
|
|
290
|
+
menuClass: '',
|
|
291
|
+
renderItem: function (item, search){
|
|
292
|
+
// escape special characters
|
|
293
|
+
search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
294
|
+
var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");
|
|
295
|
+
return '<div class="autocomplete-suggestion" data-val="' + item + '">' + item.replace(re, "<b>$1</b>") + '</div>';
|
|
296
|
+
},
|
|
297
|
+
onSelect: function(e, term, item){}
|
|
298
|
+
};
|
|
299
|
+
for (var k in options) { if (options.hasOwnProperty(k)) o[k] = options[k]; }
|
|
300
|
+
|
|
301
|
+
// init
|
|
302
|
+
var elems = typeof o.selector == 'object' ? [o.selector] : document.querySelectorAll(o.selector);
|
|
303
|
+
for (var i=0; i<elems.length; i++) {
|
|
304
|
+
var that = elems[i];
|
|
305
|
+
|
|
306
|
+
// create suggestions container "sc"
|
|
307
|
+
that.sc = document.createElement('div');
|
|
308
|
+
that.sc.className = 'autocomplete-suggestions '+o.menuClass;
|
|
309
|
+
|
|
310
|
+
that.autocompleteAttr = that.getAttribute('autocomplete');
|
|
311
|
+
that.setAttribute('autocomplete', 'off');
|
|
312
|
+
that.cache = {};
|
|
313
|
+
that.last_val = '';
|
|
314
|
+
|
|
315
|
+
that.updateSC = function(resize, next){
|
|
316
|
+
var rect = that.getBoundingClientRect();
|
|
317
|
+
that.sc.style.left = Math.round(rect.left + (window.pageXOffset || document.documentElement.scrollLeft) + o.offsetLeft) + 'px';
|
|
318
|
+
that.sc.style.top = Math.round(rect.bottom + (window.pageYOffset || document.documentElement.scrollTop) + o.offsetTop) + 'px';
|
|
319
|
+
that.sc.style.width = Math.round(rect.right - rect.left) + 'px'; // outerWidth
|
|
320
|
+
if (!resize) {
|
|
321
|
+
that.sc.style.display = 'block';
|
|
322
|
+
that.sc.classList.remove('hide');
|
|
323
|
+
if (!that.sc.maxHeight) { that.sc.maxHeight = parseInt((window.getComputedStyle ? getComputedStyle(that.sc, null) : that.sc.currentStyle).maxHeight); }
|
|
324
|
+
if (!that.sc.suggestionHeight) that.sc.suggestionHeight = that.sc.querySelector('.autocomplete-suggestion').offsetHeight;
|
|
325
|
+
if (that.sc.suggestionHeight)
|
|
326
|
+
if (!next) that.sc.scrollTop = 0;
|
|
327
|
+
else {
|
|
328
|
+
var scrTop = that.sc.scrollTop, selTop = next.getBoundingClientRect().top - that.sc.getBoundingClientRect().top;
|
|
329
|
+
if (selTop + that.sc.suggestionHeight - that.sc.maxHeight > 0)
|
|
330
|
+
that.sc.scrollTop = selTop + that.sc.suggestionHeight + scrTop - that.sc.maxHeight;
|
|
331
|
+
else if (selTop < 0)
|
|
332
|
+
that.sc.scrollTop = selTop + scrTop;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
addEvent(window, 'resize', that.updateSC);
|
|
337
|
+
document.body.appendChild(that.sc);
|
|
338
|
+
|
|
339
|
+
live('autocomplete-suggestion', 'mouseleave', function(e){
|
|
340
|
+
var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
|
|
341
|
+
if (sel) setTimeout(function(){ sel.className = sel.className.replace('selected', ''); }, 20);
|
|
342
|
+
}, that.sc);
|
|
343
|
+
|
|
344
|
+
live('autocomplete-suggestion', 'mouseover', function(e){
|
|
345
|
+
var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
|
|
346
|
+
if (sel) sel.className = sel.className.replace('selected', '');
|
|
347
|
+
this.className += ' selected';
|
|
348
|
+
}, that.sc);
|
|
349
|
+
|
|
350
|
+
live('autocomplete-suggestion', 'mousedown', function(e){
|
|
351
|
+
if (hasClass(this, 'autocomplete-suggestion')) { // else outside click
|
|
352
|
+
var v = this.getAttribute('data-val');
|
|
353
|
+
that.value = v;
|
|
354
|
+
o.onSelect(e, v, this);
|
|
355
|
+
that.sc.style.display = 'none';
|
|
356
|
+
that.sc.classList.add("hide");
|
|
357
|
+
|
|
358
|
+
}
|
|
359
|
+
}, that.sc);
|
|
360
|
+
|
|
361
|
+
that.blurHandler = function(){
|
|
362
|
+
try { var over_sb = document.querySelector('.autocomplete-suggestions:hover'); } catch(e){ var over_sb = 0; }
|
|
363
|
+
if (!over_sb) {
|
|
364
|
+
that.last_val = that.value;
|
|
365
|
+
that.sc.style.display = 'none';
|
|
366
|
+
that.sc.classList.add("hide");
|
|
367
|
+
setTimeout(function(){
|
|
368
|
+
that.sc.style.display = 'none';
|
|
369
|
+
that.sc.classList.add("hide");
|
|
370
|
+
}, 350); // hide suggestions on fast input
|
|
371
|
+
} else if (that !== document.activeElement) setTimeout(function(){ that.focus(); }, 20);
|
|
372
|
+
};
|
|
373
|
+
addEvent(that, 'blur', that.blurHandler);
|
|
374
|
+
|
|
375
|
+
var suggest = function(data, val){
|
|
376
|
+
if (!val) {
|
|
377
|
+
var val = that.value;
|
|
378
|
+
}
|
|
379
|
+
that.cache[val] = data;
|
|
380
|
+
if (data.length && val.length >= o.minChars) {
|
|
381
|
+
var s = '';
|
|
382
|
+
for (var i=0;i<data.length;i++) s += o.renderItem(data[i], val);
|
|
383
|
+
that.sc.innerHTML = s;
|
|
384
|
+
that.updateSC(0);
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
that.sc.style.display = 'none';
|
|
388
|
+
that.sc.classList.add("hide");
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
that.keydownHandler = function(e){
|
|
393
|
+
var key = window.event ? e.keyCode : e.which;
|
|
394
|
+
// down (40), up (38)
|
|
395
|
+
if ((key == 40 || key == 38) && that.sc.innerHTML) {
|
|
396
|
+
var next, sel = that.sc.querySelector('.autocomplete-suggestion.selected');
|
|
397
|
+
if (!sel) {
|
|
398
|
+
next = (key == 40) ? that.sc.querySelector('.autocomplete-suggestion') : that.sc.childNodes[that.sc.childNodes.length - 1]; // first : last
|
|
399
|
+
next.className += ' selected';
|
|
400
|
+
that.value = next.getAttribute('data-val');
|
|
401
|
+
} else {
|
|
402
|
+
next = (key == 40) ? sel.nextSibling : sel.previousSibling;
|
|
403
|
+
if (next) {
|
|
404
|
+
sel.className = sel.className.replace('selected', '');
|
|
405
|
+
next.className += ' selected';
|
|
406
|
+
that.value = next.getAttribute('data-val');
|
|
407
|
+
}
|
|
408
|
+
else { sel.className = sel.className.replace('selected', ''); that.value = that.last_val; next = 0; }
|
|
409
|
+
}
|
|
410
|
+
that.updateSC(0, next);
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
// esc
|
|
414
|
+
else if (key == 27) {
|
|
415
|
+
that.value = that.last_val;
|
|
416
|
+
that.sc.style.display = 'none';
|
|
417
|
+
that.sc.classList.add("hide");
|
|
418
|
+
}
|
|
419
|
+
// enter
|
|
420
|
+
else if (key == 13 || key == 9) {
|
|
421
|
+
if (that.sc.style.display !== 'none') {
|
|
422
|
+
e.preventDefault();
|
|
423
|
+
}
|
|
424
|
+
var sel = that.sc.querySelector('.autocomplete-suggestion.selected');
|
|
425
|
+
if (sel && that.sc.style.display != 'none') {
|
|
426
|
+
o.onSelect(e, sel.getAttribute('data-val'), sel);
|
|
427
|
+
setTimeout(function(){
|
|
428
|
+
that.sc.style.display = 'none';
|
|
429
|
+
that.sc.classList.add("hide");
|
|
430
|
+
}, 20); }
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
addEvent(that, 'keydown', that.keydownHandler);
|
|
434
|
+
|
|
435
|
+
that.keyupHandler = function(e){
|
|
436
|
+
var key = window.event ? e.keyCode : e.which;
|
|
437
|
+
if (!key || (key < 35 || key > 40) && key != 13 && key != 27) {
|
|
438
|
+
var val = that.value;
|
|
439
|
+
if (val.length >= o.minChars) {
|
|
440
|
+
if (val != that.last_val) {
|
|
441
|
+
that.last_val = val;
|
|
442
|
+
clearTimeout(that.timer);
|
|
443
|
+
if (o.cache) {
|
|
444
|
+
if (val in that.cache) { suggest(that.cache[val]); return; }
|
|
445
|
+
// no requests if previous suggestions were empty
|
|
446
|
+
for (var i=1; i<val.length-o.minChars; i++) {
|
|
447
|
+
var part = val.slice(0, val.length-i);
|
|
448
|
+
if (part in that.cache && !that.cache[part].length) { suggest([]); return; }
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
that.timer = setTimeout(function(){ o.source(val, suggest); }, o.delay);
|
|
452
|
+
}
|
|
453
|
+
} else {
|
|
454
|
+
that.last_val = val;
|
|
455
|
+
that.sc.style.display = 'none';
|
|
456
|
+
that.sc.classList.add("hide");
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
addEvent(that, 'keyup', that.keyupHandler);
|
|
461
|
+
|
|
462
|
+
that.focusHandler = function(e){
|
|
463
|
+
that.last_val = '\n';
|
|
464
|
+
that.keyupHandler(e);
|
|
465
|
+
};
|
|
466
|
+
if (!o.minChars) addEvent(that, 'focus', that.focusHandler);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// public destroy method
|
|
470
|
+
this.destroy = function(){
|
|
471
|
+
for (var i=0; i<elems.length; i++) {
|
|
472
|
+
var that = elems[i];
|
|
473
|
+
removeEvent(window, 'resize', that.updateSC);
|
|
474
|
+
removeEvent(that, 'blur', that.blurHandler);
|
|
475
|
+
removeEvent(that, 'focus', that.focusHandler);
|
|
476
|
+
removeEvent(that, 'keydown', that.keydownHandler);
|
|
477
|
+
removeEvent(that, 'keyup', that.keyupHandler);
|
|
478
|
+
if (that.autocompleteAttr)
|
|
479
|
+
that.setAttribute('autocomplete', that.autocompleteAttr);
|
|
480
|
+
else
|
|
481
|
+
that.removeAttribute('autocomplete');
|
|
482
|
+
document.body.removeChild(that.sc);
|
|
483
|
+
that = null;
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
return autoComplete;
|
|
488
|
+
})();
|
|
489
|
+
|
|
490
|
+
(function(){
|
|
491
|
+
if (module.exports)
|
|
492
|
+
module.exports = autoComplete;
|
|
493
|
+
else
|
|
494
|
+
window.autoComplete = autoComplete;
|
|
495
|
+
})();
|
|
496
|
+
} (autoComplete$1));
|
|
497
|
+
return autoComplete$1.exports;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
var autoCompleteExports = requireAutoComplete();
|
|
494
501
|
var autoComplete = /*@__PURE__*/getDefaultExportFromCjs(autoCompleteExports);
|
|
495
502
|
|
|
496
503
|
var AutoComplete = /*#__PURE__*/_mergeNamespaces({
|
|
@@ -667,7 +674,7 @@ function newInterval(floori, offseti, count, field) {
|
|
|
667
674
|
if (step < 0) while (++step <= 0) {
|
|
668
675
|
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
669
676
|
} else while (--step >= 0) {
|
|
670
|
-
while (offseti(date,
|
|
677
|
+
while (offseti(date, 1), !test(date)) {} // eslint-disable-line no-empty
|
|
671
678
|
}
|
|
672
679
|
}
|
|
673
680
|
});
|
|
@@ -2387,151 +2394,158 @@ function flattenResult(result, mappings) {
|
|
|
2387
2394
|
|
|
2388
2395
|
var simpleheat$2 = {exports: {}};
|
|
2389
2396
|
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
module.exports = simpleheat;
|
|
2393
|
-
|
|
2394
|
-
function simpleheat(canvas) {
|
|
2395
|
-
if (!(this instanceof simpleheat)) return new simpleheat(canvas);
|
|
2396
|
-
|
|
2397
|
-
this._canvas = canvas = typeof canvas === 'string' ? document.getElementById(canvas) : canvas;
|
|
2398
|
-
|
|
2399
|
-
this._ctx = canvas.getContext('2d');
|
|
2400
|
-
this._width = canvas.width;
|
|
2401
|
-
this._height = canvas.height;
|
|
2402
|
-
|
|
2403
|
-
this._max = 1;
|
|
2404
|
-
this._data = [];
|
|
2405
|
-
}
|
|
2406
|
-
|
|
2407
|
-
simpleheat.prototype = {
|
|
2397
|
+
var hasRequiredSimpleheat;
|
|
2408
2398
|
|
|
2409
|
-
|
|
2399
|
+
function requireSimpleheat () {
|
|
2400
|
+
if (hasRequiredSimpleheat) return simpleheat$2.exports;
|
|
2401
|
+
hasRequiredSimpleheat = 1;
|
|
2402
|
+
(function (module) {
|
|
2410
2403
|
|
|
2411
|
-
|
|
2412
|
-
0.4: 'blue',
|
|
2413
|
-
0.6: 'cyan',
|
|
2414
|
-
0.7: 'lime',
|
|
2415
|
-
0.8: 'yellow',
|
|
2416
|
-
1.0: 'red'
|
|
2417
|
-
},
|
|
2404
|
+
module.exports = simpleheat;
|
|
2418
2405
|
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
return this;
|
|
2422
|
-
},
|
|
2406
|
+
function simpleheat(canvas) {
|
|
2407
|
+
if (!(this instanceof simpleheat)) return new simpleheat(canvas);
|
|
2423
2408
|
|
|
2424
|
-
|
|
2425
|
-
this._max = max;
|
|
2426
|
-
return this;
|
|
2427
|
-
},
|
|
2409
|
+
this._canvas = canvas = typeof canvas === 'string' ? document.getElementById(canvas) : canvas;
|
|
2428
2410
|
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
},
|
|
2411
|
+
this._ctx = canvas.getContext('2d');
|
|
2412
|
+
this._width = canvas.width;
|
|
2413
|
+
this._height = canvas.height;
|
|
2433
2414
|
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
},
|
|
2415
|
+
this._max = 1;
|
|
2416
|
+
this._data = [];
|
|
2417
|
+
}
|
|
2438
2418
|
|
|
2439
|
-
|
|
2440
|
-
blur = blur === undefined ? 15 : blur;
|
|
2419
|
+
simpleheat.prototype = {
|
|
2441
2420
|
|
|
2442
|
-
|
|
2443
|
-
var circle = this._circle = this._createCanvas(),
|
|
2444
|
-
ctx = circle.getContext('2d'),
|
|
2445
|
-
r2 = this._r = r + blur;
|
|
2421
|
+
defaultRadius: 25,
|
|
2446
2422
|
|
|
2447
|
-
|
|
2423
|
+
defaultGradient: {
|
|
2424
|
+
0.4: 'blue',
|
|
2425
|
+
0.6: 'cyan',
|
|
2426
|
+
0.7: 'lime',
|
|
2427
|
+
0.8: 'yellow',
|
|
2428
|
+
1.0: 'red'
|
|
2429
|
+
},
|
|
2448
2430
|
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2431
|
+
data: function (data) {
|
|
2432
|
+
this._data = data;
|
|
2433
|
+
return this;
|
|
2434
|
+
},
|
|
2452
2435
|
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2436
|
+
max: function (max) {
|
|
2437
|
+
this._max = max;
|
|
2438
|
+
return this;
|
|
2439
|
+
},
|
|
2457
2440
|
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2441
|
+
add: function (point) {
|
|
2442
|
+
this._data.push(point);
|
|
2443
|
+
return this;
|
|
2444
|
+
},
|
|
2445
|
+
|
|
2446
|
+
clear: function () {
|
|
2447
|
+
this._data = [];
|
|
2448
|
+
return this;
|
|
2449
|
+
},
|
|
2450
|
+
|
|
2451
|
+
radius: function (r, blur) {
|
|
2452
|
+
blur = blur === undefined ? 15 : blur;
|
|
2453
|
+
|
|
2454
|
+
// create a grayscale blurred circle image that we'll use for drawing points
|
|
2455
|
+
var circle = this._circle = this._createCanvas(),
|
|
2456
|
+
ctx = circle.getContext('2d'),
|
|
2457
|
+
r2 = this._r = r + blur;
|
|
2458
|
+
|
|
2459
|
+
circle.width = circle.height = r2 * 2;
|
|
2460
|
+
|
|
2461
|
+
ctx.shadowOffsetX = ctx.shadowOffsetY = r2 * 2;
|
|
2462
|
+
ctx.shadowBlur = blur;
|
|
2463
|
+
ctx.shadowColor = 'black';
|
|
2464
|
+
|
|
2465
|
+
ctx.beginPath();
|
|
2466
|
+
ctx.arc(-r2, -r2, r, 0, Math.PI * 2, true);
|
|
2467
|
+
ctx.closePath();
|
|
2468
|
+
ctx.fill();
|
|
2469
|
+
|
|
2470
|
+
return this;
|
|
2471
|
+
},
|
|
2472
|
+
|
|
2473
|
+
resize: function () {
|
|
2474
|
+
this._width = this._canvas.width;
|
|
2475
|
+
this._height = this._canvas.height;
|
|
2476
|
+
},
|
|
2477
|
+
|
|
2478
|
+
gradient: function (grad) {
|
|
2479
|
+
// create a 256x1 gradient that we'll use to turn a grayscale heatmap into a colored one
|
|
2480
|
+
var canvas = this._createCanvas(),
|
|
2481
|
+
ctx = canvas.getContext('2d'),
|
|
2482
|
+
gradient = ctx.createLinearGradient(0, 0, 0, 256);
|
|
2483
|
+
|
|
2484
|
+
canvas.width = 1;
|
|
2485
|
+
canvas.height = 256;
|
|
2486
|
+
|
|
2487
|
+
for (var i in grad) {
|
|
2488
|
+
gradient.addColorStop(+i, grad[i]);
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
ctx.fillStyle = gradient;
|
|
2492
|
+
ctx.fillRect(0, 0, 1, 256);
|
|
2493
|
+
|
|
2494
|
+
this._grad = ctx.getImageData(0, 0, 1, 256).data;
|
|
2495
|
+
|
|
2496
|
+
return this;
|
|
2497
|
+
},
|
|
2498
|
+
|
|
2499
|
+
draw: function (minOpacity) {
|
|
2500
|
+
if (!this._circle) this.radius(this.defaultRadius);
|
|
2501
|
+
if (!this._grad) this.gradient(this.defaultGradient);
|
|
2502
|
+
|
|
2503
|
+
var ctx = this._ctx;
|
|
2504
|
+
|
|
2505
|
+
ctx.clearRect(0, 0, this._width, this._height);
|
|
2506
|
+
|
|
2507
|
+
// draw a grayscale heatmap by putting a blurred circle at each data point
|
|
2508
|
+
for (var i = 0, len = this._data.length, p; i < len; i++) {
|
|
2509
|
+
p = this._data[i];
|
|
2510
|
+
ctx.globalAlpha = Math.max(p[2] / this._max, minOpacity === undefined ? 0.05 : minOpacity);
|
|
2511
|
+
ctx.drawImage(this._circle, p[0] - this._r, p[1] - this._r);
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
// colorize the heatmap, using opacity value of each pixel to get the right color from our gradient
|
|
2515
|
+
var colored = ctx.getImageData(0, 0, this._width, this._height);
|
|
2516
|
+
this._colorize(colored.data, this._grad);
|
|
2517
|
+
ctx.putImageData(colored, 0, 0);
|
|
2518
|
+
|
|
2519
|
+
return this;
|
|
2520
|
+
},
|
|
2521
|
+
|
|
2522
|
+
_colorize: function (pixels, gradient) {
|
|
2523
|
+
for (var i = 0, len = pixels.length, j; i < len; i += 4) {
|
|
2524
|
+
j = pixels[i + 3] * 4; // get gradient color from opacity value
|
|
2525
|
+
|
|
2526
|
+
if (j) {
|
|
2527
|
+
pixels[i] = gradient[j];
|
|
2528
|
+
pixels[i + 1] = gradient[j + 1];
|
|
2529
|
+
pixels[i + 2] = gradient[j + 2];
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
},
|
|
2533
|
+
|
|
2534
|
+
_createCanvas: function () {
|
|
2535
|
+
if (typeof document !== 'undefined') {
|
|
2536
|
+
return document.createElement('canvas');
|
|
2537
|
+
} else {
|
|
2538
|
+
// create a new canvas instance in node.js
|
|
2539
|
+
// the canvas class needs to have a default constructor without any parameter
|
|
2540
|
+
return new this._canvas.constructor();
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
};
|
|
2544
|
+
} (simpleheat$2));
|
|
2545
|
+
return simpleheat$2.exports;
|
|
2546
|
+
}
|
|
2486
2547
|
|
|
2487
|
-
|
|
2488
|
-
if (!this._circle) this.radius(this.defaultRadius);
|
|
2489
|
-
if (!this._grad) this.gradient(this.defaultGradient);
|
|
2490
|
-
|
|
2491
|
-
var ctx = this._ctx;
|
|
2492
|
-
|
|
2493
|
-
ctx.clearRect(0, 0, this._width, this._height);
|
|
2494
|
-
|
|
2495
|
-
// draw a grayscale heatmap by putting a blurred circle at each data point
|
|
2496
|
-
for (var i = 0, len = this._data.length, p; i < len; i++) {
|
|
2497
|
-
p = this._data[i];
|
|
2498
|
-
ctx.globalAlpha = Math.max(p[2] / this._max, minOpacity === undefined ? 0.05 : minOpacity);
|
|
2499
|
-
ctx.drawImage(this._circle, p[0] - this._r, p[1] - this._r);
|
|
2500
|
-
}
|
|
2501
|
-
|
|
2502
|
-
// colorize the heatmap, using opacity value of each pixel to get the right color from our gradient
|
|
2503
|
-
var colored = ctx.getImageData(0, 0, this._width, this._height);
|
|
2504
|
-
this._colorize(colored.data, this._grad);
|
|
2505
|
-
ctx.putImageData(colored, 0, 0);
|
|
2506
|
-
|
|
2507
|
-
return this;
|
|
2508
|
-
},
|
|
2509
|
-
|
|
2510
|
-
_colorize: function (pixels, gradient) {
|
|
2511
|
-
for (var i = 0, len = pixels.length, j; i < len; i += 4) {
|
|
2512
|
-
j = pixels[i + 3] * 4; // get gradient color from opacity value
|
|
2513
|
-
|
|
2514
|
-
if (j) {
|
|
2515
|
-
pixels[i] = gradient[j];
|
|
2516
|
-
pixels[i + 1] = gradient[j + 1];
|
|
2517
|
-
pixels[i + 2] = gradient[j + 2];
|
|
2518
|
-
}
|
|
2519
|
-
}
|
|
2520
|
-
},
|
|
2521
|
-
|
|
2522
|
-
_createCanvas: function () {
|
|
2523
|
-
if (typeof document !== 'undefined') {
|
|
2524
|
-
return document.createElement('canvas');
|
|
2525
|
-
} else {
|
|
2526
|
-
// create a new canvas instance in node.js
|
|
2527
|
-
// the canvas class needs to have a default constructor without any parameter
|
|
2528
|
-
return new this._canvas.constructor();
|
|
2529
|
-
}
|
|
2530
|
-
}
|
|
2531
|
-
};
|
|
2532
|
-
} (simpleheat$2));
|
|
2533
|
-
|
|
2534
|
-
var simpleheatExports = simpleheat$2.exports;
|
|
2548
|
+
var simpleheatExports = requireSimpleheat();
|
|
2535
2549
|
var simpleheat$1 = /*@__PURE__*/getDefaultExportFromCjs(simpleheatExports);
|
|
2536
2550
|
|
|
2537
2551
|
var _simpleheat = /*#__PURE__*/_mergeNamespaces({
|
|
@@ -4078,7 +4092,7 @@ var MorphText = /** @class */ (function (_super) {
|
|
|
4078
4092
|
.attr("class", "enter")
|
|
4079
4093
|
.attr("font-size", this.fontSize())
|
|
4080
4094
|
.attr("dy", ".35em")
|
|
4081
|
-
.attr("y", (this.reverse() ?
|
|
4095
|
+
.attr("y", (this.reverse() ? 1 : -1) * this._fontWidth * 2)
|
|
4082
4096
|
.attr("x", function (d, i) { return (-context.data().length / 2 + i) * context._fontWidth + context._fontWidth / 2; })
|
|
4083
4097
|
.style("fill-opacity", 1e-6)
|
|
4084
4098
|
.style("text-anchor", this.anchor())
|
|
@@ -4089,7 +4103,7 @@ var MorphText = /** @class */ (function (_super) {
|
|
|
4089
4103
|
text.exit()
|
|
4090
4104
|
.attr("class", "exit");
|
|
4091
4105
|
this.transition.apply(text.exit())
|
|
4092
|
-
.attr("y", (this.reverse() ? -1 :
|
|
4106
|
+
.attr("y", (this.reverse() ? -1 : 1) * this._fontWidth * 2)
|
|
4093
4107
|
.style("fill-opacity", 1e-6)
|
|
4094
4108
|
.remove();
|
|
4095
4109
|
};
|
|
@@ -4413,7 +4427,7 @@ var Opportunity = /** @class */ (function (_super) {
|
|
|
4413
4427
|
})
|
|
4414
4428
|
.attr("y1", nodeRectHeight / 2)
|
|
4415
4429
|
.attr("x2", function (d2) {
|
|
4416
|
-
return (d2.delta > 0) ? (nodeRectWidth + nodeRectWidthPadding - 4) + ((Math.abs(d2.delta) - 1)) * (w / context.groupCount) : ((-
|
|
4430
|
+
return (d2.delta > 0) ? (nodeRectWidth + nodeRectWidthPadding - 4) + ((Math.abs(d2.delta) - 1)) * (w / context.groupCount) : ((-30 - ((Math.abs(d2.delta) - 1)) * (w / context.groupCount)) + 4);
|
|
4417
4431
|
})
|
|
4418
4432
|
.attr("y2", nodeRectHeight / 2)
|
|
4419
4433
|
.style("stroke-dasharray", ("3, 3"))
|