@ni/nimble-components 29.3.1 → 29.3.3
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/all-components-bundle.js +73 -40
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +2686 -2685
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/wafer-map/experimental/computations.d.ts +10 -2
- package/dist/esm/wafer-map/experimental/computations.js +39 -32
- package/dist/esm/wafer-map/experimental/computations.js.map +1 -1
- package/dist/esm/wafer-map/experimental/hover-handler.d.ts +1 -0
- package/dist/esm/wafer-map/experimental/hover-handler.js +8 -1
- package/dist/esm/wafer-map/experimental/hover-handler.js.map +1 -1
- package/dist/esm/wafer-map/experimental/worker-renderer.d.ts +9 -1
- package/dist/esm/wafer-map/experimental/worker-renderer.js +10 -2
- package/dist/esm/wafer-map/experimental/worker-renderer.js.map +1 -1
- package/dist/esm/wafer-map/index.js +15 -3
- package/dist/esm/wafer-map/index.js.map +1 -1
- package/dist/esm/wafer-map/modules/create-matrix-renderer.js +1 -1
- package/dist/esm/wafer-map/modules/create-matrix-renderer.js.map +1 -1
- package/dist/esm/wafer-map/workers/matrix-renderer.d.ts +37 -1
- package/dist/esm/wafer-map/workers/matrix-renderer.js +1 -2
- package/dist/esm/wafer-map/workers/matrix-renderer.js.map +1 -1
- package/dist/esm/wafer-map/workers/types.d.ts +6 -0
- package/dist/esm/wafer-map/workers/types.js.map +1 -1
- package/dist/esm/wafer-map/workers/worker-code.d.ts +1 -0
- package/dist/esm/wafer-map/workers/worker-code.js +2 -0
- package/dist/esm/wafer-map/workers/worker-code.js.map +1 -0
- package/package.json +3 -4
|
@@ -16278,7 +16278,7 @@
|
|
|
16278
16278
|
|
|
16279
16279
|
/**
|
|
16280
16280
|
* Do not edit directly
|
|
16281
|
-
* Generated on Fri, 07 Jun 2024
|
|
16281
|
+
* Generated on Fri, 07 Jun 2024 20:22:50 GMT
|
|
16282
16282
|
*/
|
|
16283
16283
|
|
|
16284
16284
|
const Information100DarkUi = "#a46eff";
|
|
@@ -78607,8 +78607,7 @@ img.ProseMirror-separator {
|
|
|
78607
78607
|
.join("-");
|
|
78608
78608
|
}
|
|
78609
78609
|
|
|
78610
|
-
// eslint-disable-next-line no-template-curly-in-string
|
|
78611
|
-
const workerCode = "var MatrixRenderer = (function (exports) {\n 'use strict';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol(\"Comlink.proxy\");\n const createEndpoint = Symbol(\"Comlink.endpoint\");\n const releaseProxy = Symbol(\"Comlink.releaseProxy\");\n const finalizer = Symbol(\"Comlink.finalizer\");\n const throwMarker = Symbol(\"Comlink.thrown\");\n const isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n return createProxy(ep, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n ep.addEventListener(\"message\", function l(ev) {\n if (!ev.data || !ev.data.id || ev.data.id !== id) {\n return;\n }\n ep.removeEventListener(\"message\", l);\n resolve(ev.data);\n });\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n }\n\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink's `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.values = Float64Array.from([]);\n this.scaledColumnIndices = Float64Array.from([]);\n this.scaledRowIndices = Float64Array.from([]);\n this.columnIndicesPositions = Int32Array.from([]);\n this.renderConfig = {\n dieDimensions: {\n width: 0,\n height: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n verticalCoefficient: 1,\n horizontalCoefficient: 1,\n horizontalConstant: 0,\n verticalConstant: 0,\n labelsFontSize: 0,\n colorScale: []\n };\n this.transformConfig = {\n transform: {\n k: 1,\n x: 0,\n y: 0\n },\n topLeftCanvasCorner: {\n x: 0,\n y: 0\n },\n bottomRightCanvasCorner: {\n x: 0,\n y: 0\n }\n };\n }\n calculateHorizontalScaledIndices(columnIndex) {\n return (this.renderConfig.horizontalCoefficient * columnIndex\n + this.renderConfig.horizontalConstant\n + this.renderConfig.margin.left);\n }\n calculateVerticalScaledIndices(rowIndex) {\n return (this.renderConfig.verticalCoefficient * rowIndex\n + this.renderConfig.verticalConstant\n + this.renderConfig.margin.top);\n }\n setColumnIndices(columnIndices) {\n if (columnIndices.length === 0 || columnIndices[0] === undefined) {\n return;\n }\n const scaledColumnIndex = [\n this.calculateHorizontalScaledIndices(columnIndices[0])\n ];\n const columnPositions = [0];\n let prev = columnIndices[0];\n for (let i = 1; i < columnIndices.length; i++) {\n const xIndex = columnIndices[i];\n if (xIndex && xIndex !== prev) {\n const scaledX = this.calculateHorizontalScaledIndices(columnIndices[i]);\n scaledColumnIndex.push(scaledX);\n columnPositions.push(i);\n prev = xIndex;\n }\n }\n this.scaledColumnIndices = Float64Array.from(scaledColumnIndex);\n this.columnIndicesPositions = Int32Array.from(columnPositions);\n }\n setRowIndices(rowIndices) {\n this.scaledRowIndices = new Float64Array(rowIndices.length);\n for (let i = 0; i < rowIndices.length; i++) {\n this.scaledRowIndices[i] = this.calculateVerticalScaledIndices(rowIndices[i]);\n }\n }\n setRenderConfig(renderConfig) {\n this.renderConfig = renderConfig;\n }\n setTransformConfig(transformData) {\n this.transformConfig = transformData;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext('2d');\n }\n scaleCanvas() {\n this.context.translate(this.transformConfig.transform.x, this.transformConfig.transform.y);\n this.context.scale(this.transformConfig.transform.k, this.transformConfig.transform.k);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = 'Green';\n this.context.fillRect(scaledX, scaledY, this.renderConfig.dieDimensions.width, this.renderConfig.dieDimensions.height);\n }\n }\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n";
|
|
78610
|
+
const workerCode = "var MatrixRenderer = (function (exports) {\n 'use strict';\n\n /**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n const proxyMarker = Symbol(\"Comlink.proxy\");\n const createEndpoint = Symbol(\"Comlink.endpoint\");\n const releaseProxy = Symbol(\"Comlink.releaseProxy\");\n const finalizer = Symbol(\"Comlink.finalizer\");\n const throwMarker = Symbol(\"Comlink.thrown\");\n const isObject = (val) => (typeof val === \"object\" && val !== null) || typeof val === \"function\";\n /**\n * Internal transfer handle to handle objects marked to proxy.\n */\n const proxyTransferHandler = {\n canHandle: (val) => isObject(val) && val[proxyMarker],\n serialize(obj) {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port1);\n return [port2, [port2]];\n },\n deserialize(port) {\n port.start();\n return wrap(port);\n },\n };\n /**\n * Internal transfer handler to handle thrown exceptions.\n */\n const throwTransferHandler = {\n canHandle: (value) => isObject(value) && throwMarker in value,\n serialize({ value }) {\n let serialized;\n if (value instanceof Error) {\n serialized = {\n isError: true,\n value: {\n message: value.message,\n name: value.name,\n stack: value.stack,\n },\n };\n }\n else {\n serialized = { isError: false, value };\n }\n return [serialized, []];\n },\n deserialize(serialized) {\n if (serialized.isError) {\n throw Object.assign(new Error(serialized.value.message), serialized.value);\n }\n throw serialized.value;\n },\n };\n /**\n * Allows customizing the serialization of certain values.\n */\n const transferHandlers = new Map([\n [\"proxy\", proxyTransferHandler],\n [\"throw\", throwTransferHandler],\n ]);\n function isAllowedOrigin(allowedOrigins, origin) {\n for (const allowedOrigin of allowedOrigins) {\n if (origin === allowedOrigin || allowedOrigin === \"*\") {\n return true;\n }\n if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {\n return true;\n }\n }\n return false;\n }\n function expose(obj, ep = globalThis, allowedOrigins = [\"*\"]) {\n ep.addEventListener(\"message\", function callback(ev) {\n if (!ev || !ev.data) {\n return;\n }\n if (!isAllowedOrigin(allowedOrigins, ev.origin)) {\n console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);\n return;\n }\n const { id, type, path } = Object.assign({ path: [] }, ev.data);\n const argumentList = (ev.data.argumentList || []).map(fromWireValue);\n let returnValue;\n try {\n const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);\n const rawValue = path.reduce((obj, prop) => obj[prop], obj);\n switch (type) {\n case \"GET\" /* MessageType.GET */:\n {\n returnValue = rawValue;\n }\n break;\n case \"SET\" /* MessageType.SET */:\n {\n parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);\n returnValue = true;\n }\n break;\n case \"APPLY\" /* MessageType.APPLY */:\n {\n returnValue = rawValue.apply(parent, argumentList);\n }\n break;\n case \"CONSTRUCT\" /* MessageType.CONSTRUCT */:\n {\n const value = new rawValue(...argumentList);\n returnValue = proxy(value);\n }\n break;\n case \"ENDPOINT\" /* MessageType.ENDPOINT */:\n {\n const { port1, port2 } = new MessageChannel();\n expose(obj, port2);\n returnValue = transfer(port1, [port1]);\n }\n break;\n case \"RELEASE\" /* MessageType.RELEASE */:\n {\n returnValue = undefined;\n }\n break;\n default:\n return;\n }\n }\n catch (value) {\n returnValue = { value, [throwMarker]: 0 };\n }\n Promise.resolve(returnValue)\n .catch((value) => {\n return { value, [throwMarker]: 0 };\n })\n .then((returnValue) => {\n const [wireValue, transferables] = toWireValue(returnValue);\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n if (type === \"RELEASE\" /* MessageType.RELEASE */) {\n // detach and deactive after sending release response above.\n ep.removeEventListener(\"message\", callback);\n closeEndPoint(ep);\n if (finalizer in obj && typeof obj[finalizer] === \"function\") {\n obj[finalizer]();\n }\n }\n })\n .catch((error) => {\n // Send Serialization Error To Caller\n const [wireValue, transferables] = toWireValue({\n value: new TypeError(\"Unserializable return value\"),\n [throwMarker]: 0,\n });\n ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);\n });\n });\n if (ep.start) {\n ep.start();\n }\n }\n function isMessagePort(endpoint) {\n return endpoint.constructor.name === \"MessagePort\";\n }\n function closeEndPoint(endpoint) {\n if (isMessagePort(endpoint))\n endpoint.close();\n }\n function wrap(ep, target) {\n return createProxy(ep, [], target);\n }\n function throwIfProxyReleased(isReleased) {\n if (isReleased) {\n throw new Error(\"Proxy has been released and is not useable\");\n }\n }\n function releaseEndpoint(ep) {\n return requestResponseMessage(ep, {\n type: \"RELEASE\" /* MessageType.RELEASE */,\n }).then(() => {\n closeEndPoint(ep);\n });\n }\n const proxyCounter = new WeakMap();\n const proxyFinalizers = \"FinalizationRegistry\" in globalThis &&\n new FinalizationRegistry((ep) => {\n const newCount = (proxyCounter.get(ep) || 0) - 1;\n proxyCounter.set(ep, newCount);\n if (newCount === 0) {\n releaseEndpoint(ep);\n }\n });\n function registerProxy(proxy, ep) {\n const newCount = (proxyCounter.get(ep) || 0) + 1;\n proxyCounter.set(ep, newCount);\n if (proxyFinalizers) {\n proxyFinalizers.register(proxy, ep, proxy);\n }\n }\n function unregisterProxy(proxy) {\n if (proxyFinalizers) {\n proxyFinalizers.unregister(proxy);\n }\n }\n function createProxy(ep, path = [], target = function () { }) {\n let isProxyReleased = false;\n const proxy = new Proxy(target, {\n get(_target, prop) {\n throwIfProxyReleased(isProxyReleased);\n if (prop === releaseProxy) {\n return () => {\n unregisterProxy(proxy);\n releaseEndpoint(ep);\n isProxyReleased = true;\n };\n }\n if (prop === \"then\") {\n if (path.length === 0) {\n return { then: () => proxy };\n }\n const r = requestResponseMessage(ep, {\n type: \"GET\" /* MessageType.GET */,\n path: path.map((p) => p.toString()),\n }).then(fromWireValue);\n return r.then.bind(r);\n }\n return createProxy(ep, [...path, prop]);\n },\n set(_target, prop, rawValue) {\n throwIfProxyReleased(isProxyReleased);\n // FIXME: ES6 Proxy Handler `set` methods are supposed to return a\n // boolean. To show good will, we return true asynchronously ¯\\_(ツ)_/¯\n const [value, transferables] = toWireValue(rawValue);\n return requestResponseMessage(ep, {\n type: \"SET\" /* MessageType.SET */,\n path: [...path, prop].map((p) => p.toString()),\n value,\n }, transferables).then(fromWireValue);\n },\n apply(_target, _thisArg, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const last = path[path.length - 1];\n if (last === createEndpoint) {\n return requestResponseMessage(ep, {\n type: \"ENDPOINT\" /* MessageType.ENDPOINT */,\n }).then(fromWireValue);\n }\n // We just pretend that `bind()` didn’t happen.\n if (last === \"bind\") {\n return createProxy(ep, path.slice(0, -1));\n }\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, {\n type: \"APPLY\" /* MessageType.APPLY */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n construct(_target, rawArgumentList) {\n throwIfProxyReleased(isProxyReleased);\n const [argumentList, transferables] = processArguments(rawArgumentList);\n return requestResponseMessage(ep, {\n type: \"CONSTRUCT\" /* MessageType.CONSTRUCT */,\n path: path.map((p) => p.toString()),\n argumentList,\n }, transferables).then(fromWireValue);\n },\n });\n registerProxy(proxy, ep);\n return proxy;\n }\n function myFlat(arr) {\n return Array.prototype.concat.apply([], arr);\n }\n function processArguments(argumentList) {\n const processed = argumentList.map(toWireValue);\n return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];\n }\n const transferCache = new WeakMap();\n function transfer(obj, transfers) {\n transferCache.set(obj, transfers);\n return obj;\n }\n function proxy(obj) {\n return Object.assign(obj, { [proxyMarker]: true });\n }\n function toWireValue(value) {\n for (const [name, handler] of transferHandlers) {\n if (handler.canHandle(value)) {\n const [serializedValue, transferables] = handler.serialize(value);\n return [\n {\n type: \"HANDLER\" /* WireValueType.HANDLER */,\n name,\n value: serializedValue,\n },\n transferables,\n ];\n }\n }\n return [\n {\n type: \"RAW\" /* WireValueType.RAW */,\n value,\n },\n transferCache.get(value) || [],\n ];\n }\n function fromWireValue(value) {\n switch (value.type) {\n case \"HANDLER\" /* WireValueType.HANDLER */:\n return transferHandlers.get(value.name).deserialize(value.value);\n case \"RAW\" /* WireValueType.RAW */:\n return value.value;\n }\n }\n function requestResponseMessage(ep, msg, transfers) {\n return new Promise((resolve) => {\n const id = generateUUID();\n ep.addEventListener(\"message\", function l(ev) {\n if (!ev.data || !ev.data.id || ev.data.id !== id) {\n return;\n }\n ep.removeEventListener(\"message\", l);\n resolve(ev.data);\n });\n if (ep.start) {\n ep.start();\n }\n ep.postMessage(Object.assign({ id }, msg), transfers);\n });\n }\n function generateUUID() {\n return new Array(4)\n .fill(0)\n .map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16))\n .join(\"-\");\n }\n\n /* eslint-disable @typescript-eslint/member-ordering */\n /**\n * MatrixRenderer class is meant to be used within a Web Worker context,\n * using Comlink to facilitate communication between the main thread and the worker.\n * The MatrixRenderer class manages a matrix of dies, once an instance of MatrixRenderer is created,\n * it is exposed to the main thread using Comlink's `expose` method.\n * This setup is used in the wafer-map component to perform heavy computational duties\n */\n class MatrixRenderer {\n constructor() {\n this.values = Float64Array.from([]);\n this.scaledColumnIndices = Float64Array.from([]);\n this.scaledRowIndices = Float64Array.from([]);\n this.columnIndicesPositions = Int32Array.from([]);\n this.colorIndices = Int32Array.from([]);\n this.colors = [];\n this.colorValues = Float64Array.from([]);\n this.outsideRangeDieColor = 'rgba(218,223,236,1)';\n this.fontSizeFactor = 0.8;\n this.renderConfig = {\n dieDimensions: {\n width: 0,\n height: 0\n },\n margin: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n verticalCoefficient: 1,\n horizontalCoefficient: 1,\n horizontalConstant: 0,\n verticalConstant: 0,\n gridMinX: 0,\n gridMaxX: 0,\n gridMinY: 0,\n gridMaxY: 0,\n labelsFontSize: 0,\n colorScale: [],\n dieLabelsSuffix: '',\n maxCharacters: 0\n };\n this.transformConfig = {\n transform: {\n k: 1,\n x: 0,\n y: 0\n },\n topLeftCanvasCorner: {\n x: 0,\n y: 0\n },\n bottomRightCanvasCorner: {\n x: 0,\n y: 0\n }\n };\n }\n isDieInGrid(x, y) {\n return (x >= this.renderConfig.gridMinX\n && x <= this.renderConfig.gridMaxX\n && y >= this.renderConfig.gridMinY\n && y <= this.renderConfig.gridMaxY);\n }\n calculateHorizontalScaledIndices(columnIndex) {\n return (this.renderConfig.horizontalCoefficient * columnIndex\n + this.renderConfig.horizontalConstant\n + this.renderConfig.margin.left);\n }\n calculateVerticalScaledIndices(rowIndex) {\n return (this.renderConfig.verticalCoefficient * rowIndex\n + this.renderConfig.verticalConstant\n + this.renderConfig.margin.top);\n }\n findColorIndex(value) {\n let index = -1;\n if (this.colorValues.length === 0 || this.colorValues[0] >= value) {\n return index;\n }\n for (let i = 0; i < this.colorValues.length; i++) {\n if (value <= this.colorValues[i]) {\n index = i;\n break;\n }\n }\n return index;\n }\n setMatrixData(columnIndices, rowIndices, valuesBuffer) {\n const scaledColumnIndex = [];\n const columnPositions = [];\n const scaledRowIndices = [];\n const values = [];\n const colorIndices = [];\n let prevXIndex;\n let dieCount = 0;\n for (let i = 0; i < columnIndices.length; i++) {\n const xIndex = columnIndices[i];\n const yIndex = rowIndices[i];\n if (this.isDieInGrid(xIndex, yIndex)) {\n if (xIndex !== prevXIndex) {\n scaledColumnIndex.push(this.calculateHorizontalScaledIndices(xIndex));\n columnPositions.push(dieCount);\n prevXIndex = xIndex;\n }\n scaledRowIndices.push(this.calculateVerticalScaledIndices(yIndex));\n const value = valuesBuffer[i];\n values.push(value);\n colorIndices.push(this.findColorIndex(value));\n dieCount += 1;\n }\n }\n this.scaledColumnIndices = Float64Array.from(scaledColumnIndex);\n this.columnIndicesPositions = Int32Array.from(columnPositions);\n this.scaledRowIndices = Float64Array.from(scaledRowIndices);\n this.values = Float64Array.from(values);\n this.colorIndices = Int32Array.from(colorIndices);\n }\n setRenderConfig(renderConfig) {\n this.renderConfig = renderConfig;\n this.colors = renderConfig.colorScale.map(marker => marker.color);\n this.colorValues = Float64Array.from(renderConfig.colorScale.map(marker => marker.value));\n }\n setTransformConfig(transformData) {\n this.transformConfig = transformData;\n }\n setCanvas(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext('2d');\n }\n scaleCanvas() {\n this.context.translate(this.transformConfig.transform.x, this.transformConfig.transform.y);\n this.context.scale(this.transformConfig.transform.k, this.transformConfig.transform.k);\n }\n setCanvasDimensions(data) {\n this.canvas.width = data.width;\n this.canvas.height = data.height;\n }\n getCanvasDimensions() {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n };\n }\n clearCanvas() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n drawWafer() {\n this.context.restore();\n this.context.save();\n this.clearCanvas();\n this.scaleCanvas();\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n // Fill style is temporary green for all dies, will be replaced with a color based on the value of the die in a future implementation\n this.context.fillStyle = this.colors[this.colorIndices[columnStartIndex]]\n ?? this.outsideRangeDieColor;\n this.context.fillRect(scaledX, scaledY, this.renderConfig.dieDimensions.width, this.renderConfig.dieDimensions.height);\n }\n }\n }\n drawText() {\n this.context.font = `${this.renderConfig.labelsFontSize.toString()}px sans-serif`;\n this.context.fillStyle = '#ffffff';\n this.context.textAlign = 'center';\n this.context.lineCap = 'butt';\n const approximateTextHeight = this.context.measureText('M');\n for (let i = 0; i < this.scaledColumnIndices.length; i++) {\n const scaledX = this.scaledColumnIndices[i];\n if (!(scaledX >= this.transformConfig.topLeftCanvasCorner.x\n && scaledX < this.transformConfig.bottomRightCanvasCorner.x)) {\n continue;\n }\n // columnIndexPositions is used to get chunks to determine the start and end index of the column, it looks something like [0, 1, 4, 9, 12]\n // This means that the first column has a start index of 0 and an end index of 1, the second column has a start index of 1 and an end index of 4, and so on\n // scaledRowIndices is used when we reach the end of the columnIndexPositions, when columnIndexPositions is [0, 1, 4, 9, 12], scaledRowIndices is 13\n const columnEndIndex = this.columnIndicesPositions[i + 1] !== undefined\n ? this.columnIndicesPositions[i + 1]\n : this.scaledRowIndices.length;\n for (let columnStartIndex = this.columnIndicesPositions[i]; columnStartIndex < columnEndIndex; columnStartIndex++) {\n const scaledY = this.scaledRowIndices[columnStartIndex];\n if (!(scaledY >= this.transformConfig.topLeftCanvasCorner.y\n && scaledY < this.transformConfig.bottomRightCanvasCorner.y)) {\n continue;\n }\n let label = `${this.values[columnStartIndex] || 'NaN'}${this.renderConfig.dieLabelsSuffix}`;\n if (label.length >= this.renderConfig.maxCharacters) {\n label = `${label.substring(0, this.renderConfig.maxCharacters)}…`;\n }\n this.context.fillText(label, scaledX + this.renderConfig.dieDimensions.width / 2, scaledY\n + this.renderConfig.dieDimensions.height / 2\n + approximateTextHeight.width / 2, this.renderConfig.dieDimensions.width * this.fontSizeFactor);\n }\n }\n }\n }\n expose(MatrixRenderer);\n\n exports.MatrixRenderer = MatrixRenderer;\n\n return exports;\n\n})({});\n";
|
|
78612
78611
|
|
|
78613
78612
|
let url;
|
|
78614
78613
|
/**
|
|
@@ -78637,6 +78636,7 @@ img.ProseMirror-separator {
|
|
|
78637
78636
|
class WorkerRenderer {
|
|
78638
78637
|
constructor(wafermap) {
|
|
78639
78638
|
this.wafermap = wafermap;
|
|
78639
|
+
this.minDieDim = 100;
|
|
78640
78640
|
}
|
|
78641
78641
|
async setupWafer(snapshot) {
|
|
78642
78642
|
if (this.matrixRenderer === undefined) {
|
|
@@ -78647,8 +78647,7 @@ img.ProseMirror-separator {
|
|
|
78647
78647
|
}
|
|
78648
78648
|
await this.matrixRenderer.setCanvasDimensions(snapshot.canvasDimensions);
|
|
78649
78649
|
await this.matrixRenderer.setRenderConfig(snapshot.renderConfig);
|
|
78650
|
-
await this.matrixRenderer.
|
|
78651
|
-
await this.matrixRenderer.setRowIndices(snapshot.rowIndices);
|
|
78650
|
+
await this.matrixRenderer.setMatrixData(snapshot.columnIndices, snapshot.rowIndices, snapshot.values);
|
|
78652
78651
|
}
|
|
78653
78652
|
async drawWafer(snapshot) {
|
|
78654
78653
|
const topLeftCanvasCorner = snapshot.transform.invert([0, 0]);
|
|
@@ -78668,6 +78667,14 @@ img.ProseMirror-separator {
|
|
|
78668
78667
|
}
|
|
78669
78668
|
});
|
|
78670
78669
|
await this.matrixRenderer.drawWafer();
|
|
78670
|
+
if (!snapshot.dieLabelsHidden
|
|
78671
|
+
&& snapshot.dieDimensions
|
|
78672
|
+
&& snapshot.dieDimensions.width
|
|
78673
|
+
* snapshot.dieDimensions.height
|
|
78674
|
+
* (snapshot.transform.k || 1)
|
|
78675
|
+
>= this.minDieDim) {
|
|
78676
|
+
await this.matrixRenderer.drawText();
|
|
78677
|
+
}
|
|
78671
78678
|
}
|
|
78672
78679
|
renderHover() {
|
|
78673
78680
|
if (this.wafermap.computations.dieDimensions === undefined
|
|
@@ -78801,7 +78808,8 @@ img.ProseMirror-separator {
|
|
|
78801
78808
|
x: invertedPoint[0],
|
|
78802
78809
|
y: invertedPoint[1]
|
|
78803
78810
|
});
|
|
78804
|
-
if (dieCoordinates === undefined
|
|
78811
|
+
if (dieCoordinates === undefined
|
|
78812
|
+
|| !this.isDieInGrid(dieCoordinates.x, dieCoordinates.y)) {
|
|
78805
78813
|
this.wafermap.hoverDie = undefined;
|
|
78806
78814
|
return;
|
|
78807
78815
|
}
|
|
@@ -78861,6 +78869,12 @@ img.ProseMirror-separator {
|
|
|
78861
78869
|
}
|
|
78862
78870
|
return undefined;
|
|
78863
78871
|
}
|
|
78872
|
+
isDieInGrid(x, y) {
|
|
78873
|
+
return (x >= this.wafermap.computations.gridMinX
|
|
78874
|
+
&& x <= this.wafermap.computations.gridMaxX
|
|
78875
|
+
&& y >= this.wafermap.computations.gridMinY
|
|
78876
|
+
&& y <= this.wafermap.computations.gridMaxY);
|
|
78877
|
+
}
|
|
78864
78878
|
}
|
|
78865
78879
|
|
|
78866
78880
|
/**
|
|
@@ -78946,6 +78960,18 @@ img.ProseMirror-separator {
|
|
|
78946
78960
|
get verticalConstant() {
|
|
78947
78961
|
return this._verticalConstant;
|
|
78948
78962
|
}
|
|
78963
|
+
get gridMinX() {
|
|
78964
|
+
return this._gridMinX;
|
|
78965
|
+
}
|
|
78966
|
+
get gridMaxX() {
|
|
78967
|
+
return this._gridMaxX;
|
|
78968
|
+
}
|
|
78969
|
+
get gridMinY() {
|
|
78970
|
+
return this._gridMinY;
|
|
78971
|
+
}
|
|
78972
|
+
get gridMaxY() {
|
|
78973
|
+
return this._gridMaxY;
|
|
78974
|
+
}
|
|
78949
78975
|
get labelsFontSize() {
|
|
78950
78976
|
return this._labelsFontSize;
|
|
78951
78977
|
}
|
|
@@ -78986,14 +79012,17 @@ img.ProseMirror-separator {
|
|
|
78986
79012
|
return;
|
|
78987
79013
|
}
|
|
78988
79014
|
const containerDiameter = Math.min(this._containerDimensions.width, this._containerDimensions.height);
|
|
78989
|
-
|
|
78990
|
-
|
|
78991
|
-
|
|
79015
|
+
if (this.gridDimensionsValidAndDefined()) {
|
|
79016
|
+
this.setGridDimensionsFromBoundingBox();
|
|
79017
|
+
}
|
|
79018
|
+
else {
|
|
79019
|
+
this.setGridDimensionsFromDies();
|
|
79020
|
+
}
|
|
78992
79021
|
// this scale is used for positioning the dies on the canvas
|
|
78993
79022
|
const originLocation = this.wafermap.originLocation;
|
|
78994
|
-
this._horizontalScale = this.createHorizontalScale(originLocation,
|
|
79023
|
+
this._horizontalScale = this.createHorizontalScale(originLocation, containerDiameter);
|
|
78995
79024
|
// this scale is used for positioning the dies on the canvas
|
|
78996
|
-
this._verticalScale = this.createVerticalScale(originLocation,
|
|
79025
|
+
this._verticalScale = this.createVerticalScale(originLocation, containerDiameter);
|
|
78997
79026
|
this._horizontalCoefficient = this._horizontalScale(1) - this._horizontalScale(0);
|
|
78998
79027
|
this._verticalCoefficient = this._verticalScale(1) - this._verticalScale(0);
|
|
78999
79028
|
this._horizontalConstant = this._horizontalScale(0);
|
|
@@ -79019,22 +79048,15 @@ img.ProseMirror-separator {
|
|
|
79019
79048
|
&& typeof this.wafermap.gridMaxX === 'number'
|
|
79020
79049
|
&& typeof this.wafermap.gridMinX === 'number');
|
|
79021
79050
|
}
|
|
79022
|
-
|
|
79023
|
-
|
|
79024
|
-
|
|
79025
|
-
|
|
79026
|
-
|
|
79027
|
-
&& typeof this.wafermap.gridMinX === 'number') {
|
|
79028
|
-
gridDimensions.origin.x = this.wafermap.gridMinX;
|
|
79029
|
-
gridDimensions.origin.y = this.wafermap.gridMinY;
|
|
79030
|
-
gridDimensions.rows = this.wafermap.gridMaxY - this.wafermap.gridMinY + 1;
|
|
79031
|
-
gridDimensions.cols = this.wafermap.gridMaxX - this.wafermap.gridMinX + 1;
|
|
79032
|
-
}
|
|
79033
|
-
return gridDimensions;
|
|
79051
|
+
setGridDimensionsFromBoundingBox() {
|
|
79052
|
+
this._gridMinX = this.wafermap.gridMinX;
|
|
79053
|
+
this._gridMinY = this.wafermap.gridMinY;
|
|
79054
|
+
this._gridMaxX = this.wafermap.gridMaxX;
|
|
79055
|
+
this._gridMaxY = this.wafermap.gridMaxY;
|
|
79034
79056
|
}
|
|
79035
|
-
|
|
79057
|
+
setGridDimensionsFromDies() {
|
|
79036
79058
|
if (this.wafermap.diesTable === undefined) {
|
|
79037
|
-
return
|
|
79059
|
+
return;
|
|
79038
79060
|
}
|
|
79039
79061
|
const colIndex = this.wafermap.diesTable
|
|
79040
79062
|
.getChild('colIndex')
|
|
@@ -79059,11 +79081,10 @@ img.ProseMirror-separator {
|
|
|
79059
79081
|
maxPoint.y = rowIndex[i];
|
|
79060
79082
|
}
|
|
79061
79083
|
}
|
|
79062
|
-
|
|
79063
|
-
|
|
79064
|
-
|
|
79065
|
-
|
|
79066
|
-
};
|
|
79084
|
+
this._gridMinX = minPoint.x;
|
|
79085
|
+
this._gridMinY = minPoint.y;
|
|
79086
|
+
this._gridMaxX = maxPoint.x;
|
|
79087
|
+
this._gridMaxY = maxPoint.y;
|
|
79067
79088
|
}
|
|
79068
79089
|
calculateContainerDimensions(canvasDimensions, margin) {
|
|
79069
79090
|
return {
|
|
@@ -79071,30 +79092,30 @@ img.ProseMirror-separator {
|
|
|
79071
79092
|
height: canvasDimensions.height - margin.top - margin.bottom
|
|
79072
79093
|
};
|
|
79073
79094
|
}
|
|
79074
|
-
createHorizontalScale(originLocation,
|
|
79095
|
+
createHorizontalScale(originLocation, containerWidth) {
|
|
79075
79096
|
const scale = linear();
|
|
79076
79097
|
if (originLocation === WaferMapOriginLocation.bottomLeft
|
|
79077
79098
|
|| originLocation === WaferMapOriginLocation.topLeft) {
|
|
79078
79099
|
return scale
|
|
79079
|
-
.domain([
|
|
79100
|
+
.domain([this._gridMinX, this._gridMaxX + 1])
|
|
79080
79101
|
.range([0, containerWidth]);
|
|
79081
79102
|
}
|
|
79082
79103
|
return scale
|
|
79083
|
-
.domain([
|
|
79104
|
+
.domain([this._gridMinX - 1, this._gridMaxX])
|
|
79084
79105
|
.range([containerWidth, 0]);
|
|
79085
79106
|
}
|
|
79086
|
-
createVerticalScale(originLocation,
|
|
79107
|
+
createVerticalScale(originLocation, containerHeight) {
|
|
79087
79108
|
const scale = linear();
|
|
79088
79109
|
// html canvas has top-left origin https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_shapes#the_grid
|
|
79089
79110
|
// we need to flip the vertical scale
|
|
79090
79111
|
if (originLocation === WaferMapOriginLocation.bottomLeft
|
|
79091
79112
|
|| originLocation === WaferMapOriginLocation.bottomRight) {
|
|
79092
79113
|
return scale
|
|
79093
|
-
.domain([
|
|
79114
|
+
.domain([this._gridMinY - 1, this._gridMaxY])
|
|
79094
79115
|
.range([containerHeight, 0]);
|
|
79095
79116
|
}
|
|
79096
79117
|
return scale
|
|
79097
|
-
.domain([
|
|
79118
|
+
.domain([this._gridMinY, this._gridMaxY + 1])
|
|
79098
79119
|
.range([0, containerHeight]);
|
|
79099
79120
|
}
|
|
79100
79121
|
calculateMarginAddition(baseMargin, addedMargin) {
|
|
@@ -79122,7 +79143,7 @@ img.ProseMirror-separator {
|
|
|
79122
79143
|
}
|
|
79123
79144
|
});
|
|
79124
79145
|
// the linear color scale will not be infinite but will be limited by the color scale resolution
|
|
79125
|
-
const valueSamples =
|
|
79146
|
+
const valueSamples = range(min, max, (max - min) / (values.length * this.colorScaleResolution)).concat(max);
|
|
79126
79147
|
return valueSamples.map(value => {
|
|
79127
79148
|
return {
|
|
79128
79149
|
color: d3ColorScale(value),
|
|
@@ -79311,30 +79332,42 @@ img.ProseMirror-separator {
|
|
|
79311
79332
|
horizontalCoefficient: this.computations.horizontalCoefficient,
|
|
79312
79333
|
horizontalConstant: this.computations.horizontalConstant,
|
|
79313
79334
|
verticalConstant: this.computations.verticalConstant,
|
|
79335
|
+
gridMinX: this.computations.gridMinX,
|
|
79336
|
+
gridMaxX: this.computations.gridMaxX,
|
|
79337
|
+
gridMinY: this.computations.gridMinY,
|
|
79338
|
+
gridMaxY: this.computations.gridMaxY,
|
|
79314
79339
|
labelsFontSize: this.computations.labelsFontSize,
|
|
79315
|
-
colorScale: this.computations.colorScale
|
|
79340
|
+
colorScale: this.computations.colorScale,
|
|
79341
|
+
dieLabelsSuffix: this.dieLabelsSuffix,
|
|
79342
|
+
maxCharacters: this.maxCharacters
|
|
79316
79343
|
};
|
|
79317
79344
|
const dieDimensions = this.computations.dieDimensions;
|
|
79318
79345
|
const transform = this.transform;
|
|
79346
|
+
const dieLabelsHidden = this.dieLabelsHidden;
|
|
79319
79347
|
if (this.diesTable === undefined) {
|
|
79320
79348
|
return {
|
|
79321
79349
|
canvasDimensions,
|
|
79322
79350
|
renderConfig,
|
|
79323
79351
|
dieDimensions,
|
|
79324
79352
|
transform,
|
|
79353
|
+
dieLabelsHidden,
|
|
79325
79354
|
columnIndices: Int32Array.from([]),
|
|
79326
|
-
rowIndices: Int32Array.from([])
|
|
79355
|
+
rowIndices: Int32Array.from([]),
|
|
79356
|
+
values: Float64Array.from([])
|
|
79327
79357
|
};
|
|
79328
79358
|
}
|
|
79329
79359
|
const columnIndices = this.diesTable.getChild('colIndex').toArray();
|
|
79330
79360
|
const rowIndices = this.diesTable.getChild('rowIndex').toArray();
|
|
79361
|
+
const values = this.diesTable.getChild('value').toArray();
|
|
79331
79362
|
return {
|
|
79332
79363
|
canvasDimensions,
|
|
79333
79364
|
renderConfig,
|
|
79334
79365
|
columnIndices,
|
|
79335
79366
|
rowIndices,
|
|
79367
|
+
values,
|
|
79336
79368
|
dieDimensions,
|
|
79337
|
-
transform
|
|
79369
|
+
transform,
|
|
79370
|
+
dieLabelsHidden
|
|
79338
79371
|
};
|
|
79339
79372
|
}
|
|
79340
79373
|
validate() {
|