@windborne/grapher 1.0.21 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/26b23c7580ea3345d644.wasm +0 -0
- package/dist/744.bundle.cjs +2 -1
- package/dist/744.bundle.cjs.map +1 -0
- package/dist/744.bundle.esm.js +2 -1
- package/dist/744.bundle.esm.js.map +1 -0
- package/dist/bundle.cjs +1 -1
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.esm.js +1 -1
- package/dist/bundle.esm.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +1 -1
- package/src/components/graph_body.jsx +41 -1
- package/src/components/range_graph.jsx +70 -22
- package/src/components/x_axis.jsx +139 -21
- package/src/components/y_axis.jsx +0 -5
- package/src/grapher.jsx +4 -3
- package/src/grapher.scss +84 -43
- package/src/helpers/color_to_vector.js +6 -1
- package/src/helpers/colors.js +82 -16
- package/src/helpers/custom_prop_types.js +2 -1
- package/src/helpers/place_grid.js +219 -0
- package/src/index.d.ts +150 -24
- package/src/renderer/create_gl_program.js +11 -3
- package/src/renderer/draw_area.js +1161 -102
- package/src/renderer/draw_background.js +5 -0
- package/src/renderer/draw_bars.js +100 -11
- package/src/renderer/draw_line.js +338 -38
- package/src/renderer/draw_zero_line.js +5 -0
- package/src/renderer/extract_vertices.js +1 -1
- package/src/renderer/graph_body_renderer.js +278 -17
- package/src/renderer/line.frag +16 -1
- package/src/renderer/line_program.js +200 -10
- package/src/renderer/shadow.frag +98 -0
- package/src/renderer/shadow.vert +20 -0
- package/src/renderer/shadow_program.js +479 -0
- package/src/rust/Cargo.lock +22 -31
- package/src/rust/pkg/grapher_rs.d.ts +6 -0
- package/src/rust/pkg/grapher_rs.js +5 -0
- package/src/rust/pkg/grapher_rs_bg.js +305 -0
- package/src/rust/pkg/grapher_rs_bg.wasm +0 -0
- package/src/rust/pkg/grapher_rs_bg.wasm.d.ts +11 -0
- package/src/rust/pkg/index.js +397 -0
- package/src/state/calculate_tooltip_state.js +6 -6
- package/src/state/state_controller.js +20 -6
package/src/rust/pkg/index.js
CHANGED
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
let cachedUint8ArrayMemory0 = null;
|
|
4
|
+
|
|
5
|
+
function getUint8ArrayMemory0() {
|
|
6
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
7
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
8
|
+
}
|
|
9
|
+
return cachedUint8ArrayMemory0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
13
|
+
ptr = ptr >>> 0;
|
|
14
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let WASM_VECTOR_LEN = 0;
|
|
18
|
+
|
|
19
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
20
|
+
|
|
21
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
22
|
+
? function (arg, view) {
|
|
23
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
24
|
+
}
|
|
25
|
+
: function (arg, view) {
|
|
26
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
27
|
+
view.set(buf);
|
|
28
|
+
return {
|
|
29
|
+
read: arg.length,
|
|
30
|
+
written: buf.length
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
35
|
+
|
|
36
|
+
if (realloc === undefined) {
|
|
37
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
38
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
39
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
40
|
+
WASM_VECTOR_LEN = buf.length;
|
|
41
|
+
return ptr;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let len = arg.length;
|
|
45
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
46
|
+
|
|
47
|
+
const mem = getUint8ArrayMemory0();
|
|
48
|
+
|
|
49
|
+
let offset = 0;
|
|
50
|
+
|
|
51
|
+
for (; offset < len; offset++) {
|
|
52
|
+
const code = arg.charCodeAt(offset);
|
|
53
|
+
if (code > 0x7F) break;
|
|
54
|
+
mem[ptr + offset] = code;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (offset !== len) {
|
|
58
|
+
if (offset !== 0) {
|
|
59
|
+
arg = arg.slice(offset);
|
|
60
|
+
}
|
|
61
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
62
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
63
|
+
const ret = encodeString(arg, view);
|
|
64
|
+
|
|
65
|
+
offset += ret.written;
|
|
66
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
WASM_VECTOR_LEN = offset;
|
|
70
|
+
return ptr;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function isLikeNone(x) {
|
|
74
|
+
return x === undefined || x === null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let cachedDataViewMemory0 = null;
|
|
78
|
+
|
|
79
|
+
function getDataViewMemory0() {
|
|
80
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
81
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
82
|
+
}
|
|
83
|
+
return cachedDataViewMemory0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
87
|
+
|
|
88
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
89
|
+
|
|
90
|
+
function getStringFromWasm0(ptr, len) {
|
|
91
|
+
ptr = ptr >>> 0;
|
|
92
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
96
|
+
|
|
97
|
+
function getFloat64ArrayMemory0() {
|
|
98
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
99
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
100
|
+
}
|
|
101
|
+
return cachedFloat64ArrayMemory0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
|
105
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
106
|
+
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
107
|
+
WASM_VECTOR_LEN = arg.length;
|
|
108
|
+
return ptr;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
112
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
113
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
114
|
+
WASM_VECTOR_LEN = arg.length;
|
|
115
|
+
return ptr;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @param {number} length
|
|
119
|
+
* @param {Float64Array} data
|
|
120
|
+
* @param {Uint8Array} data_null_mask
|
|
121
|
+
* @param {any} params
|
|
122
|
+
* @param {Uint8Array} null_mask
|
|
123
|
+
* @param {Float64Array} y_values
|
|
124
|
+
* @param {Float64Array} min_y_values
|
|
125
|
+
* @param {Float64Array} max_y_values
|
|
126
|
+
*/
|
|
127
|
+
export function selected_space_to_render_space(length, data, data_null_mask, params, null_mask, y_values, min_y_values, max_y_values) {
|
|
128
|
+
const ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
|
|
129
|
+
const len0 = WASM_VECTOR_LEN;
|
|
130
|
+
const ptr1 = passArray8ToWasm0(data_null_mask, wasm.__wbindgen_malloc);
|
|
131
|
+
const len1 = WASM_VECTOR_LEN;
|
|
132
|
+
var ptr2 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
|
133
|
+
var len2 = WASM_VECTOR_LEN;
|
|
134
|
+
var ptr3 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
|
135
|
+
var len3 = WASM_VECTOR_LEN;
|
|
136
|
+
var ptr4 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
|
137
|
+
var len4 = WASM_VECTOR_LEN;
|
|
138
|
+
var ptr5 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
|
139
|
+
var len5 = WASM_VECTOR_LEN;
|
|
140
|
+
wasm.selected_space_to_render_space(length, ptr0, len0, ptr1, len1, params, ptr2, len2, null_mask, ptr3, len3, y_values, ptr4, len4, min_y_values, ptr5, len5, max_y_values);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
144
|
+
|
|
145
|
+
function getFloat32ArrayMemory0() {
|
|
146
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
147
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
148
|
+
}
|
|
149
|
+
return cachedFloat32ArrayMemory0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
|
153
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
154
|
+
getFloat32ArrayMemory0().set(arg, ptr / 4);
|
|
155
|
+
WASM_VECTOR_LEN = arg.length;
|
|
156
|
+
return ptr;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
let cachedUint32ArrayMemory0 = null;
|
|
160
|
+
|
|
161
|
+
function getUint32ArrayMemory0() {
|
|
162
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
163
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
164
|
+
}
|
|
165
|
+
return cachedUint32ArrayMemory0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
169
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
170
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
171
|
+
WASM_VECTOR_LEN = arg.length;
|
|
172
|
+
return ptr;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* @param {number} dpi_increase
|
|
176
|
+
* @param {Uint8Array} null_mask
|
|
177
|
+
* @param {Float64Array} y_values
|
|
178
|
+
* @param {Float64Array} min_y_values
|
|
179
|
+
* @param {Float64Array} max_y_values
|
|
180
|
+
* @param {Float32Array} positions
|
|
181
|
+
* @param {Float32Array} prev_positions
|
|
182
|
+
* @param {Float32Array} vertices
|
|
183
|
+
* @param {Uint32Array} indices
|
|
184
|
+
* @param {boolean} dashed
|
|
185
|
+
* @param {number} dash0
|
|
186
|
+
* @param {number} dash1
|
|
187
|
+
*/
|
|
188
|
+
export function extract_vertices(dpi_increase, null_mask, y_values, min_y_values, max_y_values, positions, prev_positions, vertices, indices, dashed, dash0, dash1) {
|
|
189
|
+
const ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
|
190
|
+
const len0 = WASM_VECTOR_LEN;
|
|
191
|
+
const ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
|
192
|
+
const len1 = WASM_VECTOR_LEN;
|
|
193
|
+
const ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
|
194
|
+
const len2 = WASM_VECTOR_LEN;
|
|
195
|
+
const ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
|
196
|
+
const len3 = WASM_VECTOR_LEN;
|
|
197
|
+
var ptr4 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
198
|
+
var len4 = WASM_VECTOR_LEN;
|
|
199
|
+
var ptr5 = passArrayF32ToWasm0(prev_positions, wasm.__wbindgen_malloc);
|
|
200
|
+
var len5 = WASM_VECTOR_LEN;
|
|
201
|
+
var ptr6 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);
|
|
202
|
+
var len6 = WASM_VECTOR_LEN;
|
|
203
|
+
var ptr7 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
204
|
+
var len7 = WASM_VECTOR_LEN;
|
|
205
|
+
wasm.extract_vertices(dpi_increase, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, positions, ptr5, len5, prev_positions, ptr6, len6, vertices, ptr7, len7, indices, dashed, dash0, dash1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @param {Uint8Array} null_mask
|
|
210
|
+
* @param {Float64Array} y_values
|
|
211
|
+
* @param {Float64Array} min_y_values
|
|
212
|
+
* @param {Float64Array} max_y_values
|
|
213
|
+
* @param {boolean} dashed
|
|
214
|
+
* @param {number} dash0
|
|
215
|
+
* @param {number} dash1
|
|
216
|
+
* @returns {number}
|
|
217
|
+
*/
|
|
218
|
+
export function get_point_number(null_mask, y_values, min_y_values, max_y_values, dashed, dash0, dash1) {
|
|
219
|
+
const ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
|
220
|
+
const len0 = WASM_VECTOR_LEN;
|
|
221
|
+
const ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
|
222
|
+
const len1 = WASM_VECTOR_LEN;
|
|
223
|
+
const ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
|
224
|
+
const len2 = WASM_VECTOR_LEN;
|
|
225
|
+
const ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
|
226
|
+
const len3 = WASM_VECTOR_LEN;
|
|
227
|
+
const ret = wasm.get_point_number(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, dashed, dash0, dash1);
|
|
228
|
+
return ret;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export function main_js() {
|
|
232
|
+
wasm.main_js();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
async function __wbg_load(module, imports) {
|
|
236
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
237
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
238
|
+
try {
|
|
239
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
240
|
+
|
|
241
|
+
} catch (e) {
|
|
242
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
243
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
244
|
+
|
|
245
|
+
} else {
|
|
246
|
+
throw e;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const bytes = await module.arrayBuffer();
|
|
252
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
253
|
+
|
|
254
|
+
} else {
|
|
255
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
256
|
+
|
|
257
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
258
|
+
return { instance, module };
|
|
259
|
+
|
|
260
|
+
} else {
|
|
261
|
+
return instance;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function __wbg_get_imports() {
|
|
267
|
+
const imports = {};
|
|
268
|
+
imports.wbg = {};
|
|
269
|
+
imports.wbg.__wbg_maxx_a3b1e1c3299e47bf = function(arg0) {
|
|
270
|
+
const ret = arg0.maxX;
|
|
271
|
+
return ret;
|
|
272
|
+
};
|
|
273
|
+
imports.wbg.__wbg_maxy_007b81ea99058122 = function(arg0) {
|
|
274
|
+
const ret = arg0.maxY;
|
|
275
|
+
return ret;
|
|
276
|
+
};
|
|
277
|
+
imports.wbg.__wbg_minx_e03d57649d81fc8f = function(arg0) {
|
|
278
|
+
const ret = arg0.minX;
|
|
279
|
+
return ret;
|
|
280
|
+
};
|
|
281
|
+
imports.wbg.__wbg_miny_46aab5af597882a7 = function(arg0) {
|
|
282
|
+
const ret = arg0.minY;
|
|
283
|
+
return ret;
|
|
284
|
+
};
|
|
285
|
+
imports.wbg.__wbg_renderheight_d030fe5a23b4c32b = function(arg0) {
|
|
286
|
+
const ret = arg0.renderHeight;
|
|
287
|
+
return ret;
|
|
288
|
+
};
|
|
289
|
+
imports.wbg.__wbg_renderwidth_8685762ee304f2a7 = function(arg0) {
|
|
290
|
+
const ret = arg0.renderWidth;
|
|
291
|
+
return ret;
|
|
292
|
+
};
|
|
293
|
+
imports.wbg.__wbg_scale_d705e0de44ed2361 = function(arg0) {
|
|
294
|
+
const ret = arg0.scale;
|
|
295
|
+
return ret;
|
|
296
|
+
};
|
|
297
|
+
imports.wbg.__wbindgen_copy_to_typed_array = function(arg0, arg1, arg2) {
|
|
298
|
+
new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));
|
|
299
|
+
};
|
|
300
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
301
|
+
const table = wasm.__wbindgen_export_0;
|
|
302
|
+
const offset = table.grow(4);
|
|
303
|
+
table.set(0, undefined);
|
|
304
|
+
table.set(offset + 0, undefined);
|
|
305
|
+
table.set(offset + 1, null);
|
|
306
|
+
table.set(offset + 2, true);
|
|
307
|
+
table.set(offset + 3, false);
|
|
308
|
+
;
|
|
309
|
+
};
|
|
310
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
311
|
+
const obj = arg1;
|
|
312
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
313
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
314
|
+
var len1 = WASM_VECTOR_LEN;
|
|
315
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
316
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
317
|
+
};
|
|
318
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
319
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
return imports;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function __wbg_init_memory(imports, memory) {
|
|
326
|
+
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function __wbg_finalize_init(instance, module) {
|
|
330
|
+
wasm = instance.exports;
|
|
331
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
332
|
+
cachedDataViewMemory0 = null;
|
|
333
|
+
cachedFloat32ArrayMemory0 = null;
|
|
334
|
+
cachedFloat64ArrayMemory0 = null;
|
|
335
|
+
cachedUint32ArrayMemory0 = null;
|
|
336
|
+
cachedUint8ArrayMemory0 = null;
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
wasm.__wbindgen_start();
|
|
340
|
+
return wasm;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function initSync(module) {
|
|
344
|
+
if (wasm !== undefined) return wasm;
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
if (typeof module !== 'undefined') {
|
|
348
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
349
|
+
({module} = module)
|
|
350
|
+
} else {
|
|
351
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const imports = __wbg_get_imports();
|
|
356
|
+
|
|
357
|
+
__wbg_init_memory(imports);
|
|
358
|
+
|
|
359
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
360
|
+
module = new WebAssembly.Module(module);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
364
|
+
|
|
365
|
+
return __wbg_finalize_init(instance, module);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
async function __wbg_init(module_or_path) {
|
|
369
|
+
if (wasm !== undefined) return wasm;
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
if (typeof module_or_path !== 'undefined') {
|
|
373
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
374
|
+
({module_or_path} = module_or_path)
|
|
375
|
+
} else {
|
|
376
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
if (typeof module_or_path === 'undefined') {
|
|
381
|
+
module_or_path = new URL('index_bg.wasm', import.meta.url);
|
|
382
|
+
}
|
|
383
|
+
const imports = __wbg_get_imports();
|
|
384
|
+
|
|
385
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
386
|
+
module_or_path = fetch(module_or_path);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
__wbg_init_memory(imports);
|
|
390
|
+
|
|
391
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
392
|
+
|
|
393
|
+
return __wbg_finalize_init(instance, module);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export { initSync };
|
|
397
|
+
export default __wbg_init;
|
|
@@ -82,7 +82,7 @@ export default function calculateTooltipState({mousePresent, mouseX, mouseY, siz
|
|
|
82
82
|
continue;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
const
|
|
85
|
+
const ignoreYDistanceCheck = alwaysTooltipped.has(singleSeries) || allTooltipped;
|
|
86
86
|
let xDistanceThreshold = DISTANCE_THRESHOLD;
|
|
87
87
|
let yDistanceThreshold = DISTANCE_THRESHOLD;
|
|
88
88
|
let distanceThreshold = DISTANCE_THRESHOLD;
|
|
@@ -112,7 +112,7 @@ export default function calculateTooltipState({mousePresent, mouseX, mouseY, siz
|
|
|
112
112
|
const yDistance = Math.abs(pixelY - mouseY);
|
|
113
113
|
const distance = Math.sqrt((xDistance)**2 + (pixelY - mouseY)**2);
|
|
114
114
|
|
|
115
|
-
if (xDistance > xDistanceThreshold ||
|
|
115
|
+
if (!ignoreYDistanceCheck && (xDistance > xDistanceThreshold || yDistance > yDistanceThreshold || distance > distanceThreshold)) {
|
|
116
116
|
continue;
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -170,12 +170,12 @@ export default function calculateTooltipState({mousePresent, mouseX, mouseY, siz
|
|
|
170
170
|
xLabel,
|
|
171
171
|
yLabel,
|
|
172
172
|
fullYPrecision: singleSeries.fullYPrecision,
|
|
173
|
-
|
|
173
|
+
ignoreYDistanceCheck
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
const unsavedTooltips = tooltips.filter(({ distance,
|
|
178
|
-
return distance === minDistance ||
|
|
177
|
+
const unsavedTooltips = tooltips.filter(({ distance, ignoreYDistanceCheck }) => {
|
|
178
|
+
return distance === minDistance || ignoreYDistanceCheck;
|
|
179
179
|
}).sort((a, b) => b.distance - a.distance);
|
|
180
180
|
|
|
181
181
|
return {
|
|
@@ -225,7 +225,7 @@ export function toggleTooltipSaved({ currentTooltips, savedTooltips }) {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
const lastTooltip = currentTooltips[currentTooltips.length - 1];
|
|
228
|
-
if (lastTooltip.xDistance > DISTANCE_THRESHOLD || (!lastTooltip.
|
|
228
|
+
if (lastTooltip.xDistance > DISTANCE_THRESHOLD || (!lastTooltip.ignoreYDistanceCheck && lastTooltip.distance > DISTANCE_THRESHOLD)) {
|
|
229
229
|
return savedTooltips;
|
|
230
230
|
}
|
|
231
231
|
|
|
@@ -878,12 +878,19 @@ export default class StateController extends Eventable {
|
|
|
878
878
|
});
|
|
879
879
|
|
|
880
880
|
if (this.rangeGraphRenderer && this.rangeGraphRenderer.sizing) {
|
|
881
|
+
// Use tighter bounds for range graph to prevent clipping
|
|
882
|
+
const rangeGraphBounds = {
|
|
883
|
+
...this._globalBounds,
|
|
884
|
+
minY: this._globalBounds.unscaledMinY !== undefined ? this._globalBounds.unscaledMinY : this._globalBounds.minY,
|
|
885
|
+
maxY: this._globalBounds.unscaledMaxY !== undefined ? this._globalBounds.unscaledMaxY : this._globalBounds.maxY
|
|
886
|
+
};
|
|
887
|
+
|
|
881
888
|
this.rangeGraphRenderer.render(singleSeries, singleSeries.inRenderSpaceRangeGraph, {
|
|
882
889
|
shadowColor: 'transparent',
|
|
883
890
|
shadowBlur: 0,
|
|
884
891
|
width: 1,
|
|
885
|
-
bounds:
|
|
886
|
-
globalBounds:
|
|
892
|
+
bounds: rangeGraphBounds,
|
|
893
|
+
globalBounds: rangeGraphBounds,
|
|
887
894
|
inRenderSpaceAreaBottom: singleSeries.inRenderSpaceRangeGraphAreaBottom
|
|
888
895
|
});
|
|
889
896
|
}
|
|
@@ -997,6 +1004,13 @@ export default class StateController extends Eventable {
|
|
|
997
1004
|
|
|
998
1005
|
const { scale } = singleSeries.axis;
|
|
999
1006
|
const globalBounds = this._globalBounds;
|
|
1007
|
+
|
|
1008
|
+
const rangeGraphBounds = {
|
|
1009
|
+
...globalBounds,
|
|
1010
|
+
minY: globalBounds.unscaledMinY !== undefined ? globalBounds.unscaledMinY : globalBounds.minY,
|
|
1011
|
+
maxY: globalBounds.unscaledMaxY !== undefined ? globalBounds.unscaledMaxY : globalBounds.maxY
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1000
1014
|
const renderWidth = Math.ceil(this.rangeGraphRenderer.sizing.renderWidth/DPI_INCREASE);
|
|
1001
1015
|
const renderHeight = Math.ceil(this.rangeGraphRenderer.sizing.renderHeight);
|
|
1002
1016
|
|
|
@@ -1026,10 +1040,10 @@ export default class StateController extends Eventable {
|
|
|
1026
1040
|
});
|
|
1027
1041
|
|
|
1028
1042
|
const toRenderSpaceParams = {
|
|
1029
|
-
minX:
|
|
1030
|
-
maxX:
|
|
1031
|
-
minY:
|
|
1032
|
-
maxY:
|
|
1043
|
+
minX: rangeGraphBounds.minX,
|
|
1044
|
+
maxX: rangeGraphBounds.maxX,
|
|
1045
|
+
minY: rangeGraphBounds.minY,
|
|
1046
|
+
maxY: rangeGraphBounds.maxY,
|
|
1033
1047
|
renderWidth,
|
|
1034
1048
|
renderHeight,
|
|
1035
1049
|
scale,
|