@windborne/grapher 1.0.53 → 1.0.55
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/744.bundle.cjs +2 -0
- package/dist/744.bundle.cjs.map +1 -0
- package/dist/744.bundle.esm.js +2 -0
- package/dist/744.bundle.esm.js.map +1 -0
- package/dist/97448149e3e6fbc66aad.wasm +0 -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 +4 -4
- package/src/components/tooltip.jsx +1 -6
- package/src/renderer/graph_body_renderer.js +11 -3
- package/src/rust/pkg/index.js +398 -0
- package/src/rust/pkg/index_bg.wasm +0 -0
- package/src/rust/pkg/package.json +16 -0
- package/src/state/calculate_tooltip_state.js +12 -3
- package/dist/599.bundle.cjs +0 -1
- package/dist/599.bundle.esm.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windborne/grapher",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.55",
|
|
4
4
|
"description": "Graphing library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "dist/bundle.esm.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dev": "webpack-dev-server --config webpack.dev.config.cjs",
|
|
32
32
|
"build": "rm -rf dist && mkdir -p dist && rm -f *.wasm && webpack --config webpack.prod.config.cjs && touch src/rust/pkg/.npmignore",
|
|
33
33
|
"analyze-size": "webpack --config webpack.prod.config.cjs --json | webpack-bundle-size-analyzer",
|
|
34
|
-
"test": "
|
|
34
|
+
"test": "mochapack --webpack-config webpack.test.config.cjs --require test/setup.js --recursive --glob \"*.test.js\" test",
|
|
35
35
|
"coverage": "NODE_ENV=coverage nyc --reporter=lcov --reporter=text npm run test"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"eslint-plugin-react": "^7.17.0",
|
|
70
70
|
"file-loader": "^6.2.0",
|
|
71
71
|
"html-webpack-plugin": "^5.6.0",
|
|
72
|
-
"
|
|
72
|
+
"babel-plugin-istanbul": "^7.0.0",
|
|
73
73
|
"jsdom": "^16.3.0",
|
|
74
74
|
"jsdom-global": "^3.0.2",
|
|
75
75
|
"kefir": "^3.8.6",
|
|
76
76
|
"mocha": "^7.2.0",
|
|
77
|
-
"
|
|
77
|
+
"mochapack": "^2.1.4",
|
|
78
78
|
"nyc": "^15.1.0",
|
|
79
79
|
"prop-types": "^15.7.2",
|
|
80
80
|
"react": "^16.12.0",
|
|
@@ -242,10 +242,6 @@ export default class Tooltip extends React.PureComponent {
|
|
|
242
242
|
group.pixelY = tooltip.pixelY;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
if (tooltip.tooltipPixelY !== undefined && (group.tooltipPixelY === undefined || tooltip.tooltipPixelY < group.tooltipPixelY)) {
|
|
246
|
-
group.tooltipPixelY = tooltip.tooltipPixelY;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
245
|
added = true;
|
|
250
246
|
break;
|
|
251
247
|
}
|
|
@@ -255,7 +251,6 @@ export default class Tooltip extends React.PureComponent {
|
|
|
255
251
|
groupedTooltips.push({
|
|
256
252
|
pixelX: tooltip.pixelX,
|
|
257
253
|
pixelY: tooltip.pixelY,
|
|
258
|
-
tooltipPixelY: tooltip.tooltipPixelY,
|
|
259
254
|
multiplier: tooltip.multiplier,
|
|
260
255
|
tooltips: [tooltip]
|
|
261
256
|
});
|
|
@@ -364,7 +359,7 @@ export default class Tooltip extends React.PureComponent {
|
|
|
364
359
|
<div
|
|
365
360
|
key={i}
|
|
366
361
|
className="custom-tooltip-container"
|
|
367
|
-
style={{top: tooltip.
|
|
362
|
+
style={{top: tooltip.pixelY, left: tooltip.pixelX}}
|
|
368
363
|
>
|
|
369
364
|
<CustomTooltipComponent {...tooltip} />
|
|
370
365
|
</div>
|
|
@@ -352,11 +352,19 @@ export default class GraphBodyRenderer extends Eventable {
|
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
if (singleSeries.rendering === 'bar') {
|
|
355
|
+
const barSeriesInAxis = singleSeries.axis.series.filter(s => s.rendering === 'bar');
|
|
356
|
+
let barClosestSpacing = null;
|
|
357
|
+
for (const s of barSeriesInAxis) {
|
|
358
|
+
const sp = s.dataBounds?.closestSpacing;
|
|
359
|
+
if (sp != null && sp > 0 && (barClosestSpacing === null || sp > barClosestSpacing)) {
|
|
360
|
+
barClosestSpacing = sp;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
355
363
|
let barParams = {
|
|
356
364
|
...commonCPUParams,
|
|
357
|
-
indexInAxis:
|
|
358
|
-
axisSeriesCount:
|
|
359
|
-
closestSpacing: globalBounds.closestSpacing,
|
|
365
|
+
indexInAxis: barSeriesInAxis.indexOf(singleSeries),
|
|
366
|
+
axisSeriesCount: barSeriesInAxis.length,
|
|
367
|
+
closestSpacing: barClosestSpacing || globalBounds.closestSpacing,
|
|
360
368
|
bounds
|
|
361
369
|
};
|
|
362
370
|
|
package/src/rust/pkg/index.js
CHANGED
|
@@ -0,0 +1,398 @@
|
|
|
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
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
96
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
97
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
98
|
+
WASM_VECTOR_LEN = arg.length;
|
|
99
|
+
return ptr;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
103
|
+
|
|
104
|
+
function getFloat64ArrayMemory0() {
|
|
105
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
106
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
107
|
+
}
|
|
108
|
+
return cachedFloat64ArrayMemory0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
|
112
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
113
|
+
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
114
|
+
WASM_VECTOR_LEN = arg.length;
|
|
115
|
+
return ptr;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
119
|
+
|
|
120
|
+
function getFloat32ArrayMemory0() {
|
|
121
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
122
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
123
|
+
}
|
|
124
|
+
return cachedFloat32ArrayMemory0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function passArrayF32ToWasm0(arg, malloc) {
|
|
128
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
129
|
+
getFloat32ArrayMemory0().set(arg, ptr / 4);
|
|
130
|
+
WASM_VECTOR_LEN = arg.length;
|
|
131
|
+
return ptr;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
let cachedUint32ArrayMemory0 = null;
|
|
135
|
+
|
|
136
|
+
function getUint32ArrayMemory0() {
|
|
137
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
138
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
139
|
+
}
|
|
140
|
+
return cachedUint32ArrayMemory0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
144
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
145
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
146
|
+
WASM_VECTOR_LEN = arg.length;
|
|
147
|
+
return ptr;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* @param {number} dpi_increase
|
|
151
|
+
* @param {Uint8Array} null_mask
|
|
152
|
+
* @param {Float64Array} y_values
|
|
153
|
+
* @param {Float64Array} min_y_values
|
|
154
|
+
* @param {Float64Array} max_y_values
|
|
155
|
+
* @param {Float32Array} positions
|
|
156
|
+
* @param {Float32Array} prev_positions
|
|
157
|
+
* @param {Float32Array} vertices
|
|
158
|
+
* @param {Uint32Array} indices
|
|
159
|
+
* @param {boolean} dashed
|
|
160
|
+
* @param {number} dash0
|
|
161
|
+
* @param {number} dash1
|
|
162
|
+
*/
|
|
163
|
+
export function extract_vertices(dpi_increase, null_mask, y_values, min_y_values, max_y_values, positions, prev_positions, vertices, indices, dashed, dash0, dash1) {
|
|
164
|
+
const ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
|
165
|
+
const len0 = WASM_VECTOR_LEN;
|
|
166
|
+
const ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
|
167
|
+
const len1 = WASM_VECTOR_LEN;
|
|
168
|
+
const ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
|
169
|
+
const len2 = WASM_VECTOR_LEN;
|
|
170
|
+
const ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
|
171
|
+
const len3 = WASM_VECTOR_LEN;
|
|
172
|
+
var ptr4 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);
|
|
173
|
+
var len4 = WASM_VECTOR_LEN;
|
|
174
|
+
var ptr5 = passArrayF32ToWasm0(prev_positions, wasm.__wbindgen_malloc);
|
|
175
|
+
var len5 = WASM_VECTOR_LEN;
|
|
176
|
+
var ptr6 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);
|
|
177
|
+
var len6 = WASM_VECTOR_LEN;
|
|
178
|
+
var ptr7 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);
|
|
179
|
+
var len7 = WASM_VECTOR_LEN;
|
|
180
|
+
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);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @param {Uint8Array} null_mask
|
|
185
|
+
* @param {Float64Array} y_values
|
|
186
|
+
* @param {Float64Array} min_y_values
|
|
187
|
+
* @param {Float64Array} max_y_values
|
|
188
|
+
* @param {boolean} dashed
|
|
189
|
+
* @param {number} dash0
|
|
190
|
+
* @param {number} dash1
|
|
191
|
+
* @returns {number}
|
|
192
|
+
*/
|
|
193
|
+
export function get_point_number(null_mask, y_values, min_y_values, max_y_values, dashed, dash0, dash1) {
|
|
194
|
+
const ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
|
195
|
+
const len0 = WASM_VECTOR_LEN;
|
|
196
|
+
const ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
|
197
|
+
const len1 = WASM_VECTOR_LEN;
|
|
198
|
+
const ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
|
199
|
+
const len2 = WASM_VECTOR_LEN;
|
|
200
|
+
const ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
|
201
|
+
const len3 = WASM_VECTOR_LEN;
|
|
202
|
+
const ret = wasm.get_point_number(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, dashed, dash0, dash1);
|
|
203
|
+
return ret;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function main_js() {
|
|
207
|
+
wasm.main_js();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* @param {number} length
|
|
212
|
+
* @param {Float64Array} data
|
|
213
|
+
* @param {Uint8Array} data_null_mask
|
|
214
|
+
* @param {any} params
|
|
215
|
+
* @param {Uint8Array} null_mask
|
|
216
|
+
* @param {Float64Array} y_values
|
|
217
|
+
* @param {Float64Array} min_y_values
|
|
218
|
+
* @param {Float64Array} max_y_values
|
|
219
|
+
*/
|
|
220
|
+
export function selected_space_to_render_space(length, data, data_null_mask, params, null_mask, y_values, min_y_values, max_y_values) {
|
|
221
|
+
const ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
|
|
222
|
+
const len0 = WASM_VECTOR_LEN;
|
|
223
|
+
const ptr1 = passArray8ToWasm0(data_null_mask, wasm.__wbindgen_malloc);
|
|
224
|
+
const len1 = WASM_VECTOR_LEN;
|
|
225
|
+
var ptr2 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);
|
|
226
|
+
var len2 = WASM_VECTOR_LEN;
|
|
227
|
+
var ptr3 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);
|
|
228
|
+
var len3 = WASM_VECTOR_LEN;
|
|
229
|
+
var ptr4 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);
|
|
230
|
+
var len4 = WASM_VECTOR_LEN;
|
|
231
|
+
var ptr5 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);
|
|
232
|
+
var len5 = WASM_VECTOR_LEN;
|
|
233
|
+
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);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
async function __wbg_load(module, imports) {
|
|
237
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
238
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
239
|
+
try {
|
|
240
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
241
|
+
|
|
242
|
+
} catch (e) {
|
|
243
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
244
|
+
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);
|
|
245
|
+
|
|
246
|
+
} else {
|
|
247
|
+
throw e;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const bytes = await module.arrayBuffer();
|
|
253
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
254
|
+
|
|
255
|
+
} else {
|
|
256
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
257
|
+
|
|
258
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
259
|
+
return { instance, module };
|
|
260
|
+
|
|
261
|
+
} else {
|
|
262
|
+
return instance;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function __wbg_get_imports() {
|
|
268
|
+
const imports = {};
|
|
269
|
+
imports.wbg = {};
|
|
270
|
+
imports.wbg.__wbg_maxx_a3b1e1c3299e47bf = function(arg0) {
|
|
271
|
+
const ret = arg0.maxX;
|
|
272
|
+
return ret;
|
|
273
|
+
};
|
|
274
|
+
imports.wbg.__wbg_maxy_007b81ea99058122 = function(arg0) {
|
|
275
|
+
const ret = arg0.maxY;
|
|
276
|
+
return ret;
|
|
277
|
+
};
|
|
278
|
+
imports.wbg.__wbg_minx_e03d57649d81fc8f = function(arg0) {
|
|
279
|
+
const ret = arg0.minX;
|
|
280
|
+
return ret;
|
|
281
|
+
};
|
|
282
|
+
imports.wbg.__wbg_miny_46aab5af597882a7 = function(arg0) {
|
|
283
|
+
const ret = arg0.minY;
|
|
284
|
+
return ret;
|
|
285
|
+
};
|
|
286
|
+
imports.wbg.__wbg_renderheight_d030fe5a23b4c32b = function(arg0) {
|
|
287
|
+
const ret = arg0.renderHeight;
|
|
288
|
+
return ret;
|
|
289
|
+
};
|
|
290
|
+
imports.wbg.__wbg_renderwidth_8685762ee304f2a7 = function(arg0) {
|
|
291
|
+
const ret = arg0.renderWidth;
|
|
292
|
+
return ret;
|
|
293
|
+
};
|
|
294
|
+
imports.wbg.__wbg_scale_d705e0de44ed2361 = function(arg0) {
|
|
295
|
+
const ret = arg0.scale;
|
|
296
|
+
return ret;
|
|
297
|
+
};
|
|
298
|
+
imports.wbg.__wbindgen_copy_to_typed_array = function(arg0, arg1, arg2) {
|
|
299
|
+
new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));
|
|
300
|
+
};
|
|
301
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
302
|
+
const table = wasm.__wbindgen_export_0;
|
|
303
|
+
const offset = table.grow(4);
|
|
304
|
+
table.set(0, undefined);
|
|
305
|
+
table.set(offset + 0, undefined);
|
|
306
|
+
table.set(offset + 1, null);
|
|
307
|
+
table.set(offset + 2, true);
|
|
308
|
+
table.set(offset + 3, false);
|
|
309
|
+
;
|
|
310
|
+
};
|
|
311
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
312
|
+
const obj = arg1;
|
|
313
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
314
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
315
|
+
var len1 = WASM_VECTOR_LEN;
|
|
316
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
317
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
318
|
+
};
|
|
319
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
320
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
return imports;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function __wbg_init_memory(imports, memory) {
|
|
327
|
+
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function __wbg_finalize_init(instance, module) {
|
|
331
|
+
wasm = instance.exports;
|
|
332
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
333
|
+
cachedDataViewMemory0 = null;
|
|
334
|
+
cachedFloat32ArrayMemory0 = null;
|
|
335
|
+
cachedFloat64ArrayMemory0 = null;
|
|
336
|
+
cachedUint32ArrayMemory0 = null;
|
|
337
|
+
cachedUint8ArrayMemory0 = null;
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
wasm.__wbindgen_start();
|
|
341
|
+
return wasm;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function initSync(module) {
|
|
345
|
+
if (wasm !== undefined) return wasm;
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
if (typeof module !== 'undefined') {
|
|
349
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
350
|
+
({module} = module)
|
|
351
|
+
} else {
|
|
352
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const imports = __wbg_get_imports();
|
|
357
|
+
|
|
358
|
+
__wbg_init_memory(imports);
|
|
359
|
+
|
|
360
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
361
|
+
module = new WebAssembly.Module(module);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
365
|
+
|
|
366
|
+
return __wbg_finalize_init(instance, module);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
async function __wbg_init(module_or_path) {
|
|
370
|
+
if (wasm !== undefined) return wasm;
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
if (typeof module_or_path !== 'undefined') {
|
|
374
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
375
|
+
({module_or_path} = module_or_path)
|
|
376
|
+
} else {
|
|
377
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (typeof module_or_path === 'undefined') {
|
|
382
|
+
module_or_path = new URL('index_bg.wasm', import.meta.url);
|
|
383
|
+
}
|
|
384
|
+
const imports = __wbg_get_imports();
|
|
385
|
+
|
|
386
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
387
|
+
module_or_path = fetch(module_or_path);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
__wbg_init_memory(imports);
|
|
391
|
+
|
|
392
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
393
|
+
|
|
394
|
+
return __wbg_finalize_init(instance, module);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export { initSync };
|
|
398
|
+
export default __wbg_init;
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "grapher-rs",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"collaborators": [
|
|
5
|
+
"Kai Marshland <kaimarshland@gmail.com>"
|
|
6
|
+
],
|
|
7
|
+
"version": "0.1.0",
|
|
8
|
+
"files": [
|
|
9
|
+
"index_bg.wasm",
|
|
10
|
+
"index.js"
|
|
11
|
+
],
|
|
12
|
+
"main": "index.js",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"./snippets/*"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -109,11 +109,20 @@ export default function calculateTooltipState({mousePresent, mouseX, mouseY, siz
|
|
|
109
109
|
let distanceThreshold = DISTANCE_THRESHOLD;
|
|
110
110
|
|
|
111
111
|
if (singleSeries.rendering === 'bar') {
|
|
112
|
-
const
|
|
113
|
-
const
|
|
112
|
+
const barSeriesInAxis = singleSeries.axis.series.filter(s => s.rendering === 'bar');
|
|
113
|
+
const indexInAxis = barSeriesInAxis.indexOf(singleSeries);
|
|
114
|
+
const axisSeriesCount = barSeriesInAxis.length;
|
|
115
|
+
|
|
116
|
+
let barClosestSpacing = null;
|
|
117
|
+
for (const s of barSeriesInAxis) {
|
|
118
|
+
const sp = s.dataBounds?.closestSpacing;
|
|
119
|
+
if (sp != null && sp > 0 && (barClosestSpacing === null || sp > barClosestSpacing)) {
|
|
120
|
+
barClosestSpacing = sp;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
114
123
|
|
|
115
124
|
const { totalBarWidth, barWidth } = getBarWidths({
|
|
116
|
-
closestSpacing,
|
|
125
|
+
closestSpacing: barClosestSpacing || closestSpacing,
|
|
117
126
|
bounds,
|
|
118
127
|
sizing,
|
|
119
128
|
axisSeriesCount
|
package/dist/599.bundle.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.webpackChunkGrapher=globalThis.webpackChunkGrapher||[]).push([[599],{599:()=>{}}]);
|
package/dist/599.bundle.esm.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const id=599;export const ids=[599];export const modules={599:()=>{}};
|