@hpcc-js/other 2.13.63 → 2.13.69

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 CHANGED
@@ -2,8 +2,8 @@ import { HTMLWidget, timeParse, format, select, map, extent, range, Utility, Pal
2
2
  import { VerticalList, HorizontalList, Grid } from '@hpcc-js/layout';
3
3
 
4
4
  var PKG_NAME = "@hpcc-js/other";
5
- var PKG_VERSION = "2.13.63";
6
- var BUILD_VERSION = "2.76.0";
5
+ var PKG_VERSION = "2.13.69";
6
+ var BUILD_VERSION = "2.88.0";
7
7
 
8
8
  /*! *****************************************************************************
9
9
  Copyright (c) Microsoft Corporation.
@@ -137,12 +137,12 @@ function nap() {
137
137
  function sleep(time) {
138
138
  if (frame) return; // Soonest alarm already set, or will be.
139
139
  if (timeout) timeout = clearTimeout(timeout);
140
- var delay = time - clockNow;
140
+ var delay = time - clockNow; // Strictly less than if we recomputed clockNow.
141
141
  if (delay > 24) {
142
- if (time < Infinity) timeout = setTimeout(wake, delay);
142
+ if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
143
143
  if (interval) interval = clearInterval(interval);
144
144
  } else {
145
- if (!interval) clockLast = clockNow, interval = setInterval(poke, pokeDelay);
145
+ if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
146
146
  frame = 1, setFrame(wake);
147
147
  }
148
148
  }
@@ -613,10 +613,12 @@ var t0 = new Date,
613
613
  function newInterval(floori, offseti, count, field) {
614
614
 
615
615
  function interval(date) {
616
- return floori(date = new Date(+date)), date;
616
+ return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
617
617
  }
618
618
 
619
- interval.floor = interval;
619
+ interval.floor = function(date) {
620
+ return floori(date = new Date(+date)), date;
621
+ };
620
622
 
621
623
  interval.ceil = function(date) {
622
624
  return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
@@ -633,11 +635,12 @@ function newInterval(floori, offseti, count, field) {
633
635
  };
634
636
 
635
637
  interval.range = function(start, stop, step) {
636
- var range = [];
638
+ var range = [], previous;
637
639
  start = interval.ceil(start);
638
640
  step = step == null ? 1 : Math.floor(step);
639
641
  if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
640
- do range.push(new Date(+start)); while (offseti(start, step), floori(start), start < stop)
642
+ do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
643
+ while (previous < start && start < stop);
641
644
  return range;
642
645
  };
643
646
 
@@ -645,7 +648,13 @@ function newInterval(floori, offseti, count, field) {
645
648
  return newInterval(function(date) {
646
649
  if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
647
650
  }, function(date, step) {
648
- if (date >= date) while (--step >= 0) while (offseti(date, 1), !test(date)) {} // eslint-disable-line no-empty
651
+ if (date >= date) {
652
+ if (step < 0) while (++step <= 0) {
653
+ while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
654
+ } else while (--step >= 0) {
655
+ while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
656
+ }
657
+ }
649
658
  });
650
659
  };
651
660
 
@@ -669,66 +678,10 @@ function newInterval(floori, offseti, count, field) {
669
678
  return interval;
670
679
  }
671
680
 
672
- var millisecond = newInterval(function() {
673
- // noop
674
- }, function(date, step) {
675
- date.setTime(+date + step);
676
- }, function(start, end) {
677
- return end - start;
678
- });
679
-
680
- // An optimized implementation for this simple case.
681
- millisecond.every = function(k) {
682
- k = Math.floor(k);
683
- if (!isFinite(k) || !(k > 0)) return null;
684
- if (!(k > 1)) return millisecond;
685
- return newInterval(function(date) {
686
- date.setTime(Math.floor(date / k) * k);
687
- }, function(date, step) {
688
- date.setTime(+date + step * k);
689
- }, function(start, end) {
690
- return (end - start) / k;
691
- });
692
- };
693
-
694
- var durationSecond = 1e3;
695
681
  var durationMinute = 6e4;
696
- var durationHour = 36e5;
697
682
  var durationDay = 864e5;
698
683
  var durationWeek = 6048e5;
699
684
 
700
- var second = newInterval(function(date) {
701
- date.setTime(Math.floor(date / durationSecond) * durationSecond);
702
- }, function(date, step) {
703
- date.setTime(+date + step * durationSecond);
704
- }, function(start, end) {
705
- return (end - start) / durationSecond;
706
- }, function(date) {
707
- return date.getUTCSeconds();
708
- });
709
-
710
- var minute = newInterval(function(date) {
711
- date.setTime(Math.floor(date / durationMinute) * durationMinute);
712
- }, function(date, step) {
713
- date.setTime(+date + step * durationMinute);
714
- }, function(start, end) {
715
- return (end - start) / durationMinute;
716
- }, function(date) {
717
- return date.getMinutes();
718
- });
719
-
720
- var hour = newInterval(function(date) {
721
- var offset = date.getTimezoneOffset() * durationMinute % durationHour;
722
- if (offset < 0) offset += durationHour;
723
- date.setTime(Math.floor((+date - offset) / durationHour) * durationHour + offset);
724
- }, function(date, step) {
725
- date.setTime(+date + step * durationHour);
726
- }, function(start, end) {
727
- return (end - start) / durationHour;
728
- }, function(date) {
729
- return date.getHours();
730
- });
731
-
732
685
  var day = newInterval(function(date) {
733
686
  date.setHours(0, 0, 0, 0);
734
687
  }, function(date, step) {
@@ -793,88 +746,6 @@ year.every = function(k) {
793
746
  });
794
747
  };
795
748
 
796
- var utcMinute = newInterval(function(date) {
797
- date.setUTCSeconds(0, 0);
798
- }, function(date, step) {
799
- date.setTime(+date + step * durationMinute);
800
- }, function(start, end) {
801
- return (end - start) / durationMinute;
802
- }, function(date) {
803
- return date.getUTCMinutes();
804
- });
805
-
806
- var utcHour = newInterval(function(date) {
807
- date.setUTCMinutes(0, 0, 0);
808
- }, function(date, step) {
809
- date.setTime(+date + step * durationHour);
810
- }, function(start, end) {
811
- return (end - start) / durationHour;
812
- }, function(date) {
813
- return date.getUTCHours();
814
- });
815
-
816
- var utcDay = newInterval(function(date) {
817
- date.setUTCHours(0, 0, 0, 0);
818
- }, function(date, step) {
819
- date.setUTCDate(date.getUTCDate() + step);
820
- }, function(start, end) {
821
- return (end - start) / durationDay;
822
- }, function(date) {
823
- return date.getUTCDate() - 1;
824
- });
825
-
826
- function utcWeekday(i) {
827
- return newInterval(function(date) {
828
- date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
829
- date.setUTCHours(0, 0, 0, 0);
830
- }, function(date, step) {
831
- date.setUTCDate(date.getUTCDate() + step * 7);
832
- }, function(start, end) {
833
- return (end - start) / durationWeek;
834
- });
835
- }
836
-
837
- var utcSunday = utcWeekday(0);
838
- var utcMonday = utcWeekday(1);
839
- var utcTuesday = utcWeekday(2);
840
- var utcWednesday = utcWeekday(3);
841
- var utcThursday = utcWeekday(4);
842
- var utcFriday = utcWeekday(5);
843
- var utcSaturday = utcWeekday(6);
844
-
845
- var utcMonth = newInterval(function(date) {
846
- date.setUTCDate(1);
847
- date.setUTCHours(0, 0, 0, 0);
848
- }, function(date, step) {
849
- date.setUTCMonth(date.getUTCMonth() + step);
850
- }, function(start, end) {
851
- return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
852
- }, function(date) {
853
- return date.getUTCMonth();
854
- });
855
-
856
- var utcYear = newInterval(function(date) {
857
- date.setUTCMonth(0, 1);
858
- date.setUTCHours(0, 0, 0, 0);
859
- }, function(date, step) {
860
- date.setUTCFullYear(date.getUTCFullYear() + step);
861
- }, function(start, end) {
862
- return end.getUTCFullYear() - start.getUTCFullYear();
863
- }, function(date) {
864
- return date.getUTCFullYear();
865
- });
866
-
867
- // An optimized implementation for this simple case.
868
- utcYear.every = function(k) {
869
- return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
870
- date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
871
- date.setUTCMonth(0, 1);
872
- date.setUTCHours(0, 0, 0, 0);
873
- }, function(date, step) {
874
- date.setUTCFullYear(date.getUTCFullYear() + step * k);
875
- });
876
- };
877
-
878
749
  var css_248z$1 = ".other_CalendarHeatMap{shape-rendering:crispEdges}.other_CalendarHeatMap .day{fill:#fff;stroke:#ccc}.other_CalendarHeatMap .day.selected{stroke:red}.other_CalendarHeatMap .day.over{stroke:orange}.other_CalendarHeatMap .day.selected.over{stroke:red}.other_CalendarHeatMap .month{fill:none;stroke:#000;stroke-width:2px}";
879
750
  styleInject(css_248z$1);
880
751