diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 79d9af3..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - // ... 其他配置 - ignorePatterns: ['**/*.d.ts'], - env: { - es6: true - } -}; \ No newline at end of file diff --git a/deploy.bat b/deploy.bat new file mode 100644 index 0000000..e69de29 diff --git a/test/render-line/webgl.drawio b/design/webgl.drawio similarity index 72% rename from test/render-line/webgl.drawio rename to design/webgl.drawio index 87294c2..17a22cc 100644 --- a/test/render-line/webgl.drawio +++ b/design/webgl.drawio @@ -1,6 +1,6 @@ - - + + @@ -566,203 +566,275 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + - - + + - - - - - - - - - - - - - - - - + - - + + - + - - + + - + + + + + + + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - - - - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/package-lock.json b/package-lock.json index 562619b..a03b9c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,6 @@ "@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-service": "~5.0.0", - "eslint": "^7.32.0", "eslint-plugin-vue": "^8.0.3", "unplugin-auto-import": "^0.17.5", "unplugin-vue-components": "^0.26.0" @@ -36,6 +35,7 @@ "resolved": "https://registry.npmmirror.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true, + "peer": true, "engines": { "node": ">=0.10.0" } @@ -1910,6 +1910,7 @@ "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, + "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.1.1", @@ -1930,6 +1931,7 @@ "resolved": "https://registry.npmmirror.com/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "peer": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -1942,6 +1944,7 @@ "resolved": "https://registry.npmmirror.com/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true, + "peer": true, "engines": { "node": ">= 4" } @@ -1951,6 +1954,7 @@ "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, + "peer": true, "engines": { "node": ">=10" } @@ -1997,6 +2001,7 @@ "resolved": "https://registry.npmmirror.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "dev": true, + "peer": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.0", "debug": "^4.1.1", @@ -2010,7 +2015,8 @@ "version": "1.2.1", "resolved": "https://registry.npmmirror.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@intlify/core-base": { "version": "9.9.1", @@ -3680,6 +3686,7 @@ "resolved": "https://registry.npmmirror.com/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, + "peer": true, "engines": { "node": ">=6" } @@ -3756,6 +3763,7 @@ "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, + "peer": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -3780,6 +3788,7 @@ "resolved": "https://registry.npmmirror.com/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -4986,7 +4995,8 @@ "version": "0.1.4", "resolved": "https://registry.npmmirror.com/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/deepmerge": { "version": "1.5.2", @@ -5218,6 +5228,7 @@ "resolved": "https://registry.npmmirror.com/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, + "peer": true, "dependencies": { "esutils": "^2.0.2" }, @@ -5413,6 +5424,7 @@ "resolved": "https://registry.npmmirror.com/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", "dev": true, + "peer": true, "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -5502,6 +5514,7 @@ "resolved": "https://registry.npmmirror.com/eslint/-/eslint-7.32.0.tgz", "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "dev": true, + "peer": true, "dependencies": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.3", @@ -5637,6 +5650,7 @@ "resolved": "https://registry.npmmirror.com/eslint-utils/-/eslint-utils-2.1.0.tgz", "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, + "peer": true, "dependencies": { "eslint-visitor-keys": "^1.1.0" }, @@ -5649,6 +5663,7 @@ "resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, + "peer": true, "engines": { "node": ">=4" } @@ -5767,6 +5782,7 @@ "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.12.11.tgz", "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dev": true, + "peer": true, "dependencies": { "@babel/highlight": "^7.10.4" } @@ -5776,6 +5792,7 @@ "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -5788,6 +5805,7 @@ "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5801,6 +5819,7 @@ "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -5812,13 +5831,15 @@ "version": "1.1.4", "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/eslint/node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, + "peer": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -5833,6 +5854,7 @@ "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "peer": true, "engines": { "node": ">=10" } @@ -5842,6 +5864,7 @@ "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "peer": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -5854,6 +5877,7 @@ "resolved": "https://registry.npmmirror.com/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "peer": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -5866,6 +5890,7 @@ "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -5875,6 +5900,7 @@ "resolved": "https://registry.npmmirror.com/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true, + "peer": true, "engines": { "node": ">= 4" } @@ -5884,6 +5910,7 @@ "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "peer": true, "dependencies": { "yallist": "^4.0.0" }, @@ -5896,6 +5923,7 @@ "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -5905,6 +5933,7 @@ "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.0.tgz", "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, + "peer": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -5920,6 +5949,7 @@ "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "peer": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -5932,6 +5962,7 @@ "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -5941,6 +5972,7 @@ "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -5953,6 +5985,7 @@ "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, + "peer": true, "engines": { "node": ">=10" } @@ -5962,6 +5995,7 @@ "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -5976,13 +6010,15 @@ "version": "4.0.0", "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "peer": true }, "node_modules/espree": { "version": "7.3.1", "resolved": "https://registry.npmmirror.com/espree/-/espree-7.3.1.tgz", "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, + "peer": true, "dependencies": { "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", @@ -5997,6 +6033,7 @@ "resolved": "https://registry.npmmirror.com/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true, + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -6009,6 +6046,7 @@ "resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, + "peer": true, "engines": { "node": ">=4" } @@ -6018,6 +6056,7 @@ "resolved": "https://registry.npmmirror.com/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, + "peer": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -6243,7 +6282,8 @@ "version": "2.0.6", "resolved": "https://registry.npmmirror.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/fastq": { "version": "1.17.1", @@ -6283,6 +6323,7 @@ "resolved": "https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, + "peer": true, "dependencies": { "flat-cache": "^3.0.4" }, @@ -6376,6 +6417,7 @@ "resolved": "https://registry.npmmirror.com/flat-cache/-/flat-cache-3.2.0.tgz", "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, + "peer": true, "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", @@ -6389,7 +6431,8 @@ "version": "3.2.9", "resolved": "https://registry.npmmirror.com/flatted/-/flatted-3.2.9.tgz", "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/follow-redirects": { "version": "1.15.5", @@ -6483,7 +6526,8 @@ "version": "1.0.1", "resolved": "https://registry.npmmirror.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true + "dev": true, + "peer": true }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -6965,6 +7009,7 @@ "resolved": "https://registry.npmmirror.com/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "peer": true, "engines": { "node": ">=0.8.19" } @@ -7245,6 +7290,7 @@ "resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, + "peer": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -7269,7 +7315,8 @@ "version": "3.0.1", "resolved": "https://registry.npmmirror.com/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/json-parse-better-errors": { "version": "1.0.2", @@ -7293,7 +7340,8 @@ "version": "1.0.1", "resolved": "https://registry.npmmirror.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/json5": { "version": "2.2.3", @@ -7330,6 +7378,7 @@ "resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, + "peer": true, "dependencies": { "json-buffer": "3.0.1" } @@ -7376,6 +7425,7 @@ "resolved": "https://registry.npmmirror.com/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "peer": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -7518,13 +7568,15 @@ "version": "4.6.2", "resolved": "https://registry.npmmirror.com/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmmirror.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz", "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/lodash.uniq": { "version": "4.5.0", @@ -8349,6 +8401,7 @@ "resolved": "https://registry.npmmirror.com/optionator/-/optionator-0.9.3.tgz", "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, + "peer": true, "dependencies": { "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", @@ -9243,6 +9296,7 @@ "resolved": "https://registry.npmmirror.com/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "peer": true, "engines": { "node": ">= 0.8.0" } @@ -9281,6 +9335,7 @@ "resolved": "https://registry.npmmirror.com/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true, + "peer": true, "engines": { "node": ">=0.4.0" } @@ -9511,6 +9566,7 @@ "resolved": "https://registry.npmmirror.com/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -9998,6 +10054,7 @@ "resolved": "https://registry.npmmirror.com/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -10012,6 +10069,7 @@ "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -10024,6 +10082,7 @@ "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -10035,7 +10094,8 @@ "version": "1.1.4", "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/sockjs": { "version": "0.3.24", @@ -10141,7 +10201,8 @@ "version": "1.0.3", "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "dev": true, + "peer": true }, "node_modules/ssri": { "version": "8.0.1", @@ -10252,6 +10313,7 @@ "resolved": "https://registry.npmmirror.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "peer": true, "engines": { "node": ">=8" } @@ -10348,6 +10410,7 @@ "resolved": "https://registry.npmmirror.com/table/-/table-6.8.1.tgz", "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", "dev": true, + "peer": true, "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", @@ -10364,6 +10427,7 @@ "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.12.0.tgz", "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -10375,7 +10439,8 @@ "version": "1.0.0", "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true + "dev": true, + "peer": true }, "node_modules/tapable": { "version": "2.2.1", @@ -10458,7 +10523,8 @@ "version": "0.2.0", "resolved": "https://registry.npmmirror.com/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/thenify": { "version": "3.3.1", @@ -10590,6 +10656,7 @@ "resolved": "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "peer": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -10921,7 +10988,8 @@ "version": "2.4.0", "resolved": "https://registry.npmmirror.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/validate-npm-package-license": { "version": "3.0.4", @@ -11843,7 +11911,8 @@ "version": "1.2.6", "resolved": "https://registry.npmmirror.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true + "dev": true, + "peer": true }, "@achrinza/node-ipc": { "version": "9.2.8", @@ -13145,6 +13214,7 @@ "resolved": "https://registry.npmmirror.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, + "peer": true, "requires": { "ajv": "^6.12.4", "debug": "^4.1.1", @@ -13162,6 +13232,7 @@ "resolved": "https://registry.npmmirror.com/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "peer": true, "requires": { "type-fest": "^0.20.2" } @@ -13170,13 +13241,15 @@ "version": "4.0.6", "resolved": "https://registry.npmmirror.com/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "dev": true, + "peer": true }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true + "dev": true, + "peer": true } } }, @@ -13222,6 +13295,7 @@ "resolved": "https://registry.npmmirror.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "dev": true, + "peer": true, "requires": { "@humanwhocodes/object-schema": "^1.2.0", "debug": "^4.1.1", @@ -13232,7 +13306,8 @@ "version": "1.2.1", "resolved": "https://registry.npmmirror.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "dev": true, + "peer": true }, "@intlify/core-base": { "version": "9.9.1", @@ -14625,7 +14700,8 @@ "version": "4.1.3", "resolved": "https://registry.npmmirror.com/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true + "dev": true, + "peer": true }, "ansi-escapes": { "version": "3.2.0", @@ -14681,6 +14757,7 @@ "resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, + "peer": true, "requires": { "sprintf-js": "~1.0.2" } @@ -14701,7 +14778,8 @@ "version": "2.0.0", "resolved": "https://registry.npmmirror.com/astral-regex/-/astral-regex-2.0.0.tgz", "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true + "dev": true, + "peer": true }, "async": { "version": "2.6.4", @@ -15661,7 +15739,8 @@ "version": "0.1.4", "resolved": "https://registry.npmmirror.com/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "peer": true }, "deepmerge": { "version": "1.5.2", @@ -15837,6 +15916,7 @@ "resolved": "https://registry.npmmirror.com/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, + "peer": true, "requires": { "esutils": "^2.0.2" } @@ -16010,6 +16090,7 @@ "resolved": "https://registry.npmmirror.com/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", "dev": true, + "peer": true, "requires": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" @@ -16081,6 +16162,7 @@ "resolved": "https://registry.npmmirror.com/eslint/-/eslint-7.32.0.tgz", "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "dev": true, + "peer": true, "requires": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.3", @@ -16129,6 +16211,7 @@ "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.12.11.tgz", "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dev": true, + "peer": true, "requires": { "@babel/highlight": "^7.10.4" } @@ -16138,6 +16221,7 @@ "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "peer": true, "requires": { "color-convert": "^2.0.1" } @@ -16147,6 +16231,7 @@ "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "peer": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -16157,6 +16242,7 @@ "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "peer": true, "requires": { "color-name": "~1.1.4" } @@ -16165,13 +16251,15 @@ "version": "1.1.4", "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "peer": true }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, + "peer": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -16182,13 +16270,15 @@ "version": "4.0.0", "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true + "dev": true, + "peer": true }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "peer": true, "requires": { "is-glob": "^4.0.1" } @@ -16198,6 +16288,7 @@ "resolved": "https://registry.npmmirror.com/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "peer": true, "requires": { "type-fest": "^0.20.2" } @@ -16206,19 +16297,22 @@ "version": "4.0.0", "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "dev": true, + "peer": true }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmmirror.com/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "dev": true, + "peer": true }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, + "peer": true, "requires": { "yallist": "^4.0.0" } @@ -16227,13 +16321,15 @@ "version": "3.1.1", "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "dev": true, + "peer": true }, "semver": { "version": "7.6.0", "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.0.tgz", "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, + "peer": true, "requires": { "lru-cache": "^6.0.0" } @@ -16243,6 +16339,7 @@ "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "peer": true, "requires": { "shebang-regex": "^3.0.0" } @@ -16251,13 +16348,15 @@ "version": "3.0.0", "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "dev": true, + "peer": true }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "peer": true, "requires": { "has-flag": "^4.0.0" } @@ -16266,13 +16365,15 @@ "version": "0.20.2", "resolved": "https://registry.npmmirror.com/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true + "dev": true, + "peer": true }, "which": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, + "peer": true, "requires": { "isexe": "^2.0.0" } @@ -16281,7 +16382,8 @@ "version": "4.0.0", "resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "dev": true, + "peer": true } } }, @@ -16349,6 +16451,7 @@ "resolved": "https://registry.npmmirror.com/eslint-utils/-/eslint-utils-2.1.0.tgz", "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, + "peer": true, "requires": { "eslint-visitor-keys": "^1.1.0" }, @@ -16357,7 +16460,8 @@ "version": "1.3.0", "resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true + "dev": true, + "peer": true } } }, @@ -16452,6 +16556,7 @@ "resolved": "https://registry.npmmirror.com/espree/-/espree-7.3.1.tgz", "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, + "peer": true, "requires": { "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", @@ -16462,13 +16567,15 @@ "version": "7.4.1", "resolved": "https://registry.npmmirror.com/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true + "dev": true, + "peer": true }, "eslint-visitor-keys": { "version": "1.3.0", "resolved": "https://registry.npmmirror.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true + "dev": true, + "peer": true } } }, @@ -16476,7 +16583,8 @@ "version": "4.0.1", "resolved": "https://registry.npmmirror.com/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "dev": true, + "peer": true }, "esquery": { "version": "1.5.0", @@ -16664,7 +16772,8 @@ "version": "2.0.6", "resolved": "https://registry.npmmirror.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "peer": true }, "fastq": { "version": "1.17.1", @@ -16698,6 +16807,7 @@ "resolved": "https://registry.npmmirror.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, + "peer": true, "requires": { "flat-cache": "^3.0.4" } @@ -16775,6 +16885,7 @@ "resolved": "https://registry.npmmirror.com/flat-cache/-/flat-cache-3.2.0.tgz", "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, + "peer": true, "requires": { "flatted": "^3.2.9", "keyv": "^4.5.3", @@ -16785,7 +16896,8 @@ "version": "3.2.9", "resolved": "https://registry.npmmirror.com/flatted/-/flatted-3.2.9.tgz", "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", - "dev": true + "dev": true, + "peer": true }, "follow-redirects": { "version": "1.15.5", @@ -16852,7 +16964,8 @@ "version": "1.0.1", "resolved": "https://registry.npmmirror.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true + "dev": true, + "peer": true }, "gensync": { "version": "1.0.0-beta.2", @@ -17234,7 +17347,8 @@ "version": "0.1.4", "resolved": "https://registry.npmmirror.com/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true + "dev": true, + "peer": true }, "inflight": { "version": "1.0.6", @@ -17454,6 +17568,7 @@ "resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, + "peer": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -17469,7 +17584,8 @@ "version": "3.0.1", "resolved": "https://registry.npmmirror.com/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "dev": true, + "peer": true }, "json-parse-better-errors": { "version": "1.0.2", @@ -17493,7 +17609,8 @@ "version": "1.0.1", "resolved": "https://registry.npmmirror.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "peer": true }, "json5": { "version": "2.2.3", @@ -17522,6 +17639,7 @@ "resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, + "peer": true, "requires": { "json-buffer": "3.0.1" } @@ -17562,6 +17680,7 @@ "resolved": "https://registry.npmmirror.com/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "peer": true, "requires": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -17681,13 +17800,15 @@ "version": "4.6.2", "resolved": "https://registry.npmmirror.com/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "dev": true, + "peer": true }, "lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmmirror.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz", "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true + "dev": true, + "peer": true }, "lodash.uniq": { "version": "4.5.0", @@ -18349,6 +18470,7 @@ "resolved": "https://registry.npmmirror.com/optionator/-/optionator-0.9.3.tgz", "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, + "peer": true, "requires": { "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", @@ -18985,7 +19107,8 @@ "version": "1.2.1", "resolved": "https://registry.npmmirror.com/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true + "dev": true, + "peer": true }, "prettier": { "version": "2.8.8", @@ -19014,7 +19137,8 @@ "version": "2.0.3", "resolved": "https://registry.npmmirror.com/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true + "dev": true, + "peer": true }, "progress-webpack-plugin": { "version": "1.0.16", @@ -19202,7 +19326,8 @@ "version": "3.2.0", "resolved": "https://registry.npmmirror.com/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true + "dev": true, + "peer": true }, "regexpu-core": { "version": "5.3.2", @@ -19610,6 +19735,7 @@ "resolved": "https://registry.npmmirror.com/slice-ansi/-/slice-ansi-4.0.0.tgz", "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, + "peer": true, "requires": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -19621,6 +19747,7 @@ "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "peer": true, "requires": { "color-convert": "^2.0.1" } @@ -19630,6 +19757,7 @@ "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "peer": true, "requires": { "color-name": "~1.1.4" } @@ -19638,7 +19766,8 @@ "version": "1.1.4", "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "peer": true } } }, @@ -19737,7 +19866,8 @@ "version": "1.0.3", "resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "dev": true, + "peer": true }, "ssri": { "version": "8.0.1", @@ -19825,7 +19955,8 @@ "version": "3.1.1", "resolved": "https://registry.npmmirror.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true + "dev": true, + "peer": true }, "strip-literal": { "version": "1.3.0", @@ -19900,6 +20031,7 @@ "resolved": "https://registry.npmmirror.com/table/-/table-6.8.1.tgz", "integrity": "sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==", "dev": true, + "peer": true, "requires": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", @@ -19913,6 +20045,7 @@ "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.12.0.tgz", "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dev": true, + "peer": true, "requires": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -19924,7 +20057,8 @@ "version": "1.0.0", "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true + "dev": true, + "peer": true } } }, @@ -19984,7 +20118,8 @@ "version": "0.2.0", "resolved": "https://registry.npmmirror.com/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true + "dev": true, + "peer": true }, "thenify": { "version": "3.3.1", @@ -20091,6 +20226,7 @@ "resolved": "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "peer": true, "requires": { "prelude-ls": "^1.2.1" } @@ -20348,7 +20484,8 @@ "version": "2.4.0", "resolved": "https://registry.npmmirror.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", - "dev": true + "dev": true, + "peer": true }, "validate-npm-package-license": { "version": "3.0.4", diff --git a/package.json b/package.json index c968d92..7c2f71c 100644 --- a/package.json +++ b/package.json @@ -10,14 +10,14 @@ "dependencies": { "core-js": "^3.8.3", "element-plus": "^2.5.6", + "lodash.get": "^4.4.2", "mitt": "^3.0.1", + "onml": "^2.1.0", "stream": "^0.0.2", "vue": "^3.2.13", "vue-i18n": "^9.9.1", - "waveql": "^1.8.0", - "lodash.get": "^4.4.2", - "onml": "^2.1.0", - "w3c-keyname": "^2.2.8" + "w3c-keyname": "^2.2.8", + "waveql": "^1.8.0" }, "devDependencies": { "@babel/core": "^7.12.16", @@ -25,7 +25,6 @@ "@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-eslint": "~5.0.0", "@vue/cli-service": "~5.0.0", - "eslint": "^7.32.0", "eslint-plugin-vue": "^8.0.3", "unplugin-auto-import": "^0.17.5", "unplugin-vue-components": "^0.26.0" diff --git a/public/icon.svg b/public/icon.svg new file mode 100644 index 0000000..28ba1ed --- /dev/null +++ b/public/icon.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/iconfont.css b/public/iconfont.css index ec9df89..8300b89 100644 --- a/public/iconfont.css +++ b/public/iconfont.css @@ -1,8 +1,6 @@ @font-face { font-family: "iconfont"; /* Project id 4440655 */ - src: url('iconfont.woff2?t=1709378049768') format('woff2'), - url('iconfont.woff?t=1709378049768') format('woff'), - url('iconfont.ttf?t=1709378049768') format('truetype'); + src: url('iconfont.woff2?t=1713691301672') format('woff2'); } .iconfont { @@ -13,11 +11,35 @@ -moz-osx-font-smoothing: grayscale; } +.icon-ctrl:before { + content: "\e605"; +} + +.icon-shift:before { + content: "\e626"; +} + +.icon-mouse:before { + content: "\e69e"; +} + +.icon-left-right:before { + content: "\e61c"; +} + +.icon-up-down:before { + content: "\e61d"; +} + +.icon-help:before { + content: "\e87a"; +} + .icon-parameter:before { content: "\e6be"; } -.icon-task-:before { +.icon-task:before { content: "\e602"; } @@ -29,11 +51,11 @@ content: "\e69d"; } -.icon-Function:before { +.icon-function:before { content: "\e90e"; } -.icon-R:before { +.icon-real:before { content: "\e6ec"; } @@ -41,7 +63,7 @@ content: "\e603"; } -.icon-String:before { +.icon-string:before { content: "\e614"; } @@ -61,7 +83,7 @@ content: "\e657"; } -.icon-Collections:before { +.icon-collections:before { content: "\e689"; } diff --git a/public/iconfont.woff2 b/public/iconfont.woff2 index 98fed9a..e665988 100644 Binary files a/public/iconfont.woff2 and b/public/iconfont.woff2 differ diff --git a/public/index.html b/public/index.html index a4dcd71..2a54d26 100644 --- a/public/index.html +++ b/public/index.html @@ -12,13 +12,25 @@ + + -
diff --git a/public/ondark.css b/public/ondark.css index ee68068..1cebdeb 100644 --- a/public/ondark.css +++ b/public/ondark.css @@ -192,7 +192,7 @@ --vscode-symbolIcon-fieldForeground: #75beff; --vscode-symbolIcon-fileForeground: #cccccc; --vscode-symbolIcon-folderForeground: #cccccc; - --vscode-symbolIcon-functionForeground: #b180d7; + --vscode-symbolicon-functionForeground: #b180d7; --vscode-symbolIcon-interfaceForeground: #75beff; --vscode-symbolIcon-keyForeground: #cccccc; --vscode-symbolIcon-keywordForeground: #cccccc; @@ -205,9 +205,9 @@ --vscode-symbolIcon-operatorForeground: #cccccc; --vscode-symbolIcon-packageForeground: #cccccc; --vscode-symbolIcon-propertyForeground: #cccccc; - --vscode-symbolIcon-referenceForeground: #cccccc; + --vscode-symbolicon-realeferenceForeground: #cccccc; --vscode-symbolIcon-snippetForeground: #cccccc; - --vscode-symbolIcon-stringForeground: #cccccc; + --vscode-symbolicon-stringForeground: #cccccc; --vscode-symbolIcon-structForeground: #cccccc; --vscode-symbolIcon-textForeground: #cccccc; --vscode-symbolIcon-typeParameterForeground: #cccccc; @@ -565,7 +565,7 @@ --vscode-debugIcon-pauseForeground: #75beff; --vscode-debugIcon-stopForeground: #f48771; --vscode-debugIcon-disconnectForeground: #f48771; - --vscode-debugIcon-restartForeground: #89d185; + --vscode-debugicon-realestartForeground: #89d185; --vscode-debugIcon-stepOverForeground: #75beff; --vscode-debugIcon-stepIntoForeground: #75beff; --vscode-debugIcon-stepOutForeground: #75beff; diff --git a/public/vcd.css b/public/vcd.css index 8bd3c58..59ae30a 100644 --- a/public/vcd.css +++ b/public/vcd.css @@ -4,13 +4,20 @@ --main-color: #CB81DA; --main-dark-color: #2D323B; --main-light-color: var(--main-color); - --sidebar-width: 280px; + --sidebar-width: 230px; --right-nav-width: 60px; --time-scale-height: 50px; --sidebar-padding: 10px; - --vcd-render-padding: 24px; + --sidebar-item-margin: 5px; + --vcd-render-padding: 30px; /* 需要满足如下公式 --time-scale-height + --sidebar-padding = --vcd-render-padding + canvas预留 高度 */ --render-scale-x: 1; + + /* css 动画属性 */ + --animation-7s: .7s cubic-bezier(0.23,1,0.32,1); + --animation-5s: .5s cubic-bezier(0.23,1,0.32,1); + --animation-3s: .35s cubic-bezier(0.23,1,0.32,1); + --gray-box-shadow-0: 0 0 8px 3px rgba(182, 181, 182, 0.9); } html, body { @@ -93,4 +100,18 @@ body::-webkit-scrollbar { a { color: var(--main-color); +} + +.digital-ide-icon { + background-image: url(./icon.svg); + background-size: 100%; + height: 50px; + width: 50px; +} + +.digital-ide-icon.big { + background-image: url(./icon.svg); + background-size: 100%; + height: 200px; + width: 200px; } \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 3dd30de..71665a2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,9 +14,9 @@ - diff --git a/src/components/about/index.vue b/src/components/about/index.vue index 22ae9eb..71af409 100644 --- a/src/components/about/index.vue +++ b/src/components/about/index.vue @@ -1,18 +1,39 @@ + \ No newline at end of file diff --git a/src/components/right-nav.vue b/src/components/right-nav.vue index 03fe5dd..2c2f957 100644 --- a/src/components/right-nav.vue +++ b/src/components/right-nav.vue @@ -12,7 +12,7 @@
- +

-
-

{{ t('search-setting') }}

-
- {{ t('search-case-sensitivity') }} - +
+
+

{{ t('general-setting') }}

+
+ {{ t('language-setting') }} + + + + +
+
+
+ + {{ t('prerender') }} + + + +
+ +
+ +
+ + {{ t('render-animation') }} + + +
+ +
+ +
+ + {{ t('horizontal-scaling-ratio') }} + + + +
+
+
+ + {{ t('horizontal-roll-ratio') }} + + + +
+
+
+ + {{ t('vertical-roll-ratio') }} + + + +
-
+
-
- {{ t('search-display-parent-only') }} - +
+

{{ t('appearance-setting') }}

+
+ {{ t('display-wave-height') }} + +
+ +
+ +
+ {{ t('display-signal-info-scope') }} + + {{ t('display-signal-info-scope.width') }} + {{ t('display-signal-info-scope.parent') }} + +
+ +
+ +
+ {{ t('wavecolor') }} + + + +
+ +
-
+
-
- {{ t('search-scope') }} - - - - +
+

{{ t('search-setting') }}

+
+ {{ t('search-case-sensitivity') }} + +
+ +
+ +
+ {{ t('search-display-parent-only') }} + +
+ +
+ +
+ {{ t('search-scope') }} + + + + +
-
- -
-

{{ t('general-setting') }}

-
- {{ t('language-setting') }} - - - - -
-
-
- {{ t('wheel-zoom-ratio') }} - -
-
- -
- -
-

{{ t('appearance-setting') }}

-
- {{ t('display-wave-height') }} - -
- -
- -
- {{ t('display-signal-info-scope') }} - - width - parent - -
-
- \ No newline at end of file diff --git a/src/components/sidebar.vue b/src/components/sidebar.vue index 728dc53..e348078 100644 --- a/src/components/sidebar.vue +++ b/src/components/sidebar.vue @@ -1,111 +1,123 @@ - \ No newline at end of file diff --git a/src/components/treeview/modules.vue b/src/components/treeview/modules.vue index 33c6590..13df6ff 100644 --- a/src/components/treeview/modules.vue +++ b/src/components/treeview/modules.vue @@ -56,8 +56,8 @@ export default { } const expandManage = reactive({ - expanded: true, - expandTagClass: mods.length === 0 ? '' : 'expand-tag', + expanded: false, + expandTagClass: mods.length === 0 ? '' : 'collapse-tag', click() { this.expanded = !this.expanded; if (this.expandTagClass) { diff --git a/src/components/treeview/search.vue b/src/components/treeview/search.vue index 52ede22..3240924 100644 --- a/src/components/treeview/search.vue +++ b/src/components/treeview/search.vue @@ -13,19 +13,23 @@ @blur="searchManage.displayResult = false" />
-
+
-
-
-
- +
+
+
{{ t('search-nothing') }} @@ -36,71 +40,72 @@
- \ No newline at end of file diff --git a/src/hook/global.js b/src/hook/global.js index 8af369b..065f7cd 100644 --- a/src/hook/global.js +++ b/src/hook/global.js @@ -1,5 +1,6 @@ import mitt from 'mitt'; import { reactive } from 'vue'; +import WebGL2WaveRender from './wave-view/render-wave'; const emitter = mitt(); @@ -35,8 +36,11 @@ const globalLookup = reactive({ tgcd: null, // 其实就是 signalValues chango: {}, + // 初始化时会被定义 render: () => {}, + waveRender: undefined, + pstate: undefined, xScale: 1, @@ -60,25 +64,75 @@ const globalLookup = reactive({ childModule.parent = module; } } + }, + + /** + * @returns {WebGL2WaveRender} + */ + getWaveRender() { + return this.waveRender; } }); +const globalStyle = reactive({ + timeScaleHeight: 30, + sideBarPadding: 10, + sideBarItemMargin: 5, + vcdRenderPadding: 24, + yOffset: 0, +}); + const globalSetting = reactive({ + language: 'zh', caseSensitivity: false, displayParentOnly: false, displaySignalHeight: 50, searchMode: 'so', // so, mo, sm searchScope: ['wire', 'reg', 'integer'], - displaySignalInfoScope: ['width', 'parent'], - wheelZoomRatio: 1, - minGridWidth: 300 + displaySignalInfoScope: ['width'], + HorizontalScalingRatio: 1, + HorizontalRollRatio: 1, + VerticalRollRario: 1, + minGridWidth: 300, + prerender: true, + renderAnimation: false, }); +function loadSetting() { + const settingString = localStorage.getItem('setting') + try { + const setting = JSON.parse(settingString); + return setting; + } catch (error) { + return undefined; + } +} + +const storedSetting = loadSetting(); +if (storedSetting) { + for (const key of Reflect.ownKeys(storedSetting)) { + const value = storedSetting[key]; + if (value !== undefined) { + globalSetting[key] = value; + } + } +} + + + +// for (const key of Reflect.ownKeys(globalSetting)) { +// const value = localStorageGetItem(key); +// if (value !== undefined && value !== null) { +// globalSetting[key] = value; +// } +// } + const signalValues = {}; export { emitter, globalLookup, globalSetting, + globalStyle, signalValues }; \ No newline at end of file diff --git a/src/hook/render.js b/src/hook/render.js index 950569b..0dc67c0 100644 --- a/src/hook/render.js +++ b/src/hook/render.js @@ -1,6 +1,7 @@ import { globalLookup, globalSetting, signalValues } from "./global"; import { domContainer, pluginRenderTimeGrid, pluginRenderValues, mountTree, - genOnWheel, genKeyHandler, keyBindo } from './wave-view'; + genOnWheel, genKeyHandler, keyEvent } from './wave-view'; + import { findCurrentSignalValue } from './utils'; let mainRenderEl = null; @@ -38,6 +39,7 @@ function makeWaveView(parentElement) { if (!parentElement) { parentElement = getMainRenderEl(); } + const container = domContainer({ elemento: mountTree.defaultElemento, layers: mountTree.defaultLayers, @@ -55,7 +57,7 @@ function makeWaveView(parentElement) { console.log('updater'); }; - container.elo.container.addEventListener('wheel', genOnWheel(parentElement, container.pstate, globalLookup, keyBindo)); + container.elo.container.addEventListener('wheel', genOnWheel(parentElement, container.pstate, globalLookup, keyEvent)); } diff --git a/src/hook/types/index.d.ts b/src/hook/types/index.d.ts deleted file mode 100644 index 72881f9..0000000 --- a/src/hook/types/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -export interface RenderElements { - grid: HTMLDivElement - view: HTMLDivElement - values: HTMLDivElement -} - -export interface ChangoItem { - kind: string - wave: Array - lineVao: WebGLVertexArrayObject - maskVao: WebGLVertexArrayObject -} - -export interface WireInfoItem { - kind: string - link: string - name: string - size: number - parent: WireInfoItem - type: string -} - -export interface Pstate { - width: number - height: number - xScale: number - xOffset: number - yOffset: number - yStep: number - yDuty: number -} - -export interface WebGLLocation { - colors: WebGLUniformLocation - shifts: WebGLUniformLocation - scale: WebGLUniformLocation - offset: WebGLUniformLocation - pos: number - widthShifts: WebGLUniformLocation - gl: WebGL2RenderingContext -} - -export interface PerspectivePoint { - x: number - y: number - color: number -} \ No newline at end of file diff --git a/src/hook/types/index.js b/src/hook/types/index.js deleted file mode 100644 index 3ded390..0000000 --- a/src/hook/types/index.js +++ /dev/null @@ -1 +0,0 @@ -module.Render = {}; \ No newline at end of file diff --git a/src/hook/utils.js b/src/hook/utils.js index 238382c..e54987d 100644 --- a/src/hook/utils.js +++ b/src/hook/utils.js @@ -1,5 +1,3 @@ -/* eslint-disable no-undef */ - import { Stream } from "stream"; import { globalLookup } from "./global"; @@ -12,22 +10,6 @@ async function getVcdStream() { return ostream; } -/** - * @returns {Promise} - */ -async function readVcdFile() { - const response = await fetch('test.vcd'); - const blob = await response.blob(); - const reader = new FileReader(); - return new Promise((resolve, reject) => { - reader.onload = event => { - const fileContent = event.target.result; - const unintarray = new Uint8Array(fileContent); - resolve(unintarray); - }; - reader.readAsArrayBuffer(blob); - }); -} function debounceWrapper(fn, delay) { let timer @@ -47,13 +29,13 @@ function makeIconClass(mod) { case 'module': return 'icon-memory-chip'; case 'begin': return 'icon-brackets'; case 'fork': return 'icon-fork'; - case 'function': return 'icon-Function'; - case 'task': return 'icon-task-'; + case 'function': return 'icon-function'; + case 'task': return 'icon-task'; case 'event': return 'icon-prevent'; case 'integer': return 'icon-integer'; case 'parameter': return 'icon-parameter'; - case 'real': return 'icon-R'; + case 'real': return 'icon-real'; case 'realtime': return 'icon-wave-square'; case 'reg': return 'icon-register'; case 'supply0': return 'icon-wave-square'; @@ -68,7 +50,7 @@ function makeIconClass(mod) { case 'wand': return 'icon-wave-square'; case 'wire': return 'icon-wave-square'; case 'wor': return 'icon-wave-square'; - case 'string': return 'icon-String'; + case 'string': return 'icon-string'; default: break; } @@ -322,12 +304,57 @@ function isVariable(wire) { return variables.has(wire.type); } +function webglColor2rgba(r, g, b, a) { + const standRed = Math.floor(r * 255); + const standGreen = Math.floor(g * 255); + const standBlue = Math.floor(b * 255); + return `rgba(${standRed},${standGreen},${standBlue},${a})`; +} +/** + * + * @param {string} rgba + * @returns {{ + * red: number, + * green: number, + * blue: number, + * alpha: number + * } | undefined} + */ +function rgba2WebglColor(rgba) { + const match = rgba.match(/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d+(\.\d+)?)\)$/); + if (match) { + return { + red: parseInt(match[1]) / 255, + green: parseInt(match[2]) / 255, + blue: parseInt(match[3]) / 255, + alpha: parseFloat(match[4]) + }; + } else { + return undefined; + } +} + +const predefinedColors = [ + '#ff4500', + '#ff8c00', + '#ffd700', + '#90ee90', + '#00ced1', + '#1e90ff', + '#c71585', + 'rgba(255, 69, 0, 0.68)', + 'rgb(255, 120, 0)', + 'hsv(51, 100, 98)', + 'hsva(120, 40, 94, 0.5)', + 'hsl(181, 100%, 37%)', + 'hsla(209, 100%, 56%, 0.73)', + '#c7158577' +]; export { getVcdStream, - readVcdFile, debounceWrapper, makeSearchResultItem, handleTimeScale, @@ -341,5 +368,8 @@ export { gcd, findCurrentSignalValue, normaliseUsingGCD, - updateWireCurrentValue + updateWireCurrentValue, + predefinedColors, + webglColor2rgba, + rgba2WebglColor }; \ No newline at end of file diff --git a/src/hook/wave-view/bracer.js b/src/hook/wave-view/bracer.js index 1a9f58b..100f0a2 100644 --- a/src/hook/wave-view/bracer.js +++ b/src/hook/wave-view/bracer.js @@ -1,107 +1,108 @@ -'use strict'; -const getX = require('./get-x.js'); -const surferer = require('./surferer.js'); +import getX from './get-x'; +import surferer from './surferer'; const skipT = (wave, iStart, tLimit) => { - let iRes = iStart; - let [tRes, vRes] = wave[iStart]; - for (let i = iStart; i < wave.length; i++) { - const [t, v] = wave[i]; - if (t >= tLimit) { - break; + let iRes = iStart; + let [tRes, vRes] = wave[iStart]; + for (let i = iStart; i < wave.length; i++) { + const [t, v] = wave[i]; + if (t >= tLimit) { + break; + } + iRes = i; + tRes = t; + vRes = v; } - iRes = i; - tRes = t; - vRes = v; - } - return [iRes, vRes, tRes]; + return [iRes, vRes, tRes]; }; const bracer = (lane, desc, pstate) => { - const body = lane.body; - const { yStep } = pstate; - let { clock, valid, ready, up } = body; - up = up || 1; + const body = lane.body; + const { yStep } = pstate; + let { clock, valid, ready, up } = body; + up = up || 1; - const res = []; - let count = 0; + const res = []; + let count = 0; - if (clock && clock.ref) { - const clockWave = desc.chango[clock.ref].wave; - const clockEr = surferer(clockWave, pstate); - let tPrevClock = 0; + if (clock && clock.ref) { + const clockWave = desc.chango[clock.ref].wave; + const clockEr = surferer(clockWave, pstate); + let tPrevClock = 0; - if (valid && valid.ref) { - const validWave = desc.chango[valid.ref].wave; - let iValid = 0; - let vValid; + if (valid && valid.ref) { + const validWave = desc.chango[valid.ref].wave; + let iValid = 0; + let vValid; - if (ready && ready.ref) { - const readyWave = desc.chango[ready.ref].wave; - let iReady = 0; - let vReady; + if (ready && ready.ref) { + const readyWave = desc.chango[ready.ref].wave; + let iReady = 0; + let vReady; - for (const iClock of clockEr) { - const [tClock, vClock] = clockWave[iClock]; - if (vClock) { - [iValid, vValid] = skipT(validWave, iValid, tClock); - [iReady, vReady] = skipT(readyWave, iReady, tClock); - const xClock = getX(pstate, tClock); - const xPrevClock = getX(pstate, tPrevClock); - const width = xClock - xPrevClock; - const height = up * yStep; - if (xClock > 0 && xPrevClock > 0 && width > 0) { - if (vValid) { - if (width >= 1) { - if (vReady) { - res.push(['rect', {fill: 'url(\'#valid&ready\')', width: Math.round(width), height, x: Math.round(xPrevClock), y: -height}]); - } else { - res.push(['rect', {fill: 'url(\'#valid&~ready\')', width: Math.round(width), height, x: Math.round(xPrevClock), y: -height}]); - } - count++; - } else { - count += 10; + for (const iClock of clockEr) { + const [tClock, vClock] = clockWave[iClock]; + if (vClock) { + [iValid, vValid] = skipT(validWave, iValid, tClock); + [iReady, vReady] = skipT(readyWave, iReady, tClock); + const xClock = getX(pstate, tClock); + const xPrevClock = getX(pstate, tPrevClock); + const width = xClock - xPrevClock; + const height = up * yStep; + if (xClock > 0 && xPrevClock > 0 && width > 0) { + if (vValid) { + if (width >= 1) { + if (vReady) { + res.push(['rect', { fill: 'url(\'#valid&ready\')', width: Math.round(width), height, x: Math.round(xPrevClock), y: -height }]); + } else { + res.push(['rect', { fill: 'url(\'#valid&~ready\')', width: Math.round(width), height, x: Math.round(xPrevClock), y: -height }]); + } + count++; + } else { + count += 10; + } + } + } + tPrevClock = tClock; + if (count > 500) { + return res; + } + } } - } - } - tPrevClock = tClock; - if (count > 500) { - return res; - } - } - } - } else { - for (const iClock of clockEr) { - const [tClock, vClock] = clockWave[iClock]; - if (vClock) { - [iValid, vValid] = skipT(validWave, iValid, tClock); - const xClock = getX(pstate, tClock); - const xPrevClock = getX(pstate, tPrevClock); - const width = xClock - xPrevClock; - const height = up * yStep; - if (xClock > 0 && xPrevClock > 0 && width > 0) { - if (vValid) { - if (width >= 1) { - res.push(['rect', {fill: 'url(\'#valid\')', width: Math.round(width), height, x: Math.round(xPrevClock), y: -height}]); - count++; - } else { - count += 10; + } else { + for (const iClock of clockEr) { + const [tClock, vClock] = clockWave[iClock]; + if (vClock) { + [iValid, vValid] = skipT(validWave, iValid, tClock); + const xClock = getX(pstate, tClock); + const xPrevClock = getX(pstate, tPrevClock); + const width = xClock - xPrevClock; + const height = up * yStep; + if (xClock > 0 && xPrevClock > 0 && width > 0) { + if (vValid) { + if (width >= 1) { + res.push(['rect', { fill: 'url(\'#valid\')', width: Math.round(width), height, x: Math.round(xPrevClock), y: -height }]); + count++; + } else { + count += 10; + } + } + } + tPrevClock = tClock; + if (count > 500) { + return res; + } + } } - } } - tPrevClock = tClock; - if (count > 500) { - return res; - } - } } - } } - } - return res; + return res; }; -module.exports = bracer; + + +export default bracer; /* eslint complexity: [1, 55] */ \ No newline at end of file diff --git a/src/hook/wave-view/dom-container.js b/src/hook/wave-view/dom-container.js index 9d5b384..59674cd 100644 --- a/src/hook/wave-view/dom-container.js +++ b/src/hook/wave-view/dom-container.js @@ -1,7 +1,9 @@ -const WebGL2WaveRender = require('./gen-render-waves-gl.js'); -const renderCursor = require('./render-cursor.js'); -const genResizeHandler = require('./gen-resize-handler.js'); -const mTree = require('./mount-tree.js'); +import { globalLookup } from '../global'; +import WebGL2WaveRender from './render-wave'; + +import renderCursor from './render-cursor'; +import genResizeHandler from './gen-resize-handler'; +import mTree from './mount-tree'; const setTime = (pstate, str) => { // const { sidebarOffset, time, timescale, tgcd, xOffset } = pstate; @@ -108,20 +110,29 @@ const domContainer = (obj) => { const pstate = { fontHeight, - width: 1024, // [px] window width - height: 1024, // [px] window height + width: 1024, // [px] window width + height: 1024, // [px] window height xScaleMax: 1000, xScaleMin: 0.001, - topBarHeight: fontHeight * 1.5, // [px] - botBarHeight: fontHeight * 1.5, // [px] + topBarHeight: fontHeight * 1.5, // [px] + botBarHeight: fontHeight * 1.5, // [px] xOffset: sidebarWidth, - yOffset: -40, // [px] - yStep: 54, // = 24 // [px] wave lane height + yOffset: -40, // [px] + yStep: 54, // = 24 // [px] wave lane height yDuty: 0.6, + + // for animation + oldXOffset: sidebarWidth, + oldYOffset: -40, + oldYStep: 54, + oldYDuty: 0.6, + sidebarWidth, container }; + globalLookup.pstate = pstate; + return { elo, pstate, @@ -138,6 +149,7 @@ const domContainer = (obj) => { tgcd: deso.tgcd, timescale: deso.timescale, xScale: deso.xScale || 8, + oldXScale: deso.xScale || 8, numLanes: deso.currentWires.size, t0: deso.t0, time: deso.time @@ -157,16 +169,20 @@ const domContainer = (obj) => { setTime(pstate, deso.timeOpt.value); } - let waveRender = new WebGL2WaveRender(elo, deso, pstate, obj.renderPlugins); + const waveRender = new WebGL2WaveRender(elo, deso, pstate, obj.renderPlugins); deso.render = waveRender.render.bind(waveRender); + deso.waveRender = waveRender; + globalLookup.waveRender = waveRender; const resizeHandler = genResizeHandler(pstate); + // 通过 resize 完成 height 和 width 的初始化 const resizeObserver = new ResizeObserver(entries => { for (let entry of entries) { // TODO : 使用更新的属性替换 contentRect // 未来版本 contentRect 可能会被丢弃 let { width, height } = entry.contentRect; + console.log(width, height); // height = height || 888; // console.log('resizeObserver', width, height); resizeHandler(width, height); @@ -183,6 +199,4 @@ const domContainer = (obj) => { }; }; -module.exports = domContainer; - -/* eslint-env browser */ +export default domContainer; \ No newline at end of file diff --git a/src/hook/wave-view/format-time.js b/src/hook/wave-view/format-time.js index 4a6a13c..3f243e7 100644 --- a/src/hook/wave-view/format-time.js +++ b/src/hook/wave-view/format-time.js @@ -1,5 +1,3 @@ -'use strict'; - const formatTime = (t, expo) => { const prefixes = ['T', 'G', 'M', 'k', '', 'm', 'µ', 'n', 'p', 'f', 'a', 'z', 'y']; const ts1 = 14 - expo; @@ -8,4 +6,4 @@ const formatTime = (t, expo) => { return (t * mult).toLocaleString() + ' ' + prefix + 's'; }; -module.exports = formatTime; +export default formatTime; diff --git a/src/hook/wave-view/format.js b/src/hook/wave-view/format.js index 9e5409c..2025591 100644 --- a/src/hook/wave-view/format.js +++ b/src/hook/wave-view/format.js @@ -1,143 +1,145 @@ -'use strict'; +const replacer = '...'; + +// '\u205D' const format = (fmt, len) => { - len = BigInt(len); - { - const m = fmt.match(/^%(?[s])?(?[bodh])(?\d+)?$/); - if (m) { - const radix = ({b: 2, o: 8, d: 10, h: 16, H: 16})[m.groups.radix]; - if (m.groups.sign) { - return (val, pos) => { - if ((val >> (len - 1n)) & 1n) { - val = val - (2n ** len); - } - let txtOrig = val.toString(radix); - if (txtOrig.length <= pos) { - return txtOrig; - } - const sign = (val < 0) ? '-' : '+'; - if (pos === 1) { - return sign; - } - if (pos === 2) { - return sign + '\u205D'; - } - return sign + '\u205D' + txtOrig.slice(2 - pos); - }; - } - if (Number(m.groups.elen) > 0) { - const elen = BigInt(m.groups.elen); - return (val, pos) => { - let txtRes = []; - for (let i = 0n; i < len; i += elen) { - const chunk = (val >> i) & (2n ** elen - 1n); - txtRes.unshift(chunk.toString(radix)); - } - txtRes = '{' + txtRes.join(', ') + '}'; - if (txtRes.length <= pos) { - return txtRes; - } - if (pos === 1) { - return '\u205D'; - } - return '\u205D' + txtRes.slice(1 - pos); - }; - } - return (val, pos) => { - let txtOrig = val.toString(radix); - if (txtOrig.length <= pos) { - return txtOrig; + len = BigInt(len); + { + const m = fmt.match(/^%(?[s])?(?[bodh])(?\d+)?$/); + if (m) { + const radix = ({ b: 2, o: 8, d: 10, h: 16, H: 16 })[m.groups.radix]; + if (m.groups.sign) { + return (val, pos) => { + if ((val >> (len - 1n)) & 1n) { + val = val - (2n ** len); + } + let txtOrig = val.toString(radix); + if (txtOrig.length <= pos) { + return txtOrig; + } + const sign = (val < 0) ? '-' : '+'; + if (pos === 1) { + return sign; + } + if (pos === 2) { + return sign + replacer; + } + return sign + replacer + txtOrig.slice(2 - pos); + }; + } + if (Number(m.groups.elen) > 0) { + const elen = BigInt(m.groups.elen); + return (val, pos) => { + let txtRes = []; + for (let i = 0n; i < len; i += elen) { + const chunk = (val >> i) & (2n ** elen - 1n); + txtRes.unshift(chunk.toString(radix)); + } + txtRes = '{' + txtRes.join(', ') + '}'; + if (txtRes.length <= pos) { + return txtRes; + } + if (pos === 1) { + return replacer; + } + return replacer + txtRes.slice(1 - pos); + }; + } + return (val, pos) => { + let txtOrig = val.toString(radix); + if (txtOrig.length <= pos) { + return txtOrig; + } + if (pos === 1) { + return replacer; + } + return replacer + txtOrig.slice(1 - pos); + }; } - if (pos === 1) { - return '\u205D'; + } { + const m = fmt.match(/^%a$/); + if (m) { + return (val, pos) => { + let txtRes = ''; + for (let i = 0n; i < len; i += 8n) { + txtRes = String.fromCharCode(Number((val >> i) & 0xffn)) + txtRes; + } + txtRes = txtRes.trim(); + if (txtRes.length <= pos) { + return txtRes; + } + txtRes = txtRes.slice(0, pos - 1) + replacer; + return txtRes; + }; + } + } { + const m = fmt.match(/^%(?
[fe])(?32|64)$/); + if (m) { + const buf = new ArrayBuffer(8); + const bufBInt = new BigInt64Array(buf); + const elen = BigInt(m.groups.elen); + const bufFloat = new ((elen === 32n) ? Float32Array : Float64Array)(buf); + const mask = (elen === 32n) ? 0xffffffffn : 0xffffffffffffffffn; + if (m.groups.form === 'f') { + if (len > elen) { + return (val, pos) => { + let txtRes = []; + for (let i = 0n; i < len; i += elen) { + bufBInt[0] = (val >> i) & mask; + const fval = bufFloat[0]; + txtRes.unshift(fval.toString()); + } + txtRes = '{' + txtRes.join(', ') + '}'; + if (txtRes.length <= pos) { + return txtRes; + } + if (pos === 1) { + return replacer; + } + return replacer + txtRes.slice(1 - pos); + }; + } + return (val, pos) => { + bufBInt[0] = val & mask; + const fval = bufFloat[0]; + let txtOrig; + txtOrig = fval.toString(); + if (txtOrig.length <= pos) { + return txtOrig; + } + for (let i = pos; i >= 0; i--) { + txtOrig = fval.toPrecision(i + 1); + if (txtOrig.length <= pos) { + return txtOrig; + } + txtOrig = fval.toExponential(i); + if (txtOrig.length <= pos) { + return txtOrig; + } + } + return (val < 0) ? '-' : '+'; + }; + } else {// e + return (val, pos) => { + bufBInt[0] = val & mask; + const fval = bufFloat[0]; + let txtOrig; + txtOrig = fval.toExponential(); + if (txtOrig.length <= pos) { + return txtOrig; + } + for (let i = 4; i <= pos; i++) { + txtOrig = fval.toExponential(pos - i); + if (txtOrig.length <= pos) { + return txtOrig; + } + } + return (val < 0) ? '-' : '+'; + }; + } } - return '\u205D' + txtOrig.slice(1 - pos); - }; } - } { - const m = fmt.match(/^%a$/); - if (m) { - return (val, pos) => { - let txtRes = ''; - for (let i = 0n; i < len; i += 8n) { - txtRes = String.fromCharCode(Number((val >> i) & 0xffn)) + txtRes; - } - txtRes = txtRes.trim(); - if (txtRes.length <= pos) { - return txtRes; - } - txtRes = txtRes.slice(0, pos - 1) + '\u205D'; - return txtRes; - }; - } - } { - const m = fmt.match(/^%(?[fe])(?32|64)$/); - if (m) { - const buf = new ArrayBuffer(8); - const bufBInt = new BigInt64Array(buf); - const elen = BigInt(m.groups.elen); - const bufFloat = new ((elen === 32n) ? Float32Array : Float64Array)(buf); - const mask = (elen === 32n) ? 0xffffffffn : 0xffffffffffffffffn; - if (m.groups.form === 'f') { - if (len > elen) { - return (val, pos) => { - let txtRes = []; - for (let i = 0n; i < len; i += elen) { - bufBInt[0] = (val >> i) & mask; - const fval = bufFloat[0]; - txtRes.unshift(fval.toString()); - } - txtRes = '{' + txtRes.join(', ') + '}'; - if (txtRes.length <= pos) { - return txtRes; - } - if (pos === 1) { - return '\u205D'; - } - return '\u205D' + txtRes.slice(1 - pos); - }; - } - return (val, pos) => { - bufBInt[0] = val & mask; - const fval = bufFloat[0]; - let txtOrig; - txtOrig = fval.toString(); - if (txtOrig.length <= pos) { - return txtOrig; - } - for (let i = pos; i >= 0; i--) { - txtOrig = fval.toPrecision(i + 1); - if (txtOrig.length <= pos) { - return txtOrig; - } - txtOrig = fval.toExponential(i); - if (txtOrig.length <= pos) { - return txtOrig; - } - } - return (val < 0) ? '-' : '+'; - }; - } else {// e - return (val, pos) => { - bufBInt[0] = val & mask; - const fval = bufFloat[0]; - let txtOrig; - txtOrig = fval.toExponential(); - if (txtOrig.length <= pos) { - return txtOrig; - } - for (let i = 4; i <= pos; i++) { - txtOrig = fval.toExponential(pos - i); - if (txtOrig.length <= pos) { - return txtOrig; - } - } - return (val < 0) ? '-' : '+'; - }; - } - } - } - return () => '?'; + return () => '?'; }; -module.exports = format; +export default format; diff --git a/src/hook/wave-view/gen-key-handler.js b/src/hook/wave-view/gen-key-handler.js index a4a5d74..37505b4 100644 --- a/src/hook/wave-view/gen-key-handler.js +++ b/src/hook/wave-view/gen-key-handler.js @@ -1,12 +1,10 @@ -'use strict'; +const { keyName } = require('w3c-keyname'); -const {keyName} = require('w3c-keyname'); - -const executeKeyHandler = (key, keyBindo, pstate, cm) => { - return (keyBindo[key] || keyBindo.nop).fn(pstate, cm); +const executeKeyHandler = (key, keyEvent, pstate, cm) => { + return (keyEvent[key] || keyEvent.nop).fn(pstate, cm); }; -const genKeyHandler = (div, pstate, deso, cm, keyBindo, plugins) => { +const genKeyHandler = (div, pstate, deso, cm, keyEvent, plugins) => { return event => { const modifier = ( @@ -17,7 +15,7 @@ const genKeyHandler = (div, pstate, deso, cm, keyBindo, plugins) => { // const key = modifier + event.key; const key = modifier + keyName(event); - if (executeKeyHandler(key, keyBindo, pstate, cm)) { + if (executeKeyHandler(key, keyEvent, pstate, cm)) { event.stopPropagation(); if (plugins != undefined) { plugins.map(fn => fn(key, event)); @@ -27,5 +25,7 @@ const genKeyHandler = (div, pstate, deso, cm, keyBindo, plugins) => { }; }; -exports.executeKeyHandler = executeKeyHandler; -exports.genKeyHandler = genKeyHandler; +export default { + executeKeyHandler, + genKeyHandler +}; \ No newline at end of file diff --git a/src/hook/wave-view/gen-on-wheel.js b/src/hook/wave-view/gen-on-wheel.js index eb1e9f2..075cc4f 100644 --- a/src/hook/wave-view/gen-on-wheel.js +++ b/src/hook/wave-view/gen-on-wheel.js @@ -1,13 +1,11 @@ -'use strict'; - -const genOnWheel = (element, pstate, deso, keyBindo, plugins) => +const genOnWheel = (element, pstate, deso, keyEvent, plugins) => event => { const { deltaX, deltaY } = event; if (event.ctrlKey) { const key = (deltaY < 0) ? 'Ctrl+icon:scrollUp' : ((deltaY > 0) ? 'Ctrl+icon:scrollDown' : 'nop'); - if (keyBindo[key].fn(pstate)) { + if (keyEvent[key].fn(pstate)) { if (plugins != undefined) { plugins.map(fn => fn(key, event)); } @@ -16,7 +14,7 @@ const genOnWheel = (element, pstate, deso, keyBindo, plugins) => event.preventDefault(); } else if (event.shiftKey) { const key = (deltaY < 0) ? 'Shift+icon:scrollUp' : ((deltaY > 0) ? 'Shift+icon:scrollDown' : 'nop'); - if (keyBindo[key].fn(pstate)) { + if (keyEvent[key].fn(pstate)) { if (plugins != undefined) { plugins.map(fn => fn(key, event)); } @@ -24,8 +22,17 @@ const genOnWheel = (element, pstate, deso, keyBindo, plugins) => } event.preventDefault(); } else if (deltaX !== 0 && deltaY === 0) { - const key = (deltaX < 0) ? 'icon:scrollLeft': 'icon:scrollRight'; - if (keyBindo[key].fn(pstate)) { + const key = (deltaX < 0) ? 'scrollLeft': 'scrollRight'; + if (keyEvent[key].fn(pstate)) { + if (plugins != undefined) { + plugins.map(fn => fn(key, event)); + } + deso.render(); + } + event.preventDefault(); + } else if (deltaX === 0 && deltaY !== 0) { + const key = (deltaY < 0) ? 'scrollUp': 'scrollDown'; + if (keyEvent[key].fn(pstate)) { if (plugins != undefined) { plugins.map(fn => fn(key, event)); } @@ -35,4 +42,4 @@ const genOnWheel = (element, pstate, deso, keyBindo, plugins) => } }; -module.exports = genOnWheel; +export default genOnWheel; \ No newline at end of file diff --git a/src/hook/wave-view/gen-resize-handler.js b/src/hook/wave-view/gen-resize-handler.js index 7cd2cdf..dca2234 100644 --- a/src/hook/wave-view/gen-resize-handler.js +++ b/src/hook/wave-view/gen-resize-handler.js @@ -1,6 +1,4 @@ -'use strict'; - -const xOffsetUpdate = require('./x-offset-update.js'); +import xOffsetUpdate from './x-offset-update'; const genResizeHandler = pstate => (width, height) => { @@ -8,8 +6,6 @@ const genResizeHandler = pstate => pstate.width = width; pstate.height = height; - console.log('time', time); - // Y const yOffsetMax = (numLanes + 2) * 2 * yStep; if (yOffsetMax < 0) { @@ -21,7 +17,7 @@ const genResizeHandler = pstate => const xScaleMin = pstate.xScaleMin = 0.001; pstate.xScale = (xScale < xScaleMin) ? xScaleMin : xScale; - xOffsetUpdate(pstate, xOffset); + xOffsetUpdate(pstate, () => xOffset); }; -module.exports = genResizeHandler; +export default genResizeHandler; diff --git a/src/hook/wave-view/get-element.js b/src/hook/wave-view/get-element.js index da03bad..8f8dc88 100644 --- a/src/hook/wave-view/get-element.js +++ b/src/hook/wave-view/get-element.js @@ -1,5 +1,3 @@ -'use strict'; - const getElement = divName => { if (typeof divName === 'string') { const c = document.getElementById(divName); @@ -11,6 +9,6 @@ const getElement = divName => { return divName; }; -module.exports = getElement; +export default getElement; /* eslint-env browser */ diff --git a/src/hook/wave-view/get-label.js b/src/hook/wave-view/get-label.js index 4e5abcb..8fb9040 100644 --- a/src/hook/wave-view/get-label.js +++ b/src/hook/wave-view/get-label.js @@ -1,6 +1,4 @@ -'use strict'; - -const format = require('./format.js'); +import format from './format'; const getLabel = (lane) => { if (typeof lane !== 'object') { @@ -31,4 +29,4 @@ const getLabel = (lane) => { }; }; -module.exports = getLabel; +export default getLabel; diff --git a/src/hook/wave-view/get-listing.js b/src/hook/wave-view/get-listing.js index a6593a1..122e1dc 100644 --- a/src/hook/wave-view/get-listing.js +++ b/src/hook/wave-view/get-listing.js @@ -1,26 +1,24 @@ -'use strict'; +import lister from './lister'; -const lister = require('./lister.js'); - -const getListing = async (readers) => { - let listing = []; - const r = readers.find(reader => reader.ext === 'lst'); - if (r) { - const utf8Decoder = new TextDecoder('utf-8'); - const list = lister(); - for (let i = 0; i < 10000; i++) { - let { done, value } = await r.reader.read(); - if (typeof value !== 'string') { - value = utf8Decoder.decode(value, {stream: true}); - } - list.onChunk(value); - if (done) { - listing = list.getTrace(); - break; - } +async function getListing(readers) { + let listing = []; + const r = readers.find(reader => reader.ext === 'lst'); + if (r) { + const utf8Decoder = new TextDecoder('utf-8'); + const list = lister(); + for (let i = 0; i < 10000; i++) { + let { done, value } = await r.reader.read(); + if (typeof value !== 'string') { + value = utf8Decoder.decode(value, { stream: true }); + } + list.onChunk(value); + if (done) { + listing = list.getTrace(); + break; + } + } } - } - return listing; -}; + return listing; +} -module.exports = getListing; +export default getListing; diff --git a/src/hook/wave-view/get-t.js b/src/hook/wave-view/get-t.js index 2ae318d..3eb5d11 100644 --- a/src/hook/wave-view/get-t.js +++ b/src/hook/wave-view/get-t.js @@ -1,5 +1,3 @@ -'use strict'; - const getT = (x, pstate) => { const {xOffset, xScale, tgcd } = pstate; return Math.round((x / xScale) - (xOffset / xScale)) * tgcd; @@ -10,4 +8,4 @@ const getT = (x, pstate) => { // (t / tgcd) * xScale / 2 + (xOffset * width / 2) = x; }; -module.exports = getT; +export default getT; diff --git a/src/hook/wave-view/get-x.js b/src/hook/wave-view/get-x.js index d9deb12..feca577 100644 --- a/src/hook/wave-view/get-x.js +++ b/src/hook/wave-view/get-x.js @@ -1,6 +1,4 @@ -'use strict'; - const getX = (pstate, time) => time * pstate.xScale + pstate.xOffset; -module.exports = getX; +export default getX; \ No newline at end of file diff --git a/src/hook/wave-view/hash.js b/src/hook/wave-view/hash.js index 8a9300d..c1fd065 100644 --- a/src/hook/wave-view/hash.js +++ b/src/hook/wave-view/hash.js @@ -1,5 +1,3 @@ -'use strict'; - // Fletcher Style checksum const hash = str => { @@ -12,4 +10,4 @@ const hash = str => { return (sum2 ^ sum1 ^ (sum2 >> 5) ^ (sum1 >> 5)) % 36; }; -module.exports = hash; +export default hash; \ No newline at end of file diff --git a/src/hook/wave-view/index.js b/src/hook/wave-view/index.js index c0139c4..350caa6 100644 --- a/src/hook/wave-view/index.js +++ b/src/hook/wave-view/index.js @@ -1,27 +1,28 @@ -'use strict'; +import getElement from './get-element'; +import getListing from './get-listing'; +import domContainer from './dom-container'; +import pluginRenderValues from './plugin-render-values'; +import pluginRenderTimeGrid from './plugin-render-time-grid'; +import keyEvent from './keyEvent'; +import mountTree from './mount-tree'; +import genKeyHandler from './gen-key-handler'; +import genOnWheel from './gen-on-wheel'; +import xOffsetUpdate from './x-offset-update'; +import getX from './get-x'; +import getT from './get-t'; -const getElement = require('./get-element.js'); -const getListing = require('./get-listing.js'); -const domContainer = require('./dom-container.js'); -const pluginRenderValues = require('./plugin-render-values.js'); -const pluginRenderTimeGrid = require('./plugin-render-time-grid.js'); -const keyBindo = require('./key-bindo.js'); -const mountTree = require('./mount-tree.js'); -const genKeyHandler = require('./gen-key-handler.js'); -const genOnWheel = require('./gen-on-wheel.js'); -const xOffsetUpdate = require('./x-offset-update.js'); -const getX = require('./get-x.js'); -const getT = require('./get-t.js'); -exports.getListing = getListing; -exports.getElement = getElement; -exports.domContainer = domContainer; -exports.pluginRenderValues = pluginRenderValues; -exports.pluginRenderTimeGrid = pluginRenderTimeGrid; -exports.keyBindo = keyBindo; -exports.mountTree = mountTree; -exports.genKeyHandler = genKeyHandler; -exports.genOnWheel = genOnWheel; -exports.xOffsetUpdate = xOffsetUpdate; -exports.getX = getX; -exports.getT = getT; +export { + getListing, + getElement, + domContainer, + pluginRenderValues, + pluginRenderTimeGrid, + keyEvent, + mountTree, + genKeyHandler, + genOnWheel, + xOffsetUpdate, + getX, + getT +}; diff --git a/src/hook/wave-view/key-bindo.js b/src/hook/wave-view/key-bindo.js deleted file mode 100644 index d674482..0000000 --- a/src/hook/wave-view/key-bindo.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -const xOffsetUpdate = require('./x-offset-update.js'); -const xScaleUpdate = require('./x-scale-update.js'); - -const yScroll = delta => (pstate, cm) => { - const info = cm.getScrollInfo(); - cm.scrollTo(null, info.top + info.clientHeight * delta); - return false; -}; - -const pluso = { - desc: 'Zoom in time', - fn: pstate => xScaleUpdate(pstate, 10 / 9 * pstate.xScale) -}; - -const minuso = { - desc: 'Zoom out time', - fn: pstate => xScaleUpdate(pstate, 9 / 10 * pstate.xScale) -}; - -const fullo = { - desc: 'All of time', - fn: pstate => xScaleUpdate(pstate, pstate.xScaleMin) -}; - -const scroll = { - left: { - desc: 'Scroll into the past', - fn: pstate => xOffsetUpdate(pstate, pstate.xOffset + pstate.time) - }, - right: { - desc: 'Scroll into the future', - fn: pstate => xOffsetUpdate(pstate, pstate.xOffset - pstate.time) - }, - up: { - desc: 'scroll up', - fn: yScroll(-.1) - }, - down: { - desc: 'scroll down', - fn: yScroll(.1) - } -}; - -const editable = { - desc: 'Toggle edit mode', - fn: (pstate, cm) => { - console.log('editable', pstate, cm); - } -}; - -module.exports = { - // Alt + <, >. left / right - 'Alt+,': scroll.left, - 'Alt+.': scroll.right, - - // Alt + [ ] home / end - 'Alt+[': { desc: 'Jump to beginning of time', fn: pstate => xOffsetUpdate(pstate, pstate.sidebarWidth) }, // Home - - 'Alt+]': { desc: 'Jump to end time', fn: pstate => xOffsetUpdate(pstate, pstate.width - pstate.xScale * pstate.time) }, // End - - // ALT + - + - 'Alt+=': pluso, // '+': pluso, '=': pluso, - 'Alt+-': minuso, // '-': minuso, '_': minuso, - 'Alt+0': fullo, // 'Shift+f': fullo, F: fullo, 'Shift+F': fullo, - 'Alt+/': editable, - - // wheel - 'icon:scrollLeft': scroll.left, - 'icon:scrollRight': scroll.right, - 'Shift+icon:scrollUp': scroll.left, - 'Shift+icon:scrollDown': scroll.right, - 'Ctrl+icon:scrollUp': pluso, - 'Ctrl+icon:scrollDown': minuso, - - // CAN'T DO: Alt + e, d, f, l - - // ArrowUp: scroll.up, 'Shift+ArrowUp': scroll.up, - // ArrowDown: scroll.down, 'Shift+ArrowDown': scroll.down, - - // PageUp: {desc: 'scroll page up', fn: yScroll(-1)}, - // PageDown: {desc: 'scroll page down', fn: yScroll(1)}, - - nop: { fn: () => false } -}; diff --git a/src/hook/wave-view/keyEvent.js b/src/hook/wave-view/keyEvent.js new file mode 100644 index 0000000..4c158a1 --- /dev/null +++ b/src/hook/wave-view/keyEvent.js @@ -0,0 +1,102 @@ +import { globalSetting } from '../global'; + +import xOffsetUpdate from './x-offset-update'; +import yOffsetUpdate from './y-offset-update'; + +import xScaleUpdate from './x-scale-update'; + + +const xScaleLevels = { + 1: 10 / 9, + 2: 10 / 7, + 3: 10 / 6, + 4: 10 / 5, + 5: 10 / 4 +}; + +const xOffsetLevel = { + 1: 5, + 2: 4, + 3: 3, + 4: 1, + 5: 0.5 +}; + +const yOffsetLevel = { + 1: 20, + 2: 40, + 3: 80, + 4: 160, + 5: 320 +}; + +const pluso = { + desc: 'Zoom in time', + fn: pstate => xScaleUpdate(pstate, () => pstate.xScale * xScaleLevels[globalSetting.HorizontalScalingRatio]) +}; + +const minuso = { + desc: 'Zoom out time', + fn: pstate => xScaleUpdate(pstate, () => pstate.xScale / xScaleLevels[globalSetting.HorizontalScalingRatio]) +}; + +const fullo = { + desc: 'All of time', + fn: pstate => xScaleUpdate(pstate, () => pstate.xScaleMin) +}; + +const scroll = { + left: { + desc: 'Scroll into the past', + fn: pstate => xOffsetUpdate(pstate, () => pstate.xOffset + pstate.time / xOffsetLevel[globalSetting.HorizontalRollRatio]) + }, + right: { + desc: 'Scroll into the future', + fn: pstate => xOffsetUpdate(pstate, () => pstate.xOffset - pstate.time / xOffsetLevel[globalSetting.HorizontalRollRatio]) + }, + up: { + desc: 'scroll up', + fn: pstate => yOffsetUpdate(pstate, () => pstate.yOffset - yOffsetLevel[globalSetting.VerticalRollRario]) + }, + down: { + desc: 'scroll down', + fn: pstate => yOffsetUpdate(pstate, () => pstate.yOffset + yOffsetLevel[globalSetting.VerticalRollRario]) + } +}; + +const editable = { + desc: 'Toggle edit mode', + fn: (pstate, cm) => { + console.log('editable', pstate, cm); + } +}; + +export default { + // Alt + <, >. left / right + // 'Alt+,': scroll.left, + // 'Alt+.': scroll.right, + + // // Alt + [ ] home / end + // 'Alt+[': { desc: 'Jump to beginning of time', fn: pstate => xOffsetUpdate(pstate, pstate.sidebarWidth) }, // Home + + // 'Alt+]': { desc: 'Jump to end time', fn: pstate => xOffsetUpdate(pstate, pstate.width - pstate.xScale * pstate.time) }, // End + + // // ALT + - + + // 'Alt+=': pluso, // '+': pluso, '=': pluso, + // 'Alt+-': minuso, // '-': minuso, '_': minuso, + // 'Alt+0': fullo, // 'Shift+f': fullo, F: fullo, 'Shift+F': fullo, + + // wheel + scrollLeft: scroll.left, + scrollRight: scroll.right, + scrollUp: scroll.up, + scrollDown: scroll.down, + + 'Shift+icon:scrollUp': scroll.left, + 'Shift+icon:scrollDown': scroll.right, + 'Ctrl+icon:scrollUp': pluso, + 'Ctrl+icon:scrollDown': minuso, + + + nop: { fn: () => false } +}; diff --git a/src/hook/wave-view/lister.js b/src/hook/wave-view/lister.js index 5b33ee9..51951e9 100644 --- a/src/hook/wave-view/lister.js +++ b/src/hook/wave-view/lister.js @@ -1,23 +1,21 @@ -'use strict'; - -module.exports = () => { - const trace = {}; - let tail = ''; - return { - onChunk: (chunk) => { - const rows = (tail + chunk).split('\n'); - // console.log('chunk:', chunk.length, 'tail:', tail.length, 'rows:', rows.length); - tail = rows.pop(); - rows.map(row => { - const m = row.match(/\s*([0-9a-f]+):\s*([0-9a-f]+)\s+(.+)/); - if (m) { - const pc = parseInt(m[1], 16); - const op = m[2]; - const asm = m[3].replace(/\t/, ' '); - trace[pc] = {op, asm}; - } - }); - }, - getTrace: () => trace - }; +export default () => { + const trace = {}; + let tail = ''; + return { + onChunk: (chunk) => { + const rows = (tail + chunk).split('\n'); + // console.log('chunk:', chunk.length, 'tail:', tail.length, 'rows:', rows.length); + tail = rows.pop(); + rows.map(row => { + const m = row.match(/\s*([0-9a-f]+):\s*([0-9a-f]+)\s+(.+)/); + if (m) { + const pc = parseInt(m[1], 16); + const op = m[2]; + const asm = m[3].replace(/\t/, ' '); + trace[pc] = { op, asm }; + } + }); + }, + getTrace: () => trace + }; }; diff --git a/src/hook/wave-view/mount-tree.js b/src/hook/wave-view/mount-tree.js index e6832e7..2e5a9a0 100644 --- a/src/hook/wave-view/mount-tree.js +++ b/src/hook/wave-view/mount-tree.js @@ -1,5 +1,3 @@ -'use strict'; - const defaultElemento = { container: ['div', { class: 'vcd-container', id: 'vcd-container' }], grid: ['div', { class: 'vcd-vline', id: 'vcd-vline' }], @@ -43,9 +41,9 @@ const createContainer = (els, layers) => { return els.container; }; -exports.defaultElemento = defaultElemento; -exports.defaultLayers = defaultLayers; -exports.createElemento = createElemento; -exports.createContainer = createContainer; - -/* eslint-env browser */ \ No newline at end of file +export default { + defaultElemento, + defaultLayers, + createElemento, + createContainer +}; \ No newline at end of file diff --git a/src/hook/wave-view/page-format.js b/src/hook/wave-view/page-format.js index 53b7896..45674d7 100644 --- a/src/hook/wave-view/page-format.js +++ b/src/hook/wave-view/page-format.js @@ -1,7 +1,6 @@ -'use strict'; +import onml from 'onml'; -const onml = require('onml'); -const format = require('./format'); +import format from './format'; const getElement = divName => { if (typeof divName === 'string') { diff --git a/src/hook/wave-view/plugin-render-time-grid.js b/src/hook/wave-view/plugin-render-time-grid.js index ee5c28b..ffd5bf9 100644 --- a/src/hook/wave-view/plugin-render-time-grid.js +++ b/src/hook/wave-view/plugin-render-time-grid.js @@ -1,69 +1,67 @@ -'use strict'; +import genSVG from 'onml/gen-svg.js'; +import stringify from 'onml/stringify.js'; -const genSVG = require('onml/gen-svg.js'); -const stringify = require('onml/stringify.js'); - -const formatTime = require('./format-time.js'); -const getT = require('./get-t.js'); +import formatTime from './format-time.js'; +import getT from './get-t.js'; const round10 = n => - ([ - /*0 1 2 3 4 5 6 7 8 9 */ - 0, 1, 2, 4, 4, 5, 5, 5, 10, 10, - /*10 11 12 13 14 15 16 17 18 19 */ - 10, 10, 10, 15, 15, 15, 15, 20, 20, 20 - ])[Math.round(n)] - || Math.round(n); + ([ + /*0 1 2 3 4 5 6 7 8 9 */ + 0, 1, 2, 4, 4, 5, 5, 5, 10, 10, + /*10 11 12 13 14 15 16 17 18 19 */ + 10, 10, 10, 15, 15, 15, 15, 20, 20, 20 + ])[Math.round(n)] + || Math.round(n); const getTimeGrid = pstate => { - const { sidebarWidth, width, height, timescale, xScale, tgcd, xOffset, topBarHeight, botBarHeight } = pstate; - const fontHeight = 16; - // const timeLineStart = (xOffset * width / 2) |0; + const { sidebarWidth, width, height, timescale, xScale, tgcd, xOffset, topBarHeight, botBarHeight } = pstate; + const fontHeight = 16; + // const timeLineStart = (xOffset * width / 2) |0; - const timeGrid = ['g', {}]; + const timeGrid = ['g', {}]; - const xStartExact = getT(sidebarWidth, pstate); - const xFinishExact = getT(width, pstate); - const density = 1; - const xLines = Math.round(density * width / sidebarWidth); + const xStartExact = getT(sidebarWidth, pstate); + const xFinishExact = getT(width, pstate); + const density = 1; + const xLines = Math.round(density * width / sidebarWidth); - const xStep = ((xFinishExact - xStartExact) / xLines); - const xExp = Math.pow(10, Math.log10(xStep) |0); - const xDelta = round10(xStep / xExp) * xExp; + const xStep = ((xFinishExact - xStartExact) / xLines); + const xExp = Math.pow(10, Math.log10(xStep) | 0); + const xDelta = round10(xStep / xExp) * xExp; - const xStart = Math.ceil(xStartExact / xDelta) * xDelta; - const xFinish = Math.floor(xFinishExact / xDelta) * xDelta; + const xStart = Math.ceil(xStartExact / xDelta) * xDelta; + const xFinish = Math.floor(xFinishExact / xDelta) * xDelta; - for (let t = xStart; t <= xFinish; t += xDelta) { - const x = Math.round(t / tgcd * xScale + xOffset); - timeGrid.push(['g', {}, - ['line', { - class: 'wd-grid-time', - x1: x, - x2: x, - y2: height - }], - ['text', { - class: 'wd-grid-time', - x: x, - y: (topBarHeight + fontHeight) / 2 - }, formatTime(t, timescale)], - ['text', { - class: 'wd-grid-time', - x: x, - y: height - (botBarHeight - fontHeight) / 2 - }, formatTime(t, timescale)] - ]); - } + for (let t = xStart; t <= xFinish; t += xDelta) { + const x = Math.round(t / tgcd * xScale + xOffset); + timeGrid.push(['g', {}, + ['line', { + class: 'wd-grid-time', + x1: x, + x2: x, + y2: height + }], + ['text', { + class: 'wd-grid-time', + x: x, + y: (topBarHeight + fontHeight) / 2 + }, formatTime(t, timescale)], + ['text', { + class: 'wd-grid-time', + x: x, + y: height - (botBarHeight - fontHeight) / 2 + }, formatTime(t, timescale)] + ]); + } - return timeGrid; + return timeGrid; }; const pluginRenderTimeGrid = (desc, pstate, els) => { - const {width, height} = pstate; - const ml = genSVG(width, height); - ml.push(getTimeGrid(pstate)); - els.grid.innerHTML = stringify(ml); + const { width, height } = pstate; + const ml = genSVG(width, height); + ml.push(getTimeGrid(pstate)); + els.grid.innerHTML = stringify(ml); }; -module.exports = pluginRenderTimeGrid; +export default pluginRenderTimeGrid; \ No newline at end of file diff --git a/src/hook/wave-view/plugin-render-values.js b/src/hook/wave-view/plugin-render-values.js index 4effb05..da341b7 100644 --- a/src/hook/wave-view/plugin-render-values.js +++ b/src/hook/wave-view/plugin-render-values.js @@ -1,8 +1,6 @@ -'use strict'; +import renderValues from './render-values'; -const renderValues = require('./render-values.js'); - -function pluginRenderValues(desc, pstate, els) { +export default function pluginRenderValues(desc, pstate, els) { const gen = renderValues(desc, pstate); for (let i = 0; i < 1e6; i++) { const iter = gen.next(); @@ -11,6 +9,4 @@ function pluginRenderValues(desc, pstate, els) { break; } } -} - -module.exports = pluginRenderValues; +} \ No newline at end of file diff --git a/src/hook/wave-view/render-cursor.js b/src/hook/wave-view/render-cursor.js index b4f5c56..2e817dd 100644 --- a/src/hook/wave-view/render-cursor.js +++ b/src/hook/wave-view/render-cursor.js @@ -1,10 +1,8 @@ -'use strict'; +import genSVG from 'onml/gen-svg.js'; +import stringify from 'onml/stringify.js'; -const genSVG = require('onml/gen-svg.js'); -const stringify = require('onml/stringify.js'); -const formatTime = require('./format-time.js'); - -const { globalLookup } = require('../global'); +import formatTime from './format-time'; +import { globalLookup } from '../global'; const renderCursor = (cfg, pstate) => { const { xmargin, fontWidth, fontHeight } = cfg; @@ -58,4 +56,4 @@ const renderCursor = (cfg, pstate) => { return stringify(genSVG(2 * xmargin, height).concat(body)); }; -module.exports = renderCursor; +export default renderCursor; \ No newline at end of file diff --git a/src/hook/wave-view/render-shader.js b/src/hook/wave-view/render-shader.js index ae3282e..a07e5e2 100644 --- a/src/hook/wave-view/render-shader.js +++ b/src/hook/wave-view/render-shader.js @@ -40,7 +40,7 @@ void main() { vec2 shift = shifts[pos.y]; vec2 widthShift = widthShifts[pos.w]; gl_Position = vec4( - float(pos.x) * scale.x + offset.x + float(widthShift.x), + float(pos.x) * scale.x + offset.x + float(widthShift.x) + shift.y, float(shift.x) * scale.y + offset.y + float(widthShift.y), 1, 1 ); diff --git a/src/hook/wave-view/render-utils.js b/src/hook/wave-view/render-utils.js index cd868db..ee6773a 100644 --- a/src/hook/wave-view/render-utils.js +++ b/src/hook/wave-view/render-utils.js @@ -28,11 +28,11 @@ const screenWidthPixel = window.screen.width * getRatio() / 100; const gl_Colors = new Float32Array([ 0, 0, 0, 0, // 0: 空 - 0, 0, 1, 1, // 1: 高阻态 Z + 0, 0, 1, 1, // 1: 未知态 X 0.2, 0.847, 0.1, 1, // 2: value = 0 用于 width = 1 的信号 0.2, 0.847, 0.1, 1, // 3: value = 1 用于 width = 1 的信号 - 0.9, 0.2, 0.2, 1, // 4: 未知态 X - .5, 1, 1, 1, // 5: vec 用于 width > 1 的信号 + 0.9, 0.2, 0.2, 1, // 4: 高阻态 Z + 0.486, 0.302, 1., 1, // 5: vec 用于 width > 1 的信号 1, 1, 0, 1, // 6: yellow 1, 0, 1, 1, // 7: strange purple @@ -41,23 +41,38 @@ const gl_Colors = new Float32Array([ 0, 1, 1, .5, // 9: (h H) weak 1 1, 0, 0, .5, // 10: (w W) weak unknown - 0, 0, 1, 0.1, // 11: 高阻态 Z 遮罩 + 0, 0, 1, 0.1, // 11: 未知态 X 遮罩 0.2, 0.847, 0.1, 0.1, // 12: value = 0 遮罩 0.2, 0.847, 0.1, 0.1, // 13: value = 1 遮罩 - 0.9, 0.2, 0.2, 0.1, // 14: 未知态 X 遮罩 - .5, 1, 1, 0.1 // 15: vec 遮罩 + 0.9, 0.2, 0.2, 0.1, // 14: 高阻态 Z 遮罩 + 0.486, 0.302, 1., 0.1 // 15: vec 遮罩 ]); -// 控制方向 +// 特殊偏移量 +// 第一列 Y 第二列 保留 const gl_Shifts = new Float32Array([ // 14 - 0, 0, // 0 - 1, -1, // 1 - 1, 0, // 2 - 1, 1, // 3 - -1, -1, // 4 + 0, 0, // 0 + 1, 0, // 1 + 1, 0, // 2 + 1, 0, // 3 + -1, 0, // 4 -1, 0, // 5 - -1, 1 // 6 + -1, 0 // 6 +]); + +// 为了满足 vec 类型的波形的开头和结尾的那个小小的内嵌的、不受scale影响的值 +// 第一列 Y 第二列 X 在所有计算完成后的额外偏移量 +const barShift = 0.005; + +const gl_Shifts_for_bar = new Float32Array([ + 0, 0, // 0 + 1, barShift, // 1 + 1, -barShift, // 2 + 1, 0, // 3 + -1, barShift, // 4 + -1, -barShift, // 5 + -1, 0 // 6 ]); const gl_Shifts_map = new Map(); @@ -78,7 +93,6 @@ const gl_WidthShifts = new Float32Array([ widthShift, widthShift // 7 ]); - export { getRatio, gl_Colors, @@ -88,5 +102,7 @@ export { gl_WidthShifts, gl_Shifts_map, screenWidthPixel, - screenHeightPixel + screenHeightPixel, + gl_Shifts_for_bar, + barShift }; \ No newline at end of file diff --git a/src/hook/wave-view/render-values.js b/src/hook/wave-view/render-values.js index d7a0f83..408b387 100644 --- a/src/hook/wave-view/render-values.js +++ b/src/hook/wave-view/render-values.js @@ -1,15 +1,13 @@ -'use strict'; +import tt from 'onml/tt.js'; +import genSVG from 'onml/gen-svg.js'; +import stringify from 'onml/stringify.js'; -const tt = require('onml/tt.js'); -const genSVG = require('onml/gen-svg.js'); -const stringify = require('onml/stringify.js'); -// const getPco = require('./get-pco.js'); -const water = require('./water.js'); -const bracer = require('./bracer.js'); -const vline = require('./vline.js'); -const getX = require('./get-x.js'); -const vlineStylo = require('./vline-stylo.js'); -const getLabel = require('./get-label.js'); +import water from './water.js'; +import bracer from './bracer'; +import vline from './vline'; +import getX from './get-x'; +import vlineStylo from './vline-stylo'; +import getLabel from './get-label'; const defs = ['defs', ['linearGradient', { id: 'valid' }, @@ -53,7 +51,7 @@ function* renderValues(desc, pstate) { const ml = genSVG(width, height - topBarHeight - botBarHeight); let ifirst = 0; - for (let i = 0; i < ilen; i += 1) { + for (let i = 0; i < ilen; ++ i) { const lane = view[i]; if (lane && (lane.name || lane.kind)) { if (i > iskip) { @@ -78,7 +76,7 @@ function* renderValues(desc, pstate) { } else if (lane && lane.ref) { const chango = desc.chango[lane.ref]; if (chango && chango.kind === 'vec') { - const mLane = ['g', tt(0, Math.round((i - (iskip - ifirst) + .8) * yStep))]; + const mLane = ['g', tt(0, Math.round((i - (iskip - ifirst) + 0.1) * yStep))]; const { wave } = chango; const jlen = wave.length; @@ -131,5 +129,5 @@ function* renderValues(desc, pstate) { return stringify(ml); } -module.exports = renderValues; +export default renderValues; /* eslint complexity: [1, 55] */ diff --git a/src/hook/wave-view/gen-render-waves-gl.js b/src/hook/wave-view/render-wave.js similarity index 53% rename from src/hook/wave-view/gen-render-waves-gl.js rename to src/hook/wave-view/render-wave.js index 3a22d1f..e8ba2a9 100644 --- a/src/hook/wave-view/gen-render-waves-gl.js +++ b/src/hook/wave-view/render-wave.js @@ -1,10 +1,16 @@ -'use strict'; +import { ElLoading } from 'element-plus'; + +import { globalSetting, globalStyle } from '../global'; +import i18n from '../../i18n'; +const { t } = i18n.global; + +import { gl_Colors, gl_Shifts, gl_Shifts_for_bar, gl_Shifts_map, gl_WidthShifts, barShift, getRatio, screenHeightPixel } from './render-utils.js'; +import { vertexShader, fragmentShader } from './render-shader.js'; -const { gl_Colors, gl_Shifts, gl_Shifts_map, gl_WidthShifts } = require('./render-utils.js'); -const { vertexShader, fragmentShader } = require('./render-shader.js'); // const { ChangoItem } = require('./types.d.ts'); + class WebGL2WaveRender { /** * @@ -43,6 +49,12 @@ class WebGL2WaveRender { * @param { Array } plugins */ constructor(elements, globalLookup, pstate, plugins) { + const loading = ElLoading.service({ + lock: true, + text: t('loading'), + background: 'rgba(0, 0, 0, 0.7)' + }); + const canvas = document.createElement('canvas'); elements.view.replaceChildren(canvas); @@ -62,9 +74,10 @@ class WebGL2WaveRender { const { lineVerticesMap, maskVerticesMap } = this.makeVertex(); this.lineVerticesMap = lineVerticesMap; this.maskVerticesMap = maskVerticesMap; - this.initData(); this.animationHandler = undefined; + + loading.close(); } /** @@ -112,21 +125,44 @@ class WebGL2WaveRender { const time = globalLookup.time; const lineVerticesMap = new Map(); const maskVerticesMap = new Map(); - for (const id of Reflect.ownKeys(globalLookup.chango)) { - const signalItem = globalLookup.chango[id]; - const { kind, wave } = signalItem; - if (kind === 'bit') { - const { lineVertices, maskVertices } = this.makeBitVertex(wave, time); + if (globalSetting.prerender) { + for (const id of Reflect.ownKeys(globalLookup.chango)) { + const { lineVertices, maskVertices } = this.makeVertexByID(id); lineVerticesMap.set(id, lineVertices); maskVerticesMap.set(id, maskVertices); - } else if (kind === 'vec') { - // const vertices = this.makeVecVertex(wave, time); - // lineVerticesMap.set(id, vertices); } } + return { lineVerticesMap, maskVerticesMap }; } + /** + * + * @param {string} id + * @returns {{ + * lineVertices: Uint32Array + * maskVertices: Uint32Array + * }} + */ + makeVertexByID(id) { + const globalLookup = this.globalLookup; + const time = globalLookup.time; + const signalItem = globalLookup.chango[id]; + + const { kind, wave } = signalItem; + if (kind === 'bit') { + const { lineVertices, maskVertices } = this.makeBitVertex(wave, time); + return { lineVertices, maskVertices }; + } else if (kind === 'vec') { + const { lineVertices, maskVertices } = this.makeVecVertex(wave, time); + return { lineVertices, maskVertices }; + } + return { + lineVertices: undefined, + maskVertices: undefined + } + } + /** * @description 将wave 的值转化为渲染需要用到的值 @@ -198,12 +234,25 @@ class WebGL2WaveRender { const r2 = [x1, gl_Shifts_map.get(y1), color, wsIndex]; const r3 = [x2, gl_Shifts_map.get(y1), color, wsIndex]; const r4 = [x2, gl_Shifts_map.get(y2), color, wsIndex]; + return this.makeQuadVertices(r1, r2, r3, r4); + } + + /** + * + * @param {number[]} p1 + * @param {number[]} p2 + * @param {number[]} p3 + * @param {number[]} p4 + * @returns {number[]} + */ + makeQuadVertices(p1, p2, p3, p4) { return [ - ...r1, ...r2, ...r3, - ...r1, ...r3, ...r4, + ...p1, ...p2, ...p3, + ...p1, ...p3, ...p4 ] } + /** * * @param {Array} wave @@ -329,112 +378,187 @@ class WebGL2WaveRender { } - if (debug) { - console.log(perspectivePoints); - console.log(pointNum); - console.log(lineVertices); - } - - const Uint32lineVertices = new Uint32Array(lineVertices); - const Uint32maskVertices = new Uint32Array(maskVertices); + // if (debug) { + // console.log(perspectivePoints); + // console.log(pointNum); + // console.log(lineVertices); + // } return { - lineVertices : Uint32lineVertices, - maskVertices : Uint32maskVertices + lineVertices : new Uint32Array(lineVertices), + maskVertices : new Uint32Array(maskVertices) }; } + + + /** * * @param {Array} wave * @param { number } time - * @returns {Uint32Array} + * @returns {{ + * lineVertices: Uint32Array + * maskVertices: Uint32Array + * }} */ - makeVecVertex(wave, time) { - const vertices = []; + makeVecVertex(wave, time, debug = false) { + const lineVertices = []; + const maskVertices = []; const length = wave.length; - for (let i = 0; i < length; ++ i) { - const [t1, val, msk] = wave[i]; - const t2 = (i === (length - 1)) ? time : wave[i + 1][0]; - // t1(val) --- t2(val) - if (msk) { - vertices.push( - t1, 0, 0, - t2, 0, 0, - t2, 0, 4, - t2, 4, 4, - t1, 6, 4, - t1, 0, 4, - t1, 3, 4, - t2, 1, 4, - t2, 0, 4 - ); - } else { - vertices.push( - t1, 0, 0, - t2, 0, 0, - t2, 0, 5, - t2, 4, 5, - t1, 6, 5, - t1, 0, 5, - t1, 3, 5, - t2, 1, 5, - t2, 0, 5 + for (let i = 0; i < length; ++ i) { + const [t1, val, mask] = wave[i]; + const t2 = (i === (length - 1)) ? time : wave[i + 1][0]; + + // t1(val) --- t2(val) + // 详见 设计图 ./design/webgl.drawio makeVecVertex原理 sheet + // 此处的 y 不是 y 的索引,详见 gl_Shifts_for_bar 的设计 + const p0 = {x: t1, y: 0}; + const p1 = {x: t2, y: 0}; + const a0 = {x: t1, y: 4}; + const a1 = {x: t2, y: 5}; + const a2 = {x: t1, y: 1}; + const a3 = {x: t2, y: 2}; + + const color = mask ? 4 : 5; + + const points = [ a1, p1, a3, a2, p0, a0 ]; + const wsIndice = [ 1, 2, 3, 5, 6, 7 ]; + for (let i = 0; i < 6; ++ i) { + const prePoint = points[i]; + const nextPoint = points[(i + 1) % 6]; + const preWsIndex = wsIndice[i]; + const nextWsIndex = wsIndice[(i + 1) % 6]; + const quadVertices = this.makeQuadVertices( + [prePoint.x, prePoint.y, color, preWsIndex], + [prePoint.x, prePoint.y, color, (preWsIndex + 4) % 8], + [nextPoint.x, nextPoint.y, color, (nextWsIndex + 4) % 8], + [nextPoint.x, nextPoint.y, color, nextWsIndex], ); + lineVertices.push(...quadVertices); } + const maskTriangles = [ + [3, 4, 5], + [5, 0, 3], + [0, 3, 2], + [0, 1, 2] + ]; + + for (const triangleIndice of maskTriangles) { + const [i1, i2, i3] = triangleIndice; + const point1 = points[i1]; + const point2 = points[i2]; + const point3 = points[i3]; + maskVertices.push( + point1.x, point1.y, color + 10, wsIndice[i1], + point2.x, point2.y, color + 10, wsIndice[i2], + point3.x, point3.y, color + 10, wsIndice[i3] + ); + } } - return new Uint32Array(vertices); + if (debug) { + console.log(lineVertices); + } + + return { + lineVertices: new Uint32Array(lineVertices), + maskVertices: new Uint32Array(maskVertices) + }; + } + + /** + * + * @param {string} id + * @returns + */ + initVertice(id) { + const webglLocation = this.webglLocation; + const gl = webglLocation.gl; + const signalItem = this.globalLookup.chango[id]; + + if (this.lineVerticesMap.get(id) === undefined) { + const { lineVertices, maskVertices } = this.makeVertexByID(id); + this.lineVerticesMap.set(id, lineVertices); + this.maskVerticesMap.set(id, maskVertices); + } + const lineVertices = this.lineVerticesMap.get(id); + const maskVertices = this.maskVerticesMap.get(id); + + // 创建并设置 绘制wave轮廓 主体轮廓的 缓冲区、vao、顶点设置 + const lineVertexBuffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, lineVertexBuffer); + gl.bufferData(gl.ARRAY_BUFFER, lineVertices, gl.STATIC_DRAW); + signalItem.lineVao = gl.createVertexArray(); + gl.bindVertexArray(signalItem.lineVao); + gl.vertexAttribIPointer(webglLocation.pos, 4, gl.UNSIGNED_INT, 0, 0); + gl.enableVertexAttribArray(webglLocation.pos); + + // 创建并设置 绘制wave半透明遮罩层 主体轮廓的 缓冲区、vao、顶点设置 + const maskVertexBuffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, maskVertexBuffer); + gl.bufferData(gl.ARRAY_BUFFER, maskVertices, gl.STATIC_DRAW); + signalItem.maskVao = gl.createVertexArray(); + gl.bindVertexArray(signalItem.maskVao); + gl.vertexAttribIPointer(webglLocation.pos, 4, gl.UNSIGNED_INT, 0, 0); + gl.enableVertexAttribArray(webglLocation.pos); } initData() { + if (globalSetting.prerender) { + for (const id of Reflect.ownKeys(this.globalLookup.chango)) { + this.initVertice(id); + } + } + const webglLocation = this.webglLocation; const gl = webglLocation.gl; - const globalLookup = this.globalLookup; - const lineVerticesMap = this.lineVerticesMap; - const maskVerticesMap = this.maskVerticesMap; - - for (const id of Reflect.ownKeys(globalLookup.chango)) { - const signalItem = globalLookup.chango[id]; - - const lineVertices = lineVerticesMap.get(id); - if (lineVertices === undefined) { - // console.warn(`无法找到 link 为 ${id} 的顶点数据`); - continue; - } - - // 创建并设置 绘制wave轮廓 主体轮廓的 缓冲区、vao、顶点设置 - const lineVertexBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, lineVertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, lineVertices, gl.STATIC_DRAW); - signalItem.lineVao = gl.createVertexArray(); - gl.bindVertexArray(signalItem.lineVao); - gl.vertexAttribIPointer(webglLocation.pos, 4, gl.UNSIGNED_INT, 0, 0); - gl.enableVertexAttribArray(webglLocation.pos); - - - const maskVertices = maskVerticesMap.get(id); - if (maskVertices === undefined) { - continue; - } - - // 创建并设置 绘制wave半透明遮罩层 主体轮廓的 缓冲区、vao、顶点设置 - const maskVertexBuffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, maskVertexBuffer); - gl.bufferData(gl.ARRAY_BUFFER, maskVertices, gl.STATIC_DRAW); - signalItem.maskVao = gl.createVertexArray(); - gl.bindVertexArray(signalItem.maskVao); - gl.vertexAttribIPointer(webglLocation.pos, 4, gl.UNSIGNED_INT, 0, 0); - gl.enableVertexAttribArray(webglLocation.pos); - } - gl.uniform4fv(webglLocation.colors, gl_Colors); gl.uniform2fv(webglLocation.widthShifts, gl_WidthShifts); gl.uniform2fv(webglLocation.shifts, gl_Shifts); } + /** + * + * @param {Array<{ + * index: number + * rgba: { + * red: number, + * green: number, + * blue: number, + * alpha: number + * } + * }>} updaters + * @param {{ + * updateMask: boolean + * }} config + */ + updateGLColor(updaters, config) { + const webglLocation = this.webglLocation; + const gl = webglLocation.gl; + + for (const updater of updaters) { + const startIndex = updater.index * 4; + const rgba = updater.rgba; + gl_Colors[startIndex] = rgba.red; + gl_Colors[startIndex + 1] = rgba.green; + gl_Colors[startIndex + 2] = rgba.blue; + gl_Colors[startIndex + 3] = rgba.alpha; + + if (config.updateMask) { + const maskIndex = (updater.index + 10) * 4; + gl_Colors[maskIndex] = rgba.red; + gl_Colors[maskIndex + 1] = rgba.green; + gl_Colors[maskIndex + 2] = rgba.blue; + } + } + + gl.uniform4fv(webglLocation.colors, gl_Colors); + this.render(); + } + render() { if (this.animationHandler !== undefined) { cancelAnimationFrame(this.animationHandler); @@ -448,76 +572,131 @@ class WebGL2WaveRender { const maskVerticesMap = this.maskVerticesMap; const elements = this.elements; - const timeScaleHeight = parseInt(document.body.style.getPropertyValue('--time-scale-height').match(/\d+/)[0]); - const sidebarPadding = parseInt(document.body.style.getPropertyValue('--sidebar-padding').match(/\d+/)[0]); - const vcdRenderPadding = parseInt(document.body.style.getPropertyValue('--vcd-render-padding').match(/\d+/)[0]); - const canvasPaddingTop = timeScaleHeight + sidebarPadding - vcdRenderPadding; + // 更新 yDuty & yStep + // yStep: scale 之后的单个 wave 的容器高度需要和 displaySignalHeight + sideBarItemMargin 一样 + // yDuty: scale 之后的单个 wave 的 padding 必须等于 sideBarItemMargin,也就是 (1 - yDuty) * yStep = 2 * margin + const sidebarItemMargin = globalStyle.sideBarItemMargin; - this.animationHandler = window.requestAnimationFrame(() => { - const { width, height, xScale, xOffset, yOffset, yStep, yDuty } = this.pstate; - const canvasHeight = height - canvasPaddingTop; - const canvasWidth = width; + const pstate = this.pstate; + const plugins = this.plugins; + + pstate.yStep = globalSetting.displaySignalHeight + globalStyle.sideBarItemMargin; + pstate.yDuty = (1 - 2 * globalStyle.sideBarItemMargin / this.pstate.yStep) * 0.9; + + document.body.style.setProperty('--vcd-render-padding', pstate.topBarHeight + 'px'); + const canvasHeight = pstate.height - pstate.topBarHeight - pstate.botBarHeight; + const canvasWidth = pstate.width; - // 默认 1594 - canvas.width = canvasWidth; + // 默认 1594 + canvas.width = canvasWidth; + // 默认 1260 + canvas.height = canvasHeight; - // 默认 1260 - canvas.height = canvasHeight; + let startTime = undefined; + // 默认执行一个 300 ms 的动画 + const animationDuration = 300; + let animationHandler = this.animationHandler = requestAnimationFrame(drawWaves); + + function linearAnimation(delta, oldVal, newVal) { + return (1 - delta) * oldVal + delta * newVal; + } + + function cubicBezierAnimation(delta, oldVal, newVal) { + delta = 3 * (1 - delta) * (1 - delta) * delta + 3 * (1 - delta) * delta * delta + delta * delta * delta; + return (1 - delta) * oldVal + delta * newVal; + } + + function renderOneFrame(animationDelta) { + // 考虑设置线性动画的变量 xScale, xOffset, yOffset, yStep, yDuty + const xScale = cubicBezierAnimation(animationDelta, pstate.oldXScale, pstate.xScale); + const xOffset = cubicBezierAnimation(animationDelta, pstate.oldXOffset, pstate.xOffset); + const yOffset = cubicBezierAnimation(animationDelta, pstate.oldYOffset, pstate.yOffset); + const yStep = cubicBezierAnimation(animationDelta, pstate.oldYStep, pstate.yStep); + const yDuty = cubicBezierAnimation(animationDelta, pstate.oldYDuty, pstate.yDuty); // 设置 glsl 变量 - gl.uniform2f(webglLocation.scale, - 2 * xScale / canvasWidth, - yStep * yDuty / canvasHeight - ); - console.log(yStep, yDuty, canvasHeight); + const scaleX = 2 * xScale / canvasWidth; + const scaleY = yStep * yDuty / canvasHeight; + gl.uniform2f(webglLocation.scale, scaleX, scaleY); + // 设置 webgl 和 canvas 大小位置一致 gl.viewport(0, 0, canvasWidth, canvasHeight); // 清楚颜色缓冲区,也就是删除上一次的渲染结果 gl.clear(gl.COLOR_BUFFER_BIT); - // 根据 globalLookup 当前激活的需要渲染的信号进行渲染 let index = 0; for (const signal of globalLookup.currentWires) { - const wave = globalLookup.chango[signal.link].wave; + const id = signal.link; + const wave = globalLookup.chango[id].wave; + // this.makeBitVertex(wave, globalLookup.time, true); - const signalItem = globalLookup.chango[signal.link]; + // this.makeVecVertex(wave, globalLookup.time, true); + + const signalItem = globalLookup.chango[id]; if (!signalItem) { return; } - // TODO: 将此处的 offset 计算中的参数和 globalSetting 的数字形成关联 - gl.uniform2f(webglLocation.offset, - (2 * xOffset / width) - 1, - (2 * yOffset - 2 * yStep * (index + .7)) / canvasHeight + 1 - ); - + const offsetX = 2 * xOffset / canvasWidth - 1; + const offsetY = 2 * (yOffset - yStep * index) / canvasHeight + 1; + gl.uniform2f(webglLocation.offset, offsetX, offsetY); - console.log('offset y', (2 * yOffset - 2 * yStep * (index + .7)) / canvasHeight + 1); + // 根据 lineVao 进行绘制 + if (lineVerticesMap.get(id) === undefined) { + this.initVertice(id); + } + const lineVertices = lineVerticesMap.get(id); + const maskVertices = maskVerticesMap.get(id); - // 根据 lineVao 进行绘制 - const lineVertices = lineVerticesMap.get(signal.link); - const maskVertices = maskVerticesMap.get(signal.link); - if (signal.size === 1) { // 如果是 width 为 1 的 + gl.uniform2fv(webglLocation.shifts, gl_Shifts); gl.bindVertexArray(signalItem.lineVao); gl.drawArrays(gl.TRIANGLE_STRIP, 0, lineVertices.length / 4); -`` + gl.bindVertexArray(signalItem.maskVao); gl.drawArrays(gl.TRIANGLES, 0, maskVertices.length / 4); } else { // 如果是 width 大于 1 的 - gl.drawArrays(gl.LINE_STRIP, 0, lineVertices.length / 4); + gl.uniform2fv(webglLocation.shifts, gl_Shifts_for_bar); + gl.bindVertexArray(signalItem.lineVao); + gl.drawArrays(gl.TRIANGLES, 0, lineVertices.length / 4); + + gl.bindVertexArray(signalItem.maskVao); + gl.drawArrays(gl.TRIANGLES, 0, maskVertices.length / 4); } index ++; } - this.plugins.map(fn => fn(globalLookup, this.pstate, elements)); - this.animationHandler = undefined; - }); + plugins.map(fn => fn(globalLookup, pstate, elements)); + } + + function drawWaves(now) { + if (startTime === undefined) { + startTime = now; + } else { + const pastTime = now - startTime; + const animationDelta = globalSetting.renderAnimation ? Math.min(pastTime / animationDuration, 1) : 1; + renderOneFrame(animationDelta); + // 达到 1 时说明线性动画时间到了,退出即可 + if (animationDelta >= 1) { + cancelAnimationFrame(animationHandler); + // 更新状态变量 + pstate.oldXOffset = pstate.xOffset; + pstate.oldYOffset = pstate.yOffset; + pstate.oldXScale = pstate.xScale; + pstate.oldYStep = pstate.yStep; + pstate.oldYDuty = pstate.yDuty; + return; + } + } + // 进入下一帧 + requestAnimationFrame(drawWaves); + } } + } -module.exports = WebGL2WaveRender; \ No newline at end of file +export default WebGL2WaveRender; \ No newline at end of file diff --git a/src/hook/wave-view/sampler.js b/src/hook/wave-view/sampler.js index 8785b95..e7c8348 100644 --- a/src/hook/wave-view/sampler.js +++ b/src/hook/wave-view/sampler.js @@ -1,22 +1,18 @@ -'use strict'; - -function* sampler (wave) { - let t1, v0, v1; - [t1, v1] = wave[0]; // initial state - let t = 0; - for (let i = 1; i < wave.length; i++) { - v0 = v1; - [t1, v1] = wave[i]; // next change - while (true) { - if (t >= t1) { - break; - } - t = yield v0; +export default function* sampler(wave) { + let t1, v0, v1; + [t1, v1] = wave[0]; // initial state + let t = 0; + for (let i = 1; i < wave.length; i++) { + v0 = v1; + [t1, v1] = wave[i]; // next change + while (true) { + if (t >= t1) { + break; + } + t = yield v0; + } + } + while (true) { // to the end of time + yield v1; } - } - while(true) { // to the end of time - yield v1; - } } - -module.exports = sampler; diff --git a/src/hook/wave-view/surferer.js b/src/hook/wave-view/surferer.js index be9064a..5eaf3c2 100644 --- a/src/hook/wave-view/surferer.js +++ b/src/hook/wave-view/surferer.js @@ -1,24 +1,22 @@ -'use strict'; +import getT from './get-t'; -const getT = require('./get-t.js'); +function* surferer(wave, pstate) { + const { sidebarWidth, width } = pstate; + const xStartExact = getT(sidebarWidth, pstate); + const xFinishExact = getT(width, pstate); -function* surferer (wave, pstate) { - const { sidebarWidth, width } = pstate; - const xStartExact = getT(sidebarWidth, pstate); - const xFinishExact = getT(width, pstate); - - let i = 0; - for (i = 0; i < wave.length; i++) { // seek to the start of viewport - if ((wave[i] === undefined) || (wave[i][0] >= xStartExact)) { - break; + let i = 0; + for (i = 0; i < wave.length; i++) { // seek to the start of viewport + if ((wave[i] === undefined) || (wave[i][0] >= xStartExact)) { + break; + } } - } - for (; i < wave.length; i++) { // render viewport - if ((wave[i] === undefined) || (wave[i][0] > xFinishExact)) { - break; + for (; i < wave.length; i++) { // render viewport + if ((wave[i] === undefined) || (wave[i][0] > xFinishExact)) { + break; + } + yield i; } - yield i; - } } -module.exports = surferer; +export default surferer; \ No newline at end of file diff --git a/src/hook/wave-view/vline-stylo.js b/src/hook/wave-view/vline-stylo.js index 8a556b4..8d187d0 100644 --- a/src/hook/wave-view/vline-stylo.js +++ b/src/hook/wave-view/vline-stylo.js @@ -1,5 +1,3 @@ -'use strict'; - const vlineStylo = { w: {h:0, l:100}, // w r: {h:10, l:45}, // r @@ -11,4 +9,4 @@ const vlineStylo = { v: {h:280, l:55} // v }; -module.exports = vlineStylo; +export default vlineStylo; diff --git a/src/hook/wave-view/vline.js b/src/hook/wave-view/vline.js index 7a89585..045cb07 100644 --- a/src/hook/wave-view/vline.js +++ b/src/hook/wave-view/vline.js @@ -1,8 +1,7 @@ -'use strict'; +import onml from 'onml'; -const getX = require('./get-x.js'); -const onml = require('onml'); -const vlineStylo = require('./vline-stylo.js'); +import getX from './get-x.js'; +import vlineStylo from './vline-stylo.js'; /* Zones 1 2 3 @@ -11,47 +10,47 @@ const vlineStylo = require('./vline-stylo.js'); */ const vline = (lane, pstate, i) => { - const {width, height, timescale, yStep, yOffset, topBarHeight, botBarHeight} = pstate; - const y = (i + .7) * yStep - yOffset; - const yMax = height - topBarHeight - botBarHeight; + const { width, height, timescale, yStep, yOffset, topBarHeight, botBarHeight } = pstate; + const y = i * yStep - yOffset; + const yMax = height - topBarHeight - botBarHeight; - return lane.vlines.map(vline => { - const t = vline.value * Math.pow(10, vline.mult - timescale); - const x = Math.round(getX(pstate, t)); - const style = (vlineStylo[vline.style] || vlineStylo.w); - const color = `hsl(${style.h},100%,${style.l}%)`; - const symbol = ['path', {style: 'stroke-width: 1px; stroke: ' + color}]; + return lane.vlines.map(vline => { + const t = vline.value * Math.pow(10, vline.mult - timescale); + const x = Math.round(getX(pstate, t)); + const style = (vlineStylo[vline.style] || vlineStylo.w); + const color = `hsl(${style.h},100%,${style.l}%)`; + const symbol = ['path', { style: 'stroke-width: 1px; stroke: ' + color }]; - if ((x < 0) || (x > width)) { - if ((y < 0) || (y > yMax)) { // Zones: 1, 7, 3, 9 - return ['g']; - } - if (x < 0) { // Zone: 4 - symbol[1].d = `M ${0} ${y} l 8 -4 v 8 z`; - return symbol; - } - // Zone: 6 - symbol[1].d = `M ${width - 16} ${y} l -8 -4 v 8 z`; - return symbol; - } + if ((x < 0) || (x > width)) { + if ((y < 0) || (y > yMax)) { // Zones: 1, 7, 3, 9 + return ['g']; + } + if (x < 0) { // Zone: 4 + symbol[1].d = `M ${0} ${y} l 8 -4 v 8 z`; + return symbol; + } + // Zone: 6 + symbol[1].d = `M ${width - 16} ${y} l -8 -4 v 8 z`; + return symbol; + } - const line = ['g', onml.tt(x, 0), - ['rect', {x: -1, width: 3, height, fill: '#fff', filter: 'url(#neonGlow-' + vline.style + ')'}], - ['rect', {width: 1, height, fill: color}] - ]; + const line = ['g', onml.tt(x, 0), + ['rect', { x: -1, width: 3, height, fill: '#fff', filter: 'url(#neonGlow-' + vline.style + ')' }], + ['rect', { width: 1, height, fill: color }] + ]; - if (y < 0) { // Zone: 2 - symbol[1].d = `M ${x} ${topBarHeight} l 4 8 h -8 z`; - return ['g', line, symbol]; - } - if (y > yMax) { // Zone: 8 - symbol[1].d = `M ${x} ${yMax} l -4 -8 h 8 z`; - return ['g', line, symbol]; - } - // Zone: 5 - symbol[1].d = `M ${x} ${y} m-4 0 l 4 -4 l 4 4 l -4 4 z`; - return ['g', line, symbol]; - }); + if (y < 0) { // Zone: 2 + symbol[1].d = `M ${x} ${topBarHeight} l 4 8 h -8 z`; + return ['g', line, symbol]; + } + if (y > yMax) { // Zone: 8 + symbol[1].d = `M ${x} ${yMax} l -4 -8 h 8 z`; + return ['g', line, symbol]; + } + // Zone: 5 + symbol[1].d = `M ${x} ${y} m-4 0 l 4 -4 l 4 4 l -4 4 z`; + return ['g', line, symbol]; + }); }; -module.exports = vline; +export default vline; \ No newline at end of file diff --git a/src/hook/wave-view/water.js b/src/hook/wave-view/water.js index 1ac7b88..37b106a 100644 --- a/src/hook/wave-view/water.js +++ b/src/hook/wave-view/water.js @@ -1,140 +1,140 @@ -'use strict'; // PC based pipeline view -const tt = require('onml/tt.js'); -const getX = require('./get-x.js'); -const surferer = require('./surferer.js'); -const sampler = require('./sampler.js'); -const hash = require('./hash.js'); +import tt from 'onml/tt.js'; + +import getX from './get-x'; +import surferer from './surferer'; +import sampler from './sampler'; +import hash from './hash'; const pushBrick = (listing, pco, v, name, label, t) => { - let pc = v; - let tail = false; - let le = listing[pc]; - if (le === undefined) { - pc = v - 2; - le = listing[pc]; - tail = true; - } - if (le) { - if (pco[pc] === undefined) { - pco[pc] = {op: le.op, asm: le.asm, bricks: []}; + let pc = v; + let tail = false; + let le = listing[pc]; + if (le === undefined) { + pc = v - 2; + le = listing[pc]; + tail = true; + } + if (le) { + if (pco[pc] === undefined) { + pco[pc] = { op: le.op, asm: le.asm, bricks: [] }; + } + pco[pc].bricks.push({ name, label, t, tail }); } - pco[pc].bricks.push({name, label, t, tail}); - } }; const progress = (lane, desc, pstate) => { - const pco = {}; + const pco = {}; - const { listing } = desc; - const { clock, othero } = lane; + const { listing } = desc; + const { clock, othero } = lane; - if (desc.chango[clock.ref] === undefined) { - // console.log(desc.chango, clock, clock.ref); - return pco; - } - const clockWave = desc.chango[clock.ref].wave; - const clockEr = surferer(clockWave, pstate); + if (desc.chango[clock.ref] === undefined) { + // console.log(desc.chango, clock, clock.ref); + return pco; + } + const clockWave = desc.chango[clock.ref].wave; + const clockEr = surferer(clockWave, pstate); - // create samplers - for (const id of Object.keys(othero)) { - ['pc', 'go'].map(role => { - const obj = othero[id][role]; - obj.sampler = sampler(desc.chango[obj.ref].wave); - obj.sampler.next(0); // dry run - }); - } + // create samplers + for (const id of Object.keys(othero)) { + ['pc', 'go'].map(role => { + const obj = othero[id][role]; + obj.sampler = sampler(desc.chango[obj.ref].wave); + obj.sampler.next(0); // dry run + }); + } - let count = 8000; // max number of pipeline bricks + let count = 8000; // max number of pipeline bricks - outerLoop: for (const iClock of clockEr) { - const [tClock, vClock] = clockWave[iClock]; - if (vClock) { - for (const key of Object.keys(othero)) { - const id = othero[key]; - const go = id.go.sampler.next(tClock).value; - const pc = id.pc.sampler.next(tClock).value; - const KEY = key.toUpperCase(); - if (go) { - pushBrick(listing, pco, pc, KEY, KEY, tClock); - if (count-- === 0) { - break outerLoop; - } + outerLoop: for (const iClock of clockEr) { + const [tClock, vClock] = clockWave[iClock]; + if (vClock) { + for (const key of Object.keys(othero)) { + const id = othero[key]; + const go = id.go.sampler.next(tClock).value; + const pc = id.pc.sampler.next(tClock).value; + const KEY = key.toUpperCase(); + if (go) { + pushBrick(listing, pco, pc, KEY, KEY, tClock); + if (count-- === 0) { + break outerLoop; + } + } + } } - } } - } - for (const [idx, key] of Object.keys(pco).entries()) { - if (pco[key] !== undefined) { - pco[key].idx = idx; + for (const [idx, key] of Object.keys(pco).entries()) { + if (pco[key] !== undefined) { + pco[key].idx = idx; + } } - } - return pco; + return pco; }; const water = (lane, desc, pstate) => { - const { width, yStep } = pstate; - const brickWidth = getX(pstate, 2) - getX(pstate, 0); + const { width, yStep } = pstate; + const brickWidth = getX(pstate, 2) - getX(pstate, 0); - const pco = progress(lane, desc, pstate); + const pco = progress(lane, desc, pstate); - const pcs = Object.keys(pco).map(e => Number(e)).sort(); + const pcs = Object.keys(pco).map(e => Number(e)).sort(); - const mLanes = []; + const mLanes = []; - // const pco = getPco(desc, pstate, lane); // signals, dats, cycles, listing, state.cursor); - for (let j = 0; j < lane.len - 2; j++) { - const pc = pcs[j]; - const pcd = pco[pc]; - if (pc === undefined || pcd === undefined) { - break; + // const pco = getPco(desc, pstate, lane); // signals, dats, cycles, listing, state.cursor); + for (let j = 0; j < lane.len - 2; j++) { + const pc = pcs[j]; + const pcd = pco[pc]; + if (pc === undefined || pcd === undefined) { + break; + } + + const asm = pcd.asm.replace(/<.+>/, '\u25C6'); + const mLane = ['g', tt(0, Math.round(j * yStep))]; + + // striped background + if (j & 1) { + mLane.push(['rect', { width: width, height: yStep - 1, class: 'pc-odd' }]); + // ['rect', {width: width, height: yStep - 2, class: (j & 1) ? 'pc-odd' : 'pc-even'}], + } + + // dotted separator + if ((j > 0) && (pc - pcs[j - 1] > 4)) { + mLane.push(['line', { class: 'gap', x1: 0, y1: 0, x2: width, y2: 0 }]); + } + + // row header + mLane.push(['text', { class: 'pc', 'xml:space': 'preserve', y: Math.round(yStep) }, + ['tspan', { class: 'pc-addr' }, parseInt(pc, 10).toString(16).padStart(12, ' ')], + ['tspan', { class: 'pc-opcode' }, pcd.op.padStart(9, ' ')], + ' ', + ['tspan', { class: 'pc-asm' }, asm] + ]); + + // bricks in row + pcd.bricks.map(e => { + mLane.push(['g', tt(Math.round(getX(pstate, e.t))), + ['rect', { + class: (e.label === '') ? e.name : 'ct' + hash(e.name).toString(36), + width: brickWidth, + height: (e.tail ? (yStep >> 1) : yStep) - 3, + y: e.tail ? ((yStep >> 1) + 1) : 1, + 'data-stage': e.label + }], + ...((brickWidth > 20) ? [['text', { class: e.name, width: brickWidth, x: brickWidth / 2, y: 16 }, e.label]] : []) + ]); + }); + + mLanes.push(mLane); } - - const asm = pcd.asm.replace(/<.+>/, '\u25C6'); - const mLane = ['g', tt(0, Math.round(j * yStep))]; - - // striped background - if (j & 1) { - mLane.push(['rect', {width: width, height: yStep - 1, class: 'pc-odd'}]); - // ['rect', {width: width, height: yStep - 2, class: (j & 1) ? 'pc-odd' : 'pc-even'}], - } - - // dotted separator - if ((j > 0) && (pc - pcs[j - 1] > 4)) { - mLane.push(['line', {class: 'gap', x1: 0, y1: 0, x2: width, y2: 0}]); - } - - // row header - mLane.push(['text', {class: 'pc', 'xml:space': 'preserve', y: Math.round(yStep * .7)}, - ['tspan', {class: 'pc-addr'}, parseInt(pc, 10).toString(16).padStart(12, ' ')], - ['tspan', {class: 'pc-opcode'}, pcd.op.padStart(9, ' ')], - ' ', - ['tspan', {class: 'pc-asm'}, asm] - ]); - - // bricks in row - pcd.bricks.map(e => { - mLane.push(['g', tt(Math.round(getX(pstate, e.t))), - ['rect', { - class: (e.label === '') ? e.name : 'ct' + hash(e.name).toString(36), - width: brickWidth, - height: (e.tail ? (yStep >> 1) : yStep) - 3, - y: e.tail ? ((yStep >> 1) + 1) : 1, - 'data-stage': e.label - }], - ...((brickWidth > 20) ? [['text', {class: e.name, width: brickWidth, x: brickWidth / 2, y: 16}, e.label]] : []) - ]); - }); - - mLanes.push(mLane); - } - return mLanes; + return mLanes; }; -module.exports = water; +export default water; \ No newline at end of file diff --git a/src/hook/wave-view/x-offset-update.js b/src/hook/wave-view/x-offset-update.js index da25402..6ef0e78 100644 --- a/src/hook/wave-view/x-offset-update.js +++ b/src/hook/wave-view/x-offset-update.js @@ -1,14 +1,11 @@ -'use strict'; - -const xOffsetUpdate = (pstate, nextOffsetX) => { +const xOffsetUpdate = (pstate, nextOffsetXFn) => { + let nextOffsetX = nextOffsetXFn(); const { width, xOffset, xScale, time, sidebarWidth } = pstate; - // console.log('input offset', nextOffsetX); - // console.log('xScale', xScale); - const maxOffsetX = width - xScale * time + 2000; // maximum offset + const maxOffsetX = width + xScale * time * 1.0; // maximum offset nextOffsetX = Math.min(nextOffsetX, maxOffsetX); - const minOffsetX = 0; // minimum offset + const minOffsetX = - width - xScale * time * 1.2; // minimum offset nextOffsetX = Math.max(nextOffsetX, minOffsetX); // console.log('max offset', maxOffsetX); @@ -16,11 +13,12 @@ const xOffsetUpdate = (pstate, nextOffsetX) => { // console.log('next offset', nextOffsetX); if (nextOffsetX === xOffset) { - return false; // exit without scroll + return false; // exit without scroll } + pstate.oldXOffset = pstate.xOffset; pstate.xOffset = nextOffsetX; return true; }; -module.exports = xOffsetUpdate; +export default xOffsetUpdate; \ No newline at end of file diff --git a/src/hook/wave-view/x-scale-update.js b/src/hook/wave-view/x-scale-update.js index 5c09e56..19cf21a 100644 --- a/src/hook/wave-view/x-scale-update.js +++ b/src/hook/wave-view/x-scale-update.js @@ -1,8 +1,14 @@ -'use strict'; +import xOffsetUpdate from './x-offset-update'; -const xOffsetUpdate = require('./x-offset-update.js'); - -const xScaleUpdate = (pstate, xScaleNext) => { +/** + * + * @param {{ + * xScale: number + * }} pstate + * @returns + */ +function xScaleUpdate(pstate, xScaleNextFn) { + let xScaleNext = xScaleNextFn(); const { xOffset, xCursor, xScale, xScaleMin, xScaleMax } = pstate; xScaleNext = (xScaleNext > xScaleMax) ? xScaleMax : xScaleNext; @@ -14,10 +20,12 @@ const xScaleUpdate = (pstate, xScaleNext) => { if (xScaleNext === xScale) { return false; // exit without scale change } + + pstate.oldXScale = pstate.xScale; pstate.xScale = xScaleNext; - xOffsetUpdate(pstate, xCursor - (xCursor - xOffset) * xScaleNext / xScale); + xOffsetUpdate(pstate, () => xCursor - (xCursor - xOffset) * xScaleNext / xScale); return true; -}; +} -module.exports = xScaleUpdate; +export default xScaleUpdate; \ No newline at end of file diff --git a/src/hook/wave-view/y-offset-update.js b/src/hook/wave-view/y-offset-update.js new file mode 100644 index 0000000..6973d45 --- /dev/null +++ b/src/hook/wave-view/y-offset-update.js @@ -0,0 +1,30 @@ +import { globalStyle, globalLookup } from '../global'; + +const yOffsetUpdate = (pstate, nextOffsetYFn) => { + let nextOffsetY = nextOffsetYFn(); + const { width, xOffset, xScale, time, sidebarWidth } = pstate; + + const currentRenderHeight = globalLookup.currentWires.size * pstate.yStep; + const canvasHeight = pstate.height - pstate.topBarHeight - pstate.botBarHeight; + console.log(currentRenderHeight, canvasHeight); + const maxOffsetX = Math.max(-40, currentRenderHeight - canvasHeight); // maximum offset + nextOffsetY = Math.min(nextOffsetY, maxOffsetX); + + const minOffsetX = -40; // minimum offset + nextOffsetY = Math.max(nextOffsetY, minOffsetX); + + if (nextOffsetY === xOffset) { + return false; // exit without scroll + } + + console.log('next offset y', nextOffsetY); + + pstate.oldYOffset = pstate.yOffset; + pstate.yOffset = nextOffsetY; + + // 这玩意儿初始设置 -40 的偏移,当作 padding-top + globalStyle.yOffset = nextOffsetY + 40; + return true; +}; + +export default yOffsetUpdate; \ No newline at end of file diff --git a/src/i18n/en.json b/src/i18n/en.json index 91deb41..381a89b 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -3,8 +3,14 @@ "signal": "Signals", "search-signal": "Search Signal", "language-setting": "Language", - "wheel-zoom-ratio": "Wheel Zoom Level", - + "horizontal-scaling-ratio": "Horizontal Scaling Level", + "horizontal-scaling-ratio-description": "There are a total of 5 gear, the higher the gear,
the higher the magnification when ctrl + mouse wheel zoomin", + + "horizontal-roll-ratio": "Horizontal Roll Level", + "horizontal-roll-ratio-description": "There are 5 gear positions in total. The higher the gear position,
the larger the step length of the left and right sliding waveform timeline", + "vertical-roll-ratio": "Vertical Roll Level", + "vertical-roll-ratio-description": "There are 5 gear positions in total. The higher the gear position,
the larger the step length of the up and down sliding waveform timeline", + "search-setting": "Search", "search-case-sensitivity": "Case Sensitivity", "search-mode": "search mode", @@ -21,6 +27,31 @@ "appearance-setting": "Appearance", "display-wave-height": "Height of Wave Track", "display-signal-info-scope": "Info displayed in sidebar", + "display-signal-info-scope.width": "width", + "display-signal-info-scope.parent": "parent", + + "wavecolor": "color of wave", + "wavecolor.normal-bit": "wave of one width", + "wavecolor.normal-vec": "wave of more than one width", + "wavecolor.high-impedance": "wave of high impedance", + "wavecolor.unknown": "wave of unknown", + + "operation-setting": "Operation", + "render-setting": "Render", + "prerender": "prerender", + "prerender-description": "Prerendering will make rendering faster, but will take up extra memory
If your computer has more than 10 GB of memory, we recommend you turn it on.", + + "render-animation": "enable rendering animation", + + "usermanual": "User Manual", + "usermanual.left-right-scroll.title": " + ", + "usermanual.left-right-scroll.caption": "move up and down", + "usermanual.up-down-scroll.title": " + / + + ", + "usermanual.up-down-scroll.caption": "move left and right", + "usermanual.xscale.title": " + + ", + "usermanual.xscale.caption": "scale along x axis", + + "loading": "loading", "current-version": "current version", "copyright": "The copyright of this software belongs to Digital-IDE project team. Welcome to Star." diff --git a/src/i18n/index.js b/src/i18n/index.js index 1ef008b..7230573 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -5,7 +5,7 @@ import zh from './zh.json'; const i18n = createI18n({ legacy: false, - locale: 'en', + locale: 'zh', warnHtmlMessage: false, messages: { en, zh } }); diff --git a/src/i18n/zh.json b/src/i18n/zh.json index 15c9e1e..9f153c8 100644 --- a/src/i18n/zh.json +++ b/src/i18n/zh.json @@ -3,7 +3,13 @@ "signal": "信号", "search-signal": "搜索信号", "language-setting": "语言", - "wheel-zoom-ratio": "滚轮缩放倍率", + "horizontal-scaling-ratio": "横向缩放速度", + "horizontal-scaling-ratio-description": "一共有5个挡位,挡位越高,
ctrl + 鼠标滚轮缩放时的倍率越高", + + "horizontal-roll-ratio": "横向滚动速度", + "horizontal-roll-ratio-description": "一共有5个挡位,挡位越高,
左右滑动波形时间轴的步长越大", + "vertical-roll-ratio": "纵向滚动速度", + "vertical-roll-ratio-description": "一共有5个挡位,挡位越高,
上下滑动波形时间轴的步长越大", "search-setting": "搜索", "search-case-sensitivity": "区分大小写", @@ -20,6 +26,31 @@ "appearance-setting": "外观", "display-wave-height": "波形轨道的高度", "display-signal-info-scope": "侧边栏展示信息", + "display-signal-info-scope.width": "位宽", + "display-signal-info-scope.parent": "所属模块名", + + "wavecolor": "波形颜色", + "wavecolor.normal-bit": "单位宽波形", + "wavecolor.normal-vec": "多位宽波形", + "wavecolor.high-impedance": "高阻态波形", + "wavecolor.unknown": "未知态波形", + + "operation-setting": "操作", + "render-setting": "渲染", + "prerender": "预渲染", + "prerender-description": "预渲染将使得渲染速度更快,但是会占用额外内存
如果您的电脑内存大于10个G,我们建议您开启。", + + "render-animation": "开启渲染动画", + + "usermanual": "使用说明", + "usermanual.left-right-scroll.title": "", + "usermanual.left-right-scroll.caption": "上下移动", + "usermanual.up-down-scroll.title": " / + ", + "usermanual.up-down-scroll.caption": "左右移动", + "usermanual.xscale.title": " + ", + "usermanual.xscale.caption": "横向缩放", + + "loading": "加载中", "current-version": "当前版本", "copyright": "本软件版权归 Digital-IDE 项目组所有,欢迎 Star。" diff --git a/vue.config.js b/vue.config.js index 7664cf5..a7ee688 100644 --- a/vue.config.js +++ b/vue.config.js @@ -10,5 +10,9 @@ module.exports = defineConfig({ }) return definitions; }) + }, + publicPath: './', + configureWebpack: { + devtool: false, } }) diff --git a/webpack.config.js b/webpack.config.js index 7bb9a2f..8ee12ad 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,12 +3,13 @@ const Components = require('unplugin-vue-components/webpack') const { ElementPlusResolver } = require('unplugin-vue-components/resolvers') module.exports = { - plugins: [ - AutoImport({ - resolvers: [ElementPlusResolver()], - }), - Components({ - resolvers: [ElementPlusResolver()], - }), - ], + plugins: [ + AutoImport({ + resolvers: [ElementPlusResolver()], + }), + Components({ + resolvers: [ElementPlusResolver()], + }), + ], + devtool: 'none', } \ No newline at end of file