@genspectrum/dashboard-components 0.4.3 → 0.4.5
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/custom-elements.json +145 -12
- package/dist/dashboard-components.js +232 -149
- package/dist/dashboard-components.js.map +1 -1
- package/dist/genspectrum-components.d.ts +33 -0
- package/package.json +1 -1
- package/src/preact/aggregatedData/aggregate-table.tsx +3 -2
- package/src/preact/aggregatedData/aggregate.stories.tsx +6 -0
- package/src/preact/aggregatedData/aggregate.tsx +28 -6
- package/src/preact/components/table.stories.tsx +51 -1
- package/src/preact/components/table.tsx +4 -3
- package/src/preact/locationFilter/location-filter.stories.tsx +12 -1
- package/src/preact/locationFilter/location-filter.tsx +10 -3
- package/src/preact/mutationComparison/mutation-comparison-table.tsx +7 -2
- package/src/preact/mutationComparison/mutation-comparison.stories.tsx +3 -0
- package/src/preact/mutationComparison/mutation-comparison.tsx +25 -3
- package/src/preact/mutations/mutations-grid.tsx +8 -2
- package/src/preact/mutations/mutations-insertions-table.tsx +3 -2
- package/src/preact/mutations/mutations-table.tsx +3 -2
- package/src/preact/mutations/mutations.stories.tsx +3 -0
- package/src/preact/mutations/mutations.tsx +16 -6
- package/src/preact/prevalenceOverTime/prevalence-over-time-table.tsx +3 -2
- package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +4 -0
- package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +8 -1
- package/src/query/queryAggregateData.spec.ts +117 -3
- package/src/query/queryAggregateData.ts +31 -2
- package/src/web-components/input/gs-location-filter.stories.ts +11 -0
- package/src/web-components/input/gs-location-filter.tsx +14 -1
- package/src/web-components/visualization/gs-aggregate.stories.ts +15 -0
- package/src/web-components/visualization/gs-aggregate.tsx +23 -0
- package/src/web-components/visualization/gs-mutation-comparison.stories.ts +4 -0
- package/src/web-components/visualization/gs-mutation-comparison.tsx +8 -0
- package/src/web-components/visualization/gs-mutations.stories.ts +4 -0
- package/src/web-components/visualization/gs-mutations.tsx +8 -0
- package/src/web-components/visualization/gs-prevalence-over-time.stories.ts +5 -0
- package/src/web-components/visualization/gs-prevalence-over-time.tsx +12 -4
|
@@ -28,8 +28,7 @@ const t$2 = (t2) => (e2, o2) => {
|
|
|
28
28
|
const t$1 = globalThis, e$2 = t$1.ShadowRoot && (void 0 === t$1.ShadyCSS || t$1.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$1 = Symbol(), o$3 = /* @__PURE__ */ new WeakMap();
|
|
29
29
|
let n$2 = class n {
|
|
30
30
|
constructor(t2, e2, o2) {
|
|
31
|
-
if (this._$cssResult$ = true, o2 !== s$1)
|
|
32
|
-
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
31
|
+
if (this._$cssResult$ = true, o2 !== s$1) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
33
32
|
this.cssText = t2, this.t = e2;
|
|
34
33
|
}
|
|
35
34
|
get styleSheet() {
|
|
@@ -46,17 +45,14 @@ let n$2 = class n {
|
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
const r$3 = (t2) => new n$2("string" == typeof t2 ? t2 : t2 + "", void 0, s$1), S$1 = (s2, o2) => {
|
|
49
|
-
if (e$2)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
void 0 !== n3 && o3.setAttribute("nonce", n3), o3.textContent = e2.cssText, s2.appendChild(o3);
|
|
55
|
-
}
|
|
48
|
+
if (e$2) s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet);
|
|
49
|
+
else for (const e2 of o2) {
|
|
50
|
+
const o3 = document.createElement("style"), n3 = t$1.litNonce;
|
|
51
|
+
void 0 !== n3 && o3.setAttribute("nonce", n3), o3.textContent = e2.cssText, s2.appendChild(o3);
|
|
52
|
+
}
|
|
56
53
|
}, c$2 = e$2 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
|
|
57
54
|
let e2 = "";
|
|
58
|
-
for (const s2 of t3.cssRules)
|
|
59
|
-
e2 += s2.cssText;
|
|
55
|
+
for (const s2 of t3.cssRules) e2 += s2.cssText;
|
|
60
56
|
return r$3(e2);
|
|
61
57
|
})(t2) : t2;
|
|
62
58
|
/**
|
|
@@ -124,25 +120,20 @@ let b$1 = class b extends HTMLElement {
|
|
|
124
120
|
return this.elementProperties.get(t2) ?? y$1;
|
|
125
121
|
}
|
|
126
122
|
static _$Ei() {
|
|
127
|
-
if (this.hasOwnProperty(d$1("elementProperties")))
|
|
128
|
-
return;
|
|
123
|
+
if (this.hasOwnProperty(d$1("elementProperties"))) return;
|
|
129
124
|
const t2 = n$1(this);
|
|
130
125
|
t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties);
|
|
131
126
|
}
|
|
132
127
|
static finalize() {
|
|
133
|
-
if (this.hasOwnProperty(d$1("finalized")))
|
|
134
|
-
return;
|
|
128
|
+
if (this.hasOwnProperty(d$1("finalized"))) return;
|
|
135
129
|
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
|
|
136
130
|
const t3 = this.properties, s2 = [...h$1(t3), ...o$2(t3)];
|
|
137
|
-
for (const i2 of s2)
|
|
138
|
-
this.createProperty(i2, t3[i2]);
|
|
131
|
+
for (const i2 of s2) this.createProperty(i2, t3[i2]);
|
|
139
132
|
}
|
|
140
133
|
const t2 = this[Symbol.metadata];
|
|
141
134
|
if (null !== t2) {
|
|
142
135
|
const s2 = litPropertyMetadata.get(t2);
|
|
143
|
-
if (void 0 !== s2)
|
|
144
|
-
for (const [t3, i2] of s2)
|
|
145
|
-
this.elementProperties.set(t3, i2);
|
|
136
|
+
if (void 0 !== s2) for (const [t3, i2] of s2) this.elementProperties.set(t3, i2);
|
|
146
137
|
}
|
|
147
138
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
148
139
|
for (const [t3, s2] of this.elementProperties) {
|
|
@@ -155,10 +146,8 @@ let b$1 = class b extends HTMLElement {
|
|
|
155
146
|
const i2 = [];
|
|
156
147
|
if (Array.isArray(s2)) {
|
|
157
148
|
const e2 = new Set(s2.flat(1 / 0).reverse());
|
|
158
|
-
for (const s3 of e2)
|
|
159
|
-
|
|
160
|
-
} else
|
|
161
|
-
void 0 !== s2 && i2.push(c$2(s2));
|
|
149
|
+
for (const s3 of e2) i2.unshift(c$2(s3));
|
|
150
|
+
} else void 0 !== s2 && i2.push(c$2(s2));
|
|
162
151
|
return i2;
|
|
163
152
|
}
|
|
164
153
|
static _$Eu(t2, s2) {
|
|
@@ -182,8 +171,7 @@ let b$1 = class b extends HTMLElement {
|
|
|
182
171
|
}
|
|
183
172
|
_$E_() {
|
|
184
173
|
const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties;
|
|
185
|
-
for (const i2 of s2.keys())
|
|
186
|
-
this.hasOwnProperty(i2) && (t2.set(i2, this[i2]), delete this[i2]);
|
|
174
|
+
for (const i2 of s2.keys()) this.hasOwnProperty(i2) && (t2.set(i2, this[i2]), delete this[i2]);
|
|
187
175
|
t2.size > 0 && (this._$Ep = t2);
|
|
188
176
|
}
|
|
189
177
|
createRenderRoot() {
|
|
@@ -227,8 +215,7 @@ let b$1 = class b extends HTMLElement {
|
|
|
227
215
|
}
|
|
228
216
|
requestUpdate(t2, s2, i2) {
|
|
229
217
|
if (void 0 !== t2) {
|
|
230
|
-
if (i2 ?? (i2 = this.constructor.getPropertyOptions(t2)), !(i2.hasChanged ?? f$2)(this[t2], s2))
|
|
231
|
-
return;
|
|
218
|
+
if (i2 ?? (i2 = this.constructor.getPropertyOptions(t2)), !(i2.hasChanged ?? f$2)(this[t2], s2)) return;
|
|
232
219
|
this.P(t2, s2, i2);
|
|
233
220
|
}
|
|
234
221
|
false === this.isUpdatePending && (this._$ES = this._$ET());
|
|
@@ -251,18 +238,14 @@ let b$1 = class b extends HTMLElement {
|
|
|
251
238
|
}
|
|
252
239
|
performUpdate() {
|
|
253
240
|
var _a;
|
|
254
|
-
if (!this.isUpdatePending)
|
|
255
|
-
return;
|
|
241
|
+
if (!this.isUpdatePending) return;
|
|
256
242
|
if (!this.hasUpdated) {
|
|
257
243
|
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
258
|
-
for (const [t4, s3] of this._$Ep)
|
|
259
|
-
this[t4] = s3;
|
|
244
|
+
for (const [t4, s3] of this._$Ep) this[t4] = s3;
|
|
260
245
|
this._$Ep = void 0;
|
|
261
246
|
}
|
|
262
247
|
const t3 = this.constructor.elementProperties;
|
|
263
|
-
if (t3.size > 0)
|
|
264
|
-
for (const [s3, i2] of t3)
|
|
265
|
-
true !== i2.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i2);
|
|
248
|
+
if (t3.size > 0) for (const [s3, i2] of t3) true !== i2.wrapped || this._$AL.has(s3) || void 0 === this[s3] || this.P(s3, this[s3], i2);
|
|
266
249
|
}
|
|
267
250
|
let t2 = false;
|
|
268
251
|
const s2 = this._$AL;
|
|
@@ -513,8 +496,7 @@ var __decorateClass$a = (decorators, target, key, kind) => {
|
|
|
513
496
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
514
497
|
if (decorator = decorators[i2])
|
|
515
498
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
516
|
-
if (kind && result)
|
|
517
|
-
__defProp$a(target, key, result);
|
|
499
|
+
if (kind && result) __defProp$a(target, key, result);
|
|
518
500
|
return result;
|
|
519
501
|
};
|
|
520
502
|
let App = class extends LitElement {
|
|
@@ -559,13 +541,9 @@ var f$1 = 0;
|
|
|
559
541
|
function u$1(e2, t2, n3, o2, i2, u2) {
|
|
560
542
|
t2 || (t2 = {});
|
|
561
543
|
var a2, c2, p2 = t2;
|
|
562
|
-
if ("ref" in p2)
|
|
563
|
-
for (c2 in p2 = {}, t2)
|
|
564
|
-
"ref" == c2 ? a2 = t2[c2] : p2[c2] = t2[c2];
|
|
544
|
+
if ("ref" in p2) for (c2 in p2 = {}, t2) "ref" == c2 ? a2 = t2[c2] : p2[c2] = t2[c2];
|
|
565
545
|
var l2 = { type: e2, props: p2, key: n3, ref: a2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --f$1, __i: -1, __u: 0, __source: i2, __self: u2 };
|
|
566
|
-
if ("function" == typeof e2 && (a2 = e2.defaultProps))
|
|
567
|
-
for (c2 in a2)
|
|
568
|
-
void 0 === p2[c2] && (p2[c2] = a2[c2]);
|
|
546
|
+
if ("function" == typeof e2 && (a2 = e2.defaultProps)) for (c2 in a2) void 0 === p2[c2] && (p2[c2] = a2[c2]);
|
|
569
547
|
return options.vnode && options.vnode(l2), l2;
|
|
570
548
|
}
|
|
571
549
|
var t, r, u, i, o = 0, f = [], c = [], e = options, a = e.__b, v = e.__r, l = e.diffed, m = e.__c, s = e.unmount, d = e.__;
|
|
@@ -584,15 +562,13 @@ function y(n3, u2, i2) {
|
|
|
584
562
|
t2 !== r2 && (o2.__N = [r2, o2.__[1]], o2.__c.setState({}));
|
|
585
563
|
}], o2.__c = r, !r.u)) {
|
|
586
564
|
var f2 = function(n4, t2, r2) {
|
|
587
|
-
if (!o2.__c.__H)
|
|
588
|
-
return true;
|
|
565
|
+
if (!o2.__c.__H) return true;
|
|
589
566
|
var u3 = o2.__c.__H.__.filter(function(n5) {
|
|
590
567
|
return !!n5.__c;
|
|
591
568
|
});
|
|
592
569
|
if (u3.every(function(n5) {
|
|
593
570
|
return !n5.__N;
|
|
594
|
-
}))
|
|
595
|
-
return !c2 || c2.call(this, n4, t2, r2);
|
|
571
|
+
})) return !c2 || c2.call(this, n4, t2, r2);
|
|
596
572
|
var i3 = false;
|
|
597
573
|
return u3.forEach(function(n5) {
|
|
598
574
|
if (n5.__N) {
|
|
@@ -639,13 +615,11 @@ function b2(n3) {
|
|
|
639
615
|
}];
|
|
640
616
|
}
|
|
641
617
|
function j() {
|
|
642
|
-
for (var n3; n3 = f.shift(); )
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
n3.__H.__h = [], e.__e(t2, n3.__v);
|
|
648
|
-
}
|
|
618
|
+
for (var n3; n3 = f.shift(); ) if (n3.__P && n3.__H) try {
|
|
619
|
+
n3.__H.__h.forEach(z), n3.__H.__h.forEach(B), n3.__H.__h = [];
|
|
620
|
+
} catch (t2) {
|
|
621
|
+
n3.__H.__h = [], e.__e(t2, n3.__v);
|
|
622
|
+
}
|
|
649
623
|
}
|
|
650
624
|
e.__b = function(n3) {
|
|
651
625
|
r = null, a && a(n3);
|
|
@@ -772,7 +746,8 @@ const tableStyle = {
|
|
|
772
746
|
fontSize: "12px"
|
|
773
747
|
}
|
|
774
748
|
};
|
|
775
|
-
const Table = ({ data, columns,
|
|
749
|
+
const Table = ({ data, columns, pageSize }) => {
|
|
750
|
+
const pagination = typeof pageSize === "number" ? { limit: pageSize } : pageSize;
|
|
776
751
|
const wrapper3 = F(null);
|
|
777
752
|
_(() => {
|
|
778
753
|
if (wrapper3.current === null) {
|
|
@@ -945,7 +920,11 @@ const compareSubstitutionValues = (a2, b3) => {
|
|
|
945
920
|
const formatProportion = (proportion) => {
|
|
946
921
|
return `${(proportion * 100).toFixed(2)}%`;
|
|
947
922
|
};
|
|
948
|
-
const MutationComparisonTable = ({
|
|
923
|
+
const MutationComparisonTable = ({
|
|
924
|
+
data,
|
|
925
|
+
proportionInterval,
|
|
926
|
+
pageSize
|
|
927
|
+
}) => {
|
|
949
928
|
const headers = [
|
|
950
929
|
{
|
|
951
930
|
name: "Mutation",
|
|
@@ -966,7 +945,7 @@ const MutationComparisonTable = ({ data, proportionInterval }) => {
|
|
|
966
945
|
}
|
|
967
946
|
];
|
|
968
947
|
const tableData = getMutationComparisonTableData(data, proportionInterval).map((row) => Object.values(row));
|
|
969
|
-
return /* @__PURE__ */ u$1(Table, { data: tableData, columns: headers,
|
|
948
|
+
return /* @__PURE__ */ u$1(Table, { data: tableData, columns: headers, pageSize });
|
|
970
949
|
};
|
|
971
950
|
const GsChart = ({ configuration }) => {
|
|
972
951
|
const canvasRef = F(null);
|
|
@@ -1714,15 +1693,25 @@ const MutationComparison = ({
|
|
|
1714
1693
|
views,
|
|
1715
1694
|
width,
|
|
1716
1695
|
height,
|
|
1717
|
-
headline = "Mutation comparison"
|
|
1696
|
+
headline = "Mutation comparison",
|
|
1697
|
+
pageSize
|
|
1718
1698
|
}) => {
|
|
1719
1699
|
const size2 = { height, width };
|
|
1720
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
1700
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
1701
|
+
MutationComparisonInner,
|
|
1702
|
+
{
|
|
1703
|
+
variants,
|
|
1704
|
+
sequenceType,
|
|
1705
|
+
views,
|
|
1706
|
+
pageSize
|
|
1707
|
+
}
|
|
1708
|
+
) }) }) });
|
|
1721
1709
|
};
|
|
1722
1710
|
const MutationComparisonInner = ({
|
|
1723
1711
|
variants,
|
|
1724
1712
|
sequenceType,
|
|
1725
|
-
views
|
|
1713
|
+
views,
|
|
1714
|
+
pageSize
|
|
1726
1715
|
}) => {
|
|
1727
1716
|
const lapis = P(LapisUrlContext);
|
|
1728
1717
|
const { data, error, isLoading } = useQuery(async () => {
|
|
@@ -1737,9 +1726,22 @@ const MutationComparisonInner = ({
|
|
|
1737
1726
|
if (data === null) {
|
|
1738
1727
|
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
1739
1728
|
}
|
|
1740
|
-
return /* @__PURE__ */ u$1(
|
|
1729
|
+
return /* @__PURE__ */ u$1(
|
|
1730
|
+
MutationComparisonTabs,
|
|
1731
|
+
{
|
|
1732
|
+
data: data.mutationData,
|
|
1733
|
+
sequenceType,
|
|
1734
|
+
views,
|
|
1735
|
+
pageSize
|
|
1736
|
+
}
|
|
1737
|
+
);
|
|
1741
1738
|
};
|
|
1742
|
-
const MutationComparisonTabs = ({
|
|
1739
|
+
const MutationComparisonTabs = ({
|
|
1740
|
+
data,
|
|
1741
|
+
views,
|
|
1742
|
+
sequenceType,
|
|
1743
|
+
pageSize
|
|
1744
|
+
}) => {
|
|
1743
1745
|
const [proportionInterval, setProportionInterval] = p({ min: 0.5, max: 1 });
|
|
1744
1746
|
const [displayedMutationTypes, setDisplayedMutationTypes] = p([
|
|
1745
1747
|
{ label: "Substitutions", checked: true, type: "substitution" },
|
|
@@ -1759,7 +1761,8 @@ const MutationComparisonTabs = ({ data, views, sequenceType }) => {
|
|
|
1759
1761
|
MutationComparisonTable,
|
|
1760
1762
|
{
|
|
1761
1763
|
data: { content: filteredData },
|
|
1762
|
-
proportionInterval
|
|
1764
|
+
proportionInterval,
|
|
1765
|
+
pageSize
|
|
1763
1766
|
}
|
|
1764
1767
|
)
|
|
1765
1768
|
};
|
|
@@ -4579,8 +4582,7 @@ var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
|
4579
4582
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
4580
4583
|
if (decorator = decorators[i2])
|
|
4581
4584
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4582
|
-
if (kind && result)
|
|
4583
|
-
__defProp$9(target, key, result);
|
|
4585
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
4584
4586
|
return result;
|
|
4585
4587
|
};
|
|
4586
4588
|
const tailwindElementCss = unsafeCSS(tailwindStyle);
|
|
@@ -4620,8 +4622,7 @@ var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
|
4620
4622
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
4621
4623
|
if (decorator = decorators[i2])
|
|
4622
4624
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4623
|
-
if (kind && result)
|
|
4624
|
-
__defProp$8(target, key, result);
|
|
4625
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
4625
4626
|
return result;
|
|
4626
4627
|
};
|
|
4627
4628
|
let MutationComparisonComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
@@ -4633,6 +4634,7 @@ let MutationComparisonComponent = class extends PreactLitAdapterWithGridJsStyles
|
|
|
4633
4634
|
this.width = "100%";
|
|
4634
4635
|
this.height = "700px";
|
|
4635
4636
|
this.headline = "Mutation comparison";
|
|
4637
|
+
this.pageSize = false;
|
|
4636
4638
|
}
|
|
4637
4639
|
render() {
|
|
4638
4640
|
return /* @__PURE__ */ u$1(
|
|
@@ -4643,7 +4645,8 @@ let MutationComparisonComponent = class extends PreactLitAdapterWithGridJsStyles
|
|
|
4643
4645
|
views: this.views,
|
|
4644
4646
|
width: this.width,
|
|
4645
4647
|
height: this.height,
|
|
4646
|
-
headline: this.headline
|
|
4648
|
+
headline: this.headline,
|
|
4649
|
+
pageSize: this.pageSize
|
|
4647
4650
|
}
|
|
4648
4651
|
);
|
|
4649
4652
|
}
|
|
@@ -4666,6 +4669,9 @@ __decorateClass$8([
|
|
|
4666
4669
|
__decorateClass$8([
|
|
4667
4670
|
n2({ type: String })
|
|
4668
4671
|
], MutationComparisonComponent.prototype, "headline", 2);
|
|
4672
|
+
__decorateClass$8([
|
|
4673
|
+
n2({ type: Object })
|
|
4674
|
+
], MutationComparisonComponent.prototype, "pageSize", 2);
|
|
4669
4675
|
MutationComparisonComponent = __decorateClass$8([
|
|
4670
4676
|
t$2("gs-mutation-comparison")
|
|
4671
4677
|
], MutationComparisonComponent);
|
|
@@ -4758,7 +4764,12 @@ const byProportion = (row, proportionInterval) => {
|
|
|
4758
4764
|
return !cell.isReference && cell.proportion >= proportionInterval.min && cell.proportion <= proportionInterval.max;
|
|
4759
4765
|
});
|
|
4760
4766
|
};
|
|
4761
|
-
const MutationsGrid = ({
|
|
4767
|
+
const MutationsGrid = ({
|
|
4768
|
+
data,
|
|
4769
|
+
sequenceType,
|
|
4770
|
+
proportionInterval,
|
|
4771
|
+
pageSize
|
|
4772
|
+
}) => {
|
|
4762
4773
|
const getHeaders = () => {
|
|
4763
4774
|
return [
|
|
4764
4775
|
{
|
|
@@ -4811,7 +4822,7 @@ const MutationsGrid = ({ data, sequenceType, proportionInterval }) => {
|
|
|
4811
4822
|
return {};
|
|
4812
4823
|
};
|
|
4813
4824
|
const tableData = getMutationsGridData(data, sequenceType, proportionInterval).map((row) => Object.values(row));
|
|
4814
|
-
return /* @__PURE__ */ u$1(Table, { data: tableData, columns: getHeaders(),
|
|
4825
|
+
return /* @__PURE__ */ u$1(Table, { data: tableData, columns: getHeaders(), pageSize });
|
|
4815
4826
|
};
|
|
4816
4827
|
const sortInsertions = (a2, b3) => {
|
|
4817
4828
|
if (a2.segment !== b3.segment) {
|
|
@@ -4822,7 +4833,7 @@ const sortInsertions = (a2, b3) => {
|
|
|
4822
4833
|
}
|
|
4823
4834
|
return a2.insertedSymbols.localeCompare(b3.insertedSymbols);
|
|
4824
4835
|
};
|
|
4825
|
-
const InsertionsTable = ({ data }) => {
|
|
4836
|
+
const InsertionsTable = ({ data, pageSize }) => {
|
|
4826
4837
|
const getHeaders = () => {
|
|
4827
4838
|
return [
|
|
4828
4839
|
{
|
|
@@ -4841,9 +4852,9 @@ const InsertionsTable = ({ data }) => {
|
|
|
4841
4852
|
];
|
|
4842
4853
|
};
|
|
4843
4854
|
const tableData = getInsertionsTableData(data).map((row) => Object.values(row));
|
|
4844
|
-
return /* @__PURE__ */ u$1(Table, { data: tableData, columns: getHeaders(),
|
|
4855
|
+
return /* @__PURE__ */ u$1(Table, { data: tableData, columns: getHeaders(), pageSize });
|
|
4845
4856
|
};
|
|
4846
|
-
const MutationsTable = ({ data, proportionInterval }) => {
|
|
4857
|
+
const MutationsTable = ({ data, proportionInterval, pageSize }) => {
|
|
4847
4858
|
const getHeaders = () => {
|
|
4848
4859
|
return [
|
|
4849
4860
|
{
|
|
@@ -4871,7 +4882,7 @@ const MutationsTable = ({ data, proportionInterval }) => {
|
|
|
4871
4882
|
];
|
|
4872
4883
|
};
|
|
4873
4884
|
const tableData = getMutationsTableData(data, proportionInterval).map((row) => Object.values(row));
|
|
4874
|
-
return /* @__PURE__ */ u$1(Table, { data: tableData, columns: getHeaders(),
|
|
4885
|
+
return /* @__PURE__ */ u$1(Table, { data: tableData, columns: getHeaders(), pageSize });
|
|
4875
4886
|
};
|
|
4876
4887
|
class FetchInsertionsOperator {
|
|
4877
4888
|
constructor(filter, sequenceType) {
|
|
@@ -4933,12 +4944,13 @@ const Mutations = ({
|
|
|
4933
4944
|
views,
|
|
4934
4945
|
width,
|
|
4935
4946
|
height,
|
|
4936
|
-
headline = "Mutations"
|
|
4947
|
+
headline = "Mutations",
|
|
4948
|
+
pageSize
|
|
4937
4949
|
}) => {
|
|
4938
4950
|
const size2 = { height, width };
|
|
4939
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationsInner, { variant, sequenceType, views }) }) }) });
|
|
4951
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(MutationsInner, { variant, sequenceType, views, pageSize }) }) }) });
|
|
4940
4952
|
};
|
|
4941
|
-
const MutationsInner = ({ variant, sequenceType, views }) => {
|
|
4953
|
+
const MutationsInner = ({ variant, sequenceType, views, pageSize }) => {
|
|
4942
4954
|
const lapis = P(LapisUrlContext);
|
|
4943
4955
|
const { data, error, isLoading } = useQuery(async () => {
|
|
4944
4956
|
return queryMutationsData(variant, sequenceType, lapis);
|
|
@@ -4952,9 +4964,9 @@ const MutationsInner = ({ variant, sequenceType, views }) => {
|
|
|
4952
4964
|
if (data === null) {
|
|
4953
4965
|
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
4954
4966
|
}
|
|
4955
|
-
return /* @__PURE__ */ u$1(MutationsTabs, { mutationsData: data, sequenceType, views });
|
|
4967
|
+
return /* @__PURE__ */ u$1(MutationsTabs, { mutationsData: data, sequenceType, views, pageSize });
|
|
4956
4968
|
};
|
|
4957
|
-
const MutationsTabs = ({ mutationsData, sequenceType, views }) => {
|
|
4969
|
+
const MutationsTabs = ({ mutationsData, sequenceType, views, pageSize }) => {
|
|
4958
4970
|
const [proportionInterval, setProportionInterval] = p({ min: 0.05, max: 1 });
|
|
4959
4971
|
const [displayedSegments, setDisplayedSegments] = useDisplayedSegments(sequenceType);
|
|
4960
4972
|
const [displayedMutationTypes, setDisplayedMutationTypes] = p([
|
|
@@ -4967,7 +4979,14 @@ const MutationsTabs = ({ mutationsData, sequenceType, views }) => {
|
|
|
4967
4979
|
case "table":
|
|
4968
4980
|
return {
|
|
4969
4981
|
title: "Table",
|
|
4970
|
-
content: /* @__PURE__ */ u$1(
|
|
4982
|
+
content: /* @__PURE__ */ u$1(
|
|
4983
|
+
MutationsTable,
|
|
4984
|
+
{
|
|
4985
|
+
data: filteredData.tableData,
|
|
4986
|
+
proportionInterval,
|
|
4987
|
+
pageSize
|
|
4988
|
+
}
|
|
4989
|
+
)
|
|
4971
4990
|
};
|
|
4972
4991
|
case "grid":
|
|
4973
4992
|
return {
|
|
@@ -4977,14 +4996,15 @@ const MutationsTabs = ({ mutationsData, sequenceType, views }) => {
|
|
|
4977
4996
|
{
|
|
4978
4997
|
data: filteredData.gridData,
|
|
4979
4998
|
sequenceType,
|
|
4980
|
-
proportionInterval
|
|
4999
|
+
proportionInterval,
|
|
5000
|
+
pageSize
|
|
4981
5001
|
}
|
|
4982
5002
|
)
|
|
4983
5003
|
};
|
|
4984
5004
|
case "insertions":
|
|
4985
5005
|
return {
|
|
4986
5006
|
title: "Insertions",
|
|
4987
|
-
content: /* @__PURE__ */ u$1(InsertionsTable, { data: filteredData.insertions })
|
|
5007
|
+
content: /* @__PURE__ */ u$1(InsertionsTable, { data: filteredData.insertions, pageSize })
|
|
4988
5008
|
};
|
|
4989
5009
|
}
|
|
4990
5010
|
};
|
|
@@ -5064,8 +5084,7 @@ var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
|
5064
5084
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
5065
5085
|
if (decorator = decorators[i2])
|
|
5066
5086
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
5067
|
-
if (kind && result)
|
|
5068
|
-
__defProp$7(target, key, result);
|
|
5087
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
5069
5088
|
return result;
|
|
5070
5089
|
};
|
|
5071
5090
|
let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
@@ -5077,6 +5096,7 @@ let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
|
5077
5096
|
this.width = "100%";
|
|
5078
5097
|
this.height = "700px";
|
|
5079
5098
|
this.headline = "Mutations";
|
|
5099
|
+
this.pageSize = false;
|
|
5080
5100
|
}
|
|
5081
5101
|
render() {
|
|
5082
5102
|
return /* @__PURE__ */ u$1(
|
|
@@ -5087,7 +5107,8 @@ let MutationsComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
|
5087
5107
|
views: this.views,
|
|
5088
5108
|
width: this.width,
|
|
5089
5109
|
height: this.height,
|
|
5090
|
-
headline: this.headline
|
|
5110
|
+
headline: this.headline,
|
|
5111
|
+
pageSize: this.pageSize
|
|
5091
5112
|
}
|
|
5092
5113
|
);
|
|
5093
5114
|
}
|
|
@@ -5110,6 +5131,9 @@ __decorateClass$7([
|
|
|
5110
5131
|
__decorateClass$7([
|
|
5111
5132
|
n2({ type: String })
|
|
5112
5133
|
], MutationsComponent.prototype, "headline", 2);
|
|
5134
|
+
__decorateClass$7([
|
|
5135
|
+
n2({ type: Object })
|
|
5136
|
+
], MutationsComponent.prototype, "pageSize", 2);
|
|
5113
5137
|
MutationsComponent = __decorateClass$7([
|
|
5114
5138
|
t$2("gs-mutations")
|
|
5115
5139
|
], MutationsComponent);
|
|
@@ -5317,8 +5341,7 @@ const en = {
|
|
|
5317
5341
|
};
|
|
5318
5342
|
var padStart = function padStart2(string, length, pad) {
|
|
5319
5343
|
var s2 = String(string);
|
|
5320
|
-
if (!s2 || s2.length >= length)
|
|
5321
|
-
return string;
|
|
5344
|
+
if (!s2 || s2.length >= length) return string;
|
|
5322
5345
|
return "" + Array(length + 1 - s2.length).join(pad) + string;
|
|
5323
5346
|
};
|
|
5324
5347
|
var padZoneStr = function padZoneStr2(instance) {
|
|
@@ -5329,8 +5352,7 @@ var padZoneStr = function padZoneStr2(instance) {
|
|
|
5329
5352
|
return (negMinutes <= 0 ? "+" : "-") + padStart(hourOffset, 2, "0") + ":" + padStart(minuteOffset, 2, "0");
|
|
5330
5353
|
};
|
|
5331
5354
|
var monthDiff = function monthDiff2(a2, b3) {
|
|
5332
|
-
if (a2.date() < b3.date())
|
|
5333
|
-
return -monthDiff2(b3, a2);
|
|
5355
|
+
if (a2.date() < b3.date()) return -monthDiff2(b3, a2);
|
|
5334
5356
|
var wholeMonthDiff = (b3.year() - a2.year()) * 12 + (b3.month() - a2.month());
|
|
5335
5357
|
var anchor = a2.clone().add(wholeMonthDiff, M);
|
|
5336
5358
|
var c2 = b3 - anchor < 0;
|
|
@@ -5375,8 +5397,7 @@ var isDayjs = function isDayjs2(d2) {
|
|
|
5375
5397
|
};
|
|
5376
5398
|
var parseLocale = function parseLocale2(preset, object, isLocal) {
|
|
5377
5399
|
var l2;
|
|
5378
|
-
if (!preset)
|
|
5379
|
-
return L;
|
|
5400
|
+
if (!preset) return L;
|
|
5380
5401
|
if (typeof preset === "string") {
|
|
5381
5402
|
var presetLower = preset.toLowerCase();
|
|
5382
5403
|
if (Ls[presetLower]) {
|
|
@@ -5395,8 +5416,7 @@ var parseLocale = function parseLocale2(preset, object, isLocal) {
|
|
|
5395
5416
|
Ls[name] = preset;
|
|
5396
5417
|
l2 = name;
|
|
5397
5418
|
}
|
|
5398
|
-
if (!isLocal && l2)
|
|
5399
|
-
L = l2;
|
|
5419
|
+
if (!isLocal && l2) L = l2;
|
|
5400
5420
|
return l2 || !isLocal && L;
|
|
5401
5421
|
};
|
|
5402
5422
|
var dayjs = function dayjs2(date, c2) {
|
|
@@ -5423,12 +5443,9 @@ Utils.i = isDayjs;
|
|
|
5423
5443
|
Utils.w = wrapper;
|
|
5424
5444
|
var parseDate = function parseDate2(cfg) {
|
|
5425
5445
|
var date = cfg.date, utc = cfg.utc;
|
|
5426
|
-
if (date === null)
|
|
5427
|
-
|
|
5428
|
-
if (
|
|
5429
|
-
return /* @__PURE__ */ new Date();
|
|
5430
|
-
if (date instanceof Date)
|
|
5431
|
-
return new Date(date);
|
|
5446
|
+
if (date === null) return /* @__PURE__ */ new Date(NaN);
|
|
5447
|
+
if (Utils.u(date)) return /* @__PURE__ */ new Date();
|
|
5448
|
+
if (date instanceof Date) return new Date(date);
|
|
5432
5449
|
if (typeof date === "string" && !/Z$/i.test(date)) {
|
|
5433
5450
|
var d2 = date.match(REGEX_PARSE);
|
|
5434
5451
|
if (d2) {
|
|
@@ -5482,8 +5499,7 @@ var Dayjs = /* @__PURE__ */ function() {
|
|
|
5482
5499
|
return this.endOf(units) < dayjs(that);
|
|
5483
5500
|
};
|
|
5484
5501
|
_proto.$g = function $g(input, get, set) {
|
|
5485
|
-
if (Utils.u(input))
|
|
5486
|
-
return this[get];
|
|
5502
|
+
if (Utils.u(input)) return this[get];
|
|
5487
5503
|
return this.set(set, input);
|
|
5488
5504
|
};
|
|
5489
5505
|
_proto.unix = function unix() {
|
|
@@ -5548,8 +5564,7 @@ var Dayjs = /* @__PURE__ */ function() {
|
|
|
5548
5564
|
date.$d[name](arg);
|
|
5549
5565
|
date.init();
|
|
5550
5566
|
this.$d = date.set(DATE, Math.min(this.$D, date.daysInMonth())).$d;
|
|
5551
|
-
} else if (name)
|
|
5552
|
-
this.$d[name](arg);
|
|
5567
|
+
} else if (name) this.$d[name](arg);
|
|
5553
5568
|
this.init();
|
|
5554
5569
|
return this;
|
|
5555
5570
|
};
|
|
@@ -5589,8 +5604,7 @@ var Dayjs = /* @__PURE__ */ function() {
|
|
|
5589
5604
|
_proto.format = function format(formatStr) {
|
|
5590
5605
|
var _this3 = this;
|
|
5591
5606
|
var locale = this.$locale();
|
|
5592
|
-
if (!this.isValid())
|
|
5593
|
-
return locale.invalidDate || INVALID_DATE_STRING;
|
|
5607
|
+
if (!this.isValid()) return locale.invalidDate || INVALID_DATE_STRING;
|
|
5594
5608
|
var str = formatStr || FORMAT_DEFAULT;
|
|
5595
5609
|
var zoneStr = Utils.z(this);
|
|
5596
5610
|
var $H = this.$H, $m = this.$m, $M = this.$M;
|
|
@@ -5713,12 +5727,10 @@ var Dayjs = /* @__PURE__ */ function() {
|
|
|
5713
5727
|
return Ls[this.$L];
|
|
5714
5728
|
};
|
|
5715
5729
|
_proto.locale = function locale(preset, object) {
|
|
5716
|
-
if (!preset)
|
|
5717
|
-
return this.$L;
|
|
5730
|
+
if (!preset) return this.$L;
|
|
5718
5731
|
var that = this.clone();
|
|
5719
5732
|
var nextLocaleName = parseLocale(preset, object, true);
|
|
5720
|
-
if (nextLocaleName)
|
|
5721
|
-
that.$L = nextLocaleName;
|
|
5733
|
+
if (nextLocaleName) that.$L = nextLocaleName;
|
|
5722
5734
|
return that;
|
|
5723
5735
|
};
|
|
5724
5736
|
_proto.clone = function clone() {
|
|
@@ -6319,7 +6331,7 @@ const tooltip$1 = (confidenceIntervalMethod) => {
|
|
|
6319
6331
|
return generalConfig;
|
|
6320
6332
|
}
|
|
6321
6333
|
};
|
|
6322
|
-
const PrevalenceOverTimeTable = ({ data, granularity }) => {
|
|
6334
|
+
const PrevalenceOverTimeTable = ({ data, granularity, pageSize }) => {
|
|
6323
6335
|
const getSplitColumns = (data2) => {
|
|
6324
6336
|
return data2.map((dataset) => ({
|
|
6325
6337
|
name: dataset.displayName,
|
|
@@ -6347,7 +6359,7 @@ const PrevalenceOverTimeTable = ({ data, granularity }) => {
|
|
|
6347
6359
|
const dataByHeader = getPrevalenceOverTimeTableData(data2, granularity2);
|
|
6348
6360
|
return Object.values(dataByHeader).map((row) => Object.values(row));
|
|
6349
6361
|
};
|
|
6350
|
-
return /* @__PURE__ */ u$1(Table, { data: getData(data, granularity), columns: getColumns(data),
|
|
6362
|
+
return /* @__PURE__ */ u$1(Table, { data: getData(data, granularity), columns: getColumns(data), pageSize });
|
|
6351
6363
|
};
|
|
6352
6364
|
class DivisionOperator {
|
|
6353
6365
|
constructor(numerator, denominator, keyField, valueField, resultField, numeratorField, denominatorField) {
|
|
@@ -6663,7 +6675,8 @@ const PrevalenceOverTime = ({
|
|
|
6663
6675
|
width,
|
|
6664
6676
|
height,
|
|
6665
6677
|
headline = "Prevalence over time",
|
|
6666
|
-
lapisDateField
|
|
6678
|
+
lapisDateField,
|
|
6679
|
+
pageSize
|
|
6667
6680
|
}) => {
|
|
6668
6681
|
const size2 = { height, width };
|
|
6669
6682
|
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
@@ -6675,7 +6688,8 @@ const PrevalenceOverTime = ({
|
|
|
6675
6688
|
smoothingWindow,
|
|
6676
6689
|
views,
|
|
6677
6690
|
confidenceIntervalMethods,
|
|
6678
|
-
lapisDateField
|
|
6691
|
+
lapisDateField,
|
|
6692
|
+
pageSize
|
|
6679
6693
|
}
|
|
6680
6694
|
) }) }) });
|
|
6681
6695
|
};
|
|
@@ -6686,7 +6700,8 @@ const PrevalenceOverTimeInner = ({
|
|
|
6686
6700
|
smoothingWindow,
|
|
6687
6701
|
views,
|
|
6688
6702
|
confidenceIntervalMethods,
|
|
6689
|
-
lapisDateField
|
|
6703
|
+
lapisDateField,
|
|
6704
|
+
pageSize
|
|
6690
6705
|
}) => {
|
|
6691
6706
|
const lapis = P(LapisUrlContext);
|
|
6692
6707
|
const { data, error, isLoading } = useQuery(
|
|
@@ -6708,7 +6723,8 @@ const PrevalenceOverTimeInner = ({
|
|
|
6708
6723
|
views,
|
|
6709
6724
|
data,
|
|
6710
6725
|
granularity,
|
|
6711
|
-
confidenceIntervalMethods
|
|
6726
|
+
confidenceIntervalMethods,
|
|
6727
|
+
pageSize
|
|
6712
6728
|
}
|
|
6713
6729
|
);
|
|
6714
6730
|
};
|
|
@@ -6716,7 +6732,8 @@ const PrevalenceOverTimeTabs = ({
|
|
|
6716
6732
|
views,
|
|
6717
6733
|
data,
|
|
6718
6734
|
granularity,
|
|
6719
|
-
confidenceIntervalMethods
|
|
6735
|
+
confidenceIntervalMethods,
|
|
6736
|
+
pageSize
|
|
6720
6737
|
}) => {
|
|
6721
6738
|
const [yAxisScaleType, setYAxisScaleType] = p("linear");
|
|
6722
6739
|
const [confidenceIntervalMethod, setConfidenceIntervalMethod] = p(
|
|
@@ -6756,7 +6773,7 @@ const PrevalenceOverTimeTabs = ({
|
|
|
6756
6773
|
case "table":
|
|
6757
6774
|
return {
|
|
6758
6775
|
title: "Table",
|
|
6759
|
-
content: /* @__PURE__ */ u$1(PrevalenceOverTimeTable, { data, granularity })
|
|
6776
|
+
content: /* @__PURE__ */ u$1(PrevalenceOverTimeTable, { data, granularity, pageSize })
|
|
6760
6777
|
};
|
|
6761
6778
|
}
|
|
6762
6779
|
};
|
|
@@ -6820,8 +6837,7 @@ var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
|
6820
6837
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
6821
6838
|
if (decorator = decorators[i2])
|
|
6822
6839
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
6823
|
-
if (kind && result)
|
|
6824
|
-
__defProp$6(target, key, result);
|
|
6840
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
6825
6841
|
return result;
|
|
6826
6842
|
};
|
|
6827
6843
|
let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
@@ -6837,6 +6853,7 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
|
|
|
6837
6853
|
this.width = "100%";
|
|
6838
6854
|
this.height = "700px";
|
|
6839
6855
|
this.lapisDateField = "date";
|
|
6856
|
+
this.pageSize = false;
|
|
6840
6857
|
}
|
|
6841
6858
|
render() {
|
|
6842
6859
|
return /* @__PURE__ */ u$1(
|
|
@@ -6851,7 +6868,8 @@ let PrevalenceOverTimeComponent = class extends PreactLitAdapterWithGridJsStyles
|
|
|
6851
6868
|
width: this.width,
|
|
6852
6869
|
height: this.height,
|
|
6853
6870
|
headline: this.headline,
|
|
6854
|
-
lapisDateField: this.lapisDateField
|
|
6871
|
+
lapisDateField: this.lapisDateField,
|
|
6872
|
+
pageSize: this.pageSize
|
|
6855
6873
|
}
|
|
6856
6874
|
);
|
|
6857
6875
|
}
|
|
@@ -6886,6 +6904,9 @@ __decorateClass$6([
|
|
|
6886
6904
|
__decorateClass$6([
|
|
6887
6905
|
n2({ type: String })
|
|
6888
6906
|
], PrevalenceOverTimeComponent.prototype, "lapisDateField", 2);
|
|
6907
|
+
__decorateClass$6([
|
|
6908
|
+
n2({ type: Object })
|
|
6909
|
+
], PrevalenceOverTimeComponent.prototype, "pageSize", 2);
|
|
6889
6910
|
PrevalenceOverTimeComponent = __decorateClass$6([
|
|
6890
6911
|
t$2("gs-prevalence-over-time")
|
|
6891
6912
|
], PrevalenceOverTimeComponent);
|
|
@@ -7206,8 +7227,7 @@ var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
|
7206
7227
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
7207
7228
|
if (decorator = decorators[i2])
|
|
7208
7229
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7209
|
-
if (kind && result)
|
|
7210
|
-
__defProp$5(target, key, result);
|
|
7230
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
7211
7231
|
return result;
|
|
7212
7232
|
};
|
|
7213
7233
|
let RelativeGrowthAdvantageComponent = class extends PreactLitAdapter {
|
|
@@ -7265,7 +7285,7 @@ __decorateClass$5([
|
|
|
7265
7285
|
RelativeGrowthAdvantageComponent = __decorateClass$5([
|
|
7266
7286
|
t$2("gs-relative-growth-advantage")
|
|
7267
7287
|
], RelativeGrowthAdvantageComponent);
|
|
7268
|
-
const AggregateTable = ({ data, fields }) => {
|
|
7288
|
+
const AggregateTable = ({ data, fields, pageSize }) => {
|
|
7269
7289
|
const headers = [
|
|
7270
7290
|
...fields.map((field) => {
|
|
7271
7291
|
return {
|
|
@@ -7283,11 +7303,26 @@ const AggregateTable = ({ data, fields }) => {
|
|
|
7283
7303
|
formatter: (cell) => formatProportion(cell)
|
|
7284
7304
|
}
|
|
7285
7305
|
];
|
|
7286
|
-
return /* @__PURE__ */ u$1(Table, { data, columns: headers,
|
|
7306
|
+
return /* @__PURE__ */ u$1(Table, { data, columns: headers, pageSize });
|
|
7307
|
+
};
|
|
7308
|
+
const compareAscending = (a2, b3) => {
|
|
7309
|
+
if (typeof a2 === "number" && typeof b3 === "number") {
|
|
7310
|
+
return a2 - b3;
|
|
7311
|
+
}
|
|
7312
|
+
const strA = a2 != null ? String(a2) : "";
|
|
7313
|
+
const strB = b3 != null ? String(b3) : "";
|
|
7314
|
+
return strA.localeCompare(strB);
|
|
7287
7315
|
};
|
|
7288
|
-
async function queryAggregateData(variant, fields, lapis, signal) {
|
|
7316
|
+
async function queryAggregateData(variant, fields, lapis, initialSort = { field: "count", direction: "descending" }, signal) {
|
|
7317
|
+
const validSortFields = ["count", "proportion", ...fields];
|
|
7318
|
+
if (!validSortFields.includes(initialSort.field)) {
|
|
7319
|
+
throw new Error(`InitialSort field not in fields. Valid fields are: ${validSortFields.join(", ")}`);
|
|
7320
|
+
}
|
|
7289
7321
|
const fetchData = new FetchAggregatedOperator(variant, fields);
|
|
7290
|
-
const
|
|
7322
|
+
const sortData = new SortOperator(fetchData, (a2, b3) => {
|
|
7323
|
+
return initialSort.direction === "ascending" ? compareAscending(a2[initialSort.field], b3[initialSort.field]) : compareAscending(b3[initialSort.field], a2[initialSort.field]);
|
|
7324
|
+
});
|
|
7325
|
+
const data = (await sortData.evaluate(lapis, signal)).content;
|
|
7291
7326
|
const total = data.reduce((acc, row) => acc + row.count, 0);
|
|
7292
7327
|
return data.map(
|
|
7293
7328
|
(row) => ({
|
|
@@ -7302,15 +7337,35 @@ const Aggregate = ({
|
|
|
7302
7337
|
height,
|
|
7303
7338
|
headline = "Mutations",
|
|
7304
7339
|
filter,
|
|
7305
|
-
fields
|
|
7340
|
+
fields,
|
|
7341
|
+
pageSize,
|
|
7342
|
+
initialSortField,
|
|
7343
|
+
initialSortDirection
|
|
7306
7344
|
}) => {
|
|
7307
7345
|
const size2 = { height, width };
|
|
7308
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
7346
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, headline, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(Headline, { heading: headline, children: /* @__PURE__ */ u$1(
|
|
7347
|
+
AggregateInner,
|
|
7348
|
+
{
|
|
7349
|
+
fields,
|
|
7350
|
+
filter,
|
|
7351
|
+
views,
|
|
7352
|
+
initialSortField,
|
|
7353
|
+
initialSortDirection,
|
|
7354
|
+
pageSize
|
|
7355
|
+
}
|
|
7356
|
+
) }) }) });
|
|
7309
7357
|
};
|
|
7310
|
-
const AggregateInner = ({
|
|
7358
|
+
const AggregateInner = ({
|
|
7359
|
+
fields,
|
|
7360
|
+
views,
|
|
7361
|
+
filter,
|
|
7362
|
+
initialSortField,
|
|
7363
|
+
initialSortDirection,
|
|
7364
|
+
pageSize
|
|
7365
|
+
}) => {
|
|
7311
7366
|
const lapis = P(LapisUrlContext);
|
|
7312
7367
|
const { data, error, isLoading } = useQuery(async () => {
|
|
7313
|
-
return queryAggregateData(filter, fields, lapis);
|
|
7368
|
+
return queryAggregateData(filter, fields, lapis, { field: initialSortField, direction: initialSortDirection });
|
|
7314
7369
|
}, [filter, fields, lapis]);
|
|
7315
7370
|
if (isLoading) {
|
|
7316
7371
|
return /* @__PURE__ */ u$1(LoadingDisplay, {});
|
|
@@ -7321,15 +7376,15 @@ const AggregateInner = ({ fields, views, filter }) => {
|
|
|
7321
7376
|
if (data === null) {
|
|
7322
7377
|
return /* @__PURE__ */ u$1(NoDataDisplay, {});
|
|
7323
7378
|
}
|
|
7324
|
-
return /* @__PURE__ */ u$1(AggregatedDataTabs, { data, views, fields });
|
|
7379
|
+
return /* @__PURE__ */ u$1(AggregatedDataTabs, { data, views, fields, pageSize });
|
|
7325
7380
|
};
|
|
7326
|
-
const AggregatedDataTabs = ({ data, views, fields }) => {
|
|
7381
|
+
const AggregatedDataTabs = ({ data, views, fields, pageSize }) => {
|
|
7327
7382
|
const getTab = (view) => {
|
|
7328
7383
|
switch (view) {
|
|
7329
7384
|
case "table":
|
|
7330
7385
|
return {
|
|
7331
7386
|
title: "Table",
|
|
7332
|
-
content: /* @__PURE__ */ u$1(AggregateTable, { data, fields })
|
|
7387
|
+
content: /* @__PURE__ */ u$1(AggregateTable, { data, fields, pageSize })
|
|
7333
7388
|
};
|
|
7334
7389
|
}
|
|
7335
7390
|
};
|
|
@@ -7349,8 +7404,7 @@ var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
|
7349
7404
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
7350
7405
|
if (decorator = decorators[i2])
|
|
7351
7406
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7352
|
-
if (kind && result)
|
|
7353
|
-
__defProp$4(target, key, result);
|
|
7407
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
7354
7408
|
return result;
|
|
7355
7409
|
};
|
|
7356
7410
|
let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
@@ -7362,6 +7416,9 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
|
7362
7416
|
this.width = "100%";
|
|
7363
7417
|
this.height = "700px";
|
|
7364
7418
|
this.headline = "Aggregate";
|
|
7419
|
+
this.initialSortField = "count";
|
|
7420
|
+
this.initialSortDirection = "descending";
|
|
7421
|
+
this.pageSize = false;
|
|
7365
7422
|
}
|
|
7366
7423
|
render() {
|
|
7367
7424
|
return /* @__PURE__ */ u$1(
|
|
@@ -7372,7 +7429,10 @@ let AggregateComponent = class extends PreactLitAdapterWithGridJsStyles {
|
|
|
7372
7429
|
filter: this.filter,
|
|
7373
7430
|
width: this.width,
|
|
7374
7431
|
height: this.height,
|
|
7375
|
-
headline: this.headline
|
|
7432
|
+
headline: this.headline,
|
|
7433
|
+
initialSortField: this.initialSortField,
|
|
7434
|
+
initialSortDirection: this.initialSortDirection,
|
|
7435
|
+
pageSize: this.pageSize
|
|
7376
7436
|
}
|
|
7377
7437
|
);
|
|
7378
7438
|
}
|
|
@@ -7395,6 +7455,15 @@ __decorateClass$4([
|
|
|
7395
7455
|
__decorateClass$4([
|
|
7396
7456
|
n2({ type: String })
|
|
7397
7457
|
], AggregateComponent.prototype, "headline", 2);
|
|
7458
|
+
__decorateClass$4([
|
|
7459
|
+
n2({ type: String })
|
|
7460
|
+
], AggregateComponent.prototype, "initialSortField", 2);
|
|
7461
|
+
__decorateClass$4([
|
|
7462
|
+
n2({ type: String })
|
|
7463
|
+
], AggregateComponent.prototype, "initialSortDirection", 2);
|
|
7464
|
+
__decorateClass$4([
|
|
7465
|
+
n2({ type: Object })
|
|
7466
|
+
], AggregateComponent.prototype, "pageSize", 2);
|
|
7398
7467
|
AggregateComponent = __decorateClass$4([
|
|
7399
7468
|
t$2("gs-aggregate")
|
|
7400
7469
|
], AggregateComponent);
|
|
@@ -7682,8 +7751,7 @@ var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
|
7682
7751
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
7683
7752
|
if (decorator = decorators[i2])
|
|
7684
7753
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7685
|
-
if (kind && result)
|
|
7686
|
-
__defProp$3(target, key, result);
|
|
7754
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
7687
7755
|
return result;
|
|
7688
7756
|
};
|
|
7689
7757
|
let DateRangeSelectorComponent = class extends PreactLitAdapter {
|
|
@@ -7779,11 +7847,16 @@ function compareLocationEntries(fields) {
|
|
|
7779
7847
|
return 0;
|
|
7780
7848
|
};
|
|
7781
7849
|
}
|
|
7782
|
-
const LocationFilter = ({
|
|
7850
|
+
const LocationFilter = ({
|
|
7851
|
+
width,
|
|
7852
|
+
initialValue,
|
|
7853
|
+
fields,
|
|
7854
|
+
placeholderText
|
|
7855
|
+
}) => {
|
|
7783
7856
|
const size2 = { width, height: "3rem" };
|
|
7784
|
-
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(LocationFilterInner, { initialValue, fields }) }) });
|
|
7857
|
+
return /* @__PURE__ */ u$1(ErrorBoundary, { size: size2, children: /* @__PURE__ */ u$1(ResizeContainer, { size: size2, children: /* @__PURE__ */ u$1(LocationFilterInner, { initialValue, fields, placeholderText }) }) });
|
|
7785
7858
|
};
|
|
7786
|
-
const LocationFilterInner = ({ initialValue, fields }) => {
|
|
7859
|
+
const LocationFilterInner = ({ initialValue, fields, placeholderText }) => {
|
|
7787
7860
|
const lapis = P(LapisUrlContext);
|
|
7788
7861
|
const [value, setValue] = p(initialValue ?? "");
|
|
7789
7862
|
const [unknownLocation, setUnknownLocation] = p(false);
|
|
@@ -7824,7 +7897,8 @@ const LocationFilterInner = ({ initialValue, fields }) => {
|
|
|
7824
7897
|
class: `input input-bordered grow ${unknownLocation ? "border-2 border-error" : ""}`,
|
|
7825
7898
|
value,
|
|
7826
7899
|
onInput,
|
|
7827
|
-
list: "countries"
|
|
7900
|
+
list: "countries",
|
|
7901
|
+
placeholder: placeholderText
|
|
7828
7902
|
}
|
|
7829
7903
|
),
|
|
7830
7904
|
/* @__PURE__ */ u$1("datalist", { id: "countries", children: data == null ? void 0 : data.map((v2) => {
|
|
@@ -7855,8 +7929,7 @@ var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
|
7855
7929
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
7856
7930
|
if (decorator = decorators[i2])
|
|
7857
7931
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7858
|
-
if (kind && result)
|
|
7859
|
-
__defProp$2(target, key, result);
|
|
7932
|
+
if (kind && result) __defProp$2(target, key, result);
|
|
7860
7933
|
return result;
|
|
7861
7934
|
};
|
|
7862
7935
|
let LocationFilterComponent = class extends PreactLitAdapter {
|
|
@@ -7865,9 +7938,18 @@ let LocationFilterComponent = class extends PreactLitAdapter {
|
|
|
7865
7938
|
this.initialValue = "";
|
|
7866
7939
|
this.fields = [];
|
|
7867
7940
|
this.width = "100%";
|
|
7941
|
+
this.placeholderText = "";
|
|
7868
7942
|
}
|
|
7869
7943
|
render() {
|
|
7870
|
-
return /* @__PURE__ */ u$1(
|
|
7944
|
+
return /* @__PURE__ */ u$1(
|
|
7945
|
+
LocationFilter,
|
|
7946
|
+
{
|
|
7947
|
+
initialValue: this.initialValue,
|
|
7948
|
+
fields: this.fields,
|
|
7949
|
+
width: this.width,
|
|
7950
|
+
placeholderText: this.placeholderText
|
|
7951
|
+
}
|
|
7952
|
+
);
|
|
7871
7953
|
}
|
|
7872
7954
|
};
|
|
7873
7955
|
__decorateClass$2([
|
|
@@ -7879,6 +7961,9 @@ __decorateClass$2([
|
|
|
7879
7961
|
__decorateClass$2([
|
|
7880
7962
|
n2({ type: String })
|
|
7881
7963
|
], LocationFilterComponent.prototype, "width", 2);
|
|
7964
|
+
__decorateClass$2([
|
|
7965
|
+
n2()
|
|
7966
|
+
], LocationFilterComponent.prototype, "placeholderText", 2);
|
|
7882
7967
|
LocationFilterComponent = __decorateClass$2([
|
|
7883
7968
|
t$2("gs-location-filter")
|
|
7884
7969
|
], LocationFilterComponent);
|
|
@@ -7950,8 +8035,7 @@ var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
|
7950
8035
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
7951
8036
|
if (decorator = decorators[i2])
|
|
7952
8037
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
7953
|
-
if (kind && result)
|
|
7954
|
-
__defProp$1(target, key, result);
|
|
8038
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
7955
8039
|
return result;
|
|
7956
8040
|
};
|
|
7957
8041
|
let TextInputComponent = class extends PreactLitAdapter {
|
|
@@ -8317,8 +8401,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
8317
8401
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
8318
8402
|
if (decorator = decorators[i2])
|
|
8319
8403
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8320
|
-
if (kind && result)
|
|
8321
|
-
__defProp(target, key, result);
|
|
8404
|
+
if (kind && result) __defProp(target, key, result);
|
|
8322
8405
|
return result;
|
|
8323
8406
|
};
|
|
8324
8407
|
let MutationFilterComponent = class extends PreactLitAdapter {
|