@genome-spy/core 0.19.0 → 0.21.0

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 (101) hide show
  1. package/dist/index.js +46 -119
  2. package/dist/schema.json +213 -25
  3. package/package.json +4 -3
  4. package/src/data/collector.test.js +2 -0
  5. package/src/data/dataFlow.test.js +2 -0
  6. package/src/data/flow.test.js +1 -0
  7. package/src/data/flowNode.test.js +1 -0
  8. package/src/data/flowOptimizer.test.js +1 -0
  9. package/src/data/formats/fasta.test.js +1 -0
  10. package/src/data/sources/inlineSource.test.js +1 -0
  11. package/src/data/sources/sequenceSource.test.js +1 -0
  12. package/src/data/transforms/clone.test.js +1 -0
  13. package/src/data/transforms/coverage.test.js +1 -0
  14. package/src/data/transforms/filter.test.js +1 -0
  15. package/src/data/transforms/flattenDelimited.test.js +1 -0
  16. package/src/data/transforms/flattenSequence.test.js +1 -0
  17. package/src/data/transforms/formula.test.js +1 -0
  18. package/src/data/transforms/identifier.test.js +1 -0
  19. package/src/data/transforms/pileup.test.js +1 -0
  20. package/src/data/transforms/project.test.js +1 -0
  21. package/src/data/transforms/regexExtract.test.js +1 -0
  22. package/src/data/transforms/regexFold.test.js +1 -0
  23. package/src/data/transforms/sample.test.js +1 -0
  24. package/src/data/transforms/stack.test.js +1 -0
  25. package/src/encoder/accessor.test.js +1 -0
  26. package/src/encoder/encoder.test.js +1 -0
  27. package/src/genome/genome.test.js +1 -0
  28. package/src/genome/scaleIndex.js +3 -2
  29. package/src/genome/scaleIndex.test.js +23 -6
  30. package/src/genome/scaleLocus.test.js +1 -0
  31. package/src/genomeSpy.js +16 -11
  32. package/src/gl/dataToVertices.js +52 -52
  33. package/src/gl/includes/common.glsl +12 -12
  34. package/src/gl/includes/picking.fragment.glsl +0 -2
  35. package/src/gl/includes/picking.vertex.glsl +0 -2
  36. package/src/gl/includes/scales.glsl +33 -2
  37. package/src/gl/point.vertex.glsl +0 -2
  38. package/src/gl/rule.vertex.glsl +1 -1
  39. package/src/gl/webGLHelper.js +0 -3
  40. package/src/marks/link.js +32 -39
  41. package/src/marks/mark.js +176 -106
  42. package/src/marks/pointMark.js +28 -59
  43. package/src/marks/rectMark.js +38 -33
  44. package/src/marks/rule.js +31 -21
  45. package/src/marks/text.js +18 -14
  46. package/src/scale/glslScaleGenerator.js +56 -17
  47. package/src/scale/scale.test.js +1 -0
  48. package/src/scale/ticks.test.js +1 -0
  49. package/src/spec/mark.d.ts +0 -3
  50. package/src/spec/scale.d.ts +0 -9
  51. package/src/spec/title.d.ts +102 -0
  52. package/src/spec/view.d.ts +6 -4
  53. package/src/tooltip/dataTooltipHandler.js +3 -2
  54. package/src/utils/addBaseUrl.test.js +1 -0
  55. package/src/utils/binnedIndex.js +147 -0
  56. package/src/utils/binnedIndex.test.js +73 -0
  57. package/src/utils/cloner.test.js +1 -0
  58. package/src/utils/coalesce.test.js +1 -0
  59. package/src/utils/concatIterables.test.js +1 -0
  60. package/src/utils/domainArray.test.js +1 -0
  61. package/src/utils/indexer.test.js +1 -0
  62. package/src/utils/iterateNestedMaps.test.js +1 -0
  63. package/src/utils/kWayMerge.test.js +1 -0
  64. package/src/utils/layout/flexLayout.js +35 -3
  65. package/src/utils/layout/flexLayout.test.js +15 -0
  66. package/src/utils/layout/grid.js +95 -0
  67. package/src/utils/layout/grid.test.js +71 -0
  68. package/src/utils/layout/padding.js +13 -0
  69. package/src/utils/layout/rectangle.js +6 -0
  70. package/src/utils/layout/rectangle.test.js +1 -0
  71. package/src/utils/mergeObjects.test.js +1 -0
  72. package/src/utils/numberExtractor.test.js +1 -0
  73. package/src/utils/propertyCacher.test.js +1 -0
  74. package/src/utils/propertyCoalescer.test.js +1 -0
  75. package/src/utils/reservationMap.test.js +1 -0
  76. package/src/utils/topK.test.js +1 -0
  77. package/src/utils/variableTools.test.js +1 -0
  78. package/src/view/axisResolution.test.js +1 -0
  79. package/src/view/axisView.js +3 -5
  80. package/src/view/concatView.js +24 -275
  81. package/src/view/flowBuilder.test.js +1 -0
  82. package/src/view/gridView.js +774 -0
  83. package/src/view/implicitRootView.js +14 -0
  84. package/src/view/layerView.js +15 -1
  85. package/src/view/renderingContext/deferredViewRenderingContext.js +3 -1
  86. package/src/view/renderingContext/simpleViewRenderingContext.js +3 -1
  87. package/src/view/scaleResolution.js +5 -11
  88. package/src/view/scaleResolution.test.js +1 -0
  89. package/src/view/title.js +165 -0
  90. package/src/view/unitView.js +9 -5
  91. package/src/view/view.js +35 -14
  92. package/src/view/view.test.js +1 -0
  93. package/src/view/viewContext.d.ts +6 -1
  94. package/src/view/viewFactory.test.js +1 -0
  95. package/src/view/viewUtils.js +1 -93
  96. package/src/view/zoom.js +89 -0
  97. package/src/gl/includes/fp64-arithmetic.glsl +0 -187
  98. package/src/gl/includes/fp64-utils.js +0 -142
  99. package/src/gl/includes/scales_fp64.glsl +0 -30
  100. package/src/utils/binnedRangeIndex.js +0 -83
  101. package/src/view/decoratorView.js +0 -513
@@ -1,187 +0,0 @@
1
- // Adapted from luma.gl - https://github.com/uber/luma.gl
2
-
3
- // Copyright (c) 2015 - 2017 Uber Technologies, Inc.
4
- //
5
- // Permission is hereby granted, free of charge, to any person obtaining a copy
6
- // of this software and associated documentation files (the "Software"), to deal
7
- // in the Software without restriction, including without limitation the rights
8
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- // copies of the Software, and to permit persons to whom the Software is
10
- // furnished to do so, subject to the following conditions:
11
- //
12
- // The above copyright notice and this permission notice shall be included in
13
- // all copies or substantial portions of the Software.
14
- //
15
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- // THE SOFTWARE.
22
-
23
- uniform float ONE;
24
-
25
- /*
26
- About LUMA_FP64_CODE_ELIMINATION_WORKAROUND
27
-
28
- The purpose of this workaround is to prevent shader compilers from
29
- optimizing away necessary arithmetic operations by swapping their sequences
30
- or transform the equation to some 'equivalent' from.
31
-
32
- The method is to multiply an artifical variable, ONE, which will be known to
33
- the compiler to be 1 only at runtime. The whole expression is then represented
34
- as a polynomial with respective to ONE. In the coefficients of all terms, only one a
35
- and one b should appear
36
-
37
- err = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE
38
- */
39
-
40
- // Divide float number to high and low floats to extend fraction bits
41
- vec2 split(float a) {
42
- const float SPLIT = 4097.0;
43
- float t = a * SPLIT;
44
- #if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
45
- float a_hi = t * ONE - (t - a);
46
- float a_lo = a * ONE - a_hi;
47
- #else
48
- float a_hi = t - (t - a);
49
- float a_lo = a - a_hi;
50
- #endif
51
- return vec2(a_hi, a_lo);
52
- }
53
-
54
- // Divide float number again when high float uses too many fraction bits
55
- vec2 split2(vec2 a) {
56
- vec2 b = split(a.x);
57
- b.y += a.y;
58
- return b;
59
- }
60
-
61
- // Special sum operation when a > b
62
- vec2 quickTwoSum(float a, float b) {
63
- #if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
64
- float sum = (a + b) * ONE;
65
- float err = b - (sum - a) * ONE;
66
- #else
67
- float sum = a + b;
68
- float err = b - (sum - a);
69
- #endif
70
- return vec2(sum, err);
71
- }
72
-
73
- // General sum operation
74
- vec2 twoSum(float a, float b) {
75
- float s = (a + b);
76
- #if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
77
- float v = (s * ONE - a) * ONE;
78
- float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);
79
- #else
80
- float v = s - a;
81
- float err = (a - (s - v)) + (b - v);
82
- #endif
83
- return vec2(s, err);
84
- }
85
-
86
- vec2 twoSub(float a, float b) {
87
- float s = (a - b);
88
- #if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
89
- float v = (s * ONE - a) * ONE;
90
- float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);
91
- #else
92
- float v = s - a;
93
- float err = (a - (s - v)) - (b + v);
94
- #endif
95
- return vec2(s, err);
96
- }
97
-
98
- vec2 twoSqr(float a) {
99
- float prod = a * a;
100
- vec2 a_fp64 = split(a);
101
- #if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
102
- float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *
103
- a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;
104
- #else
105
- float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;
106
- #endif
107
- return vec2(prod, err);
108
- }
109
-
110
- vec2 twoProd(float a, float b) {
111
- float prod = a * b;
112
- vec2 a_fp64 = split(a);
113
- vec2 b_fp64 = split(b);
114
- float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +
115
- a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;
116
- return vec2(prod, err);
117
- }
118
-
119
- vec2 sum_fp64(vec2 a, vec2 b) {
120
- vec2 s, t;
121
- s = twoSum(a.x, b.x);
122
- t = twoSum(a.y, b.y);
123
- s.y += t.x;
124
- s = quickTwoSum(s.x, s.y);
125
- s.y += t.y;
126
- s = quickTwoSum(s.x, s.y);
127
- return s;
128
- }
129
-
130
- vec2 sub_fp64(vec2 a, vec2 b) {
131
- vec2 s, t;
132
- s = twoSub(a.x, b.x);
133
- t = twoSub(a.y, b.y);
134
- s.y += t.x;
135
- s = quickTwoSum(s.x, s.y);
136
- s.y += t.y;
137
- s = quickTwoSum(s.x, s.y);
138
- return s;
139
- }
140
-
141
- vec2 mul_fp64(vec2 a, vec2 b) {
142
- vec2 prod = twoProd(a.x, b.x);
143
- // y component is for the error
144
- prod.y += a.x * b.y;
145
- #if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
146
- prod = split2(prod);
147
- #endif
148
- prod = quickTwoSum(prod.x, prod.y);
149
- prod.y += a.y * b.x;
150
- #if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
151
- prod = split2(prod);
152
- #endif
153
- prod = quickTwoSum(prod.x, prod.y);
154
- return prod;
155
- }
156
-
157
- vec2 div_fp64(vec2 a, vec2 b) {
158
- float xn = 1.0 / b.x;
159
- #if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
160
- vec2 yn = mul_fp64(a, vec2(xn, 0));
161
- #else
162
- vec2 yn = a * xn;
163
- #endif
164
- float diff = (sub_fp64(a, mul_fp64(b, yn))).x;
165
- vec2 prod = twoProd(xn, diff);
166
- return sum_fp64(yn, prod);
167
- }
168
-
169
- vec2 sqrt_fp64(vec2 a) {
170
- if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);
171
- if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);
172
-
173
- float x = 1.0 / sqrt(a.x);
174
- float yn = a.x * x;
175
- #if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
176
- vec2 yn_sqr = twoSqr(yn) * ONE;
177
- #else
178
- vec2 yn_sqr = twoSqr(yn);
179
- #endif
180
- float diff = sub_fp64(a, yn_sqr).x;
181
- vec2 prod = twoProd(x * 0.5, diff);
182
- #if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
183
- return sum_fp64(split(yn), prod);
184
- #else
185
- return sum_fp64(vec2(yn, 0.0), prod);
186
- #endif
187
- }
@@ -1,142 +0,0 @@
1
- // Adapted from luma.gl - https://github.com/visgl/luma.gl
2
-
3
- // Copyright (c) 2015 - 2017 Uber Technologies, Inc.
4
- //
5
- // Permission is hereby granted, free of charge, to any person obtaining a copy
6
- // of this software and associated documentation files (the "Software"), to deal
7
- // in the Software without restriction, including without limitation the rights
8
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- // copies of the Software, and to permit persons to whom the Software is
10
- // furnished to do so, subject to the following conditions:
11
- //
12
- // The above copyright notice and this permission notice shall be included in
13
- // all copies or substantial portions of the Software.
14
- //
15
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- // THE SOFTWARE.
22
-
23
- /**
24
- * Calculate WebGL 64 bit float
25
- *
26
- * @param {number} a the input float number
27
- * @param {number[]} [out] the output array. If not supplied, a new array is created.
28
- * @param {number} [startIndex] the index in the output array to fill from. Default 0.
29
- * @returns {number[]} the fp64 representation of the input number
30
- */
31
- export function fp64ify(a, out = [], startIndex = 0) {
32
- const hiPart = Math.fround(a);
33
- out[startIndex] = hiPart;
34
- out[startIndex + 1] = isFinite(hiPart) ? a - hiPart : 0;
35
- return out;
36
- }
37
-
38
- /**
39
- * Calculate the low part of a WebGL 64 bit float
40
- *
41
- * @param {number} a the input float number
42
- * @returns {number} the lower 32 bit of the number
43
- */
44
- export function fp64LowPart(a) {
45
- return a - Math.fround(a);
46
- }
47
-
48
- /**
49
- * @param {WebGLRenderingContext | WebGL2RenderingContext} gl
50
- */
51
- export function getPlatformShaderDefines(gl) {
52
- const debugInfo = getContextInfo(gl);
53
-
54
- switch (debugInfo.gpuVendor.toLowerCase()) {
55
- case "nvidia":
56
- return `\
57
- #define NVIDIA_GPU
58
- // Nvidia optimizes away the calculation necessary for emulated fp64
59
- #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
60
- `;
61
-
62
- case "intel":
63
- return `\
64
- #define INTEL_GPU
65
- // Intel optimizes away the calculation necessary for emulated fp64
66
- #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
67
- // Intel's built-in 'tan' function doesn't have acceptable precision
68
- #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
69
- // Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
70
- #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
71
- `;
72
-
73
- case "amd":
74
- // AMD Does not eliminate fp64 code
75
- return `\
76
- #define AMD_GPU
77
- `;
78
-
79
- default:
80
- // We don't know what GPU it is, could be that the GPU driver or
81
- // browser is not implementing UNMASKED_RENDERER constant and not
82
- // reporting a correct name
83
- return `\
84
- #define DEFAULT_GPU
85
- // Prevent driver from optimizing away the calculation necessary for emulated fp64
86
- #define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
87
- // Intel's built-in 'tan' function doesn't have acceptable precision
88
- #define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
89
- // Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
90
- #define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
91
- `;
92
- }
93
- }
94
-
95
- const GL_VENDOR = 0x1f00;
96
- const GL_RENDERER = 0x1f01;
97
- const GL_VERSION = 0x1f02;
98
- const GL_SHADING_LANGUAGE_VERSION = 0x8b8c;
99
-
100
- /**
101
- * @param {WebGLRenderingContext | WebGL2RenderingContext} gl
102
- */
103
- export function getContextInfo(gl) {
104
- const info = gl.getExtension("WEBGL_debug_renderer_info");
105
- const vendor = gl.getParameter(
106
- (info && info.UNMASKED_VENDOR_WEBGL) || GL_VENDOR
107
- );
108
- const renderer = gl.getParameter(
109
- (info && info.UNMASKED_RENDERER_WEBGL) || GL_RENDERER
110
- );
111
- const gpuVendor = identifyGPUVendor(vendor, renderer);
112
- const gpuInfo = {
113
- gpuVendor,
114
- vendor,
115
- renderer,
116
- version: gl.getParameter(GL_VERSION),
117
- shadingLanguageVersion: gl.getParameter(GL_SHADING_LANGUAGE_VERSION),
118
- };
119
- return gpuInfo;
120
- }
121
-
122
- /**
123
- * @param {string} vendor
124
- * @param {string} renderer
125
- */
126
- function identifyGPUVendor(vendor, renderer) {
127
- if (vendor.match(/NVIDIA/i) || renderer.match(/NVIDIA/i)) {
128
- return "NVIDIA";
129
- }
130
- if (vendor.match(/INTEL/i) || renderer.match(/INTEL/i)) {
131
- return "INTEL";
132
- }
133
- if (
134
- vendor.match(/AMD/i) ||
135
- renderer.match(/AMD/i) ||
136
- vendor.match(/ATI/i) ||
137
- renderer.match(/ATI/i)
138
- ) {
139
- return "AMD";
140
- }
141
- return "UNKNOWN GPU";
142
- }
@@ -1,30 +0,0 @@
1
- float scaleIdentityFp64(vec2 value) {
2
- return value[0];
3
- }
4
-
5
- float scaleLinearFp64(vec2 value, vec4 domain, vec2 range) {
6
- vec2 domainSpan = sub_fp64(domain.zw, domain.xy);
7
- float rangeSpan = range[1] - range[0];
8
-
9
- float unitValue = div_fp64(sub_fp64(value, domain.xy), domainSpan).x;
10
- return unitValue * rangeSpan + range[0];
11
- }
12
-
13
- float scaleBandFp64(vec2 value, vec4 domainExtent, vec2 range,
14
- float paddingInner, float paddingOuter,
15
- float align, float band) {
16
-
17
- // TODO: reverse
18
- float start = range[0];
19
- float stop = range[1];
20
-
21
- vec2 domainSpan = sub_fp64(domainExtent.zw, domainExtent.xy);
22
- float n = domainSpan.x;
23
-
24
- // Based on: https://github.com/d3/d3-scale/blob/master/src/band.js
25
- float step = (stop - start) / max(1.0, n - paddingInner + paddingOuter * 2.0);
26
- start += (stop - start - step * (n - paddingInner)) * align;
27
- float bandwidth = step * (1.0 - paddingInner);
28
-
29
- return start + sub_fp64(value, domainExtent.xy).x * step + bandwidth * band;
30
- }
@@ -1,83 +0,0 @@
1
- import clamp from "./clamp";
2
-
3
- const MAX_INTEGER = 2 ** 31 - 1;
4
-
5
- /**
6
- * @callback Lookup
7
- * @param {number} start
8
- * @param {number} end
9
- * @returns {[number, number]}
10
- */
11
-
12
- /**
13
- * A binned index for (overlapping) ranges that are sorted by their start position.
14
- * Allows for indexing vertices of mark instances.
15
- *
16
- * @param {number} size Number of bins
17
- * @param {[number, number]} domain
18
- */
19
- export default function createBinningRangeIndexer(size, domain) {
20
- const startIndices = new Int32Array(size);
21
- startIndices.fill(MAX_INTEGER);
22
-
23
- const endIndices = new Int32Array(size);
24
-
25
- const start = domain[0];
26
- const domainLength = domain[1] - domain[0];
27
- const divisor = domainLength / size;
28
-
29
- /** @param {number} pos */
30
- const getBin = (pos) =>
31
- clamp(Math.floor((pos - start) / divisor), 0, size - 1);
32
-
33
- /**
34
- *
35
- * @param {number} start
36
- * @param {number} end
37
- * @param {number} startIndex
38
- * @param {number} endIndex
39
- */
40
- const indexer = (start, end, startIndex, endIndex) => {
41
- const startBin = getBin(start);
42
- const endBin = getBin(end);
43
-
44
- // TODO: This loop could probably be done as a more efficient post processing
45
- // step.
46
- for (let bin = startBin; bin <= endBin; bin++) {
47
- if (startIndices[bin] > startIndex) {
48
- startIndices[bin] = startIndex;
49
- }
50
-
51
- if (endIndices[bin] < endIndex) {
52
- endIndices[bin] = endIndex;
53
- }
54
- }
55
- };
56
-
57
- /**
58
- * @type {Lookup}
59
- */
60
- const lookup = (start, end) => [
61
- startIndices[getBin(start)],
62
- endIndices[getBin(end)],
63
- ];
64
-
65
- const getIndex = () => {
66
- for (let i = 1; i < endIndices.length; i++) {
67
- if (endIndices[i] < endIndices[i - 1]) {
68
- endIndices[i] = endIndices[i - 1];
69
- }
70
- }
71
- for (let i = endIndices.length - 1; i > 0; i--) {
72
- if (endIndices[i - 1] > endIndices[i]) {
73
- endIndices[i - 1] = endIndices[i];
74
- }
75
- }
76
-
77
- return lookup;
78
- };
79
-
80
- indexer.getIndex = getIndex;
81
-
82
- return indexer;
83
- }