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