@milaboratories/miplots4 1.0.174 → 1.0.175

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.
Files changed (98) hide show
  1. package/dist/DataFrame.d.ts +1 -1
  2. package/dist/DataFrame.d.ts.map +1 -1
  3. package/dist/DataFrame.js +52 -51
  4. package/dist/DataFrame.js.map +1 -1
  5. package/dist/bubble/BubbleSettingsImpl.d.ts +3 -0
  6. package/dist/bubble/BubbleSettingsImpl.d.ts.map +1 -1
  7. package/dist/bubble/BubbleSettingsImpl.js +16 -16
  8. package/dist/bubble/BubbleSettingsImpl.js.map +1 -1
  9. package/dist/bubble/getGroupedCellsData.d.ts +1 -1
  10. package/dist/bubble/getGroupedCellsData.d.ts.map +1 -1
  11. package/dist/bubble/getGroupedCellsData.js +12 -11
  12. package/dist/bubble/getGroupedCellsData.js.map +1 -1
  13. package/dist/bubble/index.d.ts.map +1 -1
  14. package/dist/bubble/index.js +61 -69
  15. package/dist/bubble/index.js.map +1 -1
  16. package/dist/constants.js +9 -11
  17. package/dist/constants.js.map +1 -1
  18. package/dist/discrete/DiscreteSettingsImpl.d.ts +2 -1
  19. package/dist/discrete/DiscreteSettingsImpl.d.ts.map +1 -1
  20. package/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
  21. package/dist/discrete/index.d.ts.map +1 -1
  22. package/dist/discrete/index.js +137 -157
  23. package/dist/discrete/index.js.map +1 -1
  24. package/dist/heatmap/HeatmapSettingsImpl.d.ts +1 -0
  25. package/dist/heatmap/HeatmapSettingsImpl.d.ts.map +1 -1
  26. package/dist/heatmap/HeatmapSettingsImpl.js +29 -28
  27. package/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
  28. package/dist/heatmap/fillCellsData.d.ts +1 -1
  29. package/dist/heatmap/fillCellsData.d.ts.map +1 -1
  30. package/dist/heatmap/fillCellsData.js +172 -160
  31. package/dist/heatmap/fillCellsData.js.map +1 -1
  32. package/dist/heatmap/getCells.d.ts +1 -1
  33. package/dist/heatmap/getCells.d.ts.map +1 -1
  34. package/dist/heatmap/getCells.js +10 -9
  35. package/dist/heatmap/getCells.js.map +1 -1
  36. package/dist/heatmap/index.d.ts.map +1 -1
  37. package/dist/heatmap/index.js +95 -102
  38. package/dist/heatmap/index.js.map +1 -1
  39. package/dist/histogram/HistogramSettingsImpl.d.ts +1 -0
  40. package/dist/histogram/HistogramSettingsImpl.d.ts.map +1 -1
  41. package/dist/histogram/HistogramSettingsImpl.js +43 -43
  42. package/dist/histogram/HistogramSettingsImpl.js.map +1 -1
  43. package/dist/histogram/getHistogramData.d.ts +2 -2
  44. package/dist/histogram/getHistogramData.d.ts.map +1 -1
  45. package/dist/histogram/getHistogramData.js +47 -46
  46. package/dist/histogram/getHistogramData.js.map +1 -1
  47. package/dist/histogram/index.d.ts +0 -1
  48. package/dist/histogram/index.d.ts.map +1 -1
  49. package/dist/histogram/index.js +88 -89
  50. package/dist/histogram/index.js.map +1 -1
  51. package/dist/index.d.ts +3 -1
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +8 -4
  54. package/dist/index.js.map +1 -1
  55. package/dist/scatterplot/ScatterplotSettingsImpl.d.ts +2 -0
  56. package/dist/scatterplot/ScatterplotSettingsImpl.d.ts.map +1 -1
  57. package/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
  58. package/dist/scatterplot/dots.d.ts +2 -2
  59. package/dist/scatterplot/dots.d.ts.map +1 -1
  60. package/dist/scatterplot/dots.js +17 -16
  61. package/dist/scatterplot/dots.js.map +1 -1
  62. package/dist/scatterplot/index.d.ts +0 -1
  63. package/dist/scatterplot/index.d.ts.map +1 -1
  64. package/dist/scatterplot/index.js +92 -101
  65. package/dist/scatterplot/index.js.map +1 -1
  66. package/dist/scatterplot/utils/createLegendInfo.d.ts.map +1 -1
  67. package/dist/scatterplot/utils/createLegendInfo.js +1 -1
  68. package/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
  69. package/dist/types/bubble.d.ts +5 -0
  70. package/dist/types/bubble.d.ts.map +1 -1
  71. package/dist/types/bubble.js +19 -18
  72. package/dist/types/bubble.js.map +1 -1
  73. package/dist/types/dendro.d.ts +5 -0
  74. package/dist/types/dendro.d.ts.map +1 -1
  75. package/dist/types/dendro.js +10 -9
  76. package/dist/types/dendro.js.map +1 -1
  77. package/dist/types/discrete.d.ts +8 -5
  78. package/dist/types/discrete.d.ts.map +1 -1
  79. package/dist/types/discrete.js +12 -11
  80. package/dist/types/discrete.js.map +1 -1
  81. package/dist/types/heatmap.d.ts +5 -0
  82. package/dist/types/heatmap.d.ts.map +1 -1
  83. package/dist/types/heatmap.js +2 -1
  84. package/dist/types/heatmap.js.map +1 -1
  85. package/dist/types/histogram.d.ts +5 -0
  86. package/dist/types/histogram.d.ts.map +1 -1
  87. package/dist/types/histogram.js +43 -42
  88. package/dist/types/histogram.js.map +1 -1
  89. package/dist/types/scatterplot.d.ts +6 -0
  90. package/dist/types/scatterplot.d.ts.map +1 -1
  91. package/dist/types/scatterplot.js +21 -19
  92. package/dist/types/scatterplot.js.map +1 -1
  93. package/dist/utils/getFacetKeysFromValueLists.d.ts +6 -0
  94. package/dist/utils/getFacetKeysFromValueLists.d.ts.map +1 -0
  95. package/dist/utils/getFacetKeysFromValueLists.js +9 -0
  96. package/dist/utils/getFacetKeysFromValueLists.js.map +1 -0
  97. package/dist/utils/getPointShape.d.ts +1 -1
  98. package/package.json +1 -1
@@ -1,250 +1,262 @@
1
1
  import b from "../_virtual/lodash.js";
2
- import { exhaustive as te } from "../utils/index.js";
3
- import { getFacetOrGroupKey as A } from "../utils/getFacetOrGroupKey.js";
4
- import { getFacetLabels as oe } from "../discrete/utils/getFacetLabels.js";
5
- import ne from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/sum.js";
2
+ import { exhaustive as se } from "../utils/index.js";
3
+ import { getFacetOrGroupKey as I } from "../utils/getFacetOrGroupKey.js";
4
+ import { getFacetLabels as ce } from "../discrete/utils/getFacetLabels.js";
5
+ import { getFacetStringKey as ue } from "../discrete/utils/getFacetStringKey.js";
6
+ import ie from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/sum.js";
6
7
  import U from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/mean.js";
7
- import { quantileSorted as se } from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/quantile.js";
8
- import ce from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/deviation.js";
9
- import ue from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/extent.js";
10
- function ie(e) {
11
- const t = ce(e), o = U(e);
12
- return t === void 0 || o === void 0 || t === 0 ? (n) => n : (n) => (n - o) / t;
8
+ import { quantileSorted as le } from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/quantile.js";
9
+ import me from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/deviation.js";
10
+ import fe from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/extent.js";
11
+ function re(e) {
12
+ const o = me(e), t = U(e);
13
+ return o === void 0 || t === void 0 || o === 0 ? (s) => s : (s) => (s - t) / o;
13
14
  }
14
- function le(e) {
15
- const t = U(e), [o, n] = ue(e);
16
- return t === void 0 || o === void 0 || n === void 0 || n === o ? (u) => u : (u) => (u - t) / (n - o);
15
+ function ye(e) {
16
+ const o = U(e), [t, s] = fe(e);
17
+ return o === void 0 || t === void 0 || s === void 0 || s === t ? (u) => u : (u) => (u - o) / (s - t);
17
18
  }
18
- function fe(e, t) {
19
- return e === "standardScaling" ? ie(t) : e === "meanNormalization" ? le(t) : (o) => o;
19
+ function ve(e, o) {
20
+ return e === "standardScaling" ? re(o) : e === "meanNormalization" ? ye(o) : (t) => t;
20
21
  }
21
- function _(e, t) {
22
+ function _(e, o) {
22
23
  switch (e) {
23
24
  case "max": {
24
- let o = t[0];
25
- for (const n of t)
26
- o = Math.max(o, n);
27
- return o;
25
+ let t = o[0];
26
+ for (const s of o)
27
+ t = Math.max(t, s);
28
+ return t;
28
29
  }
29
30
  case "min": {
30
- let o = t[0];
31
- for (const n of t)
32
- o = Math.min(o, n);
33
- return o;
31
+ let t = o[0];
32
+ for (const s of o)
33
+ t = Math.min(t, s);
34
+ return t;
34
35
  }
35
36
  case "median": {
36
- const o = t.sort((n, u) => n - u);
37
- return se(o, 0.5);
37
+ const t = o.sort((s, u) => s - u);
38
+ return le(t, 0.5);
38
39
  }
39
40
  case "mean":
40
- return U(t) ?? t[0];
41
+ return U(o) ?? o[0];
41
42
  case "sum":
42
- return ne(t);
43
+ return ie(o);
43
44
  default:
44
- te(e, `Unknown aggregation function ${e}`);
45
+ se(e, `Unknown aggregation function ${e}`);
45
46
  }
46
47
  }
47
- function T(e) {
48
- const t = [...new Set(e)].sort();
49
- return t.length > 3 ? [...t.slice(0, 3), "..."].join(", ") : t.join(", ");
48
+ function O(e) {
49
+ const o = [...new Set(e)].sort();
50
+ return o.length > 3 ? [...o.slice(0, 3), "..."].join(", ") : o.join(", ");
50
51
  }
51
52
  function R(e) {
52
53
  if (!e.length)
53
54
  return [];
54
- let t = [[]];
55
- return e.forEach((o) => {
56
- const n = [];
57
- o.forEach((u) => {
58
- n.push(...t.map((d) => [...d, u]));
59
- }), t = n;
60
- }), t;
55
+ let o = [[]];
56
+ return e.forEach((t) => {
57
+ const s = [];
58
+ t.forEach((u) => {
59
+ s.push(...o.map((d) => [...d, u]));
60
+ }), o = s;
61
+ }), o;
61
62
  }
62
- const W = (e, t, o = {}) => e.sort(
63
- (n, u) => t === "asc" ? (o[n] ?? n).localeCompare(o[u] ?? u, "en", { numeric: !0 }) : (o[u] ?? u).localeCompare(o[n] ?? n, "en", { numeric: !0 })
63
+ const k = (e, o, t = {}) => e.sort(
64
+ (s, u) => o === "asc" ? (t[s] ?? s).localeCompare(t[u] ?? u, "en", { numeric: !0 }) : (t[u] ?? u).localeCompare(t[s] ?? s, "en", { numeric: !0 })
64
65
  );
65
- function me(e, t, o, n, u) {
66
- if (t.x || t.y) {
67
- const d = e.meta.valueSources.reduce((m, v) => (m[v] = [1 / 0, -1 / 0], m), {});
68
- e.meta.facetKeys.forEach((m) => {
69
- var G, D;
70
- const { xKeys: v, yKeys: S, cells: w, xKeysByGroups: q, yKeysByGroups: $ } = e.facets[m], V = t.x ? q : v.reduce((i, l) => (i[l] = [l], i), {}), y = t.y ? $ : S.reduce((i, l) => (i[l] = [l], i), {}), L = Object.keys(V), z = Object.keys(y);
71
- for (const i of L)
72
- for (const l of z) {
73
- const C = e.meta.valueSources.reduce((f, K) => (f[K] = [], f), {});
74
- V[i].forEach((f) => {
75
- y[l].forEach((K) => {
76
- var r, B, E, M;
77
- for (const I of e.meta.valueSources) {
78
- const X = (E = (B = (r = w[f]) == null ? void 0 : r[K]) == null ? void 0 : B.value) == null ? void 0 : E[I];
79
- X !== void 0 && C[I].push(X);
66
+ function pe(e, o, t, s, u) {
67
+ if (o.x || o.y) {
68
+ const d = e.meta.valueSources.reduce((f, y) => (f[y] = [1 / 0, -1 / 0], f), {});
69
+ e.meta.facetKeys.forEach((f) => {
70
+ var G, B;
71
+ const { xKeys: y, yKeys: V, cells: z, xKeysByGroups: q, yKeysByGroups: $ } = e.facets[f], L = o.x ? q : y.reduce((i, l) => (i[l] = [l], i), {}), E = o.y ? $ : V.reduce((i, l) => (i[l] = [l], i), {}), r = Object.keys(L), M = Object.keys(E);
72
+ for (const i of r)
73
+ for (const l of M) {
74
+ const g = e.meta.valueSources.reduce((m, K) => (m[K] = [], m), {});
75
+ L[i].forEach((m) => {
76
+ E[l].forEach((K) => {
77
+ var v, C, D, w;
78
+ for (const A of e.meta.valueSources) {
79
+ const F = (D = (C = (v = z[m]) == null ? void 0 : v[K]) == null ? void 0 : C.value) == null ? void 0 : D[A];
80
+ F !== void 0 && g[A].push(F);
80
81
  }
81
- (M = w[f]) == null || delete M[K];
82
+ (w = z[m]) == null || delete w[K];
82
83
  });
83
84
  });
84
- for (const f of e.meta.valueSources) {
85
- const K = C[f];
85
+ for (const m of e.meta.valueSources) {
86
+ const K = g[m];
86
87
  if (K.length > 0) {
87
- const r = _(t.method, K);
88
- e.facets[m].cells[i] || (e.facets[m].cells[i] = {}), e.facets[m].cells[i][l] || (e.facets[m].cells[i][l] = {
88
+ const v = _(o.method, K);
89
+ e.facets[f].cells[i] || (e.facets[f].cells[i] = {}), e.facets[f].cells[i][l] || (e.facets[f].cells[i][l] = {
89
90
  isCell: !0,
90
91
  idx: 0,
91
92
  id: `${i}_${l}`,
92
93
  x: i,
93
94
  y: l,
94
- value: e.meta.valueSources.reduce((E, M) => (E[M] = null, E), {}),
95
- normalizedValue: e.meta.valueSources.reduce((E, M) => (E[M] = null, E), {})
95
+ value: e.meta.valueSources.reduce((D, w) => (D[w] = null, D), {}),
96
+ normalizedValue: e.meta.valueSources.reduce((D, w) => (D[w] = null, D), {})
96
97
  });
97
- const B = e.facets[m].cells[i][l];
98
- B.value[f] = r, B.normalizedValue[f] = r, d[f][0] = Math.min((G = B.normalizedValue) == null ? void 0 : G[f], d[f][0]), d[f][1] = Math.max((D = B.normalizedValue) == null ? void 0 : D[f], d[f][1]);
98
+ const C = e.facets[f].cells[i][l];
99
+ C.value[m] = v, C.normalizedValue[m] = v, d[m][0] = Math.min((G = C.normalizedValue) == null ? void 0 : G[m], d[m][0]), d[m][1] = Math.max((B = C.normalizedValue) == null ? void 0 : B[m], d[m][1]);
99
100
  }
100
101
  }
101
102
  }
102
- t.x && L.forEach((i) => {
103
- o.forEach((l) => {
104
- const C = u.find((r) => r.valueColumn.value === l || r.valueColumn.valueLabels === l);
105
- if (!C)
103
+ o.x && r.forEach((i) => {
104
+ t.forEach((l) => {
105
+ const g = u.find((v) => v.valueColumn.value === l || v.valueColumn.valueLabels === l);
106
+ if (!g)
106
107
  return;
107
- const f = [];
108
- V[i].forEach((r) => {
109
- f.push(e.meta.xDataByKeys[l][r]), delete e.meta.xDataByKeys[l][r];
108
+ const m = [];
109
+ L[i].forEach((v) => {
110
+ m.push(e.meta.xDataByKeys[l][v]), delete e.meta.xDataByKeys[l][v];
110
111
  });
111
- const K = C.type === "continuous" ? _(t.method, f) : T(f);
112
+ const K = g.type === "continuous" ? _(o.method, m) : O(m);
112
113
  e.meta.xDataByKeys[l][i] = K;
113
114
  });
114
- }), t.y && (n.forEach((i) => {
115
+ }), o.y && (s.forEach((i) => {
115
116
  e.meta.yDataByKeys[i] = {};
116
- }), z.forEach((i) => {
117
- n.forEach((l) => {
118
- const C = u.find((r) => r.valueColumn.value === l || r.valueColumn.valueLabels === l);
119
- if (!C)
117
+ }), M.forEach((i) => {
118
+ s.forEach((l) => {
119
+ const g = u.find((v) => v.valueColumn.value === l || v.valueColumn.valueLabels === l);
120
+ if (!g)
120
121
  return;
121
- const f = [];
122
- y[i].forEach((r) => {
123
- f.push(e.meta.yDataByKeys[l][r]), delete e.meta.yDataByKeys[l][r];
122
+ const m = [];
123
+ E[i].forEach((v) => {
124
+ m.push(e.meta.yDataByKeys[l][v]), delete e.meta.yDataByKeys[l][v];
124
125
  });
125
- const K = C.type === "continuous" ? _(t.method, f) : T(f);
126
+ const K = g.type === "continuous" ? _(o.method, m) : O(m);
126
127
  e.meta.yDataByKeys[l][i] = K;
127
128
  });
128
- })), t.x && (e.facets[m].xKeys = Object.keys(q), e.facets[m].xKeysByGroups = { null: e.facets[m].xKeys }, e.meta.xLabels = e.meta.xGroupLabels, e.meta.xGroupKeys = ["null"], e.meta.xGroupKeyValues = { null: ["null"] }), t.y && (e.facets[m].yKeys = Object.keys($), e.facets[m].yKeysByGroups = { null: e.facets[m].yKeys }, e.meta.yLabels = e.meta.yGroupLabels, e.meta.yGroupKeys = ["null"], e.meta.yGroupKeyValues = { null: ["null"] });
129
+ })), o.x && (e.facets[f].xKeys = Object.keys(q), e.facets[f].xKeysByGroups = { null: e.facets[f].xKeys }, e.meta.xLabels = e.meta.xGroupLabels, e.meta.xGroupKeys = ["null"], e.meta.xGroupKeyValues = { null: ["null"] }), o.y && (e.facets[f].yKeys = Object.keys($), e.facets[f].yKeysByGroups = { null: e.facets[f].yKeys }, e.meta.yLabels = e.meta.yGroupLabels, e.meta.yGroupKeys = ["null"], e.meta.yGroupKeyValues = { null: ["null"] });
129
130
  }), e.meta.valueExtent = d;
130
131
  }
131
132
  }
132
- function ye(e, t) {
133
- var o, n;
133
+ function xe(e, o) {
134
+ var t, s;
134
135
  for (const u of e.meta.valueSources)
135
- e.meta.valueExtent[u][0] = Math.min((o = t.normalizedValue) == null ? void 0 : o[u], e.meta.valueExtent[u][0]), e.meta.valueExtent[u][1] = Math.max((n = t.normalizedValue) == null ? void 0 : n[u], e.meta.valueExtent[u][1]);
136
+ e.meta.valueExtent[u][0] = Math.min((t = o.normalizedValue) == null ? void 0 : t[u], e.meta.valueExtent[u][0]), e.meta.valueExtent[u][1] = Math.max((s = o.normalizedValue) == null ? void 0 : s[u], e.meta.valueExtent[u][1]);
136
137
  }
137
- function re(e, t) {
138
- if (Object.values(t).length) {
139
- const o = e.meta.valueSources.reduce((n, u) => (t[u] && (n[u] = [1 / 0, -1 / 0]), n), {});
140
- e.meta.facetKeys.forEach((n) => {
141
- const { xKeys: u, yKeys: d, cells: m } = e.facets[n];
142
- for (const v of e.meta.valueSources) {
143
- const S = t[v];
144
- if (!S)
138
+ function he(e, o) {
139
+ if (Object.values(o).length) {
140
+ const t = e.meta.valueSources.reduce((s, u) => (o[u] && (s[u] = [1 / 0, -1 / 0]), s), {});
141
+ e.meta.facetKeys.forEach((s) => {
142
+ const { xKeys: u, yKeys: d, cells: f } = e.facets[s];
143
+ for (const y of e.meta.valueSources) {
144
+ const V = o[y];
145
+ if (!V)
145
146
  continue;
146
- const w = S.direction === "row" ? u : d, q = S.direction === "row" ? d : u, $ = S.direction === "row" ? (V, y) => {
147
- var L;
148
- return (L = m[V]) == null ? void 0 : L[y];
149
- } : (V, y) => {
150
- var L;
151
- return (L = m[y]) == null ? void 0 : L[V];
147
+ const z = V.direction === "row" ? u : d, q = V.direction === "row" ? d : u, $ = V.direction === "row" ? (L, E) => {
148
+ var r;
149
+ return (r = f[L]) == null ? void 0 : r[E];
150
+ } : (L, E) => {
151
+ var r;
152
+ return (r = f[E]) == null ? void 0 : r[L];
152
153
  };
153
- q.forEach((V) => {
154
- const y = [];
155
- w.forEach((z) => {
156
- var D, i;
157
- const G = (i = (D = $(z, V)) == null ? void 0 : D.value) == null ? void 0 : i[v];
158
- G !== void 0 && y.push(G);
154
+ q.forEach((L) => {
155
+ const E = [];
156
+ z.forEach((M) => {
157
+ var B, i;
158
+ const G = (i = (B = $(M, L)) == null ? void 0 : B.value) == null ? void 0 : i[y];
159
+ G !== void 0 && E.push(G);
159
160
  });
160
- const L = fe(S.method, y);
161
- w.forEach((z) => {
162
- var D, i, l;
163
- const G = $(z, V);
164
- G !== void 0 && (G.normalizedValue[v] = L((D = G.value) == null ? void 0 : D[v]), o[v][0] = Math.min((i = G.normalizedValue) == null ? void 0 : i[v], o[v][0]), o[v][1] = Math.max((l = G.normalizedValue) == null ? void 0 : l[v], o[v][1]));
161
+ const r = ve(V.method, E);
162
+ z.forEach((M) => {
163
+ var B, i, l;
164
+ const G = $(M, L);
165
+ G !== void 0 && (G.normalizedValue[y] = r((B = G.value) == null ? void 0 : B[y]), t[y][0] = Math.min((i = G.normalizedValue) == null ? void 0 : i[y], t[y][0]), t[y][1] = Math.max((l = G.normalizedValue) == null ? void 0 : l[y], t[y][1]));
165
166
  });
166
167
  });
167
168
  }
168
- }), e.meta.valueExtent = { ...e.meta.valueExtent, valueExtent: o };
169
+ }), e.meta.valueExtent = { ...e.meta.valueExtent, valueExtent: t };
169
170
  }
170
171
  }
171
- function Le(e, t, o, n, u, d, m, v, S, w, q, $, V, y, L, z, G) {
172
- const D = d.length ? d.map((a) => y[a.value] ?? t.getColumnCategories(a.value)) : [["null"]], i = m.length ? m.map((a) => y[a.value] ?? t.getColumnCategories(a.value)) : [["null"]], l = v.length ? v.map((a) => y[a.value] ?? t.getColumnCategories(a.value)) : [["null"]], C = R(D), f = R(i), K = R(l), r = C.map(A), B = f.map(A), E = K.map(A);
173
- e.meta.facetKeys = r, e.meta.xGroupKeys = B, e.meta.yGroupKeys = E;
174
- const M = oe(t, d, r, C);
175
- e.meta.facetKeyValues = r.reduce((a, s) => (a[s] = M[s], a), {}), e.meta.xGroupKeyValues = B.reduce((a, s, h) => (a[s] = f[h], a), {}), e.meta.yGroupKeyValues = E.reduce((a, s, h) => (a[s] = K[h], a), {});
176
- const I = o.valueLabels ?? o.value, X = n.valueLabels ?? n.value, Z = S.filter((a) => a.axis === "x").map((a) => a.valueColumn.valueLabels ?? a.valueColumn.value), O = S.filter((a) => a.axis === "y").map((a) => a.valueColumn.valueLabels ?? a.valueColumn.value), k = Object.values(w ?? {}).map((a) => a.value), ee = Object.values(q ?? {}).map((a) => a.value), H = b.uniq([...Z, ...k, I]), J = b.uniq([...O, ...ee, X]);
177
- for (let a = 0; a < t.rowsCount; a++) {
178
- const s = A(d.map((c) => t.getColumnValue(c.value, a))), h = A(m.map((c) => t.getColumnValue(c.value, a))), g = A(v.map((c) => t.getColumnValue(c.value, a))), N = m.map((c) => t.getColumnValue(c.valueLabels ?? c.value, a)).join(", "), ae = v.map((c) => t.getColumnValue(c.valueLabels ?? c.value, a)).join(", ");
179
- e.meta.xGroupLabels[h] = N, e.meta.yGroupLabels[g] = ae;
180
- const p = String(t.getColumnValue(o.value, a)), x = String(t.getColumnValue(n.value, a)), F = e.meta.valueSources.reduce((c, j) => (c[j] = t.getColumnValue(u[j].value, a) ?? V, c), {});
181
- if (p === "null" || x === "null" || Object.values(F).every((c) => c === null))
172
+ function ge(e, o, t, s, u, d, f, y, V, z, q, $, L, E, r, M, G, B) {
173
+ var T;
174
+ const i = d.length ? d.map((a) => r[a.value] ?? o.getColumnCategories(a.value)) : [["null"]], l = f.length ? f.map((a) => r[a.value] ?? o.getColumnCategories(a.value)) : [["null"]], g = y.length ? y.map((a) => r[a.value] ?? o.getColumnCategories(a.value)) : [["null"]];
175
+ let m = R(i);
176
+ const K = R(l), v = R(g);
177
+ (T = V == null ? void 0 : V.order) != null && T.length && (m = m.filter((a) => {
178
+ var n;
179
+ return (n = V.order) == null ? void 0 : n.includes(ue(a));
180
+ }));
181
+ const C = m.map(I), D = new Set(C), w = K.map(I), A = v.map(I);
182
+ e.meta.facetKeys = C, e.meta.xGroupKeys = w, e.meta.yGroupKeys = A;
183
+ const F = ce(o, d, C, m);
184
+ e.meta.facetKeyValues = C.reduce((a, n) => (a[n] = F[n], a), {}), e.meta.xGroupKeyValues = w.reduce((a, n, h) => (a[n] = K[h], a), {}), e.meta.yGroupKeyValues = A.reduce((a, n, h) => (a[n] = v[h], a), {});
185
+ const H = t.valueLabels ?? t.value, J = s.valueLabels ?? s.value, ee = z.filter((a) => a.axis === "x").map((a) => a.valueColumn.valueLabels ?? a.valueColumn.value), ae = z.filter((a) => a.axis === "y").map((a) => a.valueColumn.valueLabels ?? a.valueColumn.value), oe = Object.values(q ?? {}).map((a) => a.value), te = Object.values($ ?? {}).map((a) => a.value), P = b.uniq([...ee, ...oe, H]), Q = b.uniq([...ae, ...te, J]);
186
+ for (let a = 0; a < o.rowsCount; a++) {
187
+ const n = I(d.map((c) => o.getColumnValue(c.value, a)));
188
+ if (!D.has(n))
182
189
  continue;
183
- e.facets[s] || (e.facets[s] = {
190
+ const h = I(f.map((c) => o.getColumnValue(c.value, a))), S = I(y.map((c) => o.getColumnValue(c.value, a))), N = f.map((c) => o.getColumnValue(c.valueLabels ?? c.value, a)).join(", "), ne = y.map((c) => o.getColumnValue(c.valueLabels ?? c.value, a)).join(", ");
191
+ e.meta.xGroupLabels[h] = N, e.meta.yGroupLabels[S] = ne;
192
+ const p = String(o.getColumnValue(t.value, a)), x = String(o.getColumnValue(s.value, a)), Y = e.meta.valueSources.reduce((c, j) => (c[j] = o.getColumnValue(u[j].value, a) ?? E, c), {});
193
+ if (p === "null" || x === "null" || Object.values(Y).every((c) => c === null))
194
+ continue;
195
+ e.facets[n] || (e.facets[n] = {
184
196
  xKeys: [],
185
197
  yKeys: [],
186
198
  xKeysByGroups: {},
187
199
  yKeysByGroups: {},
188
200
  cells: {}
189
- }), e.facets[s].xKeysByGroups[h] || (e.facets[s].xKeysByGroups[h] = []), e.facets[s].yKeysByGroups[g] || (e.facets[s].yKeysByGroups[g] = []), e.facets[s].xKeys.push(p), e.facets[s].yKeys.push(x), e.facets[s].xKeysByGroups[h].push(p), e.facets[s].yKeysByGroups[g].push(x), e.facets[s].cells[p] || (e.facets[s].cells[p] = {});
201
+ }), e.facets[n].xKeysByGroups[h] || (e.facets[n].xKeysByGroups[h] = []), e.facets[n].yKeysByGroups[S] || (e.facets[n].yKeysByGroups[S] = []), e.facets[n].xKeys.push(p), e.facets[n].yKeys.push(x), e.facets[n].xKeysByGroups[h].push(p), e.facets[n].yKeysByGroups[S].push(x), e.facets[n].cells[p] || (e.facets[n].cells[p] = {});
190
202
  for (const c of e.meta.valueSources)
191
- if (e.facets[s].cells[p][x] && e.facets[s].cells[p][x].value[c] !== F[c])
203
+ if (e.facets[n].cells[p][x] && e.facets[n].cells[p][x].value[c] !== Y[c])
192
204
  throw Error(`More than 1 value for x=${p}, y=${x}`);
193
- const P = t.getColumnValue(I, a);
194
- if (e.meta.xLabels[p] && String(P) !== e.meta.xLabels[p])
205
+ const W = o.getColumnValue(H, a);
206
+ if (e.meta.xLabels[p] && String(W) !== e.meta.xLabels[p])
195
207
  throw Error(`More than 1 x-label value for x=${p}`);
196
- const Q = t.getColumnValue(X, a);
197
- if (e.meta.yLabels[x] && String(Q) !== e.meta.yLabels[x])
208
+ const Z = o.getColumnValue(J, a);
209
+ if (e.meta.yLabels[x] && String(Z) !== e.meta.yLabels[x])
198
210
  throw Error(`More than 1 y-label value for y=${x}`);
199
- e.meta.xLabels[p] = String(P), e.meta.yLabels[x] = String(Q), H.forEach((c) => {
200
- const j = typeof e.meta.xDataByKeys[c] < "u", Y = j && typeof e.meta.xDataByKeys[c][p] < "u";
201
- if (j || (e.meta.xDataByKeys[c] = {}), Y && e.meta.xDataByKeys[c][p] !== t.getColumnValue(c, a))
211
+ e.meta.xLabels[p] = String(W), e.meta.yLabels[x] = String(Z), P.forEach((c) => {
212
+ const j = typeof e.meta.xDataByKeys[c] < "u", X = j && typeof e.meta.xDataByKeys[c][p] < "u";
213
+ if (j || (e.meta.xDataByKeys[c] = {}), X && e.meta.xDataByKeys[c][p] !== o.getColumnValue(c, a))
202
214
  throw Error(`More than 1 value for x = ${p} and column = ${c}`);
203
- Y || (e.meta.xDataByKeys[c][p] = t.getColumnValue(c, a));
204
- }), J.forEach((c) => {
205
- const j = typeof e.meta.yDataByKeys[c] < "u", Y = j && typeof e.meta.yDataByKeys[c][x] < "u";
206
- if (j || (e.meta.yDataByKeys[c] = {}), Y && e.meta.yDataByKeys[c][x] !== t.getColumnValue(c, a))
215
+ X || (e.meta.xDataByKeys[c][p] = o.getColumnValue(c, a));
216
+ }), Q.forEach((c) => {
217
+ const j = typeof e.meta.yDataByKeys[c] < "u", X = j && typeof e.meta.yDataByKeys[c][x] < "u";
218
+ if (j || (e.meta.yDataByKeys[c] = {}), X && e.meta.yDataByKeys[c][x] !== o.getColumnValue(c, a))
207
219
  throw Error(`More than 1 value for y = ${x} and column = ${c}`);
208
- Y || (e.meta.yDataByKeys[c][x] = t.getColumnValue(c, a));
209
- }), e.facets[s].cells[p][x] = {
220
+ X || (e.meta.yDataByKeys[c][x] = o.getColumnValue(c, a));
221
+ }), e.facets[n].cells[p][x] = {
210
222
  isCell: !0,
211
223
  idx: a,
212
224
  id: `${p}_${x}`,
213
225
  x: p,
214
226
  y: x,
215
- value: F,
216
- normalizedValue: F
217
- }, ye(e, e.facets[s].cells[p][x]);
227
+ value: Y,
228
+ normalizedValue: Y
229
+ }, xe(e, e.facets[n].cells[p][x]);
218
230
  }
219
231
  e.meta.facetKeys = e.meta.facetKeys.filter((a) => e.facets[a]), e.meta.facetKeys.forEach((a) => {
220
- const s = e.facets[a], h = b.uniq(s.xKeys), g = b.uniq(s.yKeys);
221
- s.xKeys = y[o.value] ? b.intersection(y[o.value], h) : h, s.yKeys = y[n.value] ? b.intersection(y[n.value], g) : g, B.forEach((N) => {
232
+ const n = e.facets[a], h = b.uniq(n.xKeys), S = b.uniq(n.yKeys);
233
+ n.xKeys = r[t.value] ? b.intersection(r[t.value], h) : h, n.yKeys = r[s.value] ? b.intersection(r[s.value], S) : S, w.forEach((N) => {
222
234
  e.facets[a].xKeysByGroups[N] = b.intersection(
223
- s.xKeys,
235
+ n.xKeys,
224
236
  e.facets[a].xKeysByGroups[N]
225
237
  );
226
- }), E.forEach((N) => {
238
+ }), A.forEach((N) => {
227
239
  e.facets[a].yKeysByGroups[N] = b.intersection(
228
- s.yKeys,
240
+ n.yKeys,
229
241
  e.facets[a].yKeysByGroups[N]
230
242
  );
231
243
  });
232
- }), me(e, G, H, J, S), re(e, $), e.meta.xKeysByGroups = e.meta.xGroupKeys.reduce((a, s) => {
233
- const h = W(b.uniq(
234
- b.flatten(e.meta.facetKeys.map((g) => e.facets[g].xKeysByGroups[s]))
235
- ), L.sorting, e.meta.xLabels);
236
- return a[s] = y[o.value] ? b.intersection(y[o.value], h) : h, a;
237
- }, {}), e.meta.xKeys = e.meta.xGroupKeys.reduce((a, s) => (a = a.concat(e.meta.xKeysByGroups[s]), a), []), e.meta.yKeysByGroups = e.meta.yGroupKeys.reduce((a, s) => {
238
- const h = W(b.uniq(
239
- b.flatten(e.meta.facetKeys.map((g) => e.facets[g].yKeysByGroups[s]))
240
- ), z.sorting, e.meta.yLabels);
241
- return a[s] = y[n.value] ? b.intersection(y[n.value], h) : h, a;
242
- }, {}), e.meta.yKeys = e.meta.yGroupKeys.reduce((a, s) => (a = a.concat(e.meta.yKeysByGroups[s]), a), []);
244
+ }), pe(e, B, P, Q, z), he(e, L), e.meta.xKeysByGroups = e.meta.xGroupKeys.reduce((a, n) => {
245
+ const h = k(b.uniq(
246
+ b.flatten(e.meta.facetKeys.map((S) => e.facets[S].xKeysByGroups[n]))
247
+ ), M.sorting, e.meta.xLabels);
248
+ return a[n] = r[t.value] ? b.intersection(r[t.value], h) : h, a;
249
+ }, {}), e.meta.xKeys = e.meta.xGroupKeys.reduce((a, n) => (a = a.concat(e.meta.xKeysByGroups[n]), a), []), e.meta.yKeysByGroups = e.meta.yGroupKeys.reduce((a, n) => {
250
+ const h = k(b.uniq(
251
+ b.flatten(e.meta.facetKeys.map((S) => e.facets[S].yKeysByGroups[n]))
252
+ ), G.sorting, e.meta.yLabels);
253
+ return a[n] = r[s.value] ? b.intersection(r[s.value], h) : h, a;
254
+ }, {}), e.meta.yKeys = e.meta.yGroupKeys.reduce((a, n) => (a = a.concat(e.meta.yKeysByGroups[n]), a), []);
243
255
  for (const a of e.meta.valueSources)
244
256
  e.meta.valueExtent[a][0] === 1 / 0 && (e.meta.valueExtent[a][0] = 0), e.meta.valueExtent[a][1] === -1 / 0 && (e.meta.valueExtent[a][1] = 0);
245
- return e.meta.xLabels.null = o.nullValueLabel ?? "NA", e.meta.yLabels.null = n.nullValueLabel ?? "NA", e.meta.xGroupLabels.null = m.map((a) => a.nullValueLabel ?? "NA").join(", "), e.meta.yGroupLabels.null = v.map((a) => a.nullValueLabel ?? "NA").join(", "), e;
257
+ return e.meta.xLabels.null = t.nullValueLabel ?? "NA", e.meta.yLabels.null = s.nullValueLabel ?? "NA", e.meta.xGroupLabels.null = f.map((a) => a.nullValueLabel ?? "NA").join(", "), e.meta.yGroupLabels.null = y.map((a) => a.nullValueLabel ?? "NA").join(", "), e;
246
258
  }
247
259
  export {
248
- Le as fillCellsData
260
+ ge as fillCellsData
249
261
  };
250
262
  //# sourceMappingURL=fillCellsData.js.map