From 0a34eaac785a6d2d99a300483353ba59b65075f2 Mon Sep 17 00:00:00 2001 From: mdelez <60604010+mdelez@users.noreply.github.com> Date: Fri, 17 Sep 2021 09:06:02 +0200 Subject: [PATCH] refactor: openseadragon prod build fix (DSP-1779) (#534) * refactor: attempt to use addOverlay * refactor: fixes incorrect region coordinates * test: fixes unit tests * refactor: attempt to make github-ci happy * chore: installs pdfjs-dist dependency * chore: removes svg-overlay package * refactor: changes the way region hover events work --- angular.json | 9 +- package-lock.json | 185 +++++------------- package.json | 3 +- .../still-image/still-image.component.scss | 10 +- .../still-image/still-image.component.spec.ts | 135 ++----------- .../still-image/still-image.component.ts | 171 +++------------- src/config/config.prod.json | 22 +-- 7 files changed, 110 insertions(+), 425 deletions(-) diff --git a/angular.json b/angular.json index 6a69044b27..b98b5c599e 100644 --- a/angular.json +++ b/angular.json @@ -27,7 +27,10 @@ "json2typescript", "ngraph.graph", "ngraph.forcelayout", - "tinycolor2" + "tinycolor2", + "ng2-pdf-viewer", + "pdfjs-dist", + "openseadragon" ], "assets": [ "src/favicon.ico", @@ -39,7 +42,6 @@ ], "scripts": [ "node_modules/openseadragon/build/openseadragon/openseadragon.min.js", - "node_modules/svg-overlay/openseadragon-svg-overlay.js", "node_modules/3d-force-graph/dist/3d-force-graph.min.js", "node_modules/d3-force-3d/dist/d3-force-3d.js" ] @@ -131,8 +133,7 @@ "src/styles.scss" ], "scripts": [ - "node_modules/openseadragon/build/openseadragon/openseadragon.min.js", - "node_modules/svg-overlay/openseadragon-svg-overlay.js" + "node_modules/openseadragon/build/openseadragon/openseadragon.min.js" ], "assets": [ "src/favicon.ico", diff --git a/package-lock.json b/package-lock.json index cde7ed567d..682bc8e13b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,9 +37,9 @@ "ng2-pdf-viewer": "^7.0.1", "ngx-color-picker": "^11.0.0", "openseadragon": "^2.4.0", + "pdfjs-dist": "^2.7.570", "rxjs": "~6.5.5", "semver": "^6.1.1", - "svg-overlay": "github:openseadragon/svg-overlay", "three": "^0.125.0", "three-spritetext": "^1.5.1", "ts-md5": "^1.2.7", @@ -56,6 +56,7 @@ "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", + "@types/openseadragon": "^2.4.7", "@typescript-eslint/eslint-plugin": "^4.15.2", "@typescript-eslint/eslint-plugin-tslint": "^4.15.2", "@typescript-eslint/parser": "^4.15.2", @@ -679,7 +680,6 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", - "dev": true, "dependencies": { "@babel/highlight": "^7.14.5" }, @@ -699,7 +699,6 @@ "version": "7.12.10", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/generator": "^7.12.10", @@ -729,7 +728,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, "bin": { "semver": "bin/semver" } @@ -738,7 +736,6 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -747,7 +744,6 @@ "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", - "dev": true, "dependencies": { "@babel/types": "^7.12.11", "jsesc": "^2.5.1", @@ -758,7 +754,6 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -857,7 +852,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", - "dev": true, "dependencies": { "@babel/helper-get-function-arity": "^7.15.4", "@babel/template": "^7.15.4", @@ -871,7 +865,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.14.5", "@babel/parser": "^7.15.4", @@ -885,7 +878,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", - "dev": true, "dependencies": { "@babel/types": "^7.15.4" }, @@ -897,7 +889,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", - "dev": true, "dependencies": { "@babel/types": "^7.15.4" }, @@ -909,7 +900,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz", "integrity": "sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA==", - "dev": true, "dependencies": { "@babel/types": "^7.15.4" }, @@ -921,7 +911,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz", "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==", - "dev": true, "dependencies": { "@babel/types": "^7.15.4" }, @@ -933,7 +922,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.4.tgz", "integrity": "sha512-9fHHSGE9zTC++KuXLZcB5FKgvlV83Ox+NLUmQTawovwlJ85+QMhk1CnVk406CQVj97LaWod6KVjl2Sfgw9Aktw==", - "dev": true, "dependencies": { "@babel/helper-module-imports": "^7.15.4", "@babel/helper-replace-supers": "^7.15.4", @@ -952,7 +940,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.14.5", "@babel/parser": "^7.15.4", @@ -966,7 +953,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz", "integrity": "sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw==", - "dev": true, "dependencies": { "@babel/types": "^7.15.4" }, @@ -1001,7 +987,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz", "integrity": "sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw==", - "dev": true, "dependencies": { "@babel/helper-member-expression-to-functions": "^7.15.4", "@babel/helper-optimise-call-expression": "^7.15.4", @@ -1016,7 +1001,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz", "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==", - "dev": true, "dependencies": { "@babel/types": "^7.15.4" }, @@ -1040,7 +1024,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", - "dev": true, "dependencies": { "@babel/types": "^7.15.4" }, @@ -1052,7 +1035,6 @@ "version": "7.14.9", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -1098,7 +1080,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz", "integrity": "sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ==", - "dev": true, "dependencies": { "@babel/template": "^7.15.4", "@babel/traverse": "^7.15.4", @@ -1112,7 +1093,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.14.5", "@babel/parser": "^7.15.4", @@ -1126,7 +1106,6 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", @@ -1140,7 +1119,6 @@ "version": "7.15.5", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.5.tgz", "integrity": "sha512-2hQstc6I7T6tQsWzlboMh3SgMRPaS4H6H7cPQsJkdzTzEGqQrpLDsE2BGASU5sBPoEQyHzeqU6C8uKbFeEk6sg==", - "dev": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -2147,7 +2125,6 @@ "version": "7.12.7", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/parser": "^7.12.7", @@ -2158,7 +2135,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.14.5", "@babel/generator": "^7.15.4", @@ -2178,7 +2154,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.4.tgz", "integrity": "sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw==", - "dev": true, "dependencies": { "@babel/types": "^7.15.4", "jsesc": "^2.5.1", @@ -2192,7 +2167,6 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -2201,7 +2175,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.4.tgz", "integrity": "sha512-0f1HJFuGmmbrKTCZtbm3cU+b/AqdEYk5toj5iQur58xkVMlS0JWaKxTBSmCXd47uiN7vbcozAupm6Mvs80GNhw==", - "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.14.9", "to-fast-properties": "^2.0.0" @@ -2976,6 +2949,12 @@ "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", "dev": true }, + "node_modules/@types/openseadragon": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/@types/openseadragon/-/openseadragon-2.4.7.tgz", + "integrity": "sha512-DQBeHTBI5ThXoWwfooEidKY0z2xAkSC2etos0JzQ1H1VfbGcXOtExGnu0JpzDx498zOJyrklBZBWfmk31t2xNQ==", + "dev": true + }, "node_modules/@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", @@ -3971,7 +3950,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -4990,7 +4968,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -5308,6 +5285,7 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-9.0.0.tgz", "integrity": "sha512-ctjwuntPfZZT2mNj2NDIVu51t9cvbhl/16epc5xEwyzyDt76pX9UgwvY+MbXrf/C/FWwdtmNtfP698BKI+9leQ==", "dev": true, + "peer": true, "peerDependencies": { "tslib": "^1.10.0" } @@ -5317,6 +5295,7 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-9.0.0.tgz", "integrity": "sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w==", "dev": true, + "peer": true, "peerDependencies": { "rxjs": "^6.5.3", "tslib": "^1.10.0", @@ -5355,7 +5334,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -5363,8 +5341,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "node_modules/colord": { "version": "2.7.0", @@ -5605,7 +5582,6 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, "dependencies": { "safe-buffer": "~5.1.1" } @@ -6694,7 +6670,6 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -7377,7 +7352,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -8852,7 +8826,6 @@ "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -8962,7 +8935,6 @@ "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, "engines": { "node": ">=4" } @@ -9077,7 +9049,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, "engines": { "node": ">=4" } @@ -10673,8 +10644,7 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "3.14.1", @@ -10711,7 +10681,6 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, "bin": { "jsesc": "bin/jsesc" }, @@ -10770,7 +10739,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, "dependencies": { "minimist": "^1.2.5" }, @@ -11337,8 +11305,7 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lodash-es": { "version": "4.17.21", @@ -11855,8 +11822,7 @@ "node_modules/minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "node_modules/minipass": { "version": "3.1.3", @@ -12053,8 +12019,7 @@ "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/multicast-dns": { "version": "6.2.3", @@ -15442,8 +15407,7 @@ "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/safe-regex": { "version": "1.1.0", @@ -17170,7 +17134,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -17178,14 +17141,6 @@ "node": ">=4" } }, - "node_modules/svg-overlay": { - "version": "0.0.5", - "resolved": "git+ssh://git@github.com/openseadragon/svg-overlay.git#edb9d4b64a885abf2609f048da97354307fdfd45", - "license": "BSD-3-Clause", - "dependencies": { - "openseadragon": "^2.0.0" - } - }, "node_modules/svgo": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.5.0.tgz", @@ -17523,7 +17478,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, "engines": { "node": ">=4" } @@ -20873,7 +20827,6 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", - "dev": true, "requires": { "@babel/highlight": "^7.14.5" } @@ -20887,7 +20840,6 @@ "version": "7.12.10", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", - "dev": true, "requires": { "@babel/code-frame": "^7.10.4", "@babel/generator": "^7.12.10", @@ -20909,14 +20861,12 @@ "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } }, @@ -20924,7 +20874,6 @@ "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", - "dev": true, "requires": { "@babel/types": "^7.12.11", "jsesc": "^2.5.1", @@ -20934,8 +20883,7 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } }, @@ -21006,7 +20954,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", - "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.15.4", "@babel/template": "^7.15.4", @@ -21017,7 +20964,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", - "dev": true, "requires": { "@babel/code-frame": "^7.14.5", "@babel/parser": "^7.15.4", @@ -21030,7 +20976,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", - "dev": true, "requires": { "@babel/types": "^7.15.4" } @@ -21039,7 +20984,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", - "dev": true, "requires": { "@babel/types": "^7.15.4" } @@ -21048,7 +20992,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz", "integrity": "sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA==", - "dev": true, "requires": { "@babel/types": "^7.15.4" } @@ -21057,7 +21000,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz", "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==", - "dev": true, "requires": { "@babel/types": "^7.15.4" } @@ -21066,7 +21008,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.4.tgz", "integrity": "sha512-9fHHSGE9zTC++KuXLZcB5FKgvlV83Ox+NLUmQTawovwlJ85+QMhk1CnVk406CQVj97LaWod6KVjl2Sfgw9Aktw==", - "dev": true, "requires": { "@babel/helper-module-imports": "^7.15.4", "@babel/helper-replace-supers": "^7.15.4", @@ -21082,7 +21023,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", - "dev": true, "requires": { "@babel/code-frame": "^7.14.5", "@babel/parser": "^7.15.4", @@ -21095,7 +21035,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz", "integrity": "sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw==", - "dev": true, "requires": { "@babel/types": "^7.15.4" } @@ -21121,7 +21060,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz", "integrity": "sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw==", - "dev": true, "requires": { "@babel/helper-member-expression-to-functions": "^7.15.4", "@babel/helper-optimise-call-expression": "^7.15.4", @@ -21133,7 +21071,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz", "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==", - "dev": true, "requires": { "@babel/types": "^7.15.4" } @@ -21151,7 +21088,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", - "dev": true, "requires": { "@babel/types": "^7.15.4" } @@ -21159,8 +21095,7 @@ "@babel/helper-validator-identifier": { "version": "7.14.9", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", - "dev": true + "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==" }, "@babel/helper-validator-option": { "version": "7.14.5", @@ -21196,7 +21131,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz", "integrity": "sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ==", - "dev": true, "requires": { "@babel/template": "^7.15.4", "@babel/traverse": "^7.15.4", @@ -21207,7 +21141,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", - "dev": true, "requires": { "@babel/code-frame": "^7.14.5", "@babel/parser": "^7.15.4", @@ -21220,7 +21153,6 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", @@ -21230,8 +21162,7 @@ "@babel/parser": { "version": "7.15.5", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.5.tgz", - "integrity": "sha512-2hQstc6I7T6tQsWzlboMh3SgMRPaS4H6H7cPQsJkdzTzEGqQrpLDsE2BGASU5sBPoEQyHzeqU6C8uKbFeEk6sg==", - "dev": true + "integrity": "sha512-2hQstc6I7T6tQsWzlboMh3SgMRPaS4H6H7cPQsJkdzTzEGqQrpLDsE2BGASU5sBPoEQyHzeqU6C8uKbFeEk6sg==" }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.15.4", @@ -21915,7 +21846,6 @@ "version": "7.12.7", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", - "dev": true, "requires": { "@babel/code-frame": "^7.10.4", "@babel/parser": "^7.12.7", @@ -21926,7 +21856,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", - "dev": true, "requires": { "@babel/code-frame": "^7.14.5", "@babel/generator": "^7.15.4", @@ -21943,7 +21872,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.4.tgz", "integrity": "sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw==", - "dev": true, "requires": { "@babel/types": "^7.15.4", "jsesc": "^2.5.1", @@ -21953,8 +21881,7 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } }, @@ -21962,7 +21889,6 @@ "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.4.tgz", "integrity": "sha512-0f1HJFuGmmbrKTCZtbm3cU+b/AqdEYk5toj5iQur58xkVMlS0JWaKxTBSmCXd47uiN7vbcozAupm6Mvs80GNhw==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.14.9", "to-fast-properties": "^2.0.0" @@ -22635,6 +22561,12 @@ "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", "dev": true }, + "@types/openseadragon": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/@types/openseadragon/-/openseadragon-2.4.7.tgz", + "integrity": "sha512-DQBeHTBI5ThXoWwfooEidKY0z2xAkSC2etos0JzQ1H1VfbGcXOtExGnu0JpzDx498zOJyrklBZBWfmk31t2xNQ==", + "dev": true + }, "@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", @@ -23349,7 +23281,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -24187,7 +24118,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -24413,8 +24343,6 @@ "integrity": "sha512-v3+E0Ucu2xWJMOJ2fA/q9pDT/hlxHftHGPUay1/1cTgyPV5JTHFdO9hqo837Sx2s9vKBMTt5gO+lhF95PO6J+g==", "dev": true, "requires": { - "@angular/compiler": "9.0.0", - "@angular/core": "9.0.0", "app-root-path": "^3.0.0", "aria-query": "^3.0.0", "axobject-query": "2.0.2", @@ -24430,17 +24358,17 @@ }, "dependencies": { "@angular/compiler": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-9.0.0.tgz", + "version": "https://registry.npmjs.org/@angular/compiler/-/compiler-9.0.0.tgz", "integrity": "sha512-ctjwuntPfZZT2mNj2NDIVu51t9cvbhl/16epc5xEwyzyDt76pX9UgwvY+MbXrf/C/FWwdtmNtfP698BKI+9leQ==", "dev": true, + "peer": true, "requires": {} }, "@angular/core": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@angular/core/-/core-9.0.0.tgz", + "version": "https://registry.npmjs.org/@angular/core/-/core-9.0.0.tgz", "integrity": "sha512-6Pxgsrf0qF9iFFqmIcWmjJGkkCaCm6V5QNnxMy2KloO3SDq6QuMVRbN9RtC8Urmo25LP+eZ6ZgYqFYpdD8Hd9w==", "dev": true, + "peer": true, "requires": {} }, "source-map": { @@ -24471,7 +24399,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -24479,8 +24406,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "colord": { "version": "2.7.0", @@ -24694,7 +24620,6 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -25622,7 +25547,6 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, "requires": { "ms": "2.1.2" } @@ -26194,8 +26118,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { "version": "6.8.0", @@ -27383,8 +27306,7 @@ "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==" }, "get-caller-file": { "version": "2.0.5", @@ -27463,8 +27385,7 @@ "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" }, "globby": { "version": "11.0.4", @@ -27551,8 +27472,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-symbols": { "version": "1.0.2", @@ -28767,8 +28687,7 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { "version": "3.14.1", @@ -28795,8 +28714,7 @@ "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==" }, "json-parse-better-errors": { "version": "1.0.2", @@ -28849,7 +28767,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, "requires": { "minimist": "^1.2.5" } @@ -29287,8 +29204,7 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash-es": { "version": "4.17.21", @@ -29700,8 +29616,7 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "minipass": { "version": "3.1.3", @@ -29856,8 +29771,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "multicast-dns": { "version": "6.2.3", @@ -29960,7 +29874,6 @@ "resolved": "https://registry.npmjs.org/ng2-pdf-viewer/-/ng2-pdf-viewer-7.0.1.tgz", "integrity": "sha512-kjjsvHd5t1Ff7ydb3Far3d6cSyw/XJH5KXgcp/0bFzSFBAV2c5aOghxoY/yQVjgG+R6F16nVUh2UrZdngLXLSg==", "requires": { - "pdfjs-dist": "~2.7.570", "tslib": "^2.0.0" } }, @@ -32427,8 +32340,7 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safe-regex": { "version": "1.1.0", @@ -33820,18 +33732,10 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } }, - "svg-overlay": { - "version": "git+ssh://git@github.com/openseadragon/svg-overlay.git#edb9d4b64a885abf2609f048da97354307fdfd45", - "from": "svg-overlay@github:openseadragon/svg-overlay", - "requires": { - "openseadragon": "^2.0.0" - } - }, "svgo": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.5.0.tgz", @@ -34106,8 +34010,7 @@ "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" }, "to-object-path": { "version": "0.3.0", diff --git a/package.json b/package.json index fbac27bbfe..15e7c72bd9 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "ng2-pdf-viewer": "^7.0.1", "ngx-color-picker": "^11.0.0", "openseadragon": "^2.4.0", + "pdfjs-dist": "^2.7.570", "rxjs": "~6.5.5", "semver": "^6.1.1", - "svg-overlay": "github:openseadragon/svg-overlay", "three": "^0.125.0", "three-spritetext": "^1.5.1", "ts-md5": "^1.2.7", @@ -70,6 +70,7 @@ "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", + "@types/openseadragon": "^2.4.7", "@typescript-eslint/eslint-plugin": "^4.15.2", "@typescript-eslint/eslint-plugin-tslint": "^4.15.2", "@typescript-eslint/parser": "^4.15.2", diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.scss b/src/app/workspace/resource/representation/still-image/still-image.component.scss index 8158b75679..5c77563058 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.scss +++ b/src/app/workspace/resource/representation/still-image/still-image.component.scss @@ -38,22 +38,22 @@ $bright: #ccc; Overlay styling */ -::ng-deep .roi-svgoverlay { +::ng-deep .region { filter: alpha(opacity=40); opacity: 0.4; fill: transparent; stroke: #00695c; stroke-width: 2px; - vector-effect: non-scaling-stroke; } -::ng-deep .roi-svgoverlay:hover, -.roi-svgoverlay:focus { +::ng-deep .region:hover, +.region:focus { filter: alpha(opacity=100); opacity: 1; + cursor: pointer; } -::ng-deep .roi-svgoverlay.active { +::ng-deep .region.active { filter: alpha(opacity=100); opacity: 1; } diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.spec.ts b/src/app/workspace/resource/representation/still-image/still-image.component.spec.ts index 1af95fc145..759c95d124 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.spec.ts +++ b/src/app/workspace/resource/representation/still-image/still-image.component.spec.ts @@ -49,81 +49,6 @@ const rectangleGeom = `{ "type": "rectangle" }`; -const rectangleGeom2 = `{ - "status": "active", - "lineColor": "#ff3333", - "lineWidth": 2, - "points": [{ - "x": 0.17296511627906977, - "y": 0.08226691042047532 - }, { - "x": 0.7122093023255814, - "y": 0.16544789762340037 - }], - "type": "rectangle" - }`; - -const polygonGeom = `{ - "status": "active", - "lineColor": "#ff3333", - "lineWidth": 2, - "points": [{ - "x": 0.17532467532467533, - "y": 0.18049792531120332 - }, { - "x": 0.8051948051948052, - "y": 0.17012448132780084 - }, { - "x": 0.8311688311688312, - "y": 0.7261410788381742 - }, { - "x": 0.19480519480519481, - "y": 0.7323651452282157 - }, { - "x": 0.17857142857142858, - "y": 0.17842323651452283 - }, { - "x": 0.18506493506493507, - "y": 0.1825726141078838 - }, { - "x": 0.17857142857142858, - "y": 0.1825726141078838 - }], - "type": "polygon" -}`; - -const circleGeom = `{ - "status": "active", - "lineColor": "#3333ff", - "lineWidth": 2, - "points": [{ - "x": 0.3400735294117647, - "y": 0.45376078914919854 - }], - "type": "circle", - "radius": { - "x": 0.04595588235294118, - "y": 0.03082614056720101 - }, - "original_index": 1 -}`; - -const circleGeom2 = `{ - "status": "active", - "lineColor": "#3333ff", - "lineWidth": 2, - "points": [{ - "x": 0.5305232558139537, - "y": 0.3126142595978062 - }], - "type": "circle", - "radius": { - "x": 0.18023255813953487, - "y": 0.08957952468007313 - }, - "original_index": 1 -}`; - class Geom extends ReadValue { geometryString: string; } @@ -148,7 +73,8 @@ function makeRegion(geomString: string[], iri: string): ReadResource { @Component({ template: ` ` }) @@ -168,10 +94,7 @@ class TestHostComponent implements OnInit { = [ new FileRepresentation(stillImageFileValue, [ - new Region(makeRegion([rectangleGeom], 'first')), - new Region(makeRegion([polygonGeom], 'second')), - new Region(makeRegion([circleGeom], 'third')), - new Region(makeRegion([circleGeom2, rectangleGeom2], 'fourth')) + new Region(makeRegion([rectangleGeom], 'first')) ]) ]; } @@ -199,7 +122,7 @@ describe('StillImageComponent', () => { MatDialogModule, MatIconModule, MatSnackBarModule, - MatToolbarModule + MatToolbarModule, ], providers: [ AppInitService, @@ -257,18 +180,16 @@ describe('StillImageComponent', () => { }); - it('should have 5 test regions loaded (rectangle, polygon, circle, [circle, rectangle])', () => { + it('should have 1 test region loaded (rectangle)', () => { - const overlay = testHostComponent.osdViewerComp['_viewer'].svgOverlay(); - expect(overlay.node().childElementCount).toEqual(5); + const osd = testHostComponent.osdViewerComp['_viewer']; + expect(osd.element.getElementsByClassName('region').length).toEqual(1); }); - it('should emit the region\'s Iri when a region is hovered', () => { - - const overlay = testHostComponent.osdViewerComp['_viewer'].svgOverlay(); + it('should emit the region\'s Iri when a region is clicked', () => { - // first region -> polygon element (second element in element) - const regionSvgEle: HTMLElement = overlay.node().childNodes[0].childNodes[1]; + const osd = testHostComponent.osdViewerComp['_viewer']; + const overlayElement = osd.element.getElementsByClassName('region')[0]; const event = new MouseEvent('click', { bubbles: true, @@ -276,7 +197,7 @@ describe('StillImageComponent', () => { view: window }); - regionSvgEle.dispatchEvent(event); + overlayElement.dispatchEvent(event); testHostFixture.detectChanges(); @@ -284,38 +205,4 @@ describe('StillImageComponent', () => { }); - it('should highlight a region', () => { - - testHostComponent.osdViewerComp['_highlightRegion']('first'); - testHostFixture.detectChanges(); - - const overlay = testHostComponent.osdViewerComp['_viewer'].svgOverlay(); - - // first region -> polygon element (second element in element) - const regionSvgEle: HTMLElement = overlay.node().childNodes[0].childNodes[1]; - - let attr = regionSvgEle.getAttribute('class'); - expect(attr).toEqual('roi-svgoverlay active'); - - testHostComponent.osdViewerComp['_unhighlightAllRegions'](); - testHostFixture.detectChanges(); - - attr = regionSvgEle.getAttribute('class'); - expect(attr).toEqual('roi-svgoverlay'); - - }); - - it('should highlight a region using the input "activateRegion"', () => { - testHostComponent.inputActivateRegion = 'first'; - testHostFixture.detectChanges(); - - const overlay = testHostComponent.osdViewerComp['_viewer'].svgOverlay(); - - // first region -> polygon element (second element in element) - const regionSvgEle: HTMLElement = overlay.node().childNodes[0].childNodes[1]; - - const attr = regionSvgEle.getAttribute('class'); - expect(attr).toEqual('roi-svgoverlay active'); - }); - }); diff --git a/src/app/workspace/resource/representation/still-image/still-image.component.ts b/src/app/workspace/resource/representation/still-image/still-image.component.ts index cc9d43d7b3..41b37de7b9 100644 --- a/src/app/workspace/resource/representation/still-image/still-image.component.ts +++ b/src/app/workspace/resource/representation/still-image/still-image.component.ts @@ -24,14 +24,8 @@ import { DialogComponent } from 'src/app/main/dialog/dialog.component'; import { ErrorHandlerService } from 'src/app/main/error/error-handler.service'; import { DspCompoundPosition } from '../../dsp-resource'; import { FileRepresentation } from '../file-representation'; +import * as OpenSeadragon from 'openseadragon'; -// this component needs the openseadragon library itself, as well as the openseadragon plugin openseadragon-svg-overlay -// both libraries are installed via package.json, and loaded globally via the script tag in .angular-cli.json - -// openSeadragon does not export itself as ES6/ECMA2015 module, -// it is loaded globally in scripts tag of angular-cli.json, -// we still need to declare the namespace to make TypeScript compiler happy. -declare let OpenSeadragon: any; /** * represents a region resource. @@ -91,7 +85,7 @@ export class GeometryForRegion { */ interface PolygonsForRegion { - [key: string]: SVGPolygonElement[]; + [key: string]: HTMLDivElement[]; } @@ -114,11 +108,12 @@ export class StillImageComponent implements OnChanges, OnDestroy { @Output() regionClicked = new EventEmitter(); + @Output() regionAdded = new EventEmitter(); private _regionDrawMode: Boolean = false; // stores whether viewer is currently drawing a region private _regionDragInfo; // stores the information of the first click for drawing a region - private _viewer; + private _viewer: OpenSeadragon.Viewer; private _regions: PolygonsForRegion = {}; constructor( @@ -300,7 +295,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { } const overlayElement = document.createElement('div'); overlayElement.style.background = 'rgba(255,0,0,0.3)'; - const viewportPos = this._viewer.viewport.pointFromPixel(event.position); + const viewportPos = this._viewer.viewport.pointFromPixel((event as OpenSeadragon.ViewerEvent).position); this._viewer.addOverlay(overlayElement, new OpenSeadragon.Rect(viewportPos.x, viewportPos.y, 0, 0)); this._regionDragInfo = { overlayElement: overlayElement, @@ -311,7 +306,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { if (!this._regionDragInfo){ return; } - const viewPortPos = this._viewer.viewport.pointFromPixel(event.position); + const viewPortPos = this._viewer.viewport.pointFromPixel((event as OpenSeadragon.ViewerEvent).position); const diffX = viewPortPos.x - this._regionDragInfo.startPos.x; const diffY = viewPortPos.y - this._regionDragInfo.startPos.y; const location = new OpenSeadragon.Rect( @@ -320,6 +315,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { Math.abs(diffX), Math.abs(diffY) ); + this._viewer.updateOverlay(this._regionDragInfo.overlayElement, location); this._regionDragInfo.endPos = viewPortPos; }, @@ -344,11 +340,11 @@ export class StillImageComponent implements OnChanges, OnDestroy { */ private _highlightRegion(regionIri) { - const activeRegion: SVGPolygonElement[] = this._regions[regionIri]; + const activeRegion: HTMLDivElement[] = this._regions[regionIri]; if (activeRegion !== undefined) { for (const pol of activeRegion) { - pol.setAttribute('class', 'roi-svgoverlay active'); + pol.setAttribute('class', 'region active'); } } } @@ -362,7 +358,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { for (const reg in this._regions) { if (this._regions.hasOwnProperty(reg)) { for (const pol of this._regions[reg]) { - pol.setAttribute('class', 'roi-svgoverlay'); + pol.setAttribute('class', 'region'); } } } @@ -376,7 +372,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { for (const reg in this._regions) { if (this._regions.hasOwnProperty(reg)) { for (const pol of this._regions[reg]) { - if (pol instanceof SVGPolygonElement) { + if (pol instanceof HTMLDivElement) { pol.remove(); } } @@ -407,7 +403,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { // rotateLeftButton: 'DSP_OSD_ROTATE_LEFT', // doesn't work yet // rotateRightButton: 'DSP_OSD_ROTATE_RIGHT', // doesn't work yet showNavigator: true, - navigatorPosition: 'ABSOLUTE', + navigatorPosition: 'ABSOLUTE' as const, navigatorTop: '40px', navigatorLeft: 'calc(100% - 160px)', navigatorHeight: '120px', @@ -425,9 +421,7 @@ export class StillImageComponent implements OnChanges, OnDestroy { viewerContainer.classList.remove('fullscreen'); } }); - this._viewer.addHandler('resize', (args) => { - args.eventSource.svgOverlay().resize(); - }); + this._addRegionDrawer(); } @@ -581,134 +575,33 @@ export class StillImageComponent implements OnChanges, OnDestroy { const lineColor = geometry.lineColor; const lineWidth = geometry.lineWidth; - let svgElement; - switch (geometry.type) { - case 'rectangle': - svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'polygon'); // yes, we render rectangles as svg polygon elements - this._addSVGAttributesRectangle(svgElement, geometry, aspectRatio, xOffset); - break; - case 'polygon': - svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'polygon'); - this._addSVGAttributesPolygon(svgElement, geometry, aspectRatio, xOffset); - break; - case 'circle': - svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'circle'); - this._addSVGAttributesCircle(svgElement, geometry, aspectRatio, xOffset); - break; - default: - console.log('ERROR: StillImageOSDViewerComponent.createSVGOverlay: unknown geometryType: ' + geometry.type); - return; - } - svgElement.id = 'roi-svgoverlay-' + Math.random() * 10000; - svgElement.setAttribute('class', 'roi-svgoverlay'); - svgElement.setAttribute('style', 'stroke: ' + lineColor + '; stroke-width: ' + lineWidth + 'px;'); + const elt = document.createElement('div'); + elt.id = 'region-overlay-' + Math.random() * 10000; + elt.className = 'region'; + elt.title = toolTip; + elt.setAttribute('style', 'outline: solid ' + lineColor + ' ' + lineWidth + 'px;'); - // event when a region is clicked (output) - svgElement.addEventListener('click', (event: MouseEvent) => { + elt.addEventListener('click', (event: MouseEvent) => { this.regionClicked.emit(regionIri); }, false); - const svgTitle = document.createElementNS('http://www.w3.org/2000/svg', 'title'); - svgTitle.textContent = toolTip; + const diffX = geometry.points[1].x - geometry.points[0].x; + const diffY = geometry.points[1].y - geometry.points[0].y; - const svgGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g'); - svgGroup.appendChild(svgTitle); - svgGroup.appendChild(svgElement); + const loc = new OpenSeadragon.Rect( + Math.min(geometry.points[0].x, geometry.points[0].x + diffX), + Math.min(geometry.points[0].y, geometry.points[0].y + diffY), + Math.abs(diffX), + Math.abs(diffY * aspectRatio)); - const overlay = this._viewer.svgOverlay(); - overlay.node().appendChild(svgGroup); // tODO: use method osdviewer's method addOverlay - - this._regions[regionIri].push(svgElement); - } + loc.y = loc.y * aspectRatio; - /** - * adds the necessary attributes to create a ROI-overlay of type 'rectangle' to a SVGElement - * @param svgElement - an SVGElement (should have type 'polygon' (sic)) - * @param geometry - the geometry describing the rectangle - * @param aspectRatio - the aspectRatio (h/w) of the image on which the circle should be placed - * @param xOffset - the x-offset in Openseadragon viewport coordinates of the image on which the circle should be placed - */ - private _addSVGAttributesRectangle(svgElement: SVGElement, geometry: RegionGeometry, aspectRatio: number, xOffset: number): void { - const pointA = geometry.points[0]; - const pointB = geometry.points[1]; - - // geometry.points contains two diagonally opposed corners of the rectangle, but the order of the corners is arbitrary. - // we therefore construct the upperleft (UL), lowerright (LR), upperright (UR) and lowerleft (LL) positions of the corners with min and max operations. - const positionUL = new Point2D(Math.min(pointA.x, pointB.x), Math.min(pointA.y, pointB.y)); - const positionLR = new Point2D(Math.max(pointA.x, pointB.x), Math.max(pointA.y, pointB.y)); - const positionUR = new Point2D(Math.max(pointA.x, pointB.x), Math.min(pointA.y, pointB.y)); - const positionLL = new Point2D(Math.min(pointA.x, pointB.x), Math.max(pointA.y, pointB.y)); - - const points = [positionUL, positionUR, positionLR, positionLL]; - const viewCoordPoints = this._image2ViewPortCoords(points, aspectRatio, xOffset); - const pointsString = this._createSVGPolygonPointsAttribute(viewCoordPoints); - svgElement.setAttribute('points', pointsString); - } - - /** - * adds the necessary attributes to create a ROI-overlay of type 'polygon' to a SVGElement - * @param svgElement - an SVGElement (should have type 'polygon') - * @param geometry - the geometry describing the polygon - * @param aspectRatio - the aspectRatio (h/w) of the image on which the circle should be placed - * @param xOffset - the x-offset in Openseadragon viewport coordinates of the image on which the circle should be placed - */ - private _addSVGAttributesPolygon(svgElement: SVGElement, geometry: RegionGeometry, aspectRatio: number, xOffset: number): void { - const viewCoordPoints = this._image2ViewPortCoords(geometry.points, aspectRatio, xOffset); - const pointsString = this._createSVGPolygonPointsAttribute(viewCoordPoints); - svgElement.setAttribute('points', pointsString); - } - - /** - * adds the necessary attributes to create a ROI-overlay of type 'circle' to a SVGElement - * @param svgElement - an SVGElement (should have type 'circle') - * @param geometry - the geometry describing the circle - * @param aspectRatio - the aspectRatio (h/w) of the image on which the circle should be placed - * @param xOffset - the x-offset in Openseadragon viewport coordinates of the image on which the circle should be placed - */ - private _addSVGAttributesCircle(svgElement: SVGElement, geometry: RegionGeometry, aspectRatio: number, xOffset: number): void { - const viewCoordPoints = this._image2ViewPortCoords(geometry.points, aspectRatio, xOffset); - const cx = String(viewCoordPoints[0].x); - const cy = String(viewCoordPoints[0].y); - // geometry.radius contains not the radius itself, but the coordinates of a (arbitrary) point on the circle. - // we therefore have to calculate the length of the vector geometry.radius to get the actual radius. -> sqrt(x^2 + y^2) - // since geometry.radius has its y coordinate scaled to the height of the image, - // we need to multiply it with the aspectRatio to get to the scale used by Openseadragon, analoguous to this.image2ViewPortCoords() - const radius = String(Math.sqrt(geometry.radius.x * geometry.radius.x + aspectRatio * aspectRatio * geometry.radius.y * geometry.radius.y)); - svgElement.setAttribute('cx', cx); - svgElement.setAttribute('cy', cy); - svgElement.setAttribute('r', radius); - } - - /** - * maps a Point2D[] with coordinates relative to an image to a new Point2D[] with coordinates in the viewport coordinate system of Openseadragon - * see also: https://openseadragon.github.io/examples/viewport-coordinates/ - * @param points - an array of points in coordinate system relative to an image - * @param aspectRatio - the aspectRatio (h/w) of the image - * @param xOffset - the x-offset in viewport coordinates of the image - * @returns - a new Point2D[] with coordinates in the viewport coordinate system of Openseadragon - */ - private _image2ViewPortCoords(points: Point2D[], aspectRatio: number, xOffset: number): Point2D[] { - return points.map( - (point) => (new Point2D(point.x + xOffset, point.y * aspectRatio)) - ); - } + this._viewer.addOverlay({ + element: elt, + location: loc + }); - /** - * returns a string in the format expected by the 'points' attribute of a SVGElement - * @param points - an array of points to be serialized to a string - * @returns - the points serialized to a string in the format expected by the 'points' attribute of a SVGElement - */ - private _createSVGPolygonPointsAttribute(points: Point2D[]): string { - let pointsString = ''; - for (const i in points) { - if (points.hasOwnProperty(i)) { - pointsString += points[i].x; - pointsString += ','; - pointsString += points[i].y; - pointsString += ' '; - } - } - return pointsString; + this._regions[regionIri].push(elt); } } diff --git a/src/config/config.prod.json b/src/config/config.prod.json index a91c65be85..f6b3f86d90 100644 --- a/src/config/config.prod.json +++ b/src/config/config.prod.json @@ -1,13 +1,13 @@ { - "apiProtocol": "https", - "apiHost": "api.dasch.swiss", - "apiPort": 443, - "apiPath": "", - "iiifProtocol": "https", - "iiifHost": "iiif.dasch.swiss", - "iiifPort": 443, - "iiifPath": "", - "geonameToken": "knora", - "jsonWebToken": "", - "logErrors": false + "apiProtocol": "http", + "apiHost": "0.0.0.0", + "apiPort": 3333, + "apiPath": "", + "iiifProtocol": "http", + "iiifHost": "0.0.0.0", + "iiifPort": 1024, + "iiifPath": "", + "geonameToken": "knora", + "jsonWebToken": "", + "logErrors": false }