From 0aa7d6fe01918aeaa3af86670d5d6dc79e49f3e8 Mon Sep 17 00:00:00 2001 From: Philipp Schaad Date: Mon, 27 May 2024 11:52:23 +0200 Subject: [PATCH 1/4] Fmt --- package-lock.json | 260 +++++++++--------- package.json | 2 +- src/overlay_manager.ts | 10 +- src/overlays/avg_parallelism_overlay.ts | 27 +- src/overlays/depth_overlay.ts | 27 +- src/overlays/generic_sdfg_overlay.ts | 10 +- src/overlays/logical_group_overlay.ts | 16 +- src/overlays/memory_location_overlay.ts | 13 +- src/overlays/memory_volume_overlay.ts | 22 +- src/overlays/operational_intensity_overlay.ts | 27 +- src/overlays/runtime_micro_seconds_overlay.ts | 14 +- ...simulated_operational_intensity_overlay.ts | 27 +- src/overlays/static_flops_overlay.ts | 27 +- src/renderer/renderer.ts | 86 +++--- src/renderer/renderer_elements.ts | 6 +- src/sdfv.ts | 6 - src/utils/sdfv_settings.ts | 100 +++++-- 17 files changed, 392 insertions(+), 288 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6c1d085d..07638912 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2633,9 +2633,9 @@ } }, "node_modules/@jest/reporters/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -2981,9 +2981,9 @@ } }, "node_modules/@jsonjoy.com/base64": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.1.tgz", - "integrity": "sha512-LnFjVChaGY8cZVMwAIMjvA1XwQjZ/zIXHyh28IyJkyNkzof4Dkm1+KN9UIm3lHhREH4vs7XwZ0NpkZKnwOtEfg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA==", "dev": true, "engines": { "node": ">=10.0" @@ -2997,9 +2997,9 @@ } }, "node_modules/@jsonjoy.com/json-pack": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.0.3.tgz", - "integrity": "sha512-Q0SPAdmK6s5Fe3e1kcNvwNyk6e2+CxM8XZdGbf4abZG7nUO05KSie3/iX29loTBuY+75uVP6RixDSPVpotfzmQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.0.4.tgz", + "integrity": "sha512-aOcSN4MeAtFROysrbqG137b7gaDDSmVrl5mpo6sT/w+kcXpWnzhMjmY/Fh/sDx26NBxyIE7MB1seqLeCAzy9Sg==", "dev": true, "dependencies": { "@jsonjoy.com/base64": "^1.1.1", @@ -3019,9 +3019,9 @@ } }, "node_modules/@jsonjoy.com/util": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.1.2.tgz", - "integrity": "sha512-HOGa9wtE6LEz2I5mMQ2pMSjth85PmD71kPbsecs02nEUq3/Kw0wRK3gmZn5BCEB8mFLXByqPxjHgApoMwIPMKQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.1.3.tgz", + "integrity": "sha512-g//kkF4kOwUjemValCtOc/xiYzmwMRmWq3Bn+YnzOzuZLHq2PpMOxxIayN3cKbo7Ko2Np65t6D9H81IvXbXhqg==", "dev": true, "engines": { "node": ">=10.0" @@ -3101,9 +3101,9 @@ } }, "node_modules/@npmcli/fs/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -3611,9 +3611,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", - "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", "dev": true, "dependencies": { "@babel/types": "^7.20.7" @@ -3716,9 +3716,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.19.0", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.0.tgz", - "integrity": "sha512-bGyep3JqPCRry1wq+O5n7oiBgGWmeIJXPjXXCo8EK0u8duZGSYar7cGqd3ML2JUsLGeB7fmc06KYo9fLGWqPvQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.1.tgz", + "integrity": "sha512-ej0phymbFLoCB26dbbq5PGScsf2JAJ4IJHjG10LalgUV36XKTmA4GdA+PVllKvRk0sEKt64X8975qFnkSi0hqA==", "dev": true, "dependencies": { "@types/node": "*", @@ -3813,9 +3813,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.10.tgz", - "integrity": "sha512-Eem5pH9pmWBHoGAT8Dr5fdc5rYA+4NAovdM4EktRPVAAiJhmWWfQrA0cFhAbOsQdSfIHjAud6YdkbL69+zSKjw==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -3971,9 +3971,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -4096,9 +4096,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -4133,9 +4133,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -4604,6 +4604,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "deprecated": "This package is no longer supported.", "dev": true, "dependencies": { "delegates": "^1.0.0", @@ -5344,11 +5345,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -5648,9 +5649,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001616", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001616.tgz", - "integrity": "sha512-RHVYKov7IcdNjVHJFNY/78RdG4oGVjbayxv8u5IO74Wv7Hlq4PnJE6mo/OjFijjVFNy5ijnCt6H3IIo4t+wfEw==", + "version": "1.0.30001621", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001621.tgz", + "integrity": "sha512-+NLXZiviFFKX0fk8Piwv3PfLPGtRqJeq2TiNoUff/qB5KJgwecJTvCXDpmlyP/eCI/GUEmp/h/y5j0yckiiZrA==", "dev": true, "funding": [ { @@ -5691,9 +5692,9 @@ } }, "node_modules/chart.js": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.2.tgz", - "integrity": "sha512-6GD7iKwFpP5kbSD4MeRRRlTnQvxfQREy36uEtm1hzHzcOqwWx0YEHuspuoNlslu+nciLIB7fjjsHkUv/FzFcOg==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.3.tgz", + "integrity": "sha512-qK1gkGSRYcJzqrrzdR6a+I0vQ4/R+SoODXyAjscQ/4mzuNzySaMCd+hyVxitSY1+L2fjPD1Gbn+ibNqRmwQeLw==", "dependencies": { "@kurkle/color": "^0.3.0" }, @@ -6008,9 +6009,9 @@ "hasInstallScript": true }, "node_modules/core-js-compat": { - "version": "3.37.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.0.tgz", - "integrity": "sha512-vYq4L+T8aS5UuFg4UwDhc7YNRWVeVZwltad9C/jV3R2LgVOpS9BDr7l/WL6BN0dbV3k1XejPTHqqEzJgsa0frA==", + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", + "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", "dev": true, "dependencies": { "browserslist": "^4.23.0" @@ -6216,9 +6217,9 @@ } }, "node_modules/css-loader/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -6529,9 +6530,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.758", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.758.tgz", - "integrity": "sha512-/o9x6TCdrYZBMdGeTifAP3wlF/gVT+TtWJe3BSmtNh92Mw81U9hrYwW9OAGUh+sEOX/yz5e34sksqRruZbjYrw==", + "version": "1.4.779", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.779.tgz", + "integrity": "sha512-oaTiIcszNfySXVJzKcjxd2YjPxziAd+GmXyb2HbidCeFo6Z88ygOT7EimlrEQhM2U08VhSrbKhLOXP0kKUCZ6g==", "dev": true }, "node_modules/emittery": { @@ -6649,9 +6650,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.2.tgz", - "integrity": "sha512-l60ETUTmLqbVbVHv1J4/qj+M8nq7AwMzEcg3kmJDt9dCNrTk+yHcYFf/Kw75pMDwd9mPcIGCG5LcS20SxYRzFA==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", + "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", "dev": true }, "node_modules/escalade": { @@ -7312,9 +7313,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -7586,6 +7587,7 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "deprecated": "This package is no longer supported.", "dev": true, "dependencies": { "aproba": "^1.0.3 || ^2.0.0", @@ -8350,6 +8352,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -8758,9 +8761,9 @@ } }, "node_modules/istanbul-lib-report/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -8809,9 +8812,9 @@ } }, "node_modules/jackspeak": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", - "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", + "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -10095,9 +10098,9 @@ } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -10939,11 +10942,11 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -11421,9 +11424,9 @@ } }, "node_modules/node-gyp/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -11624,9 +11627,9 @@ } }, "node_modules/normalize-package-data/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -11669,6 +11672,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "deprecated": "This package is no longer supported.", "dev": true, "dependencies": { "are-we-there-yet": "^3.0.0", @@ -12056,9 +12060,9 @@ } }, "node_modules/patch-package/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "bin": { "semver": "bin/semver.js" }, @@ -12109,16 +12113,16 @@ "dev": true }, "node_modules/path-scurry": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", - "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -12134,9 +12138,9 @@ } }, "node_modules/path-scurry/node_modules/minipass": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.0.tgz", - "integrity": "sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", + "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" @@ -12163,9 +12167,9 @@ "integrity": "sha512-UzkaC2L6d9J1VzJAFH0TQwuKE/rerpTZkgW6aPLVeu/LdjWn6rnuY9lXcVN1AE9tZVfHrsJ2gZOBsRjpQECNHA==" }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", "dev": true }, "node_modules/picomatch": { @@ -12410,9 +12414,9 @@ } }, "node_modules/postcss-loader/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -12481,9 +12485,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz", - "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.0.tgz", + "integrity": "sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==", "dev": true, "dependencies": { "cssesc": "^3.0.0", @@ -13023,9 +13027,9 @@ } }, "node_modules/rimraf": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz", - "integrity": "sha512-CqDakW+hMe/Bz202FPEymy68P+G50RfMQK+Qo5YUqc9SPipvbGjCGKd0RSKEelbsfQuw3g5NZDSrlZZAJurH1A==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.7.tgz", + "integrity": "sha512-nV6YcJo5wbLW77m+8KjH8aB/7/rxQy9SZ0HY5shnwULfS+9nmTtVXAJET5NdZmCzA4fPI/Hm1wo/Po/4mopOdg==", "dev": true, "dependencies": { "glob": "^10.3.7" @@ -13034,38 +13038,38 @@ "rimraf": "dist/esm/bin.mjs" }, "engines": { - "node": ">=14" + "node": ">=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rimraf/node_modules/glob": { - "version": "10.3.12", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", - "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", + "version": "10.3.16", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz", + "integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.6", + "jackspeak": "^3.1.2", "minimatch": "^9.0.1", "minipass": "^7.0.4", - "path-scurry": "^1.10.2" + "path-scurry": "^1.11.0" }, "bin": { "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/rimraf/node_modules/minipass": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.0.tgz", - "integrity": "sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", + "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" @@ -13593,9 +13597,9 @@ } }, "node_modules/sonic-forest": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/sonic-forest/-/sonic-forest-1.0.2.tgz", - "integrity": "sha512-2rICdwIJi5kVlehMUVtJeHn3ohh5YZV4pDv0P0c1M11cRz/gXNViItpM94HQwfvnXuzybpqK0LZJgTa3lEwtAw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sonic-forest/-/sonic-forest-1.0.3.tgz", + "integrity": "sha512-dtwajos6IWMEWXdEbW1IkEkyL2gztCAgDplRIX+OT5aRKnEd5e7r7YCxRgXZdhRP1FBdOBf8axeTPhzDv8T4wQ==", "dev": true, "dependencies": { "tree-dump": "^1.0.0" @@ -14280,9 +14284,9 @@ } }, "node_modules/ts-jest": { - "version": "29.1.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", - "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", + "version": "29.1.3", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.3.tgz", + "integrity": "sha512-6L9qz3ginTd1NKhOxmkP0qU3FyKjj5CPoY+anszfVn6Pmv/RIKzhiMCsH7Yb7UvJR9I2A64rm4zQl531s2F1iw==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -14298,10 +14302,11 @@ "ts-jest": "cli.js" }, "engines": { - "node": "^16.10.0 || ^18.0.0 || >=20.0.0" + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", "@jest/types": "^29.0.0", "babel-jest": "^29.0.0", "jest": "^29.0.0", @@ -14311,6 +14316,9 @@ "@babel/core": { "optional": true }, + "@jest/transform": { + "optional": true + }, "@jest/types": { "optional": true }, @@ -14323,9 +14331,9 @@ } }, "node_modules/ts-jest/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -14422,9 +14430,9 @@ } }, "node_modules/ts-loader/node_modules/semver": { - "version": "7.6.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.1.tgz", - "integrity": "sha512-f/vbBsu+fOiYt+lmwZV0rVwJScl46HppnOA1ZvIuBWKOTlllpyJ3bfVax76/OrhCH38dyxoDIA8K7uB963IYgA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -14658,9 +14666,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.15", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.15.tgz", - "integrity": "sha512-K9HWH62x3/EalU1U6sjSZiylm9C8tgq2mSvshZpqc7QE69RaA2qjhkW2HlNA0tFpEbtyFz7HTqbSdN4MSwUodA==", + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", + "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", "dev": true, "funding": [ { @@ -14678,7 +14686,7 @@ ], "dependencies": { "escalade": "^3.1.2", - "picocolors": "^1.0.0" + "picocolors": "^1.0.1" }, "bin": { "update-browserslist-db": "cli.js" diff --git a/package.json b/package.json index 94434e86..cb4050b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@spcl/sdfv", - "version": "1.2.4", + "version": "1.2.6", "description": "A standalone viewer for SDFGs", "homepage": "https://github.com/spcl/dace-webclient", "main": "out/index.js", diff --git a/src/overlay_manager.ts b/src/overlay_manager.ts index 2891552b..7eae99c6 100644 --- a/src/overlay_manager.ts +++ b/src/overlay_manager.ts @@ -3,7 +3,11 @@ import { MathNode, parse, SymbolNode } from 'mathjs'; import { Point2D, SymbolMap } from './index'; import { GenericSdfgOverlay } from './overlays/generic_sdfg_overlay'; -import { SDFGRenderer } from './renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from './renderer/renderer'; import { SDFGElement } from './renderer/renderer_elements'; import { createElement } from './utils/utils'; @@ -346,8 +350,8 @@ export class OverlayManager { type: string, ev: MouseEvent, mousepos: Point2D, - elements: SDFGElement[], - foreground_elem: SDFGElement | undefined, + elements: Record, + foreground_elem: SDFGElement | null, ends_drag: boolean ): boolean { let dirty = false; diff --git a/src/overlays/avg_parallelism_overlay.ts b/src/overlays/avg_parallelism_overlay.ts index 6edc264e..1c1319b8 100644 --- a/src/overlays/avg_parallelism_overlay.ts +++ b/src/overlays/avg_parallelism_overlay.ts @@ -7,7 +7,11 @@ import { SymbolMap, getGraphElementUUID, } from '../index'; -import { SDFGRenderer } from '../renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from '../renderer/renderer'; import { ControlFlowBlock, ControlFlowRegion, @@ -245,18 +249,20 @@ export class AvgParallelismOverlay extends GenericSdfgOverlay { visibleRect.y, visibleRect.w, visibleRect.h)) return; - if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) { - const nodeppp = Math.sqrt(node.width * node.height) / ppp; + if (node instanceof NestedSDFG && + !node.data.node.attributes.is_collapsed) { + const nodeppp = Math.sqrt( + node.width * node.height + ) / ppp; if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) { this.shadeNode(node, ctx); - } - else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') { + } else if (node.attributes().sdfg && + node.attributes().sdfg.type !== 'SDFGShell') { this.recursivelyShadeCFG( node.data.graph, ctx, ppp, visibleRect ); } - } - else { + } else { this.shadeNode(node, ctx); } }); @@ -282,13 +288,12 @@ export class AvgParallelismOverlay extends GenericSdfgOverlay { type: string, _ev: Event, _mousepos: Point2D, - _elements: SDFGElement[], - foreground_elem: SDFGElement, + _elements: Record, + foreground_elem: SDFGElement | null, ends_drag: boolean ): boolean { if (type === 'click' && !ends_drag) { - if (foreground_elem !== undefined && foreground_elem !== null && - !(foreground_elem instanceof Edge)) { + if (foreground_elem && !(foreground_elem instanceof Edge)) { if (foreground_elem.data.avg_parallelism === undefined) { const avg_parallelism_string = this.avg_parallelism_map[ getGraphElementUUID(foreground_elem) diff --git a/src/overlays/depth_overlay.ts b/src/overlays/depth_overlay.ts index 52b3277f..e1bc188e 100644 --- a/src/overlays/depth_overlay.ts +++ b/src/overlays/depth_overlay.ts @@ -7,7 +7,11 @@ import { SymbolMap, getGraphElementUUID, } from '../index'; -import { SDFGRenderer } from '../renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from '../renderer/renderer'; import { Edge, NestedSDFG, @@ -230,18 +234,20 @@ export class DepthOverlay extends GenericSdfgOverlay { visible_rect.y, visible_rect.w, visible_rect.h)) return; - if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) { - const nodeppp = Math.sqrt(node.width * node.height) / ppp; + if (node instanceof NestedSDFG && + !node.data.node.attributes.is_collapsed) { + const nodeppp = Math.sqrt( + node.width * node.height + ) / ppp; if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) { this.shade_node(node, ctx); - } - else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') { + } else if (node.attributes().sdfg && + node.attributes().sdfg.type !== 'SDFGShell') { this.recursively_shade_sdfg( node.data.graph, ctx, ppp, visible_rect ); } - } - else { + } else { this.shade_node(node, ctx); } }); @@ -263,13 +269,12 @@ export class DepthOverlay extends GenericSdfgOverlay { type: string, _ev: Event, _mousepos: Point2D, - _elements: SDFGElement[], - foreground_elem: SDFGElement, + _elements: Record, + foreground_elem: SDFGElement | null, ends_drag: boolean ): boolean { if (type === 'click' && !ends_drag) { - if (foreground_elem !== undefined && foreground_elem !== null && - !(foreground_elem instanceof Edge)) { + if (foreground_elem && !(foreground_elem instanceof Edge)) { if (foreground_elem.data.depth === undefined) { const depth_string = this.depth_map[ getGraphElementUUID(foreground_elem) diff --git a/src/overlays/generic_sdfg_overlay.ts b/src/overlays/generic_sdfg_overlay.ts index bd021e6c..7aede953 100644 --- a/src/overlays/generic_sdfg_overlay.ts +++ b/src/overlays/generic_sdfg_overlay.ts @@ -3,7 +3,11 @@ import { log, mean, median } from 'mathjs'; import { Point2D } from '../index'; import { OverlayManager, SymbolResolver } from '../overlay_manager'; -import { SDFGRenderer } from '../renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from '../renderer/renderer'; import { SDFGElement } from '../renderer/renderer_elements'; declare const vscode: any; @@ -43,8 +47,8 @@ export class GenericSdfgOverlay { _type: string, _ev: MouseEvent, _mousepos: Point2D, - _elements: SDFGElement[], - _foreground_elem: SDFGElement | undefined, + _elements: Record, + _foreground_elem: SDFGElement | null, _ends_drag: boolean ): boolean { return false; diff --git a/src/overlays/logical_group_overlay.ts b/src/overlays/logical_group_overlay.ts index 6acc5064..c1cb0455 100644 --- a/src/overlays/logical_group_overlay.ts +++ b/src/overlays/logical_group_overlay.ts @@ -1,7 +1,11 @@ // Copyright 2019-2024 ETH Zurich and the DaCe authors. All rights reserved. import { DagreGraph, JsonSDFG, Point2D, SimpleRect } from '../index'; -import { SDFGRenderer } from '../renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from '../renderer/renderer'; import { NestedSDFG, SDFGNode, @@ -88,13 +92,11 @@ export class LogicalGroupOverlay extends GenericSdfgOverlay { // In that case, we overlay the correct grouping color(s). // If it's expanded or zoomed in close enough, we traverse inside. const sdfgGroups = sdfg.attributes.logical_groups; - if (sdfgGroups === undefined || sdfgGroups.length === 0) { + if (sdfgGroups === undefined || sdfgGroups.length === 0) return; - } - if (!graph) { + if (!graph) return; - } graph?.nodes().forEach(v => { const block = graph.node(v); @@ -169,8 +171,8 @@ export class LogicalGroupOverlay extends GenericSdfgOverlay { _type: string, _ev: MouseEvent, _mousepos: Point2D, - _elements: SDFGElement[], - _foreground_elem: SDFGElement | undefined, + _elements: Record, + _foreground_elem: SDFGElement | null, _ends_drag: boolean ): boolean { return false; diff --git a/src/overlays/memory_location_overlay.ts b/src/overlays/memory_location_overlay.ts index 914ba3c0..d29bb08f 100644 --- a/src/overlays/memory_location_overlay.ts +++ b/src/overlays/memory_location_overlay.ts @@ -1,7 +1,11 @@ // Copyright 2019-2024 ETH Zurich and the DaCe authors. All rights reserved. import { DagreGraph, Point2D, SimpleRect } from '../index'; -import { SDFGRenderer } from '../renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from '../renderer/renderer'; import { AccessNode, ControlFlowBlock, @@ -267,9 +271,8 @@ export class MemoryLocationOverlay extends GenericSdfgOverlay { node.data.graph, ctx, ppp, visibleRect ); } else if (node instanceof AccessNode) { - if (!(ctx as any).lod || ppp < SDFV.NODE_LOD) { + if (!(ctx as any).lod || ppp < SDFV.NODE_LOD) this.shadeNode(node, ctx); - } } }); } @@ -294,8 +297,8 @@ export class MemoryLocationOverlay extends GenericSdfgOverlay { _type: string, _ev: MouseEvent, _mousepos: Point2D, - _elements: SDFGElement[], - _foreground_elem: SDFGElement | undefined, + _elements: Record, + _foreground_elem: SDFGElement | null, _ends_drag: boolean ): boolean { return false; diff --git a/src/overlays/memory_volume_overlay.ts b/src/overlays/memory_volume_overlay.ts index cebec124..bd5a2246 100644 --- a/src/overlays/memory_volume_overlay.ts +++ b/src/overlays/memory_volume_overlay.ts @@ -1,7 +1,11 @@ // Copyright 2019-2024 ETH Zurich and the DaCe authors. All rights reserved. import { DagreGraph, Point2D, SimpleRect, SymbolMap } from '../index'; -import { SDFGRenderer } from '../renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from '../renderer/renderer'; import { ControlFlowBlock, ControlFlowRegion, @@ -218,11 +222,10 @@ export class MemoryVolumeOverlay extends GenericSdfgOverlay { const edge: Edge = state_graph.edge(e); // Skip if edge is invisible, or zoomed out far - if ((ctx as any).lod - && (!edge.intersect(visibleRect.x, visibleRect.y, visibleRect.w, visibleRect.h) - || ppp > SDFV.EDGE_LOD - ) - ) + if ((ctx as any).lod && (!edge.intersect( + visibleRect.x, visibleRect.y, + visibleRect.w, visibleRect.h + ) || ppp > SDFV.EDGE_LOD)) return; this.shadeEdge(edge, ctx); @@ -249,13 +252,12 @@ export class MemoryVolumeOverlay extends GenericSdfgOverlay { type: string, _ev: MouseEvent, _mousepos: Point2D, - _elements: SDFGElement[], - foreground_elem: SDFGElement | undefined, + _elements: Record, + foreground_elem: SDFGElement | null, ends_drag: boolean ): boolean { if (type === 'click' && !ends_drag) { - if (foreground_elem !== undefined && - foreground_elem instanceof Edge) { + if (foreground_elem && foreground_elem instanceof Edge) { if (foreground_elem.data.volume === undefined) { if (foreground_elem.data.attributes.volume) { this.symbolResolver.parse_symbol_expression( diff --git a/src/overlays/operational_intensity_overlay.ts b/src/overlays/operational_intensity_overlay.ts index a98b5422..3f705df5 100644 --- a/src/overlays/operational_intensity_overlay.ts +++ b/src/overlays/operational_intensity_overlay.ts @@ -7,7 +7,11 @@ import { SymbolMap, getGraphElementUUID, } from '../index'; -import { SDFGRenderer } from '../renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from '../renderer/renderer'; import { Edge, NestedSDFG, @@ -273,18 +277,20 @@ export class OperationalIntensityOverlay extends GenericSdfgOverlay { visible_rect.y, visible_rect.w, visible_rect.h)) return; - if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) { - const nodeppp = Math.sqrt(node.width * node.height) / ppp; + if (node instanceof NestedSDFG && + !node.data.node.attributes.is_collapsed) { + const nodeppp = Math.sqrt( + node.width * node.height + ) / ppp; if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) { this.shade_node(node, ctx); - } - else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') { + } else if (node.attributes().sdfg && + node.attributes().sdfg.type !== 'SDFGShell') { this.recursively_shade_sdfg( node.data.graph, ctx, ppp, visible_rect ); } - } - else { + } else { this.shade_node(node, ctx); } }); @@ -306,13 +312,12 @@ export class OperationalIntensityOverlay extends GenericSdfgOverlay { type: string, _ev: Event, _mousepos: Point2D, - _elements: SDFGElement[], - foreground_elem: SDFGElement, + _elements: Record, + foreground_elem: SDFGElement | null, ends_drag: boolean ): boolean { if (type === 'click' && !ends_drag) { - if (foreground_elem !== undefined && foreground_elem !== null && - !(foreground_elem instanceof Edge)) { + if (foreground_elem && !(foreground_elem instanceof Edge)) { if (foreground_elem.data.flops === undefined) { const flops_string = this.flops_map[ getGraphElementUUID(foreground_elem) diff --git a/src/overlays/runtime_micro_seconds_overlay.ts b/src/overlays/runtime_micro_seconds_overlay.ts index b68c911f..c385fa54 100644 --- a/src/overlays/runtime_micro_seconds_overlay.ts +++ b/src/overlays/runtime_micro_seconds_overlay.ts @@ -146,18 +146,20 @@ export class RuntimeMicroSecondsOverlay extends RuntimeReportOverlay { visible_rect.y, visible_rect.w, visible_rect.h)) return; - if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) { - const nodeppp = Math.sqrt(node.width * node.height) / ppp; + if (node instanceof NestedSDFG && + !node.data.node.attributes.is_collapsed) { + const nodeppp = Math.sqrt( + node.width * node.height + ) / ppp; if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) { this.shade_node(node, ctx); - } - else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') { + } else if (node.attributes().sdfg && + node.attributes().sdfg.type !== 'SDFGShell') { this.recursively_shade_sdfg( node.data.graph, ctx, ppp, visible_rect ); } - } - else { + } else { this.shade_node(node, ctx); } }); diff --git a/src/overlays/simulated_operational_intensity_overlay.ts b/src/overlays/simulated_operational_intensity_overlay.ts index 529c68ff..f9d469aa 100644 --- a/src/overlays/simulated_operational_intensity_overlay.ts +++ b/src/overlays/simulated_operational_intensity_overlay.ts @@ -7,7 +7,11 @@ import { SymbolMap, getGraphElementUUID, } from '../index'; -import { SDFGRenderer } from '../renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from '../renderer/renderer'; import { Edge, NestedSDFG, @@ -236,18 +240,20 @@ export class SimulatedOperationalIntensityOverlay extends GenericSdfgOverlay { visible_rect.y, visible_rect.w, visible_rect.h)) return; - if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) { - const nodeppp = Math.sqrt(node.width * node.height) / ppp; + if (node instanceof NestedSDFG && + !node.data.node.attributes.is_collapsed) { + const nodeppp = Math.sqrt( + node.width * node.height + ) / ppp; if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) { this.shade_node(node, ctx); - } - else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') { + } else if (node.attributes().sdfg && + node.attributes().sdfg.type !== 'SDFGShell') { this.recursively_shade_sdfg( node.data.graph, ctx, ppp, visible_rect ); } - } - else { + } else { this.shade_node(node, ctx); } }); @@ -269,13 +275,12 @@ export class SimulatedOperationalIntensityOverlay extends GenericSdfgOverlay { type: string, _ev: Event, _mousepos: Point2D, - _elements: SDFGElement[], - foreground_elem: SDFGElement, + _elements: Record, + foreground_elem: SDFGElement | null, ends_drag: boolean ): boolean { if (type === 'click' && !ends_drag) { - if (foreground_elem !== undefined && foreground_elem !== null && - !(foreground_elem instanceof Edge)) { + if (foreground_elem && !(foreground_elem instanceof Edge)) { if (foreground_elem.data.op_in === undefined) { const op_in_string = this.op_in_map[ getGraphElementUUID(foreground_elem) diff --git a/src/overlays/static_flops_overlay.ts b/src/overlays/static_flops_overlay.ts index 98febc74..7e8dc77d 100644 --- a/src/overlays/static_flops_overlay.ts +++ b/src/overlays/static_flops_overlay.ts @@ -7,7 +7,11 @@ import { SymbolMap, getGraphElementUUID, } from '../index'; -import { SDFGRenderer } from '../renderer/renderer'; +import { + GraphElementInfo, + SDFGElementGroup, + SDFGRenderer, +} from '../renderer/renderer'; import { Edge, NestedSDFG, @@ -230,18 +234,20 @@ export class StaticFlopsOverlay extends GenericSdfgOverlay { visible_rect.y, visible_rect.w, visible_rect.h)) return; - if (node instanceof NestedSDFG && !node.data.node.attributes.is_collapsed) { - const nodeppp = Math.sqrt(node.width * node.height) / ppp; + if (node instanceof NestedSDFG && + !node.data.node.attributes.is_collapsed) { + const nodeppp = Math.sqrt( + node.width * node.height + ) / ppp; if ((ctx as any).lod && nodeppp < SDFV.STATE_LOD) { this.shade_node(node, ctx); - } - else if (node.attributes().sdfg && node.attributes().sdfg.type !== 'SDFGShell') { + } else if (node.attributes().sdfg && + node.attributes().sdfg.type !== 'SDFGShell') { this.recursively_shade_sdfg( node.data.graph, ctx, ppp, visible_rect ); } - } - else { + } else { this.shade_node(node, ctx); } }); @@ -263,13 +269,12 @@ export class StaticFlopsOverlay extends GenericSdfgOverlay { type: string, _ev: Event, _mousepos: Point2D, - _elements: SDFGElement[], - foreground_elem: SDFGElement, + _elements: Record, + foreground_elem: SDFGElement | null, ends_drag: boolean ): boolean { if (type === 'click' && !ends_drag) { - if (foreground_elem !== undefined && foreground_elem !== null && - !(foreground_elem instanceof Edge)) { + if (foreground_elem && !(foreground_elem instanceof Edge)) { if (foreground_elem.data.flops === undefined) { const flops_string = this.flops_map[ getGraphElementUUID(foreground_elem) diff --git a/src/renderer/renderer.ts b/src/renderer/renderer.ts index 4f919ff5..773044e3 100644 --- a/src/renderer/renderer.ts +++ b/src/renderer/renderer.ts @@ -43,7 +43,7 @@ import { getPositioningInfo, getGraphElementUUID, findRootCFG, } from '../utils/sdfg/sdfg_utils'; import { traverseSDFGScopes } from '../utils/sdfg/traversal'; -import { SDFVSettings } from '../utils/sdfv_settings'; +import { SDFVSettingValT, SDFVSettings } from '../utils/sdfv_settings'; import { deepCopy, intersectRect, showErrorModal } from '../utils/utils'; import { CanvasManager } from './canvas_manager'; import { @@ -72,10 +72,10 @@ declare const canvas2pdf: any; // Some global functions and variables which are only accessible within VSCode: declare const vscode: any | null; -type SDFGElementGroup = ('states' | 'nodes' | 'edges' | 'isedges' | +export type SDFGElementGroup = ('states' | 'nodes' | 'edges' | 'isedges' | 'connectors' | 'controlFlowRegions' | 'controlFlowBlocks'); -interface SDFGElementInfo { +export interface SDFGElementInfo { sdfg: JsonSDFG, id: number, cfgId: number, @@ -84,7 +84,7 @@ interface SDFGElementInfo { conntype?: string, } -interface GraphElementInfo extends SDFGElementInfo { +export interface GraphElementInfo extends SDFGElementInfo { graph: DagreGraph, obj?: SDFGElement, } @@ -150,9 +150,7 @@ export interface SDFGRendererEvent { 'symbol_definition_changed': (symbol: string, definition?: number) => void; 'active_overlays_changed': () => void; 'backend_data_requested': (type: string, overlay: string) => void; - 'settings_changed': ( - settings: Record - ) => void; + 'settings_changed': (settings: Record) => void; } /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ @@ -880,13 +878,15 @@ export class SDFGRenderer extends EventEmitter { this.ctx = this.canvas.getContext('2d'); - // This setting decouples the canvas paint cycle from the main event loop. - // Not supported on Firefox, but can be enabled and Firefox will ignore it. - // No fps difference measured on the SDFV webclient, but the setting could - // become useful in the future in certain setups or situations. + // This setting decouples the canvas paint cycle from the main event + // loop. Not supported on Firefox, but can be enabled and Firefox will + // ignore it. No fps difference measured on the SDFV webclient, but the + // setting could become useful in the future in certain setups or + // situations. // this.ctx = this.canvas.getContext('2d', {desynchronized: true}); - - // WARNING: This setting will force CPU main thread rendering. Use for testing only. + + // WARNING: This setting will force CPU main thread rendering. Use for + // testing only. // this.ctx = this.canvas.getContext('2d', {willReadFrequently: true}); if (!this.ctx) { @@ -2066,7 +2066,7 @@ export class SDFGRenderer extends EventEmitter { // } public elementsInRect( x: number, y: number, w: number, h: number - ): { [key: string]: GraphElementInfo[] } { + ): Record { const elements: any = { states: [], nodes: [], @@ -2492,7 +2492,12 @@ export class SDFGRenderer extends EventEmitter { public find_elements_under_cursor( mouse_pos_x: number, mouse_pos_y: number - ): any { + ): { + total_elements: number, + elements: Record, + foreground_elem: SDFGElement | null, + foreground_connector: Connector | null, + } { // Find all elements under the cursor. const elements = this.elementsInRect(mouse_pos_x, mouse_pos_y, 0, 0); const clicked_states = elements.states; @@ -2526,7 +2531,7 @@ export class SDFGRenderer extends EventEmitter { const s = obj!.width * obj!.height; if (foreground_surface < 0 || s < foreground_surface) { foreground_surface = s; - foreground_elem = category[i].obj; + foreground_elem = category[i].obj ?? null; } } } @@ -2535,7 +2540,7 @@ export class SDFGRenderer extends EventEmitter { const s = c.obj!.width * c.obj!.height; if (foreground_surface < 0 || s < foreground_surface) { foreground_surface = s; - foreground_connector = c.obj; + foreground_connector = c.obj as Connector ?? null; } } @@ -3057,16 +3062,12 @@ export class SDFGRenderer extends EventEmitter { this.canvas.style.cursor = 'grab'; } else { // Hovering over an element while not in any specific mode. - if ((foreground_elem.data.state && - foreground_elem.data.state.attributes.is_collapsed) || - (foreground_elem.data.node && - foreground_elem.data.node.attributes.is_collapsed)) { - // This is a collapsed node or state, show with the - // cursor shape that this can be expanded. + // For collapsed nodes, show a cursor shape that indicates + // this can be expanded. + if (foreground_elem?.attributes().is_collapsed) this.canvas.style.cursor = 'alias'; - } else { + else this.canvas.style.cursor = 'pointer'; - } } } else { this.canvas.style.cursor = 'auto'; @@ -3076,20 +3077,21 @@ export class SDFGRenderer extends EventEmitter { this.tooltip = null; // Add newly hovered elements under the mouse cursor to the cache. - // The cache then contains hovered elements of the previous frame that are highlighted - // and the newly hovered elements of the current frame that need to be highlighted. - for (const [name, element_type_array] of Object.entries>(elements)) { - for (let j = 0; j < element_type_array.length; ++j) { - const hovered_element = element_type_array[j].obj; - if (hovered_element !== undefined) { + // The cache then contains hovered elements of the previous frame that + // are highlighted and the newly hovered elements of the current frame + // that need to be highlighted. + for (const elInfo of Object.entries(elements)) { + const elemTypeArray = elInfo[1]; + for (let j = 0; j < elemTypeArray.length; ++j) { + const hovered_element = elemTypeArray[j].obj; + if (hovered_element !== undefined) this.hovered_elements_cache.add(hovered_element); - } } } - // New cache for the next frame, which only contains the hovered/highlighted - // elements of the current frame. - const new_hovered_elements_cache: Set = new Set(); + // New cache for the next frame, which only contains the + // hovered/highlighted elements of the current frame. + const new_hovered_elements_cache = new Set(); // Only do highlighting re-computation if view is close enough to // actually see the highlights. Done by points-per-pixel metric using @@ -3105,7 +3107,6 @@ export class SDFGRenderer extends EventEmitter { // Mark hovered and highlighted elements. for (const obj of this.hovered_elements_cache) { - const intersected = obj.intersect( this.mousepos!.x, this.mousepos!.y, 0, 0 ); @@ -3127,9 +3128,8 @@ export class SDFGRenderer extends EventEmitter { // If element is hovered in the current frame then // remember it for the next frame. - if (obj.hovered) { + if (obj.hovered) new_hovered_elements_cache.add(obj); - } // Highlight all edges of the memlet tree if (obj instanceof Edge && obj.parent_id !== null) { @@ -3375,7 +3375,7 @@ export class SDFGRenderer extends EventEmitter { } } - // Set the cache for the next frame to only contain + // Set the cache for the next frame to only contain // the currently hovered/highlighted elements. this.hovered_elements_cache = new_hovered_elements_cache; @@ -3579,7 +3579,9 @@ export class SDFGRenderer extends EventEmitter { if (evtype === 'contextmenu') { if (this.mouse_mode === 'move') { let elements_to_reset = [foreground_elem]; - if (this.selected_elements.includes(foreground_elem)) + if (foreground_elem && this.selected_elements.includes( + foreground_elem + )) elements_to_reset = this.selected_elements; let element_moved = false; @@ -4286,11 +4288,11 @@ function relayoutSDFGState( const g: DagreGraph = new dagre.graphlib.Graph({ multigraph: true }); // Set layout options and a simpler algorithm for large graphs. - const layoutOptions: any = { ranksep: SDFV.RANKSEP }; + const layoutOptions: any = { ranksep: SDFVSettings.ranksep }; if (state.nodes.length >= 1000) layoutOptions.ranker = 'longest-path'; - layoutOptions.nodesep = SDFV.NODESEP; + layoutOptions.nodesep = SDFVSettings.nodesep; g.setGraph(layoutOptions); // Set an object for the graph label. diff --git a/src/renderer/renderer_elements.ts b/src/renderer/renderer_elements.ts index 57de760b..43a16960 100644 --- a/src/renderer/renderer_elements.ts +++ b/src/renderer/renderer_elements.ts @@ -88,7 +88,7 @@ function draw_summary_symbol( ctx.lineTo(left_arrow_x, arrow_end_y + 2); ctx.closePath(); ctx.fill(); - + ctx.beginPath(); ctx.moveTo(righ_arrow_x, arrow_end_y + 2); ctx.lineTo(righ_arrow_x - 2, arrow_end_y); @@ -2183,8 +2183,8 @@ export class Tasklet extends SDFGNode { public text_for_find(): string { // Include code when searching - const code = this.attributes().code.string_data; - return this.label() + " " + code; + const code = this.attributes().code.string_data; + return this.label() + ' ' + code; } private highlightedCode: TaskletCodeToken[][] = []; diff --git a/src/sdfv.ts b/src/sdfv.ts index 25b14836..d0ada346 100644 --- a/src/sdfv.ts +++ b/src/sdfv.ts @@ -71,12 +71,6 @@ export class SDFV { public static DEFAULT_MAX_FONTSIZE: number = 20; // 20 public static DEFAULT_FAR_FONT_MULTIPLIER: number = 16; // 16 - // Dagre layout options. - // Separation between ranks (vertically) in pixels. - public static RANKSEP: number = 70; // Dagre default: 50, Before update: 30 - // Separation between nodes (horizontally) in pixels. - public static NODESEP: number = 20; // Dagre default: 50, Before update: 50 - protected renderer: SDFGRenderer | null = null; protected localViewRenderer: LViewRenderer | null = null; diff --git a/src/utils/sdfv_settings.ts b/src/utils/sdfv_settings.ts index acc7c94f..5c1d1df3 100644 --- a/src/utils/sdfv_settings.ts +++ b/src/utils/sdfv_settings.ts @@ -7,6 +7,14 @@ import { } from 'bootstrap'; import { SDFGRenderer } from '../renderer/renderer'; +type RangeT = { + value: number, + min?: number, + max?: number, +}; + +export type SDFVSettingValT = boolean | string | number | RangeT; + export class SDFVSettings { private static readonly INSTANCE: SDFVSettings = new SDFVSettings(); @@ -22,7 +30,7 @@ export class SDFVSettings { private modal: Modal | null = null; private renderer: SDFGRenderer | null = null; - private readonly settingsDict: Record = { + private readonly settingsDict: Record = { // User modifiable settings fields. 'minimap': true, 'alwaysOnISEdgeLabels': true, @@ -36,10 +44,53 @@ export class SDFVSettings { 'useVerticalScrollNavigation': false, 'adaptiveContentHiding': true, 'curvedEdges': true, + 'ranksep': { + value: 30, + min: 10, + max: 100, + }, + 'nodesep': { + value: 50, + min: 0, + max: 100, + }, // Hidden settings fields. 'toolbar': true, }; + private addSlider( + root: JQuery, label: string, valueKey: string, + requiresRelayout: boolean = false, customCallback?: CallableFunction + ): void { + const settingRow = $('
', { + class: 'row', + }).appendTo(root); + const settingContainer = $('
', { + class: 'col-12', + }).appendTo(settingRow); + $('