@internetarchive/histogram-date-range 1.4.0 → 1.4.1-alpha1
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/.editorconfig +29 -29
- package/.eslintrc.js +14 -14
- package/.github/workflows/ci.yml +30 -30
- package/LICENSE +661 -661
- package/README.md +113 -113
- package/demo/index.css +28 -28
- package/demo/index.html +221 -221
- package/dist/index.js.map +1 -1
- package/dist/src/histogram-date-range.d.ts +1 -0
- package/dist/src/histogram-date-range.js +272 -252
- package/dist/src/histogram-date-range.js.map +1 -1
- package/dist/test/histogram-date-range.test.js +202 -155
- package/dist/test/histogram-date-range.test.js.map +1 -1
- package/docs/demo/index.css +28 -28
- package/docs/demo/index.html +221 -221
- package/docs/dist/src/histogram-date-range.js +18 -1
- package/index.ts +7 -7
- package/package.json +85 -85
- package/snowpack.config.js +10 -10
- package/src/histogram-date-range.ts +1194 -1172
- package/test/histogram-date-range.test.ts +1059 -992
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +28 -28
- package/web-test-runner.config.mjs +29 -29
- package/dist/demo/js/list-histogram-wrapper.d.ts +0 -20
- package/dist/demo/js/list-histogram-wrapper.js +0 -59
- package/dist/demo/js/list-histogram-wrapper.js.map +0 -1
- package/dist/demo/js/lit-histogram-wrapper.d.ts +0 -21
- package/dist/demo/js/lit-histogram-wrapper.js +0 -73
- package/dist/demo/js/lit-histogram-wrapper.js.map +0 -1
|
@@ -432,9 +432,9 @@ let HistogramDateRange = class HistogramDateRange extends LitElement {
|
|
|
432
432
|
window.scrollX;
|
|
433
433
|
// Place the tooltip (with arrow) just above the top of the histogram bars
|
|
434
434
|
this._tooltipOffsetY = histogramY - heightAboveHistogram + window.scrollY;
|
|
435
|
-
this._tooltipContent = html `
|
|
436
|
-
${formattedNumItems} ${itemsText}<br />
|
|
437
|
-
${dataset.tooltip}
|
|
435
|
+
this._tooltipContent = html `
|
|
436
|
+
${formattedNumItems} ${itemsText}<br />
|
|
437
|
+
${dataset.tooltip}
|
|
438
438
|
`;
|
|
439
439
|
(_b = (_a = this._tooltip).showPopover) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
440
440
|
}
|
|
@@ -631,25 +631,25 @@ let HistogramDateRange = class HistogramDateRange extends LitElement {
|
|
|
631
631
|
// border-radius); used as part of a SVG quadratic curve. see
|
|
632
632
|
// https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths#curve_commands
|
|
633
633
|
const cs = SLIDER_CORNER_SIZE;
|
|
634
|
-
const sliderShape = `
|
|
635
|
-
M${this.minSliderX},0
|
|
636
|
-
h-${this.sliderWidth - cs}
|
|
637
|
-
q-${cs},0 -${cs},${cs}
|
|
638
|
-
v${this.height - cs * 2}
|
|
639
|
-
q0,${cs} ${cs},${cs}
|
|
640
|
-
h${this.sliderWidth - cs}
|
|
634
|
+
const sliderShape = `
|
|
635
|
+
M${this.minSliderX},0
|
|
636
|
+
h-${this.sliderWidth - cs}
|
|
637
|
+
q-${cs},0 -${cs},${cs}
|
|
638
|
+
v${this.height - cs * 2}
|
|
639
|
+
q0,${cs} ${cs},${cs}
|
|
640
|
+
h${this.sliderWidth - cs}
|
|
641
641
|
`;
|
|
642
642
|
return this.generateSliderSVG(this.minSliderX, 'slider-min', sliderShape);
|
|
643
643
|
}
|
|
644
644
|
get maxSliderTemplate() {
|
|
645
645
|
const cs = SLIDER_CORNER_SIZE;
|
|
646
|
-
const sliderShape = `
|
|
647
|
-
M${this.maxSliderX},0
|
|
648
|
-
h${this.sliderWidth - cs}
|
|
649
|
-
q${cs},0 ${cs},${cs}
|
|
650
|
-
v${this.height - cs * 2}
|
|
651
|
-
q0,${cs} -${cs},${cs}
|
|
652
|
-
h-${this.sliderWidth - cs}
|
|
646
|
+
const sliderShape = `
|
|
647
|
+
M${this.maxSliderX},0
|
|
648
|
+
h${this.sliderWidth - cs}
|
|
649
|
+
q${cs},0 ${cs},${cs}
|
|
650
|
+
v${this.height - cs * 2}
|
|
651
|
+
q0,${cs} -${cs},${cs}
|
|
652
|
+
h-${this.sliderWidth - cs}
|
|
653
653
|
`;
|
|
654
654
|
return this.generateSliderSVG(this.maxSliderX, 'slider-max', sliderShape);
|
|
655
655
|
}
|
|
@@ -662,38 +662,38 @@ let HistogramDateRange = class HistogramDateRange extends LitElement {
|
|
|
662
662
|
draggable: !this.disabled,
|
|
663
663
|
dragging: this._isDragging,
|
|
664
664
|
});
|
|
665
|
-
return svg `
|
|
666
|
-
<svg
|
|
667
|
-
id=${id}
|
|
668
|
-
class=${sliderClasses}
|
|
669
|
-
@pointerdown=${this.drag}
|
|
670
|
-
>
|
|
671
|
-
<path d="${sliderShape} z" fill="${sliderColor}" />
|
|
672
|
-
<rect
|
|
673
|
-
x="${sliderPositionX - this.sliderWidth * k + this.sliderWidth * 0.4 * k}"
|
|
674
|
-
y="${this.height / 3}"
|
|
675
|
-
width="1"
|
|
676
|
-
height="${this.height / 3}"
|
|
677
|
-
fill="white"
|
|
678
|
-
/>
|
|
679
|
-
<rect
|
|
680
|
-
x="${sliderPositionX - this.sliderWidth * k + this.sliderWidth * 0.6 * k}"
|
|
681
|
-
y="${this.height / 3}"
|
|
682
|
-
width="1"
|
|
683
|
-
height="${this.height / 3}"
|
|
684
|
-
fill="white"
|
|
685
|
-
/>
|
|
686
|
-
</svg>
|
|
665
|
+
return svg `
|
|
666
|
+
<svg
|
|
667
|
+
id=${id}
|
|
668
|
+
class=${sliderClasses}
|
|
669
|
+
@pointerdown=${this.drag}
|
|
670
|
+
>
|
|
671
|
+
<path d="${sliderShape} z" fill="${sliderColor}" />
|
|
672
|
+
<rect
|
|
673
|
+
x="${sliderPositionX - this.sliderWidth * k + this.sliderWidth * 0.4 * k}"
|
|
674
|
+
y="${this.height / 3}"
|
|
675
|
+
width="1"
|
|
676
|
+
height="${this.height / 3}"
|
|
677
|
+
fill="white"
|
|
678
|
+
/>
|
|
679
|
+
<rect
|
|
680
|
+
x="${sliderPositionX - this.sliderWidth * k + this.sliderWidth * 0.6 * k}"
|
|
681
|
+
y="${this.height / 3}"
|
|
682
|
+
width="1"
|
|
683
|
+
height="${this.height / 3}"
|
|
684
|
+
fill="white"
|
|
685
|
+
/>
|
|
686
|
+
</svg>
|
|
687
687
|
`;
|
|
688
688
|
}
|
|
689
689
|
get selectedRangeTemplate() {
|
|
690
|
-
return svg `
|
|
691
|
-
<rect
|
|
692
|
-
x="${this.minSliderX}"
|
|
693
|
-
y="0"
|
|
694
|
-
width="${this.maxSliderX - this.minSliderX}"
|
|
695
|
-
height="${this.height}"
|
|
696
|
-
fill="${selectedRangeColor}"
|
|
690
|
+
return svg `
|
|
691
|
+
<rect
|
|
692
|
+
x="${this.minSliderX}"
|
|
693
|
+
y="0"
|
|
694
|
+
width="${this.maxSliderX - this.minSliderX}"
|
|
695
|
+
height="${this.height}"
|
|
696
|
+
fill="${selectedRangeColor}"
|
|
697
697
|
/>`;
|
|
698
698
|
}
|
|
699
699
|
get histogramTemplate() {
|
|
@@ -711,30 +711,30 @@ let HistogramDateRange = class HistogramDateRange extends LitElement {
|
|
|
711
711
|
// between adjacent bars (eg when viewing the tooltips or when trying to
|
|
712
712
|
// extend the range by clicking on a bar)
|
|
713
713
|
const barStyle = `stroke-dasharray: 0 ${barWidth} ${barHeight} ${barWidth} 0 ${barHeight}`;
|
|
714
|
-
const bar = svg `
|
|
715
|
-
<rect
|
|
716
|
-
class="bar-pointer-target"
|
|
717
|
-
x=${x}
|
|
718
|
-
y="0"
|
|
719
|
-
width=${barWidth}
|
|
720
|
-
height=${this.height}
|
|
721
|
-
@pointerenter=${this.showTooltip}
|
|
722
|
-
@pointerleave=${this.hideTooltip}
|
|
723
|
-
@click=${this.handleBarClick}
|
|
724
|
-
fill="transparent"
|
|
725
|
-
data-num-items=${data.value}
|
|
726
|
-
data-bin-start=${data.binStart}
|
|
727
|
-
data-bin-end=${data.binEnd}
|
|
728
|
-
data-tooltip=${data.tooltip}
|
|
729
|
-
/>
|
|
730
|
-
<rect
|
|
731
|
-
class="bar"
|
|
732
|
-
style=${barStyle}
|
|
733
|
-
x=${x}
|
|
734
|
-
y=${this.height - barHeight}
|
|
735
|
-
width=${barWidth}
|
|
736
|
-
height=${barHeight}
|
|
737
|
-
fill=${barFill}
|
|
714
|
+
const bar = svg `
|
|
715
|
+
<rect
|
|
716
|
+
class="bar-pointer-target"
|
|
717
|
+
x=${x}
|
|
718
|
+
y="0"
|
|
719
|
+
width=${barWidth}
|
|
720
|
+
height=${this.height}
|
|
721
|
+
@pointerenter=${this.showTooltip}
|
|
722
|
+
@pointerleave=${this.hideTooltip}
|
|
723
|
+
@click=${this.handleBarClick}
|
|
724
|
+
fill="transparent"
|
|
725
|
+
data-num-items=${data.value}
|
|
726
|
+
data-bin-start=${data.binStart}
|
|
727
|
+
data-bin-end=${data.binEnd}
|
|
728
|
+
data-tooltip=${data.tooltip}
|
|
729
|
+
/>
|
|
730
|
+
<rect
|
|
731
|
+
class="bar"
|
|
732
|
+
style=${barStyle}
|
|
733
|
+
x=${x}
|
|
734
|
+
y=${this.height - barHeight}
|
|
735
|
+
width=${barWidth}
|
|
736
|
+
height=${barHeight}
|
|
737
|
+
fill=${barFill}
|
|
738
738
|
/>`;
|
|
739
739
|
x += xScale;
|
|
740
740
|
return bar;
|
|
@@ -774,31 +774,31 @@ let HistogramDateRange = class HistogramDateRange extends LitElement {
|
|
|
774
774
|
* https://lit.dev/docs/templates/directives/#live
|
|
775
775
|
*/
|
|
776
776
|
get minInputTemplate() {
|
|
777
|
-
return html `
|
|
778
|
-
<input
|
|
779
|
-
id="date-min"
|
|
780
|
-
placeholder=${this.dateFormat}
|
|
781
|
-
type="text"
|
|
782
|
-
@focus=${this.handleInputFocus}
|
|
783
|
-
@blur=${this.handleMinDateInput}
|
|
784
|
-
@keyup=${this.handleKeyUp}
|
|
785
|
-
.value=${live(this.minSelectedDate)}
|
|
786
|
-
?disabled=${this.disabled}
|
|
787
|
-
/>
|
|
777
|
+
return html `
|
|
778
|
+
<input
|
|
779
|
+
id="date-min"
|
|
780
|
+
placeholder=${this.dateFormat}
|
|
781
|
+
type="text"
|
|
782
|
+
@focus=${this.handleInputFocus}
|
|
783
|
+
@blur=${this.handleMinDateInput}
|
|
784
|
+
@keyup=${this.handleKeyUp}
|
|
785
|
+
.value=${live(this.minSelectedDate)}
|
|
786
|
+
?disabled=${this.disabled}
|
|
787
|
+
/>
|
|
788
788
|
`;
|
|
789
789
|
}
|
|
790
790
|
get maxInputTemplate() {
|
|
791
|
-
return html `
|
|
792
|
-
<input
|
|
793
|
-
id="date-max"
|
|
794
|
-
placeholder=${this.dateFormat}
|
|
795
|
-
type="text"
|
|
796
|
-
@focus=${this.handleInputFocus}
|
|
797
|
-
@blur=${this.handleMaxDateInput}
|
|
798
|
-
@keyup=${this.handleKeyUp}
|
|
799
|
-
.value=${live(this.maxSelectedDate)}
|
|
800
|
-
?disabled=${this.disabled}
|
|
801
|
-
/>
|
|
791
|
+
return html `
|
|
792
|
+
<input
|
|
793
|
+
id="date-max"
|
|
794
|
+
placeholder=${this.dateFormat}
|
|
795
|
+
type="text"
|
|
796
|
+
@focus=${this.handleInputFocus}
|
|
797
|
+
@blur=${this.handleMaxDateInput}
|
|
798
|
+
@keyup=${this.handleKeyUp}
|
|
799
|
+
.value=${live(this.maxSelectedDate)}
|
|
800
|
+
?disabled=${this.disabled}
|
|
801
|
+
/>
|
|
802
802
|
`;
|
|
803
803
|
}
|
|
804
804
|
get minLabelTemplate() {
|
|
@@ -814,184 +814,204 @@ let HistogramDateRange = class HistogramDateRange extends LitElement {
|
|
|
814
814
|
top: `${this._tooltipOffsetY}px`,
|
|
815
815
|
left: `${this._tooltipOffsetX}px`,
|
|
816
816
|
});
|
|
817
|
-
return html `
|
|
818
|
-
<div id="tooltip" style=${styles} popover>${this._tooltipContent}</div>
|
|
817
|
+
return html `
|
|
818
|
+
<div id="tooltip" style=${styles} popover>${this._tooltipContent}</div>
|
|
819
819
|
`;
|
|
820
820
|
}
|
|
821
|
+
get histogramAccessibility() {
|
|
822
|
+
let rangeText;
|
|
823
|
+
if (this.minSelectedDate && this.maxSelectedDate) {
|
|
824
|
+
rangeText = `from ${this.minSelectedDate} to ${this.maxSelectedDate}`;
|
|
825
|
+
}
|
|
826
|
+
else if (this.minSelectedDate) {
|
|
827
|
+
rangeText = `from ${this.minSelectedDate}`;
|
|
828
|
+
}
|
|
829
|
+
else if (this.maxSelectedDate) {
|
|
830
|
+
rangeText = `up to ${this.maxSelectedDate}`;
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
rangeText = 'for all available dates';
|
|
834
|
+
}
|
|
835
|
+
const titleText = `Filter results distribution ${rangeText}`;
|
|
836
|
+
const descText = `This chart shows the distribution of search results ${rangeText}. The bars represent result counts for each time period within the selected date range.`.trim();
|
|
837
|
+
return html `<title id="histogram-title">${titleText}</title
|
|
838
|
+
><desc id="histogram-desc">${descText}</desc>`;
|
|
839
|
+
}
|
|
821
840
|
get noDataTemplate() {
|
|
822
|
-
return html `
|
|
823
|
-
<div class="missing-data-message">${this.missingDataMessage}</div>
|
|
841
|
+
return html `
|
|
842
|
+
<div class="missing-data-message">${this.missingDataMessage}</div>
|
|
824
843
|
`;
|
|
825
844
|
}
|
|
826
845
|
get activityIndicatorTemplate() {
|
|
827
846
|
if (!this.loading) {
|
|
828
847
|
return nothing;
|
|
829
848
|
}
|
|
830
|
-
return html `
|
|
831
|
-
<ia-activity-indicator mode="processing"> </ia-activity-indicator>
|
|
849
|
+
return html `
|
|
850
|
+
<ia-activity-indicator mode="processing"> </ia-activity-indicator>
|
|
832
851
|
`;
|
|
833
852
|
}
|
|
834
853
|
render() {
|
|
835
854
|
if (!this.hasBinData) {
|
|
836
855
|
return this.noDataTemplate;
|
|
837
856
|
}
|
|
838
|
-
return html `
|
|
839
|
-
<div
|
|
840
|
-
id="container"
|
|
841
|
-
class="
|
|
842
|
-
noselect
|
|
843
|
-
${this._isDragging ? 'dragging' : ''}
|
|
844
|
-
"
|
|
845
|
-
style="width: ${this.width}px"
|
|
846
|
-
>
|
|
847
|
-
${this.activityIndicatorTemplate} ${this.tooltipTemplate}
|
|
848
|
-
<div
|
|
849
|
-
class="inner-container
|
|
850
|
-
${this.disabled ? 'disabled' : ''}"
|
|
851
|
-
>
|
|
852
|
-
<svg
|
|
853
|
-
width="${this.width}"
|
|
854
|
-
height="${this.height}"
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
857
|
+
return html `
|
|
858
|
+
<div
|
|
859
|
+
id="container"
|
|
860
|
+
class="
|
|
861
|
+
noselect
|
|
862
|
+
${this._isDragging ? 'dragging' : ''}
|
|
863
|
+
"
|
|
864
|
+
style="width: ${this.width}px"
|
|
865
|
+
>
|
|
866
|
+
${this.activityIndicatorTemplate} ${this.tooltipTemplate}
|
|
867
|
+
<div
|
|
868
|
+
class="inner-container
|
|
869
|
+
${this.disabled ? 'disabled' : ''}"
|
|
870
|
+
>
|
|
871
|
+
<svg
|
|
872
|
+
width="${this.width}"
|
|
873
|
+
height="${this.height}"
|
|
874
|
+
aria-labelledby="histogram-title histogram-desc"
|
|
875
|
+
@pointerleave="${this.drop}"
|
|
876
|
+
>
|
|
877
|
+
${this.histogramAccessibility} ${this.selectedRangeTemplate}
|
|
878
|
+
<svg id="histogram">${this.histogramTemplate}</svg>
|
|
879
|
+
${this.minSliderTemplate} ${this.maxSliderTemplate}
|
|
880
|
+
</svg>
|
|
881
|
+
<div id="inputs">
|
|
882
|
+
${this.minLabelTemplate} ${this.minInputTemplate}
|
|
883
|
+
<div class="dash">-</div>
|
|
884
|
+
${this.maxLabelTemplate} ${this.maxInputTemplate}
|
|
885
|
+
<slot name="inputs-right-side"></slot>
|
|
886
|
+
</div>
|
|
887
|
+
</div>
|
|
888
|
+
</div>
|
|
869
889
|
`;
|
|
870
890
|
}
|
|
871
891
|
};
|
|
872
|
-
HistogramDateRange.styles = css `
|
|
873
|
-
.missing-data-message {
|
|
874
|
-
text-align: center;
|
|
875
|
-
}
|
|
876
|
-
#container {
|
|
877
|
-
margin: 0;
|
|
878
|
-
touch-action: none;
|
|
879
|
-
position: relative;
|
|
880
|
-
}
|
|
881
|
-
.disabled {
|
|
882
|
-
opacity: 0.3;
|
|
883
|
-
}
|
|
884
|
-
ia-activity-indicator {
|
|
885
|
-
position: absolute;
|
|
886
|
-
left: calc(50% - 10px);
|
|
887
|
-
top: 10px;
|
|
888
|
-
width: 20px;
|
|
889
|
-
height: 20px;
|
|
890
|
-
--activityIndicatorLoadingDotColor: rgba(0, 0, 0, 0);
|
|
891
|
-
--activityIndicatorLoadingRingColor: ${activityIndicatorColor};
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
/* prevent selection from interfering with tooltip, especially on mobile */
|
|
895
|
-
/* https://stackoverflow.com/a/4407335/1163042 */
|
|
896
|
-
.noselect {
|
|
897
|
-
-webkit-touch-callout: none; /* iOS Safari */
|
|
898
|
-
-webkit-user-select: none; /* Safari */
|
|
899
|
-
-moz-user-select: none; /* Old versions of Firefox */
|
|
900
|
-
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
901
|
-
user-select: none; /* current Chrome, Edge, Opera and Firefox */
|
|
902
|
-
}
|
|
903
|
-
.bar,
|
|
904
|
-
.bar-pointer-target {
|
|
905
|
-
/* create a transparent border around the hist bars to prevent "gaps" and
|
|
906
|
-
flickering when moving around between bars. this also helps with handling
|
|
907
|
-
clicks on the bars, preventing users from being able to click in between
|
|
908
|
-
bars */
|
|
909
|
-
stroke: rgba(0, 0, 0, 0);
|
|
910
|
-
/* ensure transparent stroke wide enough to cover gap between bars */
|
|
911
|
-
stroke-width: 2px;
|
|
912
|
-
}
|
|
913
|
-
.bar {
|
|
914
|
-
/* ensure the bar's pointer target receives events, not the bar itself */
|
|
915
|
-
pointer-events: none;
|
|
916
|
-
}
|
|
917
|
-
.bar-pointer-target:hover + .bar {
|
|
918
|
-
/* highlight currently hovered bar */
|
|
919
|
-
fill-opacity: 0.7;
|
|
920
|
-
}
|
|
921
|
-
.disabled .bar-pointer-target:hover + .bar {
|
|
922
|
-
/* ensure no visual hover interaction when disabled */
|
|
923
|
-
fill-opacity: 1;
|
|
924
|
-
}
|
|
925
|
-
/****** histogram ********/
|
|
926
|
-
#tooltip {
|
|
927
|
-
position: absolute;
|
|
928
|
-
background: ${tooltipBackgroundColor};
|
|
929
|
-
margin: 0;
|
|
930
|
-
border: 0;
|
|
931
|
-
color: ${tooltipTextColor};
|
|
932
|
-
text-align: center;
|
|
933
|
-
border-radius: 3px;
|
|
934
|
-
padding: 2px;
|
|
935
|
-
font-size: ${tooltipFontSize};
|
|
936
|
-
font-family: ${tooltipFontFamily};
|
|
937
|
-
touch-action: none;
|
|
938
|
-
pointer-events: none;
|
|
939
|
-
overflow: visible;
|
|
940
|
-
}
|
|
941
|
-
#tooltip:after {
|
|
942
|
-
content: '';
|
|
943
|
-
position: absolute;
|
|
944
|
-
margin-left: -5px;
|
|
945
|
-
top: 100%;
|
|
946
|
-
left: 50%;
|
|
947
|
-
/* arrow */
|
|
948
|
-
border: 5px solid ${tooltipTextColor};
|
|
949
|
-
border-color: ${tooltipBackgroundColor} transparent transparent
|
|
950
|
-
transparent;
|
|
951
|
-
}
|
|
952
|
-
/****** slider ********/
|
|
953
|
-
.slider {
|
|
954
|
-
shape-rendering: crispEdges; /* So the slider doesn't get blurry if dragged between pixels */
|
|
955
|
-
}
|
|
956
|
-
.draggable:hover {
|
|
957
|
-
cursor: grab;
|
|
958
|
-
}
|
|
959
|
-
.dragging {
|
|
960
|
-
cursor: grabbing !important;
|
|
961
|
-
}
|
|
962
|
-
/****** inputs ********/
|
|
963
|
-
#inputs {
|
|
964
|
-
display: flex;
|
|
965
|
-
justify-content: center;
|
|
966
|
-
margin: ${inputRowMargin};
|
|
967
|
-
}
|
|
968
|
-
#inputs .dash {
|
|
969
|
-
position: relative;
|
|
970
|
-
bottom: -1px;
|
|
971
|
-
align-self: center; /* Otherwise the dash sticks to the top while the inputs grow */
|
|
972
|
-
}
|
|
973
|
-
input {
|
|
974
|
-
width: ${inputWidth};
|
|
975
|
-
margin: 0 3px;
|
|
976
|
-
border: ${inputBorder};
|
|
977
|
-
border-radius: 2px !important;
|
|
978
|
-
text-align: center;
|
|
979
|
-
font-size: ${inputFontSize};
|
|
980
|
-
font-family: ${inputFontFamily};
|
|
981
|
-
}
|
|
982
|
-
.sr-only {
|
|
983
|
-
position: absolute !important;
|
|
984
|
-
width: 1px !important;
|
|
985
|
-
height: 1px !important;
|
|
986
|
-
margin: 0 !important;
|
|
987
|
-
padding: 0 !important;
|
|
988
|
-
border: 0 !important;
|
|
989
|
-
overflow: hidden !important;
|
|
990
|
-
white-space: nowrap !important;
|
|
991
|
-
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
992
|
-
-webkit-clip-path: inset(50%) !important;
|
|
993
|
-
clip-path: inset(50%) !important;
|
|
994
|
-
}
|
|
892
|
+
HistogramDateRange.styles = css `
|
|
893
|
+
.missing-data-message {
|
|
894
|
+
text-align: center;
|
|
895
|
+
}
|
|
896
|
+
#container {
|
|
897
|
+
margin: 0;
|
|
898
|
+
touch-action: none;
|
|
899
|
+
position: relative;
|
|
900
|
+
}
|
|
901
|
+
.disabled {
|
|
902
|
+
opacity: 0.3;
|
|
903
|
+
}
|
|
904
|
+
ia-activity-indicator {
|
|
905
|
+
position: absolute;
|
|
906
|
+
left: calc(50% - 10px);
|
|
907
|
+
top: 10px;
|
|
908
|
+
width: 20px;
|
|
909
|
+
height: 20px;
|
|
910
|
+
--activityIndicatorLoadingDotColor: rgba(0, 0, 0, 0);
|
|
911
|
+
--activityIndicatorLoadingRingColor: ${activityIndicatorColor};
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/* prevent selection from interfering with tooltip, especially on mobile */
|
|
915
|
+
/* https://stackoverflow.com/a/4407335/1163042 */
|
|
916
|
+
.noselect {
|
|
917
|
+
-webkit-touch-callout: none; /* iOS Safari */
|
|
918
|
+
-webkit-user-select: none; /* Safari */
|
|
919
|
+
-moz-user-select: none; /* Old versions of Firefox */
|
|
920
|
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
921
|
+
user-select: none; /* current Chrome, Edge, Opera and Firefox */
|
|
922
|
+
}
|
|
923
|
+
.bar,
|
|
924
|
+
.bar-pointer-target {
|
|
925
|
+
/* create a transparent border around the hist bars to prevent "gaps" and
|
|
926
|
+
flickering when moving around between bars. this also helps with handling
|
|
927
|
+
clicks on the bars, preventing users from being able to click in between
|
|
928
|
+
bars */
|
|
929
|
+
stroke: rgba(0, 0, 0, 0);
|
|
930
|
+
/* ensure transparent stroke wide enough to cover gap between bars */
|
|
931
|
+
stroke-width: 2px;
|
|
932
|
+
}
|
|
933
|
+
.bar {
|
|
934
|
+
/* ensure the bar's pointer target receives events, not the bar itself */
|
|
935
|
+
pointer-events: none;
|
|
936
|
+
}
|
|
937
|
+
.bar-pointer-target:hover + .bar {
|
|
938
|
+
/* highlight currently hovered bar */
|
|
939
|
+
fill-opacity: 0.7;
|
|
940
|
+
}
|
|
941
|
+
.disabled .bar-pointer-target:hover + .bar {
|
|
942
|
+
/* ensure no visual hover interaction when disabled */
|
|
943
|
+
fill-opacity: 1;
|
|
944
|
+
}
|
|
945
|
+
/****** histogram ********/
|
|
946
|
+
#tooltip {
|
|
947
|
+
position: absolute;
|
|
948
|
+
background: ${tooltipBackgroundColor};
|
|
949
|
+
margin: 0;
|
|
950
|
+
border: 0;
|
|
951
|
+
color: ${tooltipTextColor};
|
|
952
|
+
text-align: center;
|
|
953
|
+
border-radius: 3px;
|
|
954
|
+
padding: 2px;
|
|
955
|
+
font-size: ${tooltipFontSize};
|
|
956
|
+
font-family: ${tooltipFontFamily};
|
|
957
|
+
touch-action: none;
|
|
958
|
+
pointer-events: none;
|
|
959
|
+
overflow: visible;
|
|
960
|
+
}
|
|
961
|
+
#tooltip:after {
|
|
962
|
+
content: '';
|
|
963
|
+
position: absolute;
|
|
964
|
+
margin-left: -5px;
|
|
965
|
+
top: 100%;
|
|
966
|
+
left: 50%;
|
|
967
|
+
/* arrow */
|
|
968
|
+
border: 5px solid ${tooltipTextColor};
|
|
969
|
+
border-color: ${tooltipBackgroundColor} transparent transparent
|
|
970
|
+
transparent;
|
|
971
|
+
}
|
|
972
|
+
/****** slider ********/
|
|
973
|
+
.slider {
|
|
974
|
+
shape-rendering: crispEdges; /* So the slider doesn't get blurry if dragged between pixels */
|
|
975
|
+
}
|
|
976
|
+
.draggable:hover {
|
|
977
|
+
cursor: grab;
|
|
978
|
+
}
|
|
979
|
+
.dragging {
|
|
980
|
+
cursor: grabbing !important;
|
|
981
|
+
}
|
|
982
|
+
/****** inputs ********/
|
|
983
|
+
#inputs {
|
|
984
|
+
display: flex;
|
|
985
|
+
justify-content: center;
|
|
986
|
+
margin: ${inputRowMargin};
|
|
987
|
+
}
|
|
988
|
+
#inputs .dash {
|
|
989
|
+
position: relative;
|
|
990
|
+
bottom: -1px;
|
|
991
|
+
align-self: center; /* Otherwise the dash sticks to the top while the inputs grow */
|
|
992
|
+
}
|
|
993
|
+
input {
|
|
994
|
+
width: ${inputWidth};
|
|
995
|
+
margin: 0 3px;
|
|
996
|
+
border: ${inputBorder};
|
|
997
|
+
border-radius: 2px !important;
|
|
998
|
+
text-align: center;
|
|
999
|
+
font-size: ${inputFontSize};
|
|
1000
|
+
font-family: ${inputFontFamily};
|
|
1001
|
+
}
|
|
1002
|
+
.sr-only {
|
|
1003
|
+
position: absolute !important;
|
|
1004
|
+
width: 1px !important;
|
|
1005
|
+
height: 1px !important;
|
|
1006
|
+
margin: 0 !important;
|
|
1007
|
+
padding: 0 !important;
|
|
1008
|
+
border: 0 !important;
|
|
1009
|
+
overflow: hidden !important;
|
|
1010
|
+
white-space: nowrap !important;
|
|
1011
|
+
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
1012
|
+
-webkit-clip-path: inset(50%) !important;
|
|
1013
|
+
clip-path: inset(50%) !important;
|
|
1014
|
+
}
|
|
995
1015
|
`;
|
|
996
1016
|
__decorate([
|
|
997
1017
|
property({ type: Number })
|