@windborne/grapher 1.0.39 → 1.0.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windborne/grapher",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "Graphing library",
5
5
  "main": "src/index.js",
6
6
  "module": "dist/bundle.esm.js",
@@ -361,6 +361,7 @@ function drawAreaWithCutoff(
361
361
  shadowBlur,
362
362
  inRenderSpaceAreaBottom,
363
363
  cutoffIndex,
364
+ cutoffTimeValue,
364
365
  cutoffOpacity,
365
366
  originalData,
366
367
  selectionBounds,
@@ -368,7 +369,9 @@ function drawAreaWithCutoff(
368
369
  }
369
370
  ) {
370
371
  let cutoffTime;
371
- if (typeof originalData[0] === "object" && originalData[0].length === 2) {
372
+ if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {
373
+ cutoffTime = cutoffTimeValue;
374
+ } else if (typeof originalData[0] === "object" && originalData[0].length === 2) {
372
375
  const baseIndex = Math.floor(cutoffIndex);
373
376
  const fraction = cutoffIndex - baseIndex;
374
377
 
@@ -22,7 +22,7 @@ function applyPointSpacing(points, minSpacing) {
22
22
  }
23
23
 
24
24
  export default function drawLine(dataInRenderSpace, {
25
- color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, pointRadius, minPointSpacing, getIndividualPoints, getRanges, cutoffIndex, cutoffOpacity, originalData, renderCutoffGradient, currentBounds, selectionBounds, rendering, isPreview, negativeColor, hasNegatives, zero, zeroColor
25
+ color, width=1, context, shadowColor='black', shadowBlur=5, dashed=false, dashPattern=null, highlighted=false, showIndividualPoints=false, pointRadius, minPointSpacing, getIndividualPoints, getRanges, cutoffIndex, cutoffTimeValue, cutoffOpacity, originalData, renderCutoffGradient, currentBounds, selectionBounds, rendering, isPreview, negativeColor, hasNegatives, zero, zeroColor
26
26
  }) {
27
27
  if (!context) {
28
28
  console.error("Canvas context is null in drawLine");
@@ -56,7 +56,9 @@ export default function drawLine(dataInRenderSpace, {
56
56
  for (let path of paths) {
57
57
  if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {
58
58
  let cutoffTime;
59
- if (typeof originalData[0] === 'object' && originalData[0].length === 2) {
59
+ if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {
60
+ cutoffTime = cutoffTimeValue;
61
+ } else if (typeof originalData[0] === 'object' && originalData[0].length === 2) {
60
62
  const baseIndex = Math.floor(cutoffIndex);
61
63
  const fraction = cutoffIndex - baseIndex;
62
64
 
@@ -210,30 +212,48 @@ export default function drawLine(dataInRenderSpace, {
210
212
  context.strokeStyle = color;
211
213
  } else {
212
214
  const timeRatio = (cutoffTime - visibleMinTime) / (visibleMaxTime - visibleMinTime);
213
- const renderCutoffIndex = timeRatio * path.length;
214
-
215
- const preCutoffPath = [];
216
- const postCutoffPath = [];
217
- let ghostPoint = null;
218
-
219
- if (renderCutoffIndex > 0 && renderCutoffIndex < path.length - 1) {
220
- const beforeIndex = Math.floor(renderCutoffIndex);
221
- const afterIndex = Math.ceil(renderCutoffIndex);
215
+ const canvasWidth = context.canvas.width;
216
+ const cutoffPixelX = timeRatio * canvasWidth;
222
217
 
223
- if (beforeIndex !== afterIndex) {
224
- const fraction = renderCutoffIndex - beforeIndex;
225
- const beforePoint = path[beforeIndex];
226
- const afterPoint = path[afterIndex];
218
+ // Find the path segment that contains this x position
219
+ let renderCutoffIndex = -1;
220
+ let ghostPoint = null;
221
+
222
+ for (let i = 0; i < path.length - 1; i++) {
223
+ const [x1] = path[i];
224
+ const [x2] = path[i + 1];
227
225
 
228
- ghostPoint = [
229
- beforePoint[0] + fraction * (afterPoint[0] - beforePoint[0]),
230
- beforePoint[1] + fraction * (afterPoint[1] - beforePoint[1])
231
- ];
226
+ if (x1 <= cutoffPixelX && cutoffPixelX <= x2) {
227
+ const xFraction = (cutoffPixelX - x1) / (x2 - x1);
228
+ renderCutoffIndex = i + xFraction;
229
+
230
+ // Create ghost point at exact cutoff x position
231
+ const [, y1] = path[i];
232
+ const [, y2] = path[i + 1];
233
+ ghostPoint = [
234
+ cutoffPixelX,
235
+ y1 + xFraction * (y2 - y1)
236
+ ];
237
+ break;
238
+ }
239
+ }
240
+
241
+ // If cutoff is beyond the data range, check if we should still draw the full line
242
+ if (renderCutoffIndex === -1) {
243
+ const lastDataTime = originalData[originalData.length - 1][0];
244
+ const lastDataTimeMs = lastDataTime instanceof Date ? lastDataTime.getTime() : lastDataTime;
232
245
 
233
- } else {
234
- ghostPoint = path[renderCutoffIndex];
246
+ if (cutoffPixelX >= path[path.length - 1][0]) {
247
+ // Cutoff is after the last point - draw all as pre-cutoff (reduced opacity)
248
+ renderCutoffIndex = path.length - 1;
249
+ } else if (cutoffPixelX < path[0][0]) {
250
+ // Cutoff is before the first point - draw all as post-cutoff (full opacity)
251
+ renderCutoffIndex = 0;
252
+ }
235
253
  }
236
- }
254
+
255
+ const preCutoffPath = [];
256
+ const postCutoffPath = [];
237
257
 
238
258
  for (let i = 0; i < path.length; i++) {
239
259
  if (i < renderCutoffIndex) {
@@ -393,6 +393,7 @@ export default class GraphBodyRenderer extends Eventable {
393
393
 
394
394
  if (singleSeries.cutoffTime) {
395
395
  areaParams.cutoffIndex = cutoffIndex;
396
+ areaParams.cutoffTimeValue = cutoffTime;
396
397
  areaParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;
397
398
  areaParams.originalData = cutoffData;
398
399
  areaParams.renderCutoffGradient = cutoffIndex >= 0;
@@ -481,6 +482,7 @@ export default class GraphBodyRenderer extends Eventable {
481
482
 
482
483
  if (singleSeries.cutoffTime) {
483
484
  shadowParams.cutoffIndex = cutoffIndex;
485
+ shadowParams.cutoffTimeValue = cutoffTime;
484
486
  shadowParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;
485
487
  shadowParams.originalData = cutoffData;
486
488
  shadowParams.renderCutoffGradient = cutoffIndex >= 0;
@@ -629,6 +631,7 @@ export default class GraphBodyRenderer extends Eventable {
629
631
 
630
632
  if (this._webgl && singleSeries.rendering === 'shadow' && singleSeries.cutoffTime && (width > 0 || shouldShowIndividualPoints)) {
631
633
  drawParams.cutoffIndex = cutoffIndex;
634
+ drawParams.cutoffTimeValue = cutoffTime;
632
635
  drawParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;
633
636
  drawParams.originalData = cutoffData;
634
637
  drawParams.renderCutoffGradient = cutoffIndex >= 0;
@@ -648,6 +651,7 @@ export default class GraphBodyRenderer extends Eventable {
648
651
 
649
652
  if (singleSeries.cutoffTime) {
650
653
  drawParams.cutoffIndex = cutoffIndex;
654
+ drawParams.cutoffTimeValue = cutoffTime;
651
655
  drawParams.cutoffOpacity = singleSeries.cutoffOpacity !== undefined ? singleSeries.cutoffOpacity : 0.35;
652
656
  drawParams.originalData = cutoffData;
653
657
  drawParams.renderCutoffGradient = cutoffIndex >= 0;
@@ -657,7 +661,7 @@ export default class GraphBodyRenderer extends Eventable {
657
661
  const selection = this === this._stateController.rangeGraphRenderer
658
662
  ? this._stateController._bounds
659
663
  : (this._stateController._selection || this._stateController._bounds);
660
- drawParams.selectionBounds = selection || bounds;
664
+ drawParams.selectionBounds = selection || bounds;
661
665
  }
662
666
 
663
667
  // For shadow rendering, always use 2D canvas for lines/points even with WebGL
@@ -246,10 +246,12 @@ export default class LineProgram {
246
246
  }
247
247
 
248
248
  drawLineWithCutoff(dataInRenderSpace, parameters) {
249
- const { cutoffIndex, cutoffOpacity, originalData, selectionBounds } = parameters;
249
+ const { cutoffIndex, cutoffTimeValue, cutoffOpacity, originalData, selectionBounds } = parameters;
250
250
 
251
251
  let cutoffTime;
252
- if (typeof originalData[0] === 'object' && originalData[0].length === 2) {
252
+ if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {
253
+ cutoffTime = cutoffTimeValue;
254
+ } else if (typeof originalData[0] === 'object' && originalData[0].length === 2) {
253
255
  const baseIndex = Math.floor(cutoffIndex);
254
256
  const fraction = cutoffIndex - baseIndex;
255
257
 
@@ -414,16 +414,16 @@ export default class ShadowProgram {
414
414
  */
415
415
  drawShadowWithCutoff(individualPoints, params) {
416
416
 
417
- const { cutoffIndex, cutoffOpacity, originalData, selectionBounds, zero } =
417
+ const { cutoffIndex, cutoffTimeValue, cutoffOpacity, originalData, selectionBounds, zero } =
418
418
  params;
419
419
 
420
420
  this._lastIndividualPoints = null;
421
421
  this._lastParams = null;
422
422
 
423
- // All cutoff data is now in tuple format [x, y] from graph_body_renderer
424
423
  let cutoffTime;
425
-
426
- if (Array.isArray(originalData[0]) && originalData[0].length === 2) {
424
+ if (cutoffTimeValue !== undefined && cutoffTimeValue !== null) {
425
+ cutoffTime = cutoffTimeValue;
426
+ } else if (Array.isArray(originalData[0]) && originalData[0].length === 2) {
427
427
  const baseIndex = Math.floor(cutoffIndex);
428
428
  const fraction = cutoffIndex - baseIndex;
429
429
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"744.bundle.esm.js","mappings":"wIAAA,IAAIA,E,8IAEJ,IAAIC,EAA0B,KAE9B,SAASC,IAIL,OAHgC,OAA5BD,GAA2E,IAAvCA,EAAwBE,aAC5DF,EAA0B,IAAIG,WAAWJ,EAAKK,OAAOC,SAElDL,CACX,CAOA,IAAIM,EAAkB,EAEtB,MAAMC,EAA4C,oBAAhBC,YAA8B,IAAIA,YAAY,SAAW,CAAEC,OAAQA,KAAQ,MAAMC,MAAM,4BAA4B,GAE/IC,EAAwD,mBAAjCJ,EAAkBK,WACzC,SAAUC,EAAKC,GACjB,OAAOP,EAAkBK,WAAWC,EAAKC,EAC7C,EACM,SAAUD,EAAKC,GACjB,MAAMC,EAAMR,EAAkBE,OAAOI,GAErC,OADAC,EAAKE,IAAID,GACF,CACHE,KAAMJ,EAAIK,OACVC,QAASJ,EAAIG,OAErB,EA6CA,IAAIE,EAAwB,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,KAAoBT,OAAOE,YAC/CO,kBAAkBA,GAEpBN,QAAQC,KAAK,mGAIS,IAAnBK,IACPA,EAAiB,IAAIC,IAAI,aAE7B,MAAM1D,EAAUD,KAEc,iBAAnB0D,GAAmD,mBAAZE,SAA0BF,aAA0BE,SAA4B,mBAARD,KAAsBD,aAA0BC,OACtKD,EAAiBG,MAAMH,IAK3B,MAAM,SAAEhB,EAAQ,OAAEC,SA5JtBc,eAA0Bd,EAAQ1C,GAC9B,GAAwB,mBAAb6D,UAA2BnB,aAAkBmB,SAAU,CAC9D,GAAgD,mBAArCR,YAAYS,qBACnB,IACI,aAAaT,YAAYS,qBAAqBpB,EAAQ1C,EAE1D,CAAE,MAAO+D,GACL,GAA0C,oBAAtCrB,EAAOsB,QAAQC,IAAI,gBAInB,MAAMF,EAHNZ,QAAQC,KAAK,oMAAqMW,EAK1N,CAGJ,MAAMG,QAAcxB,EAAOyB,cAC3B,aAAad,YAAYe,YAAYF,EAAOlE,EAEhD,CAAO,CACH,MAAMyC,QAAiBY,YAAYe,YAAY1B,EAAQ1C,GAEvD,OAAIyC,aAAoBY,YAAYE,SACzB,CAAEd,WAAUC,UAGZD,CAEf,CACJ,CA+HuC4B,OAAiBZ,EAAgBzD,GAEpE,OAAOwC,EAAoBC,EAAUC,EACzC,CAGA,S","sources":["webpack://@windborne/grapher/./src/rust/pkg/index.js"],"sourcesContent":["let wasm;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nlet cachedFloat64ArrayMemory0 = null;\n\nfunction getFloat64ArrayMemory0() {\n if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {\n cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);\n }\n return cachedFloat64ArrayMemory0;\n}\n\nfunction passArrayF64ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 8, 8) >>> 0;\n getFloat64ArrayMemory0().set(arg, ptr / 8);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1, 1) >>> 0;\n getUint8ArrayMemory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n/**\n * @param {number} length\n * @param {Float64Array} data\n * @param {Uint8Array} data_null_mask\n * @param {any} params\n * @param {Uint8Array} null_mask\n * @param {Float64Array} y_values\n * @param {Float64Array} min_y_values\n * @param {Float64Array} max_y_values\n */\nexport function selected_space_to_render_space(length, data, data_null_mask, params, null_mask, y_values, min_y_values, max_y_values) {\n const ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(data_null_mask, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n var ptr2 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);\n var len2 = WASM_VECTOR_LEN;\n var ptr3 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);\n var len3 = WASM_VECTOR_LEN;\n var ptr4 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);\n var len4 = WASM_VECTOR_LEN;\n var ptr5 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);\n var len5 = WASM_VECTOR_LEN;\n 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);\n}\n\nlet cachedFloat32ArrayMemory0 = null;\n\nfunction getFloat32ArrayMemory0() {\n if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {\n cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);\n }\n return cachedFloat32ArrayMemory0;\n}\n\nfunction passArrayF32ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 4, 4) >>> 0;\n getFloat32ArrayMemory0().set(arg, ptr / 4);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nlet cachedUint32ArrayMemory0 = null;\n\nfunction getUint32ArrayMemory0() {\n if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {\n cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);\n }\n return cachedUint32ArrayMemory0;\n}\n\nfunction passArray32ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 4, 4) >>> 0;\n getUint32ArrayMemory0().set(arg, ptr / 4);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n/**\n * @param {number} dpi_increase\n * @param {Uint8Array} null_mask\n * @param {Float64Array} y_values\n * @param {Float64Array} min_y_values\n * @param {Float64Array} max_y_values\n * @param {Float32Array} positions\n * @param {Float32Array} prev_positions\n * @param {Float32Array} vertices\n * @param {Uint32Array} indices\n * @param {boolean} dashed\n * @param {number} dash0\n * @param {number} dash1\n */\nexport function extract_vertices(dpi_increase, null_mask, y_values, min_y_values, max_y_values, positions, prev_positions, vertices, indices, dashed, dash0, dash1) {\n const ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);\n const len3 = WASM_VECTOR_LEN;\n var ptr4 = passArrayF32ToWasm0(positions, wasm.__wbindgen_malloc);\n var len4 = WASM_VECTOR_LEN;\n var ptr5 = passArrayF32ToWasm0(prev_positions, wasm.__wbindgen_malloc);\n var len5 = WASM_VECTOR_LEN;\n var ptr6 = passArrayF32ToWasm0(vertices, wasm.__wbindgen_malloc);\n var len6 = WASM_VECTOR_LEN;\n var ptr7 = passArray32ToWasm0(indices, wasm.__wbindgen_malloc);\n var len7 = WASM_VECTOR_LEN;\n 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);\n}\n\n/**\n * @param {Uint8Array} null_mask\n * @param {Float64Array} y_values\n * @param {Float64Array} min_y_values\n * @param {Float64Array} max_y_values\n * @param {boolean} dashed\n * @param {number} dash0\n * @param {number} dash1\n * @returns {number}\n */\nexport function get_point_number(null_mask, y_values, min_y_values, max_y_values, dashed, dash0, dash1) {\n const ptr0 = passArray8ToWasm0(null_mask, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArrayF64ToWasm0(y_values, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArrayF64ToWasm0(min_y_values, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passArrayF64ToWasm0(max_y_values, wasm.__wbindgen_malloc);\n const len3 = WASM_VECTOR_LEN;\n const ret = wasm.get_point_number(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, dashed, dash0, dash1);\n return ret;\n}\n\nexport function main_js() {\n wasm.main_js();\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n 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);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_maxx_a3b1e1c3299e47bf = function(arg0) {\n const ret = arg0.maxX;\n return ret;\n };\n imports.wbg.__wbg_maxy_007b81ea99058122 = function(arg0) {\n const ret = arg0.maxY;\n return ret;\n };\n imports.wbg.__wbg_minx_e03d57649d81fc8f = function(arg0) {\n const ret = arg0.minX;\n return ret;\n };\n imports.wbg.__wbg_miny_46aab5af597882a7 = function(arg0) {\n const ret = arg0.minY;\n return ret;\n };\n imports.wbg.__wbg_renderheight_d030fe5a23b4c32b = function(arg0) {\n const ret = arg0.renderHeight;\n return ret;\n };\n imports.wbg.__wbg_renderwidth_8685762ee304f2a7 = function(arg0) {\n const ret = arg0.renderWidth;\n return ret;\n };\n imports.wbg.__wbg_scale_d705e0de44ed2361 = function(arg0) {\n const ret = arg0.scale;\n return ret;\n };\n imports.wbg.__wbindgen_copy_to_typed_array = function(arg0, arg1, arg2) {\n new Uint8Array(arg2.buffer, arg2.byteOffset, arg2.byteLength).set(getArrayU8FromWasm0(arg0, arg1));\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_0;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n ;\n };\n imports.wbg.__wbindgen_string_get = function(arg0, arg1) {\n const obj = arg1;\n const ret = typeof(obj) === 'string' ? obj : undefined;\n var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedFloat32ArrayMemory0 = null;\n cachedFloat64ArrayMemory0 = null;\n cachedUint32ArrayMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n wasm.__wbindgen_start();\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('index_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n"],"names":["wasm","cachedUint8ArrayMemory0","getUint8ArrayMemory0","byteLength","Uint8Array","memory","buffer","WASM_VECTOR_LEN","cachedTextEncoder","TextEncoder","encode","Error","encodeString","encodeInto","arg","view","buf","set","read","length","written","cachedDataViewMemory0","getDataViewMemory0","detached","undefined","DataView","cachedTextDecoder","TextDecoder","ignoreBOM","fatal","decode","cachedFloat64ArrayMemory0","passArrayF64ToWasm0","malloc","ptr","Float64Array","passArray8ToWasm0","selected_space_to_render_space","data","data_null_mask","params","null_mask","y_values","min_y_values","max_y_values","ptr0","__wbindgen_malloc","len0","ptr1","len1","ptr2","len2","ptr3","len3","ptr4","len4","ptr5","len5","cachedFloat32ArrayMemory0","passArrayF32ToWasm0","Float32Array","cachedUint32ArrayMemory0","extract_vertices","dpi_increase","positions","prev_positions","vertices","indices","dashed","dash0","dash1","ptr6","len6","ptr7","Uint32Array","passArray32ToWasm0","len7","get_point_number","main_js","__wbg_get_imports","imports","wbg","__wbg_maxx_a3b1e1c3299e47bf","arg0","maxX","__wbg_maxy_007b81ea99058122","maxY","__wbg_minx_e03d57649d81fc8f","minX","__wbg_miny_46aab5af597882a7","minY","__wbg_renderheight_d030fe5a23b4c32b","renderHeight","__wbg_renderwidth_8685762ee304f2a7","renderWidth","__wbg_scale_d705e0de44ed2361","scale","__wbindgen_copy_to_typed_array","arg1","arg2","len","byteOffset","subarray","__wbindgen_init_externref_table","table","__wbindgen_export_0","offset","grow","__wbindgen_string_get","ret","x","realloc","mem","code","charCodeAt","slice","passStringToWasm0","__wbindgen_realloc","setInt32","__wbindgen_throw","__wbg_finalize_init","instance","module","exports","__wbg_init","__wbindgen_wasm_module","__wbindgen_start","initSync","Object","getPrototypeOf","prototype","console","warn","WebAssembly","Module","Instance","async","module_or_path","URL","Request","fetch","Response","instantiateStreaming","e","headers","get","bytes","arrayBuffer","instantiate","__wbg_load"],"sourceRoot":""}