@windborne/grapher 1.0.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.
- package/.eslintrc.js +85 -0
- package/.idea/codeStyles/Project.xml +19 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/grapher.iml +12 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/0.bundle.js +2 -0
- package/0.bundle.js.map +1 -0
- package/1767282193a714f63082.module.wasm +0 -0
- package/537.bundle.js +2 -0
- package/537.bundle.js.map +1 -0
- package/831.bundle.js +2 -0
- package/831.bundle.js.map +1 -0
- package/bundle.js +2 -0
- package/bundle.js.map +1 -0
- package/package.json +75 -0
- package/readme.md +129 -0
- package/src/components/annotations.js +62 -0
- package/src/components/context_menu.js +73 -0
- package/src/components/draggable_points.js +114 -0
- package/src/components/graph_body.js +292 -0
- package/src/components/graph_title.js +16 -0
- package/src/components/options.js +111 -0
- package/src/components/percentile_button.js +72 -0
- package/src/components/range_graph.js +352 -0
- package/src/components/range_selection.js +175 -0
- package/src/components/range_selection_button.js +26 -0
- package/src/components/range_selection_button_base.js +51 -0
- package/src/components/series_key.js +235 -0
- package/src/components/series_key_axis_container.js +70 -0
- package/src/components/series_key_item.js +52 -0
- package/src/components/sidebar.js +76 -0
- package/src/components/tooltip.js +244 -0
- package/src/components/vertical_lines.js +70 -0
- package/src/components/x_axis.js +124 -0
- package/src/components/y_axis.js +239 -0
- package/src/eventable.js +65 -0
- package/src/grapher.js +367 -0
- package/src/grapher.scss +914 -0
- package/src/helpers/axis_sizes.js +2 -0
- package/src/helpers/binary_search.js +67 -0
- package/src/helpers/color_to_vector.js +35 -0
- package/src/helpers/colors.js +27 -0
- package/src/helpers/custom_prop_types.js +159 -0
- package/src/helpers/flatten_simple_data.js +81 -0
- package/src/helpers/format.js +233 -0
- package/src/helpers/generator_params_equal.js +10 -0
- package/src/helpers/name_for_series.js +16 -0
- package/src/helpers/place_grid.js +257 -0
- package/src/helpers/pyodide_ready.js +13 -0
- package/src/multigrapher.js +105 -0
- package/src/renderer/background.frag +7 -0
- package/src/renderer/background.vert +7 -0
- package/src/renderer/background_program.js +48 -0
- package/src/renderer/circle.frag +26 -0
- package/src/renderer/circle.vert +12 -0
- package/src/renderer/create_gl_program.js +36 -0
- package/src/renderer/draw_area.js +159 -0
- package/src/renderer/draw_background.js +15 -0
- package/src/renderer/draw_bars.js +80 -0
- package/src/renderer/draw_line.js +69 -0
- package/src/renderer/draw_zero_line.js +24 -0
- package/src/renderer/extract_vertices.js +137 -0
- package/src/renderer/graph_body_renderer.js +293 -0
- package/src/renderer/line.frag +51 -0
- package/src/renderer/line.vert +32 -0
- package/src/renderer/line_program.js +125 -0
- package/src/renderer/paths_from.js +72 -0
- package/src/renderer/scale_bounds.js +28 -0
- package/src/renderer/size_canvas.js +59 -0
- package/src/rust/Cargo.lock +233 -0
- package/src/rust/Cargo.toml +35 -0
- package/src/rust/pkg/grapher_rs.d.ts +42 -0
- package/src/rust/pkg/grapher_rs.js +351 -0
- package/src/rust/pkg/grapher_rs_bg.d.ts +11 -0
- package/src/rust/pkg/grapher_rs_bg.wasm +0 -0
- package/src/rust/pkg/index.js +342 -0
- package/src/rust/pkg/index_bg.wasm +0 -0
- package/src/rust/pkg/package.json +14 -0
- package/src/rust/src/extract_vertices.rs +83 -0
- package/src/rust/src/get_point_number.rs +50 -0
- package/src/rust/src/lib.rs +15 -0
- package/src/rust/src/selected_space_to_render_space.rs +131 -0
- package/src/state/average_loop_times.js +15 -0
- package/src/state/bound_calculator_from_selection.js +36 -0
- package/src/state/bound_calculators.js +41 -0
- package/src/state/calculate_annotations_state.js +59 -0
- package/src/state/calculate_data_bounds.js +104 -0
- package/src/state/calculate_tooltip_state.js +241 -0
- package/src/state/data_types.js +13 -0
- package/src/state/expand_bounds.js +58 -0
- package/src/state/find_matching_axis.js +31 -0
- package/src/state/get_default_bounds_calculator.js +15 -0
- package/src/state/hooks.js +164 -0
- package/src/state/infer_type.js +74 -0
- package/src/state/merge_bounds.js +64 -0
- package/src/state/multigraph_state_controller.js +334 -0
- package/src/state/selection_from_global_bounds.js +25 -0
- package/src/state/space_conversions/condense_data_space.js +115 -0
- package/src/state/space_conversions/data_space_to_selected_space.js +328 -0
- package/src/state/space_conversions/selected_space_to_background_space.js +144 -0
- package/src/state/space_conversions/selected_space_to_render_space.js +161 -0
- package/src/state/space_conversions/simple_series_to_data_space.js +229 -0
- package/src/state/state_controller.js +1770 -0
- package/src/state/sync_pool.js +101 -0
- package/test/setup.js +15 -0
- package/test/space_conversions/data_space_to_selected_space.test.js +434 -0
- package/webpack.dev.config.js +109 -0
- package/webpack.prod.config.js +60 -0
- package/webpack.test.config.js +59 -0
@@ -0,0 +1,351 @@
|
|
1
|
+
import * as wasm from './grapher_rs_bg.wasm';
|
2
|
+
|
3
|
+
const heap = new Array(32).fill(undefined);
|
4
|
+
|
5
|
+
heap.push(undefined, null, true, false);
|
6
|
+
|
7
|
+
function getObject(idx) { return heap[idx]; }
|
8
|
+
|
9
|
+
let WASM_VECTOR_LEN = 0;
|
10
|
+
|
11
|
+
let cachegetUint8Memory0 = null;
|
12
|
+
function getUint8Memory0() {
|
13
|
+
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
14
|
+
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
15
|
+
}
|
16
|
+
return cachegetUint8Memory0;
|
17
|
+
}
|
18
|
+
|
19
|
+
const lTextEncoder = typeof TextEncoder === 'undefined' ? require('util').TextEncoder : TextEncoder;
|
20
|
+
|
21
|
+
let cachedTextEncoder = new lTextEncoder('utf-8');
|
22
|
+
|
23
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
24
|
+
? function (arg, view) {
|
25
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
26
|
+
}
|
27
|
+
: function (arg, view) {
|
28
|
+
const buf = cachedTextEncoder.encode(arg);
|
29
|
+
view.set(buf);
|
30
|
+
return {
|
31
|
+
read: arg.length,
|
32
|
+
written: buf.length
|
33
|
+
};
|
34
|
+
});
|
35
|
+
|
36
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
37
|
+
|
38
|
+
if (realloc === undefined) {
|
39
|
+
const buf = cachedTextEncoder.encode(arg);
|
40
|
+
const ptr = malloc(buf.length);
|
41
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
42
|
+
WASM_VECTOR_LEN = buf.length;
|
43
|
+
return ptr;
|
44
|
+
}
|
45
|
+
|
46
|
+
let len = arg.length;
|
47
|
+
let ptr = malloc(len);
|
48
|
+
|
49
|
+
const mem = getUint8Memory0();
|
50
|
+
|
51
|
+
let offset = 0;
|
52
|
+
|
53
|
+
for (; offset < len; offset++) {
|
54
|
+
const code = arg.charCodeAt(offset);
|
55
|
+
if (code > 0x7F) break;
|
56
|
+
mem[ptr + offset] = code;
|
57
|
+
}
|
58
|
+
|
59
|
+
if (offset !== len) {
|
60
|
+
if (offset !== 0) {
|
61
|
+
arg = arg.slice(offset);
|
62
|
+
}
|
63
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
64
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
65
|
+
const ret = encodeString(arg, view);
|
66
|
+
|
67
|
+
offset += ret.written;
|
68
|
+
}
|
69
|
+
|
70
|
+
WASM_VECTOR_LEN = offset;
|
71
|
+
return ptr;
|
72
|
+
}
|
73
|
+
|
74
|
+
function isLikeNone(x) {
|
75
|
+
return x === undefined || x === null;
|
76
|
+
}
|
77
|
+
|
78
|
+
let cachegetInt32Memory0 = null;
|
79
|
+
function getInt32Memory0() {
|
80
|
+
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
81
|
+
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
82
|
+
}
|
83
|
+
return cachegetInt32Memory0;
|
84
|
+
}
|
85
|
+
|
86
|
+
let heap_next = heap.length;
|
87
|
+
|
88
|
+
function dropObject(idx) {
|
89
|
+
if (idx < 36) return;
|
90
|
+
heap[idx] = heap_next;
|
91
|
+
heap_next = idx;
|
92
|
+
}
|
93
|
+
|
94
|
+
function takeObject(idx) {
|
95
|
+
const ret = getObject(idx);
|
96
|
+
dropObject(idx);
|
97
|
+
return ret;
|
98
|
+
}
|
99
|
+
|
100
|
+
const lTextDecoder = typeof TextDecoder === 'undefined' ? require('util').TextDecoder : TextDecoder;
|
101
|
+
|
102
|
+
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
103
|
+
|
104
|
+
cachedTextDecoder.decode();
|
105
|
+
|
106
|
+
function getStringFromWasm0(ptr, len) {
|
107
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
108
|
+
}
|
109
|
+
|
110
|
+
function addHeapObject(obj) {
|
111
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
112
|
+
const idx = heap_next;
|
113
|
+
heap_next = heap[idx];
|
114
|
+
|
115
|
+
heap[idx] = obj;
|
116
|
+
return idx;
|
117
|
+
}
|
118
|
+
|
119
|
+
let cachegetFloat64Memory0 = null;
|
120
|
+
function getFloat64Memory0() {
|
121
|
+
if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
|
122
|
+
cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
123
|
+
}
|
124
|
+
return cachegetFloat64Memory0;
|
125
|
+
}
|
126
|
+
|
127
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
128
|
+
const ptr = malloc(arg.length * 8);
|
129
|
+
getFloat64Memory0().set(arg, ptr / 8);
|
130
|
+
WASM_VECTOR_LEN = arg.length;
|
131
|
+
return ptr;
|
132
|
+
}
|
133
|
+
|
134
|
+
function passArray8ToWasm0(arg, malloc) {
|
135
|
+
const ptr = malloc(arg.length * 1);
|
136
|
+
getUint8Memory0().set(arg, ptr / 1);
|
137
|
+
WASM_VECTOR_LEN = arg.length;
|
138
|
+
return ptr;
|
139
|
+
}
|
140
|
+
|
141
|
+
let stack_pointer = 32;
|
142
|
+
|
143
|
+
function addBorrowedObject(obj) {
|
144
|
+
if (stack_pointer == 1) throw new Error('out of js stack');
|
145
|
+
heap[--stack_pointer] = obj;
|
146
|
+
return stack_pointer;
|
147
|
+
}
|
148
|
+
/**
|
149
|
+
* @param {number} length
|
150
|
+
* @param {Float64Array} data
|
151
|
+
* @param {Uint8Array} data_null_mask
|
152
|
+
* @param {any} params
|
153
|
+
* @param {Uint8Array} null_mask
|
154
|
+
* @param {Float64Array} y_values
|
155
|
+
* @param {Float64Array} min_y_values
|
156
|
+
* @param {Float64Array} max_y_values
|
157
|
+
*/
|
158
|
+
export function selected_space_to_render_space(length, data, data_null_mask, params, null_mask, y_values, min_y_values, max_y_values) {
|
159
|
+
try {
|
160
|
+
var ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
|
161
|
+
var len0 = WASM_VECTOR_LEN;
|
162
|
+
var ptr1 = passArray8ToWasm0(data_null_mask, wasm.__wbindgen_malloc);
|
163
|
+
var len1 = WASM_VECTOR_LEN;
|
164
|
+
var ptr2 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
165
|
+
var len2 = WASM_VECTOR_LEN;
|
166
|
+
var ptr3 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
167
|
+
var len3 = WASM_VECTOR_LEN;
|
168
|
+
var ptr4 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
169
|
+
var len4 = WASM_VECTOR_LEN;
|
170
|
+
var ptr5 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
171
|
+
var len5 = WASM_VECTOR_LEN;
|
172
|
+
wasm.selected_space_to_render_space(length, ptr0, len0, ptr1, len1, addBorrowedObject(params), ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
173
|
+
} finally {
|
174
|
+
heap[stack_pointer++] = undefined;
|
175
|
+
null_mask.set(getUint8Memory0().subarray(ptr2 / 1, ptr2 / 1 + len2));
|
176
|
+
wasm.__wbindgen_free(ptr2, len2 * 1);
|
177
|
+
y_values.set(getFloat64Memory0().subarray(ptr3 / 8, ptr3 / 8 + len3));
|
178
|
+
wasm.__wbindgen_free(ptr3, len3 * 8);
|
179
|
+
min_y_values.set(getFloat64Memory0().subarray(ptr4 / 8, ptr4 / 8 + len4));
|
180
|
+
wasm.__wbindgen_free(ptr4, len4 * 8);
|
181
|
+
max_y_values.set(getFloat64Memory0().subarray(ptr5 / 8, ptr5 / 8 + len5));
|
182
|
+
wasm.__wbindgen_free(ptr5, len5 * 8);
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
let cachegetFloat32Memory0 = null;
|
187
|
+
function getFloat32Memory0() {
|
188
|
+
if (cachegetFloat32Memory0 === null || cachegetFloat32Memory0.buffer !== wasm.memory.buffer) {
|
189
|
+
cachegetFloat32Memory0 = new Float32Array(wasm.memory.buffer);
|
190
|
+
}
|
191
|
+
return cachegetFloat32Memory0;
|
192
|
+
}
|
193
|
+
|
194
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
195
|
+
const ptr = malloc(arg.length * 4);
|
196
|
+
getFloat32Memory0().set(arg, ptr / 4);
|
197
|
+
WASM_VECTOR_LEN = arg.length;
|
198
|
+
return ptr;
|
199
|
+
}
|
200
|
+
|
201
|
+
let cachegetUint32Memory0 = null;
|
202
|
+
function getUint32Memory0() {
|
203
|
+
if (cachegetUint32Memory0 === null || cachegetUint32Memory0.buffer !== wasm.memory.buffer) {
|
204
|
+
cachegetUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
205
|
+
}
|
206
|
+
return cachegetUint32Memory0;
|
207
|
+
}
|
208
|
+
|
209
|
+
function passArray32ToWasm0(arg, malloc) {
|
210
|
+
const ptr = malloc(arg.length * 4);
|
211
|
+
getUint32Memory0().set(arg, ptr / 4);
|
212
|
+
WASM_VECTOR_LEN = arg.length;
|
213
|
+
return ptr;
|
214
|
+
}
|
215
|
+
/**
|
216
|
+
* @param {number} dpi_increase
|
217
|
+
* @param {Uint8Array} null_mask
|
218
|
+
* @param {Float64Array} y_values
|
219
|
+
* @param {Float64Array} min_y_values
|
220
|
+
* @param {Float64Array} max_y_values
|
221
|
+
* @param {Float32Array} positions
|
222
|
+
* @param {Float32Array} prev_positions
|
223
|
+
* @param {Float32Array} vertices
|
224
|
+
* @param {Uint32Array} indices
|
225
|
+
* @param {boolean} dashed
|
226
|
+
* @param {number} dash0
|
227
|
+
* @param {number} dash1
|
228
|
+
*/
|
229
|
+
export function extract_vertices(dpi_increase, null_mask, y_values, min_y_values, max_y_values, positions, prev_positions, vertices, indices, dashed, dash0, dash1) {
|
230
|
+
try {
|
231
|
+
var ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
232
|
+
var len0 = WASM_VECTOR_LEN;
|
233
|
+
var ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
234
|
+
var len1 = WASM_VECTOR_LEN;
|
235
|
+
var ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
236
|
+
var len2 = WASM_VECTOR_LEN;
|
237
|
+
var ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
238
|
+
var len3 = WASM_VECTOR_LEN;
|
239
|
+
var ptr4 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);
|
240
|
+
var len4 = WASM_VECTOR_LEN;
|
241
|
+
var ptr5 = passArrayF32ToWasm0(prev_positions, wasm.__wbindgen_malloc);
|
242
|
+
var len5 = WASM_VECTOR_LEN;
|
243
|
+
var ptr6 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);
|
244
|
+
var len6 = WASM_VECTOR_LEN;
|
245
|
+
var ptr7 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
246
|
+
var len7 = WASM_VECTOR_LEN;
|
247
|
+
wasm.extract_vertices(dpi_increase, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, dashed, dash0, dash1);
|
248
|
+
} finally {
|
249
|
+
positions.set(getFloat32Memory0().subarray(ptr4 / 4, ptr4 / 4 + len4));
|
250
|
+
wasm.__wbindgen_free(ptr4, len4 * 4);
|
251
|
+
prev_positions.set(getFloat32Memory0().subarray(ptr5 / 4, ptr5 / 4 + len5));
|
252
|
+
wasm.__wbindgen_free(ptr5, len5 * 4);
|
253
|
+
vertices.set(getFloat32Memory0().subarray(ptr6 / 4, ptr6 / 4 + len6));
|
254
|
+
wasm.__wbindgen_free(ptr6, len6 * 4);
|
255
|
+
indices.set(getUint32Memory0().subarray(ptr7 / 4, ptr7 / 4 + len7));
|
256
|
+
wasm.__wbindgen_free(ptr7, len7 * 4);
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
/**
|
261
|
+
*/
|
262
|
+
export function main_js() {
|
263
|
+
wasm.main_js();
|
264
|
+
}
|
265
|
+
|
266
|
+
/**
|
267
|
+
* @param {Uint8Array} null_mask
|
268
|
+
* @param {Float64Array} y_values
|
269
|
+
* @param {Float64Array} min_y_values
|
270
|
+
* @param {Float64Array} max_y_values
|
271
|
+
* @param {boolean} dashed
|
272
|
+
* @param {number} dash0
|
273
|
+
* @param {number} dash1
|
274
|
+
* @returns {number}
|
275
|
+
*/
|
276
|
+
export function get_point_number(null_mask, y_values, min_y_values, max_y_values, dashed, dash0, dash1) {
|
277
|
+
var ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
278
|
+
var len0 = WASM_VECTOR_LEN;
|
279
|
+
var ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
280
|
+
var len1 = WASM_VECTOR_LEN;
|
281
|
+
var ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
282
|
+
var len2 = WASM_VECTOR_LEN;
|
283
|
+
var ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
284
|
+
var len3 = WASM_VECTOR_LEN;
|
285
|
+
var ret = wasm.get_point_number(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, dashed, dash0, dash1);
|
286
|
+
return ret;
|
287
|
+
}
|
288
|
+
|
289
|
+
export const __wbg_minx_3675eb59ca2b1c04 = function(arg0) {
|
290
|
+
var ret = getObject(arg0).minX;
|
291
|
+
return ret;
|
292
|
+
};
|
293
|
+
|
294
|
+
export const __wbg_maxx_add7a3e35c2f52a9 = function(arg0) {
|
295
|
+
var ret = getObject(arg0).maxX;
|
296
|
+
return ret;
|
297
|
+
};
|
298
|
+
|
299
|
+
export const __wbg_miny_9972d9159e80fde8 = function(arg0) {
|
300
|
+
var ret = getObject(arg0).minY;
|
301
|
+
return ret;
|
302
|
+
};
|
303
|
+
|
304
|
+
export const __wbg_maxy_1c5b27cf1988c667 = function(arg0) {
|
305
|
+
var ret = getObject(arg0).maxY;
|
306
|
+
return ret;
|
307
|
+
};
|
308
|
+
|
309
|
+
export const __wbg_renderwidth_a0b0f18a85207529 = function(arg0) {
|
310
|
+
var ret = getObject(arg0).renderWidth;
|
311
|
+
return ret;
|
312
|
+
};
|
313
|
+
|
314
|
+
export const __wbg_renderheight_36b17e8bfc037fc9 = function(arg0) {
|
315
|
+
var ret = getObject(arg0).renderHeight;
|
316
|
+
return ret;
|
317
|
+
};
|
318
|
+
|
319
|
+
export const __wbg_scale_5e6438f0fcc08bc0 = function(arg0) {
|
320
|
+
var ret = getObject(arg0).scale;
|
321
|
+
return addHeapObject(ret);
|
322
|
+
};
|
323
|
+
|
324
|
+
export const __wbindgen_string_get = function(arg0, arg1) {
|
325
|
+
const obj = getObject(arg1);
|
326
|
+
var ret = typeof(obj) === 'string' ? obj : undefined;
|
327
|
+
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
328
|
+
var len0 = WASM_VECTOR_LEN;
|
329
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
330
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
331
|
+
};
|
332
|
+
|
333
|
+
export const __wbindgen_object_drop_ref = function(arg0) {
|
334
|
+
takeObject(arg0);
|
335
|
+
};
|
336
|
+
|
337
|
+
export const __wbindgen_string_new = function(arg0, arg1) {
|
338
|
+
var ret = getStringFromWasm0(arg0, arg1);
|
339
|
+
return addHeapObject(ret);
|
340
|
+
};
|
341
|
+
|
342
|
+
export const __wbg_log_6a5797c4bb0f636c = function(arg0) {
|
343
|
+
console.log(getObject(arg0));
|
344
|
+
};
|
345
|
+
|
346
|
+
export const __wbindgen_throw = function(arg0, arg1) {
|
347
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
348
|
+
};
|
349
|
+
|
350
|
+
wasm.__wbindgen_start();
|
351
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/* tslint:disable */
|
2
|
+
/* eslint-disable */
|
3
|
+
export const memory: WebAssembly.Memory;
|
4
|
+
export function selected_space_to_render_space(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number): void;
|
5
|
+
export function extract_vertices(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number): void;
|
6
|
+
export function main_js(): void;
|
7
|
+
export function get_point_number(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number): number;
|
8
|
+
export function __wbindgen_malloc(a: number): number;
|
9
|
+
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
10
|
+
export function __wbindgen_free(a: number, b: number): void;
|
11
|
+
export function __wbindgen_start(): void;
|
Binary file
|
@@ -0,0 +1,342 @@
|
|
1
|
+
import * as wasm from './index_bg.wasm';
|
2
|
+
|
3
|
+
const heap = new Array(32).fill(undefined);
|
4
|
+
|
5
|
+
heap.push(undefined, null, true, false);
|
6
|
+
|
7
|
+
function getObject(idx) { return heap[idx]; }
|
8
|
+
|
9
|
+
let WASM_VECTOR_LEN = 0;
|
10
|
+
|
11
|
+
let cachegetUint8Memory0 = null;
|
12
|
+
function getUint8Memory0() {
|
13
|
+
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
14
|
+
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
15
|
+
}
|
16
|
+
return cachegetUint8Memory0;
|
17
|
+
}
|
18
|
+
|
19
|
+
const lTextEncoder = typeof TextEncoder === 'undefined' ? require('util').TextEncoder : TextEncoder;
|
20
|
+
|
21
|
+
let cachedTextEncoder = new lTextEncoder('utf-8');
|
22
|
+
|
23
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
24
|
+
? function (arg, view) {
|
25
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
26
|
+
}
|
27
|
+
: function (arg, view) {
|
28
|
+
const buf = cachedTextEncoder.encode(arg);
|
29
|
+
view.set(buf);
|
30
|
+
return {
|
31
|
+
read: arg.length,
|
32
|
+
written: buf.length
|
33
|
+
};
|
34
|
+
});
|
35
|
+
|
36
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
37
|
+
|
38
|
+
if (realloc === undefined) {
|
39
|
+
const buf = cachedTextEncoder.encode(arg);
|
40
|
+
const ptr = malloc(buf.length);
|
41
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
42
|
+
WASM_VECTOR_LEN = buf.length;
|
43
|
+
return ptr;
|
44
|
+
}
|
45
|
+
|
46
|
+
let len = arg.length;
|
47
|
+
let ptr = malloc(len);
|
48
|
+
|
49
|
+
const mem = getUint8Memory0();
|
50
|
+
|
51
|
+
let offset = 0;
|
52
|
+
|
53
|
+
for (; offset < len; offset++) {
|
54
|
+
const code = arg.charCodeAt(offset);
|
55
|
+
if (code > 0x7F) break;
|
56
|
+
mem[ptr + offset] = code;
|
57
|
+
}
|
58
|
+
|
59
|
+
if (offset !== len) {
|
60
|
+
if (offset !== 0) {
|
61
|
+
arg = arg.slice(offset);
|
62
|
+
}
|
63
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
64
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
65
|
+
const ret = encodeString(arg, view);
|
66
|
+
|
67
|
+
offset += ret.written;
|
68
|
+
}
|
69
|
+
|
70
|
+
WASM_VECTOR_LEN = offset;
|
71
|
+
return ptr;
|
72
|
+
}
|
73
|
+
|
74
|
+
function isLikeNone(x) {
|
75
|
+
return x === undefined || x === null;
|
76
|
+
}
|
77
|
+
|
78
|
+
let cachegetInt32Memory0 = null;
|
79
|
+
function getInt32Memory0() {
|
80
|
+
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
81
|
+
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
82
|
+
}
|
83
|
+
return cachegetInt32Memory0;
|
84
|
+
}
|
85
|
+
|
86
|
+
let heap_next = heap.length;
|
87
|
+
|
88
|
+
function dropObject(idx) {
|
89
|
+
if (idx < 36) return;
|
90
|
+
heap[idx] = heap_next;
|
91
|
+
heap_next = idx;
|
92
|
+
}
|
93
|
+
|
94
|
+
function takeObject(idx) {
|
95
|
+
const ret = getObject(idx);
|
96
|
+
dropObject(idx);
|
97
|
+
return ret;
|
98
|
+
}
|
99
|
+
|
100
|
+
const lTextDecoder = typeof TextDecoder === 'undefined' ? require('util').TextDecoder : TextDecoder;
|
101
|
+
|
102
|
+
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
103
|
+
|
104
|
+
cachedTextDecoder.decode();
|
105
|
+
|
106
|
+
function getStringFromWasm0(ptr, len) {
|
107
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
108
|
+
}
|
109
|
+
|
110
|
+
function addHeapObject(obj) {
|
111
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
112
|
+
const idx = heap_next;
|
113
|
+
heap_next = heap[idx];
|
114
|
+
|
115
|
+
heap[idx] = obj;
|
116
|
+
return idx;
|
117
|
+
}
|
118
|
+
|
119
|
+
let cachegetFloat64Memory0 = null;
|
120
|
+
function getFloat64Memory0() {
|
121
|
+
if (cachegetFloat64Memory0 === null || cachegetFloat64Memory0.buffer !== wasm.memory.buffer) {
|
122
|
+
cachegetFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
123
|
+
}
|
124
|
+
return cachegetFloat64Memory0;
|
125
|
+
}
|
126
|
+
|
127
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
128
|
+
const ptr = malloc(arg.length * 8);
|
129
|
+
getFloat64Memory0().set(arg, ptr / 8);
|
130
|
+
WASM_VECTOR_LEN = arg.length;
|
131
|
+
return ptr;
|
132
|
+
}
|
133
|
+
|
134
|
+
function passArray8ToWasm0(arg, malloc) {
|
135
|
+
const ptr = malloc(arg.length * 1);
|
136
|
+
getUint8Memory0().set(arg, ptr / 1);
|
137
|
+
WASM_VECTOR_LEN = arg.length;
|
138
|
+
return ptr;
|
139
|
+
}
|
140
|
+
|
141
|
+
let stack_pointer = 32;
|
142
|
+
|
143
|
+
function addBorrowedObject(obj) {
|
144
|
+
if (stack_pointer == 1) throw new Error('out of js stack');
|
145
|
+
heap[--stack_pointer] = obj;
|
146
|
+
return stack_pointer;
|
147
|
+
}
|
148
|
+
/**
|
149
|
+
* @param {number} length
|
150
|
+
* @param {Float64Array} data
|
151
|
+
* @param {Uint8Array} data_null_mask
|
152
|
+
* @param {any} params
|
153
|
+
* @param {Uint8Array} null_mask
|
154
|
+
* @param {Float64Array} y_values
|
155
|
+
* @param {Float64Array} min_y_values
|
156
|
+
* @param {Float64Array} max_y_values
|
157
|
+
*/
|
158
|
+
export function selected_space_to_render_space(length, data, data_null_mask, params, null_mask, y_values, min_y_values, max_y_values) {
|
159
|
+
try {
|
160
|
+
var ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
|
161
|
+
var len0 = WASM_VECTOR_LEN;
|
162
|
+
var ptr1 = passArray8ToWasm0(data_null_mask, wasm.__wbindgen_malloc);
|
163
|
+
var len1 = WASM_VECTOR_LEN;
|
164
|
+
var ptr2 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
165
|
+
var len2 = WASM_VECTOR_LEN;
|
166
|
+
var ptr3 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
167
|
+
var len3 = WASM_VECTOR_LEN;
|
168
|
+
var ptr4 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
169
|
+
var len4 = WASM_VECTOR_LEN;
|
170
|
+
var ptr5 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
171
|
+
var len5 = WASM_VECTOR_LEN;
|
172
|
+
wasm.selected_space_to_render_space(length, ptr0, len0, ptr1, len1, addBorrowedObject(params), ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
173
|
+
} finally {
|
174
|
+
heap[stack_pointer++] = undefined;
|
175
|
+
null_mask.set(getUint8Memory0().subarray(ptr2 / 1, ptr2 / 1 + len2));
|
176
|
+
wasm.__wbindgen_free(ptr2, len2 * 1);
|
177
|
+
y_values.set(getFloat64Memory0().subarray(ptr3 / 8, ptr3 / 8 + len3));
|
178
|
+
wasm.__wbindgen_free(ptr3, len3 * 8);
|
179
|
+
min_y_values.set(getFloat64Memory0().subarray(ptr4 / 8, ptr4 / 8 + len4));
|
180
|
+
wasm.__wbindgen_free(ptr4, len4 * 8);
|
181
|
+
max_y_values.set(getFloat64Memory0().subarray(ptr5 / 8, ptr5 / 8 + len5));
|
182
|
+
wasm.__wbindgen_free(ptr5, len5 * 8);
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
let cachegetFloat32Memory0 = null;
|
187
|
+
function getFloat32Memory0() {
|
188
|
+
if (cachegetFloat32Memory0 === null || cachegetFloat32Memory0.buffer !== wasm.memory.buffer) {
|
189
|
+
cachegetFloat32Memory0 = new Float32Array(wasm.memory.buffer);
|
190
|
+
}
|
191
|
+
return cachegetFloat32Memory0;
|
192
|
+
}
|
193
|
+
|
194
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
195
|
+
const ptr = malloc(arg.length * 4);
|
196
|
+
getFloat32Memory0().set(arg, ptr / 4);
|
197
|
+
WASM_VECTOR_LEN = arg.length;
|
198
|
+
return ptr;
|
199
|
+
}
|
200
|
+
|
201
|
+
let cachegetUint32Memory0 = null;
|
202
|
+
function getUint32Memory0() {
|
203
|
+
if (cachegetUint32Memory0 === null || cachegetUint32Memory0.buffer !== wasm.memory.buffer) {
|
204
|
+
cachegetUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
205
|
+
}
|
206
|
+
return cachegetUint32Memory0;
|
207
|
+
}
|
208
|
+
|
209
|
+
function passArray32ToWasm0(arg, malloc) {
|
210
|
+
const ptr = malloc(arg.length * 4);
|
211
|
+
getUint32Memory0().set(arg, ptr / 4);
|
212
|
+
WASM_VECTOR_LEN = arg.length;
|
213
|
+
return ptr;
|
214
|
+
}
|
215
|
+
/**
|
216
|
+
* @param {number} dpi_increase
|
217
|
+
* @param {Uint8Array} null_mask
|
218
|
+
* @param {Float64Array} y_values
|
219
|
+
* @param {Float64Array} min_y_values
|
220
|
+
* @param {Float64Array} max_y_values
|
221
|
+
* @param {Float32Array} positions
|
222
|
+
* @param {Float32Array} prev_positions
|
223
|
+
* @param {Float32Array} vertices
|
224
|
+
* @param {Uint32Array} indices
|
225
|
+
* @param {boolean} dashed
|
226
|
+
* @param {number} dash0
|
227
|
+
* @param {number} dash1
|
228
|
+
*/
|
229
|
+
export function extract_vertices(dpi_increase, null_mask, y_values, min_y_values, max_y_values, positions, prev_positions, vertices, indices, dashed, dash0, dash1) {
|
230
|
+
try {
|
231
|
+
var ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
232
|
+
var len0 = WASM_VECTOR_LEN;
|
233
|
+
var ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
234
|
+
var len1 = WASM_VECTOR_LEN;
|
235
|
+
var ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
236
|
+
var len2 = WASM_VECTOR_LEN;
|
237
|
+
var ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
238
|
+
var len3 = WASM_VECTOR_LEN;
|
239
|
+
var ptr4 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);
|
240
|
+
var len4 = WASM_VECTOR_LEN;
|
241
|
+
var ptr5 = passArrayF32ToWasm0(prev_positions, wasm.__wbindgen_malloc);
|
242
|
+
var len5 = WASM_VECTOR_LEN;
|
243
|
+
var ptr6 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);
|
244
|
+
var len6 = WASM_VECTOR_LEN;
|
245
|
+
var ptr7 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
246
|
+
var len7 = WASM_VECTOR_LEN;
|
247
|
+
wasm.extract_vertices(dpi_increase, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, dashed, dash0, dash1);
|
248
|
+
} finally {
|
249
|
+
positions.set(getFloat32Memory0().subarray(ptr4 / 4, ptr4 / 4 + len4));
|
250
|
+
wasm.__wbindgen_free(ptr4, len4 * 4);
|
251
|
+
prev_positions.set(getFloat32Memory0().subarray(ptr5 / 4, ptr5 / 4 + len5));
|
252
|
+
wasm.__wbindgen_free(ptr5, len5 * 4);
|
253
|
+
vertices.set(getFloat32Memory0().subarray(ptr6 / 4, ptr6 / 4 + len6));
|
254
|
+
wasm.__wbindgen_free(ptr6, len6 * 4);
|
255
|
+
indices.set(getUint32Memory0().subarray(ptr7 / 4, ptr7 / 4 + len7));
|
256
|
+
wasm.__wbindgen_free(ptr7, len7 * 4);
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
/**
|
261
|
+
* @param {Uint8Array} null_mask
|
262
|
+
* @param {Float64Array} y_values
|
263
|
+
* @param {Float64Array} min_y_values
|
264
|
+
* @param {Float64Array} max_y_values
|
265
|
+
* @param {boolean} dashed
|
266
|
+
* @param {number} dash0
|
267
|
+
* @param {number} dash1
|
268
|
+
* @returns {number}
|
269
|
+
*/
|
270
|
+
export function get_point_number(null_mask, y_values, min_y_values, max_y_values, dashed, dash0, dash1) {
|
271
|
+
var ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
272
|
+
var len0 = WASM_VECTOR_LEN;
|
273
|
+
var ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
274
|
+
var len1 = WASM_VECTOR_LEN;
|
275
|
+
var ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
276
|
+
var len2 = WASM_VECTOR_LEN;
|
277
|
+
var ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
278
|
+
var len3 = WASM_VECTOR_LEN;
|
279
|
+
var ret = wasm.get_point_number(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, dashed, dash0, dash1);
|
280
|
+
return ret;
|
281
|
+
}
|
282
|
+
|
283
|
+
/**
|
284
|
+
*/
|
285
|
+
export function main_js() {
|
286
|
+
wasm.main_js();
|
287
|
+
}
|
288
|
+
|
289
|
+
export const __wbg_minx_3675eb59ca2b1c04 = function(arg0) {
|
290
|
+
var ret = getObject(arg0).minX;
|
291
|
+
return ret;
|
292
|
+
};
|
293
|
+
|
294
|
+
export const __wbg_maxx_add7a3e35c2f52a9 = function(arg0) {
|
295
|
+
var ret = getObject(arg0).maxX;
|
296
|
+
return ret;
|
297
|
+
};
|
298
|
+
|
299
|
+
export const __wbg_miny_9972d9159e80fde8 = function(arg0) {
|
300
|
+
var ret = getObject(arg0).minY;
|
301
|
+
return ret;
|
302
|
+
};
|
303
|
+
|
304
|
+
export const __wbg_maxy_1c5b27cf1988c667 = function(arg0) {
|
305
|
+
var ret = getObject(arg0).maxY;
|
306
|
+
return ret;
|
307
|
+
};
|
308
|
+
|
309
|
+
export const __wbg_renderwidth_a0b0f18a85207529 = function(arg0) {
|
310
|
+
var ret = getObject(arg0).renderWidth;
|
311
|
+
return ret;
|
312
|
+
};
|
313
|
+
|
314
|
+
export const __wbg_renderheight_36b17e8bfc037fc9 = function(arg0) {
|
315
|
+
var ret = getObject(arg0).renderHeight;
|
316
|
+
return ret;
|
317
|
+
};
|
318
|
+
|
319
|
+
export const __wbg_scale_5e6438f0fcc08bc0 = function(arg0) {
|
320
|
+
var ret = getObject(arg0).scale;
|
321
|
+
return addHeapObject(ret);
|
322
|
+
};
|
323
|
+
|
324
|
+
export const __wbindgen_string_get = function(arg0, arg1) {
|
325
|
+
const obj = getObject(arg1);
|
326
|
+
var ret = typeof(obj) === 'string' ? obj : undefined;
|
327
|
+
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
328
|
+
var len0 = WASM_VECTOR_LEN;
|
329
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
330
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
331
|
+
};
|
332
|
+
|
333
|
+
export const __wbindgen_object_drop_ref = function(arg0) {
|
334
|
+
takeObject(arg0);
|
335
|
+
};
|
336
|
+
|
337
|
+
export const __wbindgen_throw = function(arg0, arg1) {
|
338
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
339
|
+
};
|
340
|
+
|
341
|
+
wasm.__wbindgen_start();
|
342
|
+
|
Binary file
|