From ff6b86a63bacd2ee5b0088ad81caf0c32f71dc33 Mon Sep 17 00:00:00 2001 From: Shreeraj Jadhav Date: Mon, 27 Nov 2023 12:14:17 -0500 Subject: [PATCH 001/113] fix(sidebar): show toggle sidebar button by default --- src/components/App.vue | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/App.vue b/src/components/App.vue index 748022779..dcde1c04e 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -3,11 +3,7 @@ + + mdi-alert + Convert to Segment Group + + Must load a background image before converting + + Delete diff --git a/src/components/SegmentGroupControls.vue b/src/components/SegmentGroupControls.vue index cfeebec56..56e77597b 100644 --- a/src/components/SegmentGroupControls.vue +++ b/src/components/SegmentGroupControls.vue @@ -1,6 +1,9 @@ From 6f14bed4ed701cdaf11df8ac32a4f1c2b8607538 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 23:55:17 +0000 Subject: [PATCH 017/113] chore(deps): bump aiohttp from 3.8.5 to 3.9.2 in /server Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.5 to 3.9.2. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.8.5...v3.9.2) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- server/poetry.lock | 176 ++++++++++++++++++++---------------------- server/pyproject.toml | 2 +- 2 files changed, 83 insertions(+), 95 deletions(-) diff --git a/server/poetry.lock b/server/poetry.lock index e011ca61f..7a9377970 100644 --- a/server/poetry.lock +++ b/server/poetry.lock @@ -1,112 +1,100 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "aiohttp" -version = "3.8.5" +version = "3.9.2" description = "Async http client/server framework (asyncio)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "aiohttp-3.8.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a94159871304770da4dd371f4291b20cac04e8c94f11bdea1c3478e557fbe0d8"}, - {file = "aiohttp-3.8.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:13bf85afc99ce6f9ee3567b04501f18f9f8dbbb2ea11ed1a2e079670403a7c84"}, - {file = "aiohttp-3.8.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2ce2ac5708501afc4847221a521f7e4b245abf5178cf5ddae9d5b3856ddb2f3a"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:96943e5dcc37a6529d18766597c491798b7eb7a61d48878611298afc1fca946c"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2ad5c3c4590bb3cc28b4382f031f3783f25ec223557124c68754a2231d989e2b"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0c413c633d0512df4dc7fd2373ec06cc6a815b7b6d6c2f208ada7e9e93a5061d"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:df72ac063b97837a80d80dec8d54c241af059cc9bb42c4de68bd5b61ceb37caa"}, - {file = "aiohttp-3.8.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c48c5c0271149cfe467c0ff8eb941279fd6e3f65c9a388c984e0e6cf57538e14"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:368a42363c4d70ab52c2c6420a57f190ed3dfaca6a1b19afda8165ee16416a82"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7607ec3ce4993464368505888af5beb446845a014bc676d349efec0e05085905"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:0d21c684808288a98914e5aaf2a7c6a3179d4df11d249799c32d1808e79503b5"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:312fcfbacc7880a8da0ae8b6abc6cc7d752e9caa0051a53d217a650b25e9a691"}, - {file = "aiohttp-3.8.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad093e823df03bb3fd37e7dec9d4670c34f9e24aeace76808fc20a507cace825"}, - {file = "aiohttp-3.8.5-cp310-cp310-win32.whl", hash = "sha256:33279701c04351a2914e1100b62b2a7fdb9a25995c4a104259f9a5ead7ed4802"}, - {file = "aiohttp-3.8.5-cp310-cp310-win_amd64.whl", hash = "sha256:6e4a280e4b975a2e7745573e3fc9c9ba0d1194a3738ce1cbaa80626cc9b4f4df"}, - {file = "aiohttp-3.8.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ae871a964e1987a943d83d6709d20ec6103ca1eaf52f7e0d36ee1b5bebb8b9b9"}, - {file = "aiohttp-3.8.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:461908b2578955045efde733719d62f2b649c404189a09a632d245b445c9c975"}, - {file = "aiohttp-3.8.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:72a860c215e26192379f57cae5ab12b168b75db8271f111019509a1196dfc780"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc14be025665dba6202b6a71cfcdb53210cc498e50068bc088076624471f8bb9"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8af740fc2711ad85f1a5c034a435782fbd5b5f8314c9a3ef071424a8158d7f6b"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:841cd8233cbd2111a0ef0a522ce016357c5e3aff8a8ce92bcfa14cef890d698f"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ed1c46fb119f1b59304b5ec89f834f07124cd23ae5b74288e364477641060ff"}, - {file = "aiohttp-3.8.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84f8ae3e09a34f35c18fa57f015cc394bd1389bce02503fb30c394d04ee6b938"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:62360cb771707cb70a6fd114b9871d20d7dd2163a0feafe43fd115cfe4fe845e"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:23fb25a9f0a1ca1f24c0a371523546366bb642397c94ab45ad3aedf2941cec6a"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:b0ba0d15164eae3d878260d4c4df859bbdc6466e9e6689c344a13334f988bb53"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:5d20003b635fc6ae3f96d7260281dfaf1894fc3aa24d1888a9b2628e97c241e5"}, - {file = "aiohttp-3.8.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0175d745d9e85c40dcc51c8f88c74bfbaef9e7afeeeb9d03c37977270303064c"}, - {file = "aiohttp-3.8.5-cp311-cp311-win32.whl", hash = "sha256:2e1b1e51b0774408f091d268648e3d57f7260c1682e7d3a63cb00d22d71bb945"}, - {file = "aiohttp-3.8.5-cp311-cp311-win_amd64.whl", hash = "sha256:043d2299f6dfdc92f0ac5e995dfc56668e1587cea7f9aa9d8a78a1b6554e5755"}, - {file = "aiohttp-3.8.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cae533195e8122584ec87531d6df000ad07737eaa3c81209e85c928854d2195c"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f21e83f355643c345177a5d1d8079f9f28b5133bcd154193b799d380331d5d3"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a7a75ef35f2df54ad55dbf4b73fe1da96f370e51b10c91f08b19603c64004acc"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2e2e9839e14dd5308ee773c97115f1e0a1cb1d75cbeeee9f33824fa5144c7634"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c44e65da1de4403d0576473e2344828ef9c4c6244d65cf4b75549bb46d40b8dd"}, - {file = "aiohttp-3.8.5-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78d847e4cde6ecc19125ccbc9bfac4a7ab37c234dd88fbb3c5c524e8e14da543"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:c7a815258e5895d8900aec4454f38dca9aed71085f227537208057853f9d13f2"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:8b929b9bd7cd7c3939f8bcfffa92fae7480bd1aa425279d51a89327d600c704d"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:5db3a5b833764280ed7618393832e0853e40f3d3e9aa128ac0ba0f8278d08649"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:a0215ce6041d501f3155dc219712bc41252d0ab76474615b9700d63d4d9292af"}, - {file = "aiohttp-3.8.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:fd1ed388ea7fbed22c4968dd64bab0198de60750a25fe8c0c9d4bef5abe13824"}, - {file = "aiohttp-3.8.5-cp36-cp36m-win32.whl", hash = "sha256:6e6783bcc45f397fdebc118d772103d751b54cddf5b60fbcc958382d7dd64f3e"}, - {file = "aiohttp-3.8.5-cp36-cp36m-win_amd64.whl", hash = "sha256:b5411d82cddd212644cf9360879eb5080f0d5f7d809d03262c50dad02f01421a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:01d4c0c874aa4ddfb8098e85d10b5e875a70adc63db91f1ae65a4b04d3344cda"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5980a746d547a6ba173fd5ee85ce9077e72d118758db05d229044b469d9029a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2a482e6da906d5e6e653be079b29bc173a48e381600161c9932d89dfae5942ef"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80bd372b8d0715c66c974cf57fe363621a02f359f1ec81cba97366948c7fc873"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1161b345c0a444ebcf46bf0a740ba5dcf50612fd3d0528883fdc0eff578006a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd56db019015b6acfaaf92e1ac40eb8434847d9bf88b4be4efe5bfd260aee692"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:153c2549f6c004d2754cc60603d4668899c9895b8a89397444a9c4efa282aaf4"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4a01951fabc4ce26ab791da5f3f24dca6d9a6f24121746eb19756416ff2d881b"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bfb9162dcf01f615462b995a516ba03e769de0789de1cadc0f916265c257e5d8"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:7dde0009408969a43b04c16cbbe252c4f5ef4574ac226bc8815cd7342d2028b6"}, - {file = "aiohttp-3.8.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:4149d34c32f9638f38f544b3977a4c24052042affa895352d3636fa8bffd030a"}, - {file = "aiohttp-3.8.5-cp37-cp37m-win32.whl", hash = "sha256:68c5a82c8779bdfc6367c967a4a1b2aa52cd3595388bf5961a62158ee8a59e22"}, - {file = "aiohttp-3.8.5-cp37-cp37m-win_amd64.whl", hash = "sha256:2cf57fb50be5f52bda004b8893e63b48530ed9f0d6c96c84620dc92fe3cd9b9d"}, - {file = "aiohttp-3.8.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:eca4bf3734c541dc4f374ad6010a68ff6c6748f00451707f39857f429ca36ced"}, - {file = "aiohttp-3.8.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1274477e4c71ce8cfe6c1ec2f806d57c015ebf84d83373676036e256bc55d690"}, - {file = "aiohttp-3.8.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:28c543e54710d6158fc6f439296c7865b29e0b616629767e685a7185fab4a6b9"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:910bec0c49637d213f5d9877105d26e0c4a4de2f8b1b29405ff37e9fc0ad52b8"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5443910d662db951b2e58eb70b0fbe6b6e2ae613477129a5805d0b66c54b6cb7"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2e460be6978fc24e3df83193dc0cc4de46c9909ed92dd47d349a452ef49325b7"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb1558def481d84f03b45888473fc5a1f35747b5f334ef4e7a571bc0dfcb11f8"}, - {file = "aiohttp-3.8.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:34dd0c107799dcbbf7d48b53be761a013c0adf5571bf50c4ecad5643fe9cfcd0"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:aa1990247f02a54185dc0dff92a6904521172a22664c863a03ff64c42f9b5410"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0e584a10f204a617d71d359fe383406305a4b595b333721fa50b867b4a0a1548"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:a3cf433f127efa43fee6b90ea4c6edf6c4a17109d1d037d1a52abec84d8f2e42"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:c11f5b099adafb18e65c2c997d57108b5bbeaa9eeee64a84302c0978b1ec948b"}, - {file = "aiohttp-3.8.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:84de26ddf621d7ac4c975dbea4c945860e08cccde492269db4e1538a6a6f3c35"}, - {file = "aiohttp-3.8.5-cp38-cp38-win32.whl", hash = "sha256:ab88bafedc57dd0aab55fa728ea10c1911f7e4d8b43e1d838a1739f33712921c"}, - {file = "aiohttp-3.8.5-cp38-cp38-win_amd64.whl", hash = "sha256:5798a9aad1879f626589f3df0f8b79b3608a92e9beab10e5fda02c8a2c60db2e"}, - {file = "aiohttp-3.8.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a6ce61195c6a19c785df04e71a4537e29eaa2c50fe745b732aa937c0c77169f3"}, - {file = "aiohttp-3.8.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:773dd01706d4db536335fcfae6ea2440a70ceb03dd3e7378f3e815b03c97ab51"}, - {file = "aiohttp-3.8.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f83a552443a526ea38d064588613aca983d0ee0038801bc93c0c916428310c28"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f7372f7341fcc16f57b2caded43e81ddd18df53320b6f9f042acad41f8e049a"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ea353162f249c8097ea63c2169dd1aa55de1e8fecbe63412a9bc50816e87b761"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5d47ae48db0b2dcf70bc8a3bc72b3de86e2a590fc299fdbbb15af320d2659de"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d827176898a2b0b09694fbd1088c7a31836d1a505c243811c87ae53a3f6273c1"}, - {file = "aiohttp-3.8.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3562b06567c06439d8b447037bb655ef69786c590b1de86c7ab81efe1c9c15d8"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4e874cbf8caf8959d2adf572a78bba17cb0e9d7e51bb83d86a3697b686a0ab4d"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6809a00deaf3810e38c628e9a33271892f815b853605a936e2e9e5129762356c"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:33776e945d89b29251b33a7e7d006ce86447b2cfd66db5e5ded4e5cd0340585c"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:eaeed7abfb5d64c539e2db173f63631455f1196c37d9d8d873fc316470dfbacd"}, - {file = "aiohttp-3.8.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:e91d635961bec2d8f19dfeb41a539eb94bd073f075ca6dae6c8dc0ee89ad6f91"}, - {file = "aiohttp-3.8.5-cp39-cp39-win32.whl", hash = "sha256:00ad4b6f185ec67f3e6562e8a1d2b69660be43070bd0ef6fcec5211154c7df67"}, - {file = "aiohttp-3.8.5-cp39-cp39-win_amd64.whl", hash = "sha256:c0a9034379a37ae42dea7ac1e048352d96286626251862e448933c0f59cbd79c"}, - {file = "aiohttp-3.8.5.tar.gz", hash = "sha256:b9552ec52cc147dbf1944ac7ac98af7602e51ea2dcd076ed194ca3c0d1c7d0bc"}, + {file = "aiohttp-3.9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:772fbe371788e61c58d6d3d904268e48a594ba866804d08c995ad71b144f94cb"}, + {file = "aiohttp-3.9.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:edd4f1af2253f227ae311ab3d403d0c506c9b4410c7fc8d9573dec6d9740369f"}, + {file = "aiohttp-3.9.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cfee9287778399fdef6f8a11c9e425e1cb13cc9920fd3a3df8f122500978292b"}, + {file = "aiohttp-3.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cc158466f6a980a6095ee55174d1de5730ad7dec251be655d9a6a9dd7ea1ff9"}, + {file = "aiohttp-3.9.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:54ec82f45d57c9a65a1ead3953b51c704f9587440e6682f689da97f3e8defa35"}, + {file = "aiohttp-3.9.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:abeb813a18eb387f0d835ef51f88568540ad0325807a77a6e501fed4610f864e"}, + {file = "aiohttp-3.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc91d07280d7d169f3a0f9179d8babd0ee05c79d4d891447629ff0d7d8089ec2"}, + {file = "aiohttp-3.9.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b65e861f4bebfb660f7f0f40fa3eb9f2ab9af10647d05dac824390e7af8f75b7"}, + {file = "aiohttp-3.9.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:04fd8ffd2be73d42bcf55fd78cde7958eeee6d4d8f73c3846b7cba491ecdb570"}, + {file = "aiohttp-3.9.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3d8d962b439a859b3ded9a1e111a4615357b01620a546bc601f25b0211f2da81"}, + {file = "aiohttp-3.9.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:8ceb658afd12b27552597cf9a65d9807d58aef45adbb58616cdd5ad4c258c39e"}, + {file = "aiohttp-3.9.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:0e4ee4df741670560b1bc393672035418bf9063718fee05e1796bf867e995fad"}, + {file = "aiohttp-3.9.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2dec87a556f300d3211decf018bfd263424f0690fcca00de94a837949fbcea02"}, + {file = "aiohttp-3.9.2-cp310-cp310-win32.whl", hash = "sha256:3e1a800f988ce7c4917f34096f81585a73dbf65b5c39618b37926b1238cf9bc4"}, + {file = "aiohttp-3.9.2-cp310-cp310-win_amd64.whl", hash = "sha256:ea510718a41b95c236c992b89fdfc3d04cc7ca60281f93aaada497c2b4e05c46"}, + {file = "aiohttp-3.9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6aaa6f99256dd1b5756a50891a20f0d252bd7bdb0854c5d440edab4495c9f973"}, + {file = "aiohttp-3.9.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a27d8c70ad87bcfce2e97488652075a9bdd5b70093f50b10ae051dfe5e6baf37"}, + {file = "aiohttp-3.9.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:54287bcb74d21715ac8382e9de146d9442b5f133d9babb7e5d9e453faadd005e"}, + {file = "aiohttp-3.9.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bb3d05569aa83011fcb346b5266e00b04180105fcacc63743fc2e4a1862a891"}, + {file = "aiohttp-3.9.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c8534e7d69bb8e8d134fe2be9890d1b863518582f30c9874ed7ed12e48abe3c4"}, + {file = "aiohttp-3.9.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4bd9d5b989d57b41e4ff56ab250c5ddf259f32db17159cce630fd543376bd96b"}, + {file = "aiohttp-3.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa6904088e6642609981f919ba775838ebf7df7fe64998b1a954fb411ffb4663"}, + {file = "aiohttp-3.9.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bda42eb410be91b349fb4ee3a23a30ee301c391e503996a638d05659d76ea4c2"}, + {file = "aiohttp-3.9.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:193cc1ccd69d819562cc7f345c815a6fc51d223b2ef22f23c1a0f67a88de9a72"}, + {file = "aiohttp-3.9.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b9f1cb839b621f84a5b006848e336cf1496688059d2408e617af33e3470ba204"}, + {file = "aiohttp-3.9.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:d22a0931848b8c7a023c695fa2057c6aaac19085f257d48baa24455e67df97ec"}, + {file = "aiohttp-3.9.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4112d8ba61fbd0abd5d43a9cb312214565b446d926e282a6d7da3f5a5aa71d36"}, + {file = "aiohttp-3.9.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c4ad4241b52bb2eb7a4d2bde060d31c2b255b8c6597dd8deac2f039168d14fd7"}, + {file = "aiohttp-3.9.2-cp311-cp311-win32.whl", hash = "sha256:ee2661a3f5b529f4fc8a8ffee9f736ae054adfb353a0d2f78218be90617194b3"}, + {file = "aiohttp-3.9.2-cp311-cp311-win_amd64.whl", hash = "sha256:4deae2c165a5db1ed97df2868ef31ca3cc999988812e82386d22937d9d6fed52"}, + {file = "aiohttp-3.9.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:6f4cdba12539215aaecf3c310ce9d067b0081a0795dd8a8805fdb67a65c0572a"}, + {file = "aiohttp-3.9.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:84e843b33d5460a5c501c05539809ff3aee07436296ff9fbc4d327e32aa3a326"}, + {file = "aiohttp-3.9.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8008d0f451d66140a5aa1c17e3eedc9d56e14207568cd42072c9d6b92bf19b52"}, + {file = "aiohttp-3.9.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:61c47ab8ef629793c086378b1df93d18438612d3ed60dca76c3422f4fbafa792"}, + {file = "aiohttp-3.9.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc71f748e12284312f140eaa6599a520389273174b42c345d13c7e07792f4f57"}, + {file = "aiohttp-3.9.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a1c3a4d0ab2f75f22ec80bca62385db2e8810ee12efa8c9e92efea45c1849133"}, + {file = "aiohttp-3.9.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a87aa0b13bbee025faa59fa58861303c2b064b9855d4c0e45ec70182bbeba1b"}, + {file = "aiohttp-3.9.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e2cc0d04688b9f4a7854c56c18aa7af9e5b0a87a28f934e2e596ba7e14783192"}, + {file = "aiohttp-3.9.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1956e3ac376b1711c1533266dec4efd485f821d84c13ce1217d53e42c9e65f08"}, + {file = "aiohttp-3.9.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:114da29f39eccd71b93a0fcacff178749a5c3559009b4a4498c2c173a6d74dff"}, + {file = "aiohttp-3.9.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:3f17999ae3927d8a9a823a1283b201344a0627272f92d4f3e3a4efe276972fe8"}, + {file = "aiohttp-3.9.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:f31df6a32217a34ae2f813b152a6f348154f948c83213b690e59d9e84020925c"}, + {file = "aiohttp-3.9.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:7a75307ffe31329928a8d47eae0692192327c599113d41b278d4c12b54e1bd11"}, + {file = "aiohttp-3.9.2-cp312-cp312-win32.whl", hash = "sha256:972b63d589ff8f305463593050a31b5ce91638918da38139b9d8deaba9e0fed7"}, + {file = "aiohttp-3.9.2-cp312-cp312-win_amd64.whl", hash = "sha256:200dc0246f0cb5405c80d18ac905c8350179c063ea1587580e3335bfc243ba6a"}, + {file = "aiohttp-3.9.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:158564d0d1020e0d3fe919a81d97aadad35171e13e7b425b244ad4337fc6793a"}, + {file = "aiohttp-3.9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:da1346cd0ccb395f0ed16b113ebb626fa43b7b07fd7344fce33e7a4f04a8897a"}, + {file = "aiohttp-3.9.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:eaa9256de26ea0334ffa25f1913ae15a51e35c529a1ed9af8e6286dd44312554"}, + {file = "aiohttp-3.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1543e7fb00214fb4ccead42e6a7d86f3bb7c34751ec7c605cca7388e525fd0b4"}, + {file = "aiohttp-3.9.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:186e94570433a004e05f31f632726ae0f2c9dee4762a9ce915769ce9c0a23d89"}, + {file = "aiohttp-3.9.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d52d20832ac1560f4510d68e7ba8befbc801a2b77df12bd0cd2bcf3b049e52a4"}, + {file = "aiohttp-3.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c45e4e815ac6af3b72ca2bde9b608d2571737bb1e2d42299fc1ffdf60f6f9a1"}, + {file = "aiohttp-3.9.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aa906b9bdfd4a7972dd0628dbbd6413d2062df5b431194486a78f0d2ae87bd55"}, + {file = "aiohttp-3.9.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:68bbee9e17d66f17bb0010aa15a22c6eb28583edcc8b3212e2b8e3f77f3ebe2a"}, + {file = "aiohttp-3.9.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4c189b64bd6d9a403a1a3f86a3ab3acbc3dc41a68f73a268a4f683f89a4dec1f"}, + {file = "aiohttp-3.9.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:8a7876f794523123bca6d44bfecd89c9fec9ec897a25f3dd202ee7fc5c6525b7"}, + {file = "aiohttp-3.9.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:d23fba734e3dd7b1d679b9473129cd52e4ec0e65a4512b488981a56420e708db"}, + {file = "aiohttp-3.9.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b141753be581fab842a25cb319f79536d19c2a51995d7d8b29ee290169868eab"}, + {file = "aiohttp-3.9.2-cp38-cp38-win32.whl", hash = "sha256:103daf41ff3b53ba6fa09ad410793e2e76c9d0269151812e5aba4b9dd674a7e8"}, + {file = "aiohttp-3.9.2-cp38-cp38-win_amd64.whl", hash = "sha256:328918a6c2835861ff7afa8c6d2c70c35fdaf996205d5932351bdd952f33fa2f"}, + {file = "aiohttp-3.9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5264d7327c9464786f74e4ec9342afbbb6ee70dfbb2ec9e3dfce7a54c8043aa3"}, + {file = "aiohttp-3.9.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:07205ae0015e05c78b3288c1517afa000823a678a41594b3fdc870878d645305"}, + {file = "aiohttp-3.9.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ae0a1e638cffc3ec4d4784b8b4fd1cf28968febc4bd2718ffa25b99b96a741bd"}, + {file = "aiohttp-3.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d43302a30ba1166325974858e6ef31727a23bdd12db40e725bec0f759abce505"}, + {file = "aiohttp-3.9.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:16a967685907003765855999af11a79b24e70b34dc710f77a38d21cd9fc4f5fe"}, + {file = "aiohttp-3.9.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6fa3ee92cd441d5c2d07ca88d7a9cef50f7ec975f0117cd0c62018022a184308"}, + {file = "aiohttp-3.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b500c5ad9c07639d48615a770f49618130e61be36608fc9bc2d9bae31732b8f"}, + {file = "aiohttp-3.9.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c07327b368745b1ce2393ae9e1aafed7073d9199e1dcba14e035cc646c7941bf"}, + {file = "aiohttp-3.9.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:cc7d6502c23a0ec109687bf31909b3fb7b196faf198f8cff68c81b49eb316ea9"}, + {file = "aiohttp-3.9.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:07be2be7071723c3509ab5c08108d3a74f2181d4964e869f2504aaab68f8d3e8"}, + {file = "aiohttp-3.9.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:122468f6fee5fcbe67cb07014a08c195b3d4c41ff71e7b5160a7bcc41d585a5f"}, + {file = "aiohttp-3.9.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:00a9abcea793c81e7f8778ca195a1714a64f6d7436c4c0bb168ad2a212627000"}, + {file = "aiohttp-3.9.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7a9825fdd64ecac5c670234d80bb52bdcaa4139d1f839165f548208b3779c6c6"}, + {file = "aiohttp-3.9.2-cp39-cp39-win32.whl", hash = "sha256:5422cd9a4a00f24c7244e1b15aa9b87935c85fb6a00c8ac9b2527b38627a9211"}, + {file = "aiohttp-3.9.2-cp39-cp39-win_amd64.whl", hash = "sha256:7d579dcd5d82a86a46f725458418458fa43686f6a7b252f2966d359033ffc8ab"}, + {file = "aiohttp-3.9.2.tar.gz", hash = "sha256:b0ad0a5e86ce73f5368a164c10ada10504bf91869c05ab75d982c6048217fbf7"}, ] [package.dependencies] aiosignal = ">=1.1.2" -async-timeout = ">=4.0.0a3,<5.0" +async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} attrs = ">=17.3.0" -charset-normalizer = ">=2.0,<4.0" frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" yarl = ">=1.0,<2.0" [package.extras] -speedups = ["Brotli", "aiodns", "cchardet"] +speedups = ["Brotli", "aiodns", "brotlicffi"] [[package]] name = "aiosignal" @@ -1471,4 +1459,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.8.1" -content-hash = "3c3ec72a728ca4a11e09432cfeda3ab8945b04f25ceb7ed5c6321ec0db7f8e65" +content-hash = "d8d247ce731060f2b40003013d35471122c98667453b184631dc13d08830ba4b" diff --git a/server/pyproject.toml b/server/pyproject.toml index 6dc322a14..025cc05b1 100644 --- a/server/pyproject.toml +++ b/server/pyproject.toml @@ -12,7 +12,7 @@ black = "^23.1.0" flake8 = "^6.0.0" pytest = "^7.2.1" numpy = "^1.24.1" -aiohttp = "^3.8.5" +aiohttp = "^3.9.2" python-socketio = "^5.8.0" charset-normalizer = "^3.1.0" From cd4ee5c9b89146878bd80ff1f64c833079329e17 Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 31 Jan 2024 10:57:12 -0500 Subject: [PATCH 018/113] fix(proxyManager): cleaner API requireProxyManager replaces withProxyManager, explicitly throwing an error if the proxy manager is unavailable. --- src/composables/onProxyManagerEvent.ts | 51 ++++++++++++++------------ src/composables/proxyManager.ts | 21 ++++++++--- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/src/composables/onProxyManagerEvent.ts b/src/composables/onProxyManagerEvent.ts index 9e8267ee8..111fd355d 100644 --- a/src/composables/onProxyManagerEvent.ts +++ b/src/composables/onProxyManagerEvent.ts @@ -1,7 +1,7 @@ import type { vtkSubscription } from '@kitware/vtk.js/interfaces'; import { VtkProxy } from '@kitware/vtk.js/macros'; import { onBeforeUnmount } from 'vue'; -import { withProxyManager } from './proxyManager'; +import { requireProxyManager } from './proxyManager'; export enum ProxyManagerEvent { ProxyCreated, @@ -15,36 +15,39 @@ export function onProxyManagerEvent( cb: (proxyID: string, obj: VtkProxy | null) => void ) { const subs: vtkSubscription[] = []; + const proxyManager = requireProxyManager(); - withProxyManager((proxyManager) => { - const proxySubs = Object.create(null); + const proxySubs: Record = Object.create(null); - subs.push( - proxyManager.onProxyRegistrationChange((info) => { - const { action, proxyId, proxy } = info; - if (action === 'register') { - if (event === ProxyManagerEvent.ProxyCreated) { - cb(proxyId, proxy); - } - if (event === ProxyManagerEvent.ProxyModified) { - proxySubs[proxyId] = proxy.onModified(() => cb(proxyId, proxy)); - } - } else if (action === 'unregister') { - if (proxyId in proxySubs) { - proxySubs[proxyId].unsubscribe(); - delete proxySubs[proxyId]; - } - if (event === ProxyManagerEvent.ProxyDeleted) { - cb(proxyId, null); - } + subs.push( + proxyManager.onProxyRegistrationChange((info) => { + const { action, proxyId, proxy } = info; + if (action === 'register') { + if (event === ProxyManagerEvent.ProxyCreated) { + cb(proxyId, proxy); } - }) - ); - }); + if (event === ProxyManagerEvent.ProxyModified) { + proxySubs[proxyId] = proxy.onModified(() => cb(proxyId, proxy)); + } + } else if (action === 'unregister') { + if (proxyId in proxySubs) { + proxySubs[proxyId].unsubscribe(); + delete proxySubs[proxyId]; + } + if (event === ProxyManagerEvent.ProxyDeleted) { + cb(proxyId, null); + } + } + }) + ); onBeforeUnmount(() => { while (subs.length) { subs.pop()!.unsubscribe(); } + Object.entries(proxySubs).forEach(([id, sub]) => { + sub.unsubscribe(); + delete proxySubs[id]; + }); }); } diff --git a/src/composables/proxyManager.ts b/src/composables/proxyManager.ts index 3a0cf089f..0a9a24540 100644 --- a/src/composables/proxyManager.ts +++ b/src/composables/proxyManager.ts @@ -1,13 +1,22 @@ import { inject } from 'vue'; import vtkProxyManager from '@kitware/vtk.js/Proxy/Core/ProxyManager'; -const defaultKey = 'ProxyManager'; +export const PROXYMANAGER_INJECT_KEY = Symbol('ProxyManager'); -export function withProxyManager(cb: (pxm: vtkProxyManager) => void) { - const pxm = inject('ProxyManager'); - return pxm ? cb(pxm) : null; +/** + * Injects a provided proxy manager instance if available. + */ +export function useProxyManager(): vtkProxyManager | undefined { + return inject(PROXYMANAGER_INJECT_KEY); } -export function useProxyManager(key = defaultKey) { - return inject(key ?? defaultKey); +/** + * Injects a provided proxy manager instance. + * + * Throws an error if no proxy manager is available. + */ +export function requireProxyManager() { + const pxm = useProxyManager(); + if (!pxm) throw new Error('No proxy manager provided'); + return pxm; } From e88e377f0a65c2708b084ecccb67dd3b49be8edc Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 31 Jan 2024 11:21:40 -0500 Subject: [PATCH 019/113] fix(ViewProxy): drop delayedRender - Improve readability for renderLater - Drop the delayed render parameter for publicAPI.render --- src/utils/batchForNextTask.ts | 17 +++++++++++++++++ src/vtk/LPSView3DProxy/index.js | 29 +++++++++++------------------ 2 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 src/utils/batchForNextTask.ts diff --git a/src/utils/batchForNextTask.ts b/src/utils/batchForNextTask.ts new file mode 100644 index 000000000..a1910173c --- /dev/null +++ b/src/utils/batchForNextTask.ts @@ -0,0 +1,17 @@ +/** + * Batches a function for the next JS task. + * + * Returns a function that wraps the given callback. + * @param fn + * @returns + */ +export function batchForNextTask(fn: () => void) { + let timeout: NodeJS.Timeout | null = null; + return () => { + if (timeout != null) return; + timeout = setTimeout(() => { + timeout = null; + fn(); + }, 0); + }; +} diff --git a/src/vtk/LPSView3DProxy/index.js b/src/vtk/LPSView3DProxy/index.js index 879185fb6..a1347bd5d 100644 --- a/src/vtk/LPSView3DProxy/index.js +++ b/src/vtk/LPSView3DProxy/index.js @@ -1,10 +1,9 @@ import { vec3 } from 'gl-matrix'; import macro from '@kitware/vtk.js/macro'; import vtkViewProxy from '@kitware/vtk.js/Proxy/Core/ViewProxy'; +import { batchForNextTask } from '@/src/utils/batchForNextTask'; export function commonViewCustomizations(publicAPI, model) { - const delayedRender = macro.debounce(model.renderWindow.render, 5); - // override resize to avoid flickering from rendering later publicAPI.resize = () => { if (model.container) { @@ -17,29 +16,20 @@ export function commonViewCustomizations(publicAPI, model) { const height = Math.max(10, Math.floor(devicePixelRatio * dims.height)); model.renderWindow.getViews()[0].setSize(width, height); publicAPI.invokeResize({ width, height }); - publicAPI.render(true); + publicAPI.render(); } }; // override render to not reset camera - publicAPI.render = (blocking = true) => { + publicAPI.render = () => { model.orientationWidget.updateMarkerOrientation(); - if (blocking) { - model.renderWindow.render(); - } else { - delayedRender(); - } + model.renderWindow.render(); }; // provide a renderLater impl that schedules for the next js task - let timeout = null; - publicAPI.renderLater = () => { - if (timeout != null) return; - timeout = setTimeout(() => { - publicAPI.render(); - timeout = null; - }, 0); - }; + publicAPI.renderLater = batchForNextTask(() => { + publicAPI.render(); + }); // add helper function publicAPI.removeAllRepresentations = () => { @@ -56,11 +46,14 @@ export function commonViewCustomizations(publicAPI, model) { model.camera.setViewUp(...viewUp); }; - // disable the built-in corner annotations const { setContainer } = publicAPI; publicAPI.setContainer = (el) => { + const changed = model.container !== el; setContainer(el); + // disable the built-in corner annotations model.cornerAnnotation.setContainer(null); + // trigger onModified + if (changed) publicAPI.modified(); }; const { resetCamera } = publicAPI; From b8e1fb60144211b02488a5b11ec00ba8ff459c7b Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 31 Jan 2024 19:40:12 -0500 Subject: [PATCH 020/113] refactor: improve proxy manager usage --- src/components/VtkThreeView.vue | 2 +- src/components/VtkTwoView.vue | 3 +- src/composables/onProxyManagerEvent.ts | 36 ++++++++++++++--------- src/composables/proxyManager.ts | 22 -------------- src/composables/useProxyManager.ts | 40 ++++++++++++++++++++++++++ src/composables/useWebGLWatchdog.ts | 8 +++--- src/core/proxies.ts | 13 +++++---- src/main.js | 11 ++++--- src/store/views.ts | 2 +- 9 files changed, 85 insertions(+), 52 deletions(-) delete mode 100644 src/composables/proxyManager.ts create mode 100644 src/composables/useProxyManager.ts diff --git a/src/components/VtkThreeView.vue b/src/components/VtkThreeView.vue index 0735cfdd7..75858684d 100644 --- a/src/components/VtkThreeView.vue +++ b/src/components/VtkThreeView.vue @@ -75,7 +75,7 @@ import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData'; import { getDiagonalLength } from '@kitware/vtk.js/Common/DataModel/BoundingBox'; import type { Vector3 } from '@kitware/vtk.js/types'; -import { useProxyManager } from '@/src/composables/proxyManager'; +import { useProxyManager } from '@/src/composables/useProxyManager'; import ViewOverlayGrid from '@/src/components/ViewOverlayGrid.vue'; import { useResizeObserver } from '../composables/useResizeObserver'; import { useCurrentImage } from '../composables/useCurrentImage'; diff --git a/src/components/VtkTwoView.vue b/src/components/VtkTwoView.vue index 85986d3aa..67b227faa 100644 --- a/src/components/VtkTwoView.vue +++ b/src/components/VtkTwoView.vue @@ -244,7 +244,7 @@ import { WL_AUTO_DEFAULT, WL_HIST_BINS, } from '../constants'; -import { useProxyManager } from '../composables/proxyManager'; +import { useProxyManager } from '../composables/useProxyManager'; import { getShiftedOpacityFromPreset } from '../utils/vtk-helpers'; import { useLayersStore } from '../store/datasets-layers'; import { useViewCameraStore } from '../store/view-configs/camera'; @@ -911,3 +911,4 @@ export default defineComponent({ cursor: pointer; } +../composables/useProxyManager diff --git a/src/composables/onProxyManagerEvent.ts b/src/composables/onProxyManagerEvent.ts index 111fd355d..dd0d743b8 100644 --- a/src/composables/onProxyManagerEvent.ts +++ b/src/composables/onProxyManagerEvent.ts @@ -1,18 +1,21 @@ import type { vtkSubscription } from '@kitware/vtk.js/interfaces'; import { VtkProxy } from '@kitware/vtk.js/macros'; import { onBeforeUnmount } from 'vue'; -import { requireProxyManager } from './proxyManager'; +import { requireProxyManager } from './useProxyManager'; -export enum ProxyManagerEvent { - ProxyCreated, - ProxyModified, - ProxyDeleted, - ProxyRegistrationChange, -} +export type ProxyManagerEvent = + | 'ProxyCreated' + | 'ProxyModified' + | 'ProxyDeleted' + | 'ProxyRegistrationChange'; export function onProxyManagerEvent( event: ProxyManagerEvent, - cb: (proxyID: string, obj: VtkProxy | null) => void + cb: ( + proxyID: string, + obj: VtkProxy | null, + action: 'register' | 'unregister' | 'modified' + ) => void ) { const subs: vtkSubscription[] = []; const proxyManager = requireProxyManager(); @@ -23,21 +26,26 @@ export function onProxyManagerEvent( proxyManager.onProxyRegistrationChange((info) => { const { action, proxyId, proxy } = info; if (action === 'register') { - if (event === ProxyManagerEvent.ProxyCreated) { - cb(proxyId, proxy); + if (event === 'ProxyCreated') { + cb(proxyId, proxy, 'register'); } - if (event === ProxyManagerEvent.ProxyModified) { - proxySubs[proxyId] = proxy.onModified(() => cb(proxyId, proxy)); + if (event === 'ProxyModified') { + proxySubs[proxyId] = proxy.onModified(() => + cb(proxyId, proxy, 'modified') + ); } } else if (action === 'unregister') { if (proxyId in proxySubs) { proxySubs[proxyId].unsubscribe(); delete proxySubs[proxyId]; } - if (event === ProxyManagerEvent.ProxyDeleted) { - cb(proxyId, null); + if (event === 'ProxyDeleted') { + cb(proxyId, null, 'unregister'); } } + if (event === 'ProxyRegistrationChange') { + cb(proxyId, proxy, action); + } }) ); diff --git a/src/composables/proxyManager.ts b/src/composables/proxyManager.ts deleted file mode 100644 index 0a9a24540..000000000 --- a/src/composables/proxyManager.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { inject } from 'vue'; -import vtkProxyManager from '@kitware/vtk.js/Proxy/Core/ProxyManager'; - -export const PROXYMANAGER_INJECT_KEY = Symbol('ProxyManager'); - -/** - * Injects a provided proxy manager instance if available. - */ -export function useProxyManager(): vtkProxyManager | undefined { - return inject(PROXYMANAGER_INJECT_KEY); -} - -/** - * Injects a provided proxy manager instance. - * - * Throws an error if no proxy manager is available. - */ -export function requireProxyManager() { - const pxm = useProxyManager(); - if (!pxm) throw new Error('No proxy manager provided'); - return pxm; -} diff --git a/src/composables/useProxyManager.ts b/src/composables/useProxyManager.ts new file mode 100644 index 000000000..640ca4a02 --- /dev/null +++ b/src/composables/useProxyManager.ts @@ -0,0 +1,40 @@ +import { inject } from 'vue'; +import ProxyManagerWrapper from '@/src/core/proxies'; + +export const PROXY_MANAGER_WRAPPER_INJECT_KEY = Symbol('ProxyManagerWrapper'); + +/** + * Injects a provided ProxyManagerWrapper instance if available. + */ +export function useProxyManagerWrapper() { + return inject(PROXY_MANAGER_WRAPPER_INJECT_KEY); +} + +/** + * Injects a provided ProxyManagerWrapper instance. + * + * Throws an error if none is available. + */ +export function requireProxyManagerWrapper() { + const pxm = useProxyManagerWrapper(); + if (!pxm) throw new Error('No ProxyManagerWrapper provided'); + return pxm; +} + +/** + * Obtains the underlying vtkProxyManager. + */ +export function useProxyManager() { + return useProxyManagerWrapper()?.proxyManager; +} + +/** + * Obtains the underlying vtkProxyManager. + * + * Throws an error if none is available. + */ +export function requireProxyManager() { + const pxm = useProxyManager(); + if (!pxm) throw new Error('No ProxyManager provided'); + return pxm; +} diff --git a/src/composables/useWebGLWatchdog.ts b/src/composables/useWebGLWatchdog.ts index e7c07eed8..6142be663 100644 --- a/src/composables/useWebGLWatchdog.ts +++ b/src/composables/useWebGLWatchdog.ts @@ -3,10 +3,10 @@ import vtkViewProxy from '@kitware/vtk.js/Proxy/Core/ViewProxy'; import vtkProxyManager from '@kitware/vtk.js/Proxy/Core/ProxyManager'; import { useEventListener, useThrottleFn } from '@vueuse/core'; import { Maybe } from '@/src/types'; -import { useProxyManager } from '@/src/composables/proxyManager'; +import { useProxyManager } from '@/src/composables/useProxyManager'; import { Messages } from '../constants'; import { useMessageStore } from '../store/messages'; -import { onProxyManagerEvent, ProxyManagerEvent } from './onProxyManagerEvent'; +import { onProxyManagerEvent } from './onProxyManagerEvent'; /** * Collects relevant context for debugging 3D crashes. @@ -50,7 +50,7 @@ export function useWebGLWatchdog() { }); }, 150); - onProxyManagerEvent(ProxyManagerEvent.ProxyCreated, (id, obj) => { + onProxyManagerEvent('ProxyCreated', (id, obj) => { if (!obj || !obj.isA('vtkViewProxy')) return; const view = obj as vtkViewProxy; // TODO getCanvas() typing @@ -63,7 +63,7 @@ export function useWebGLWatchdog() { watchdogs.set(id, cleanup); }); - onProxyManagerEvent(ProxyManagerEvent.ProxyDeleted, (id) => { + onProxyManagerEvent('ProxyDeleted', (id) => { if (watchdogs.has(id)) { watchdogs.get(id)!(); watchdogs.delete(id); diff --git a/src/core/proxies.ts b/src/core/proxies.ts index be77fad75..60e13cb84 100644 --- a/src/core/proxies.ts +++ b/src/core/proxies.ts @@ -17,10 +17,10 @@ export enum ViewProxyType { * Wrapper around the vtkProxyManager, since we don't need some of * its complexities. */ -export default class ProxyWrapper { +export default class ProxyManagerWrapper { private viewProxies: Map; private dataProxies: Map>; - private proxyManager: vtkProxyManager; + public readonly proxyManager: vtkProxyManager; constructor(proxyManager: vtkProxyManager) { this.viewProxies = new Map(); @@ -28,17 +28,20 @@ export default class ProxyWrapper { this.proxyManager = proxyManager; } - delete() { + clearAll() { const deleteProxy = (proxy: VtkProxy) => this.proxyManager.deleteProxy(proxy); this.viewProxies.forEach(deleteProxy); this.dataProxies.forEach(deleteProxy); + + this.viewProxies.clear(); + this.dataProxies.clear(); } createView(id: string, type: ViewProxyType) { if (this.viewProxies.has(id)) { - throw new Error('Cannot create a view with the same ID'); + throw new Error(`Cannot create a view with the same ID "${id}"`); } const proxy = this.proxyManager.createProxy('Views', type, { @@ -53,7 +56,7 @@ export default class ProxyWrapper { return this.viewProxies.get(id); } - removeView(id: string) { + deleteView(id: string) { const proxy = this.viewProxies.get(id); if (proxy) { this.proxyManager.deleteProxy(proxy); diff --git a/src/main.js b/src/main.js index b53260df4..351a90b04 100644 --- a/src/main.js +++ b/src/main.js @@ -22,10 +22,11 @@ import { FILE_READERS } from './io'; import { registerAllReaders } from './io/readers'; import proxyConfiguration from './vtk/proxy'; import { CorePiniaProviderPlugin } from './core/provider'; -import ProxyWrapper from './core/proxies'; +import ProxyManagerWrapper from './core/proxies'; import { patchExitPointerLock } from './utils/hacks'; import { init as initErrorReporting } from './utils/errorReporting'; import { StoreRegistry } from './plugins/storeRegistry'; +import { PROXY_MANAGER_WRAPPER_INJECT_KEY } from './composables/useProxyManager'; // patches patchExitPointerLock(); @@ -41,7 +42,9 @@ vtkImageMapper.setResolveCoincidentTopologyPolygonOffsetParameters(1, 1); registerAllReaders(FILE_READERS); -const proxyManager = vtkProxyManager.newInstance({ proxyConfiguration }); +const proxyManagerWrapper = new ProxyManagerWrapper( + vtkProxyManager.newInstance({ proxyConfiguration }) +); const dicomIO = new DICOMIO(); dicomIO.initialize(); @@ -53,7 +56,7 @@ setPipelinesBaseUrl(itkConfig.imageIOUrl); const pinia = createPinia(); pinia.use( CorePiniaProviderPlugin({ - proxies: new ProxyWrapper(proxyManager), + proxies: proxyManagerWrapper, dicomIO, }) ); @@ -63,7 +66,7 @@ const app = createApp(App); initErrorReporting(app); -app.provide('ProxyManager', proxyManager); +app.provide(PROXY_MANAGER_WRAPPER_INJECT_KEY, proxyManagerWrapper); app.use(pinia); app.use(VueToast); app.use(vuetify); diff --git a/src/store/views.ts b/src/store/views.ts index 1d42a9221..03fb81fb0 100644 --- a/src/store/views.ts +++ b/src/store/views.ts @@ -62,7 +62,7 @@ export const useViewStore = defineStore('view', { removeView(id: string) { if (id in this.viewSpecs) { delete this.viewSpecs[id]; - this.$proxies.removeView(id); + this.$proxies.deleteView(id); } }, setLayout(layout: Layout) { From 2c0abb26e25a3089a3a07e053e3ea91552b2f0d7 Mon Sep 17 00:00:00 2001 From: Forrest Date: Wed, 31 Jan 2024 22:00:08 -0500 Subject: [PATCH 021/113] fix(batchForNextTask): improve typing --- src/utils/batchForNextTask.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/batchForNextTask.ts b/src/utils/batchForNextTask.ts index a1910173c..cef800c91 100644 --- a/src/utils/batchForNextTask.ts +++ b/src/utils/batchForNextTask.ts @@ -5,13 +5,14 @@ * @param fn * @returns */ -export function batchForNextTask(fn: () => void) { +export function batchForNextTask void>(fn: T) { let timeout: NodeJS.Timeout | null = null; - return () => { + const wrapper = ((...args: any[]) => { if (timeout != null) return; timeout = setTimeout(() => { timeout = null; - fn(); + fn(...args); }, 0); - }; + }) as T; + return wrapper; } From adb14045c9d40fb4887c66e3304c86b8b6b25fbb Mon Sep 17 00:00:00 2001 From: Forrest Date: Thu, 1 Feb 2024 13:49:55 -0500 Subject: [PATCH 022/113] refactor(App): split out AppBar --- src/components/App.vue | 49 +++------------------------------- src/components/AppBar.vue | 56 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 46 deletions(-) create mode 100644 src/components/AppBar.vue diff --git a/src/components/App.vue b/src/components/App.vue index dcde1c04e..11859e69c 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -2,36 +2,7 @@