From 071111873a6199372c665d8794dc110c1d1512ee Mon Sep 17 00:00:00 2001 From: Alexander Weichart <> Date: Sat, 19 Nov 2022 12:23:23 +0100 Subject: [PATCH] fixed: code review suggestions --- copy_to_vault.sh | 1 + manifest.json | 2 +- package-lock.json | 500 +++++++++++------- package.json | 4 +- src/main.ts | 109 ++-- src/settings/GraphSettings.ts | 43 +- src/settings/categories/DisplaySettings.ts | 26 +- src/settings/categories/FilterSettings.ts | 12 +- src/settings/categories/GroupSettings.ts | 12 +- src/util/ObsidianTheme.ts | 18 +- src/views/graph/ForceGraph.ts | 58 +- src/views/graph/Graph3dView.ts | 48 +- src/views/settings/GraphSettingsView.ts | 33 +- .../settings/categories/GroupSettingsView.ts | 18 +- styles.css | 2 +- versions.json | 2 +- 16 files changed, 521 insertions(+), 367 deletions(-) diff --git a/copy_to_vault.sh b/copy_to_vault.sh index b84222a..f1ee391 100755 --- a/copy_to_vault.sh +++ b/copy_to_vault.sh @@ -29,5 +29,6 @@ echo "Copying new plugin files to $vault" cp ./manifest.json "$plugin_path" cp ./styles.css "$plugin_path" cp ./main.js "$plugin_path" +touch "$plugin_path"/.hotreload echo "Done" \ No newline at end of file diff --git a/manifest.json b/manifest.json index 1fffc68..894015b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "3d-graph", "name": "3D Graph", - "version": "1.0.0", + "version": "1.0.1", "description": "A 3D Graph for Obsidian", "author": "Alexander Weichart", "authorUrl": "https://github.com/AlexW00", diff --git a/package-lock.json b/package-lock.json index 233b69a..6982f5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,12 @@ { "name": "3d-graph", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.0.0", + "name": "3d-graph", + "version": "1.0.1", "license": "MIT", "dependencies": { "3d-force-graph": "^1.70.12", @@ -25,27 +26,27 @@ } }, "node_modules/@babel/runtime": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz", - "integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.0.tgz", + "integrity": "sha512-NDYdls71fTXoU8TZHfbBWg7DiZfNzClcKui/+kyi6ppD2L1qnWW3VV6CjtaBXSUGGhiTWJ6ereOIkUvenif66Q==", "dependencies": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.13.10" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@codemirror/state": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.1.1.tgz", - "integrity": "sha512-2s+aXsxmAwnR3Rd+JDHPG/1lw0YsA9PEwl7Re88gHJHGfxyfEzKBmsN4rr53RyPIR4lzbbhJX0DCq0WlqlBIRw==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.1.2.tgz", + "integrity": "sha512-Mxff85Hp5va+zuj+H748KbubXjrinX/k28lj43H14T2D0+4kuvEFIEIO7hCEcvBT8ubZyIelt9yGOjj2MWOEQA==", "dev": true, "peer": true }, "node_modules/@codemirror/view": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.2.0.tgz", - "integrity": "sha512-3emW1symh+GoteFMBPsltjmF790U/trouLILATh3JodbF/z98HvcQh2g3+H6dfNIHx16uNonsAF4mNzVr1TJNA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.4.0.tgz", + "integrity": "sha512-Kv32b6Tn7QVwFbj/EDswTLSocjk5kgggF6zzBFAL4o4hZ/vmtFD155+EjH1pVlbfoDyVC2M6SedPsMrwYscgNg==", "dev": true, "peer": true, "dependencies": { @@ -55,15 +56,15 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", + "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", "dev": true, "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.2", + "espree": "^9.4.0", "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -73,29 +74,35 @@ }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", - "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", + "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", "dev": true, "peer": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, - "node_modules/@humanwhocodes/gitignore-to-minimatch": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", - "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "peer": true, + "engines": { + "node": ">=12.22" + }, "funding": { "type": "github", "url": "https://github.com/sponsors/nzakas" @@ -429,9 +436,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.11.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.52.tgz", - "integrity": "sha512-GnstYouCa9kbYokBCWEVrszJ1P2rGAQpKrqACHKuixkaT8XGu8nsqHvEUIGqDs5vwtsJ7LrYqnPDKRD1V+M39A==", + "version": "16.18.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.2.tgz", + "integrity": "sha512-KIGQJyya+opDCFvDSZMNNS899ov5jlNdtN7PypgHWeb8e+5vWISdwTRo/ClsNVlmDihzOGqFyNBDamUs7TQQCA==", "dev": true }, "node_modules/@types/tern": { @@ -476,6 +483,27 @@ } } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, "node_modules/@typescript-eslint/parser": { "version": "5.29.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.29.0.tgz", @@ -546,6 +574,27 @@ } } }, + "node_modules/@typescript-eslint/type-utils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@typescript-eslint/type-utils/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, "node_modules/@typescript-eslint/types": { "version": "5.29.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.29.0.tgz", @@ -586,6 +635,27 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, "node_modules/@typescript-eslint/utils": { "version": "5.29.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.29.0.tgz", @@ -628,9 +698,9 @@ } }, "node_modules/3d-force-graph": { - "version": "1.70.12", - "resolved": "https://registry.npmjs.org/3d-force-graph/-/3d-force-graph-1.70.12.tgz", - "integrity": "sha512-l0FYOV2VSu9DGI2K4mx8qfzMgw3+H8FTi3+2ECj1mNJSn1/uzvZxt853kmsx5M+aFpq45oigAZtuvUCBpnwjxw==", + "version": "1.70.14", + "resolved": "https://registry.npmjs.org/3d-force-graph/-/3d-force-graph-1.70.14.tgz", + "integrity": "sha512-cXJcAy8ZipcX0kUstCh900wqjADSBIe8TWDCDEi5b9804mecJdta20l/3j2Pr0Br+cqJtVsK4AusSqawlKq5xw==", "dependencies": { "accessor-fn": "1", "kapsule": "^1.13", @@ -645,9 +715,9 @@ "integrity": "sha512-W4/Lj/gry8AHy+IC7Havr7fNbphHDzVAiZd5h10g8LRRz6ZKla3A1/lkFqoV1jh13R0eJLGWjDBlRGK36fcWiw==" }, "node_modules/acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true, "peer": true, "bin": { @@ -1679,15 +1749,16 @@ } }, "node_modules/eslint": { - "version": "8.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.22.0.tgz", - "integrity": "sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA==", + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", + "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", "dev": true, "peer": true, "dependencies": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.10.4", - "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", + "@eslint/eslintrc": "^1.3.3", + "@humanwhocodes/config-array": "^0.11.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -1697,21 +1768,21 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.3", + "espree": "^9.4.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", + "glob-parent": "^6.0.2", "globals": "^13.15.0", - "globby": "^11.1.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -1722,8 +1793,7 @@ "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" @@ -1809,9 +1879,9 @@ } }, "node_modules/espree": { - "version": "9.3.3", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", - "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", + "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "dev": true, "peer": true, "dependencies": { @@ -1897,9 +1967,9 @@ "peer": true }, "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -2218,6 +2288,16 @@ "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2225,6 +2305,13 @@ "dev": true, "peer": true }, + "node_modules/js-sdsl": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", + "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", + "dev": true, + "peer": true + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -2372,9 +2459,9 @@ "integrity": "sha512-JsUbEOzANskax+WSYiAPETemLWYXmixuPAlmZmhIbIj6FH/WDgEGCGnRwUQBK0GjOnVm8Ui+e5IJ+5VZ4e32eQ==" }, "node_modules/ngraph.forcelayout": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ngraph.forcelayout/-/ngraph.forcelayout-3.3.0.tgz", - "integrity": "sha512-EWqG8oSEueByuisyFl/c77M0+ts8g+dpNseafXFO71f0PvvZgzQ1zac1yO9CJVK6e94kbkvztgjDX3oQZ/4lVA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/ngraph.forcelayout/-/ngraph.forcelayout-3.3.1.tgz", + "integrity": "sha512-MKBuEh1wujyQHFTW57y5vd/uuEOK0XfXYxm3lC7kktjJLRdt/KEKEknyOlc6tjXflqBKEuYBBcu7Ax5VY+S6aw==", "dependencies": { "ngraph.events": "^1.0.0", "ngraph.merge": "^1.0.0", @@ -2382,9 +2469,9 @@ } }, "node_modules/ngraph.graph": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/ngraph.graph/-/ngraph.graph-20.0.0.tgz", - "integrity": "sha512-tJqmik6U5geNDSbmTSwm4R6coTMDbkfFFHD8wdeSJtKU/cxIWFsKtXuwMva/wTk6tQQl1C2//lrzmwfPJXAXHw==", + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/ngraph.graph/-/ngraph.graph-20.0.1.tgz", + "integrity": "sha512-VFsQ+EMkT+7lcJO1QP8Ik3w64WbHJl27Q53EO9hiFU9CRyxJ8HfcXtfWz/U8okuoYKDctbciL6pX3vG5dt1rYA==", "dependencies": { "ngraph.events": "^1.2.1" } @@ -2405,9 +2492,9 @@ "integrity": "sha512-a6xYwLaJgGxPxm5tBdKrGSNxiYklbshjlAJE0Nm7iHTMMrkKWvUG63QUhn4urMl5/aPLHIVouh0B3CktyU664w==" }, "node_modules/obsidian": { - "version": "0.15.9", - "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-0.15.9.tgz", - "integrity": "sha512-w3JL/IM3/U61rjFSFIFDSv+pcHn3mH1EIRN40kBkC/lGYqjFSPbr6daQe08QkskBz/GAYIeBoaKQIcgU9vV3LQ==", + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-0.16.3.tgz", + "integrity": "sha512-hal9qk1A0GMhHSeLr2/+o3OpLmImiP+Y+sx2ewP13ds76KXsziG96n+IPFT0mSkup1zSwhEu+DeRhmbcyCCXWw==", "dev": true, "dependencies": { "@types/codemirror": "0.0.108", @@ -2594,9 +2681,9 @@ ] }, "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + "version": "0.13.10", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz", + "integrity": "sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==" }, "node_modules/regexpp": { "version": "3.2.0", @@ -2685,9 +2772,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2785,14 +2872,14 @@ "peer": true }, "node_modules/three": { - "version": "0.143.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.143.0.tgz", - "integrity": "sha512-oKcAGYHhJ46TGEuHjodo2n6TY2R6lbvrkp+feKZxqsUL/WkH7GKKaeu6RHeyb2Xjfk2dPLRKLsOP0KM2VgT8Zg==" + "version": "0.146.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.146.0.tgz", + "integrity": "sha512-1lvNfLezN6OJ9NaFAhfX4sm5e9YCzHtaRgZ1+B4C+Hv6TibRMsuBAM5/wVKzxjpYIlMymvgsHEFrrigEfXnb2A==" }, "node_modules/three-forcegraph": { - "version": "1.39.5", - "resolved": "https://registry.npmjs.org/three-forcegraph/-/three-forcegraph-1.39.5.tgz", - "integrity": "sha512-TRvmXculSEg6TJSqWNaTa03xbn1HyASlq7SY7pVlZFdf8KnQ2ebRhGFLc9E2gRXAKZv6o4CVQkeMaNQIoAeu1A==", + "version": "1.39.6", + "resolved": "https://registry.npmjs.org/three-forcegraph/-/three-forcegraph-1.39.6.tgz", + "integrity": "sha512-3rUyFLLND4ec5P1q8ufdgPEnHMf4nacbpFfQnd/BHqfWCeZ3z/pffKwpnMzdsaZFlKkzVbRXK25JAvd1E8Nv4Q==", "dependencies": { "accessor-fn": "1", "d3-array": "1 - 3", @@ -2810,9 +2897,9 @@ } }, "node_modules/three-render-objects": { - "version": "1.27.2", - "resolved": "https://registry.npmjs.org/three-render-objects/-/three-render-objects-1.27.2.tgz", - "integrity": "sha512-cFNVSBLTM2ZjyupDs6lPUKQeOpAKrjz1OfO+GmKwMx7VpeA60+Nt8ncfBc3HwKa9V5cp1I0gjFTIjW9tORE4kw==", + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/three-render-objects/-/three-render-objects-1.27.4.tgz", + "integrity": "sha512-rPFh1eE3NjErTe6bDZZIZQeIfj0BlW5vyeOuDIievNyszrpQBs5qcvTZEomCO+/nCM5tb3ZFANA8HQWr9wjDuw==", "dependencies": { "@tweenjs/tween.js": "18", "accessor-fn": "1", @@ -2849,27 +2936,6 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -2919,13 +2985,6 @@ "punycode": "^2.1.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "node_modules/w3c-keyname": { "version": "2.2.6", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.6.tgz", @@ -2988,24 +3047,24 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.9.tgz", - "integrity": "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==", + "version": "7.20.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.0.tgz", + "integrity": "sha512-NDYdls71fTXoU8TZHfbBWg7DiZfNzClcKui/+kyi6ppD2L1qnWW3VV6CjtaBXSUGGhiTWJ6ereOIkUvenif66Q==", "requires": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.13.10" } }, "@codemirror/state": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.1.1.tgz", - "integrity": "sha512-2s+aXsxmAwnR3Rd+JDHPG/1lw0YsA9PEwl7Re88gHJHGfxyfEzKBmsN4rr53RyPIR4lzbbhJX0DCq0WlqlBIRw==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.1.2.tgz", + "integrity": "sha512-Mxff85Hp5va+zuj+H748KbubXjrinX/k28lj43H14T2D0+4kuvEFIEIO7hCEcvBT8ubZyIelt9yGOjj2MWOEQA==", "dev": true, "peer": true }, "@codemirror/view": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.2.0.tgz", - "integrity": "sha512-3emW1symh+GoteFMBPsltjmF790U/trouLILATh3JodbF/z98HvcQh2g3+H6dfNIHx16uNonsAF4mNzVr1TJNA==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.4.0.tgz", + "integrity": "sha512-Kv32b6Tn7QVwFbj/EDswTLSocjk5kgggF6zzBFAL4o4hZ/vmtFD155+EjH1pVlbfoDyVC2M6SedPsMrwYscgNg==", "dev": true, "peer": true, "requires": { @@ -3015,15 +3074,15 @@ } }, "@eslint/eslintrc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", - "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.3.tgz", + "integrity": "sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==", "dev": true, "peer": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.2", + "espree": "^9.4.0", "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -3033,21 +3092,21 @@ } }, "@humanwhocodes/config-array": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", - "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.7.tgz", + "integrity": "sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==", "dev": true, "peer": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" } }, - "@humanwhocodes/gitignore-to-minimatch": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", - "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "peer": true }, @@ -3370,9 +3429,9 @@ "dev": true }, "@types/node": { - "version": "16.11.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.52.tgz", - "integrity": "sha512-GnstYouCa9kbYokBCWEVrszJ1P2rGAQpKrqACHKuixkaT8XGu8nsqHvEUIGqDs5vwtsJ7LrYqnPDKRD1V+M39A==", + "version": "16.18.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.2.tgz", + "integrity": "sha512-KIGQJyya+opDCFvDSZMNNS899ov5jlNdtN7PypgHWeb8e+5vWISdwTRo/ClsNVlmDihzOGqFyNBDamUs7TQQCA==", "dev": true }, "@types/tern": { @@ -3399,6 +3458,23 @@ "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } } }, "@typescript-eslint/parser": { @@ -3432,6 +3508,23 @@ "@typescript-eslint/utils": "5.29.0", "debug": "^4.3.4", "tsutils": "^3.21.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } } }, "@typescript-eslint/types": { @@ -3453,6 +3546,23 @@ "is-glob": "^4.0.3", "semver": "^7.3.7", "tsutils": "^3.21.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } } }, "@typescript-eslint/utils": { @@ -3480,9 +3590,9 @@ } }, "3d-force-graph": { - "version": "1.70.12", - "resolved": "https://registry.npmjs.org/3d-force-graph/-/3d-force-graph-1.70.12.tgz", - "integrity": "sha512-l0FYOV2VSu9DGI2K4mx8qfzMgw3+H8FTi3+2ECj1mNJSn1/uzvZxt853kmsx5M+aFpq45oigAZtuvUCBpnwjxw==", + "version": "1.70.14", + "resolved": "https://registry.npmjs.org/3d-force-graph/-/3d-force-graph-1.70.14.tgz", + "integrity": "sha512-cXJcAy8ZipcX0kUstCh900wqjADSBIe8TWDCDEi5b9804mecJdta20l/3j2Pr0Br+cqJtVsK4AusSqawlKq5xw==", "requires": { "accessor-fn": "1", "kapsule": "^1.13", @@ -3497,9 +3607,9 @@ "integrity": "sha512-W4/Lj/gry8AHy+IC7Havr7fNbphHDzVAiZd5h10g8LRRz6ZKla3A1/lkFqoV1jh13R0eJLGWjDBlRGK36fcWiw==" }, "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true, "peer": true }, @@ -4163,15 +4273,16 @@ "peer": true }, "eslint": { - "version": "8.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.22.0.tgz", - "integrity": "sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA==", + "version": "8.26.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", + "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", "dev": true, "peer": true, "requires": { - "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.10.4", - "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", + "@eslint/eslintrc": "^1.3.3", + "@humanwhocodes/config-array": "^0.11.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -4181,21 +4292,21 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.3", + "espree": "^9.4.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", + "glob-parent": "^6.0.2", "globals": "^13.15.0", - "globby": "^11.1.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -4206,8 +4317,7 @@ "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "text-table": "^0.2.0" }, "dependencies": { "eslint-scope": { @@ -4264,9 +4374,9 @@ "dev": true }, "espree": { - "version": "9.3.3", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", - "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", + "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "dev": true, "peer": true, "requires": { @@ -4332,9 +4442,9 @@ "peer": true }, "fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -4583,6 +4693,13 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "peer": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -4590,6 +4707,13 @@ "dev": true, "peer": true }, + "js-sdsl": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", + "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==", + "dev": true, + "peer": true + }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -4710,9 +4834,9 @@ "integrity": "sha512-JsUbEOzANskax+WSYiAPETemLWYXmixuPAlmZmhIbIj6FH/WDgEGCGnRwUQBK0GjOnVm8Ui+e5IJ+5VZ4e32eQ==" }, "ngraph.forcelayout": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ngraph.forcelayout/-/ngraph.forcelayout-3.3.0.tgz", - "integrity": "sha512-EWqG8oSEueByuisyFl/c77M0+ts8g+dpNseafXFO71f0PvvZgzQ1zac1yO9CJVK6e94kbkvztgjDX3oQZ/4lVA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/ngraph.forcelayout/-/ngraph.forcelayout-3.3.1.tgz", + "integrity": "sha512-MKBuEh1wujyQHFTW57y5vd/uuEOK0XfXYxm3lC7kktjJLRdt/KEKEknyOlc6tjXflqBKEuYBBcu7Ax5VY+S6aw==", "requires": { "ngraph.events": "^1.0.0", "ngraph.merge": "^1.0.0", @@ -4720,9 +4844,9 @@ } }, "ngraph.graph": { - "version": "20.0.0", - "resolved": "https://registry.npmjs.org/ngraph.graph/-/ngraph.graph-20.0.0.tgz", - "integrity": "sha512-tJqmik6U5geNDSbmTSwm4R6coTMDbkfFFHD8wdeSJtKU/cxIWFsKtXuwMva/wTk6tQQl1C2//lrzmwfPJXAXHw==", + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/ngraph.graph/-/ngraph.graph-20.0.1.tgz", + "integrity": "sha512-VFsQ+EMkT+7lcJO1QP8Ik3w64WbHJl27Q53EO9hiFU9CRyxJ8HfcXtfWz/U8okuoYKDctbciL6pX3vG5dt1rYA==", "requires": { "ngraph.events": "^1.2.1" } @@ -4743,9 +4867,9 @@ "integrity": "sha512-a6xYwLaJgGxPxm5tBdKrGSNxiYklbshjlAJE0Nm7iHTMMrkKWvUG63QUhn4urMl5/aPLHIVouh0B3CktyU664w==" }, "obsidian": { - "version": "0.15.9", - "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-0.15.9.tgz", - "integrity": "sha512-w3JL/IM3/U61rjFSFIFDSv+pcHn3mH1EIRN40kBkC/lGYqjFSPbr6daQe08QkskBz/GAYIeBoaKQIcgU9vV3LQ==", + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/obsidian/-/obsidian-0.16.3.tgz", + "integrity": "sha512-hal9qk1A0GMhHSeLr2/+o3OpLmImiP+Y+sx2ewP13ds76KXsziG96n+IPFT0mSkup1zSwhEu+DeRhmbcyCCXWw==", "dev": true, "requires": { "@types/codemirror": "0.0.108", @@ -4869,9 +4993,9 @@ "dev": true }, "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + "version": "0.13.10", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz", + "integrity": "sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==" }, "regexpp": { "version": "3.2.0", @@ -4927,9 +5051,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -5000,14 +5124,14 @@ "peer": true }, "three": { - "version": "0.143.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.143.0.tgz", - "integrity": "sha512-oKcAGYHhJ46TGEuHjodo2n6TY2R6lbvrkp+feKZxqsUL/WkH7GKKaeu6RHeyb2Xjfk2dPLRKLsOP0KM2VgT8Zg==" + "version": "0.146.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.146.0.tgz", + "integrity": "sha512-1lvNfLezN6OJ9NaFAhfX4sm5e9YCzHtaRgZ1+B4C+Hv6TibRMsuBAM5/wVKzxjpYIlMymvgsHEFrrigEfXnb2A==" }, "three-forcegraph": { - "version": "1.39.5", - "resolved": "https://registry.npmjs.org/three-forcegraph/-/three-forcegraph-1.39.5.tgz", - "integrity": "sha512-TRvmXculSEg6TJSqWNaTa03xbn1HyASlq7SY7pVlZFdf8KnQ2ebRhGFLc9E2gRXAKZv6o4CVQkeMaNQIoAeu1A==", + "version": "1.39.6", + "resolved": "https://registry.npmjs.org/three-forcegraph/-/three-forcegraph-1.39.6.tgz", + "integrity": "sha512-3rUyFLLND4ec5P1q8ufdgPEnHMf4nacbpFfQnd/BHqfWCeZ3z/pffKwpnMzdsaZFlKkzVbRXK25JAvd1E8Nv4Q==", "requires": { "accessor-fn": "1", "d3-array": "1 - 3", @@ -5022,9 +5146,9 @@ } }, "three-render-objects": { - "version": "1.27.2", - "resolved": "https://registry.npmjs.org/three-render-objects/-/three-render-objects-1.27.2.tgz", - "integrity": "sha512-cFNVSBLTM2ZjyupDs6lPUKQeOpAKrjz1OfO+GmKwMx7VpeA60+Nt8ncfBc3HwKa9V5cp1I0gjFTIjW9tORE4kw==", + "version": "1.27.4", + "resolved": "https://registry.npmjs.org/three-render-objects/-/three-render-objects-1.27.4.tgz", + "integrity": "sha512-rPFh1eE3NjErTe6bDZZIZQeIfj0BlW5vyeOuDIievNyszrpQBs5qcvTZEomCO+/nCM5tb3ZFANA8HQWr9wjDuw==", "requires": { "@tweenjs/tween.js": "18", "accessor-fn": "1", @@ -5052,23 +5176,6 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -5102,13 +5209,6 @@ "punycode": "^2.1.0" } }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true, - "peer": true - }, "w3c-keyname": { "version": "2.2.6", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.6.tgz", diff --git a/package.json b/package.json index e072fb5..c2917ae 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "3d-graph", - "version": "1.0.0", + "version": "1.0.1", "description": "A 3D graph for Obsidian", "main": "main.js", "scripts": { "dev": "node esbuild.config.mjs", "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", - "build:copy": "npm run build && ./copy_to_vault.sh ~/Desktop/Obs", + "build:copy": "npm run build && ./copy_to_vault.sh ~/Desktop/YouTube", "version": "node version-bump.mjs && git add manifest.json versions.json" }, "keywords": [], diff --git a/src/main.ts b/src/main.ts index 42e4ef4..47b5051 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,32 +1,26 @@ -import { App, Notice, Plugin, WorkspaceLeaf } from "obsidian"; +import { Notice, Plugin } from "obsidian"; import { Graph3dView } from "./views/graph/Graph3dView"; -import GraphSettings, { DEFAULT_SETTINGS } from "./settings/GraphSettings"; +import GraphSettings from "./settings/GraphSettings"; import State from "./util/State"; import Graph from "./graph/Graph"; import ObsidianTheme from "./util/ObsidianTheme"; -import { NodeGroup } from "./settings/categories/GroupSettings"; import EventBus from "./util/EventBus"; import { ResolvedLinkCache } from "./graph/Link"; import shallowCompare from "./util/ShallowCompare"; export default class Graph3dPlugin extends Plugin { - // API - public static app: App; - settings: GraphSettings; _resolvedCache: ResolvedLinkCache; // States - public static settingsState: State; - public static openFileState: State = new State( - undefined - ); - private static cacheIsReady: State = new State(false); + public settingsState: State; + public openFileState: State = new State(undefined); + private cacheIsReady: State = new State(false); // Other properties - public static globalGraph: Graph; - public static theme: ObsidianTheme; + public globalGraph: Graph; + public theme: ObsidianTheme; // Graphs that are waiting for cache to be ready - private static queuedGraphs: [WorkspaceLeaf, boolean][] = []; + private queuedGraphs: Graph3dView[] = []; private callbackUnregisterHandles: (() => void)[] = []; async onload() { @@ -46,21 +40,20 @@ export default class Graph3dPlugin extends Plugin { } private async init() { - await this.loadSettings(); - this.initStates(); + await this.initStates(); this.initListeners(); } - private initStates() { - Graph3dPlugin.settingsState = new State(this.settings); - Graph3dPlugin.theme = new ObsidianTheme(this.app.workspace.containerEl); - Graph3dPlugin.app = this.app; + private async initStates() { + const settings = await this.loadSettings(); + this.settingsState = new State(settings); + this.theme = new ObsidianTheme(this.app.workspace.containerEl); } private initListeners() { this.callbackUnregisterHandles.push( // save settings on change - Graph3dPlugin.settingsState.onChange(() => this.saveSettings()) + this.settingsState.onChange(() => this.saveSettings()) ); // internal event to reset settings to default @@ -81,13 +74,13 @@ export default class Graph3dPlugin extends Plugin { // when a file gets opened, update the open file state this.registerEvent( this.app.workspace.on("file-open", (file) => { - if (file) Graph3dPlugin.openFileState.value = file.path; + if (file) this.openFileState.value = file.path; }) ); this.callbackUnregisterHandles.push( // when the cache is ready, open the queued graphs - Graph3dPlugin.cacheIsReady.onChange((isReady) => { + this.cacheIsReady.onChange((isReady) => { if (isReady) { this.openQueuedGraphs(); } @@ -95,21 +88,25 @@ export default class Graph3dPlugin extends Plugin { ); // all files are resolved, so the cache is ready: - this.app.metadataCache.on("resolved", this.onGraphCacheReady); + this.app.metadataCache.on( + "resolved", + this.onGraphCacheReady.bind(this) + ); // the cache changed: - this.app.metadataCache.on("resolve", this.onGraphCacheChanged); + this.app.metadataCache.on( + "resolve", + this.onGraphCacheChanged.bind(this) + ); } // opens all queued graphs (graphs get queued if cache isnt ready yet) private openQueuedGraphs() { - Graph3dPlugin.queuedGraphs.forEach(([leaf, isLocalGraph]) => { - leaf?.open(new Graph3dView(leaf, isLocalGraph)); - }); - Graph3dPlugin.queuedGraphs = []; + this.queuedGraphs.forEach((view) => view.showGraph()); + this.queuedGraphs = []; } private onGraphCacheReady = () => { - Graph3dPlugin.cacheIsReady.value = true; + this.cacheIsReady.value = true; this.onGraphCacheChanged(); }; @@ -118,7 +115,7 @@ export default class Graph3dPlugin extends Plugin { // Obsidian API sends a lot of (for this plugin) unnecessary stuff // with the resolve event if ( - Graph3dPlugin.cacheIsReady.value && + this.cacheIsReady.value && !shallowCompare( this._resolvedCache, this.app.metadataCache.resolvedLinks @@ -127,12 +124,12 @@ export default class Graph3dPlugin extends Plugin { this._resolvedCache = structuredClone( this.app.metadataCache.resolvedLinks ); - Graph3dPlugin.globalGraph = Graph.createFromApp(this.app); + this.globalGraph = Graph.createFromApp(this.app); } }; private onDoResetSettings = () => { - Graph3dPlugin.settingsState.value.reset(); + this.settingsState.value.reset(); EventBus.trigger("did-reset-settings"); }; @@ -141,7 +138,7 @@ export default class Graph3dPlugin extends Plugin { const newFilePath = this.app.workspace.getActiveFile()?.path; if (newFilePath) { - Graph3dPlugin.openFileState.value = newFilePath; + this.openFileState.value = newFilePath; this.openGraph(true); } else { new Notice("No file is currently open"); @@ -155,36 +152,30 @@ export default class Graph3dPlugin extends Plugin { // Open a global or local graph private openGraph = (isLocalGraph: boolean) => { - const leaf = this.app.workspace.getLeaf(isLocalGraph); - if (Graph3dPlugin.cacheIsReady.value) { - leaf?.open(new Graph3dView(leaf, isLocalGraph)); + const leaf = this.app.workspace.getLeaf(isLocalGraph ? "split" : false); + const graphView = new Graph3dView(this, leaf, isLocalGraph); + leaf.open(graphView); + if (this.cacheIsReady.value) { + graphView.showGraph(); } else { - Graph3dPlugin.queuedGraphs.push([leaf, isLocalGraph]); + this.queuedGraphs.push(graphView); } }; - // Load the settings as a GraphSettings instance - private async loadSettings() { - const loadedData = (await this.loadData()) as GraphSettings, - defaultSettings = DEFAULT_SETTINGS(); - - // Has to be done this way in order to preserve the class structure - if (loadedData?.display) { - Object.assign(defaultSettings.display, loadedData.display); - } - if (loadedData?.filters) { - Object.assign(defaultSettings.filters, loadedData.filters); - } - if (loadedData?.groups?.groups) { - defaultSettings.groups.groups = loadedData.groups.groups.map( - (groupObj) => Object.assign(new NodeGroup("", ""), groupObj) - ); - } - this.settings = defaultSettings; + private async loadSettings(): Promise { + const loadedData = await this.loadData(), + settings = GraphSettings.fromStore(loadedData); + console.log("Loaded settings", settings); + console.log("From data", loadedData); + return settings; } async saveSettings() { - await this.saveData(this.settings); + console.log( + "saveSettings:", + this.settingsState.getRawValue().toObject() + ); + await this.saveData(this.settingsState.getRawValue().toObject()); } onunload() { @@ -193,7 +184,7 @@ export default class Graph3dPlugin extends Plugin { EventBus.off("do-reset-settings", this.onDoResetSettings); } - public static getSettings(): GraphSettings { - return Graph3dPlugin.settingsState.value; + public getSettings(): GraphSettings { + return this.settingsState.value; } } diff --git a/src/settings/GraphSettings.ts b/src/settings/GraphSettings.ts index 081c945..61fc8d8 100644 --- a/src/settings/GraphSettings.ts +++ b/src/settings/GraphSettings.ts @@ -1,28 +1,41 @@ -import {DisplaySettings} from "./categories/DisplaySettings"; -import {FilterSettings} from "./categories/FilterSettings"; -import {GroupSettings} from "./categories/GroupSettings"; +import { DisplaySettings } from "./categories/DisplaySettings"; +import { FilterSettings } from "./categories/FilterSettings"; +import { GroupSettings } from "./categories/GroupSettings"; export default class GraphSettings { filters: FilterSettings; groups: GroupSettings; display: DisplaySettings; - constructor (filterOptions: FilterSettings, groupOptions: GroupSettings, displayOptions: DisplaySettings) { + constructor( + filterOptions: FilterSettings, + groupOptions: GroupSettings, + displayOptions: DisplaySettings + ) { this.filters = filterOptions; this.groups = groupOptions; this.display = displayOptions; } - public reset () { - this.filters = new FilterSettings(); - this.groups = new GroupSettings(); - this.display = new DisplaySettings(); + public static fromStore(store: any) { + return new GraphSettings( + FilterSettings.fromStore(store?.filters), + GroupSettings.fromStore(store?.groups), + DisplaySettings.fromStore(store?.display) + ); + } + + public reset() { + Object.assign(this.filters, new FilterSettings()); + Object.assign(this.groups, new GroupSettings()); + Object.assign(this.display, new DisplaySettings()); } -} -const DEFAULT_SETTINGS = () : GraphSettings => new GraphSettings( - new FilterSettings(), - new GroupSettings(), - new DisplaySettings() -); -export {DEFAULT_SETTINGS}; + public toObject() { + return { + filters: this.filters.toObject(), + groups: this.groups.toObject(), + display: this.display.toObject(), + }; + } +} diff --git a/src/settings/categories/DisplaySettings.ts b/src/settings/categories/DisplaySettings.ts index c8a8a50..5220a60 100644 --- a/src/settings/categories/DisplaySettings.ts +++ b/src/settings/categories/DisplaySettings.ts @@ -10,9 +10,27 @@ export class DisplaySettings { particleSize?: number, particleCount?: number ) { - this.nodeSize = nodeSize || this.nodeSize; - this.linkThickness = linkThickness || this.linkThickness; - this.particleSize = particleSize || this.particleSize; - this.particleCount = particleCount || this.particleCount; + this.nodeSize = nodeSize ?? this.nodeSize; + this.linkThickness = linkThickness ?? this.linkThickness; + this.particleSize = particleSize ?? this.particleSize; + this.particleCount = particleCount ?? this.particleCount; + } + + public static fromStore(store: any) { + return new DisplaySettings( + store?.nodeSize, + store?.linkThickness, + store?.particleSize, + store?.particleCount + ); + } + + public toObject() { + return { + nodeSize: this.nodeSize, + linkThickness: this.linkThickness, + particleSize: this.particleSize, + particleCount: this.particleCount, + }; } } diff --git a/src/settings/categories/FilterSettings.ts b/src/settings/categories/FilterSettings.ts index 380f6f9..a73f0c2 100644 --- a/src/settings/categories/FilterSettings.ts +++ b/src/settings/categories/FilterSettings.ts @@ -2,6 +2,16 @@ export class FilterSettings { doShowOrphans? = true; constructor(doShowOrphans?: boolean) { - this.doShowOrphans = doShowOrphans || this.doShowOrphans; + this.doShowOrphans = doShowOrphans ?? this.doShowOrphans; + } + + public static fromStore(store: any) { + return new FilterSettings(store?.doShowOrphans); + } + + public toObject() { + return { + doShowOrphans: this.doShowOrphans, + }; } } diff --git a/src/settings/categories/GroupSettings.ts b/src/settings/categories/GroupSettings.ts index 4960579..c1be3b0 100644 --- a/src/settings/categories/GroupSettings.ts +++ b/src/settings/categories/GroupSettings.ts @@ -4,7 +4,17 @@ export class GroupSettings { groups: NodeGroup[] = []; constructor(groups?: NodeGroup[]) { - this.groups = groups || this.groups; + this.groups = groups ?? this.groups; + } + + public static fromStore(store: any) { + return new GroupSettings(store?.groups); + } + + public toObject() { + return { + groups: this.groups, + }; } } diff --git a/src/util/ObsidianTheme.ts b/src/util/ObsidianTheme.ts index 7e6a11e..7f6c34b 100644 --- a/src/util/ObsidianTheme.ts +++ b/src/util/ObsidianTheme.ts @@ -9,15 +9,14 @@ export default class ObsidianTheme { backgroundModifierSuccess: string; backgroundModifierError: string; - textAccent: string; - textAccentHover: string; + colorAccent: string; + interactiveAccentHover: string; textNormal: string; textMuted: string; textFaint: string; - interactiveAccent: string; - interactiveAccentHover: string; + textAccent: string; // some others missing, but not needed currently @@ -45,11 +44,8 @@ export default class ObsidianTheme { .getPropertyValue("--background-modifier-error") .trim(); - this.textAccent = getComputedStyle(root) - .getPropertyValue("--text-accent") - .trim(); - this.textAccentHover = getComputedStyle(root) - .getPropertyValue("--text-accent-hover") + this.colorAccent = getComputedStyle(root) + .getPropertyValue("--color-accent") .trim(); this.textNormal = getComputedStyle(root) @@ -62,8 +58,8 @@ export default class ObsidianTheme { .getPropertyValue("--text-faint") .trim(); - this.interactiveAccent = getComputedStyle(root) - .getPropertyValue("--interactive-accent") + this.textAccent = getComputedStyle(root) + .getPropertyValue("--text-accent") .trim(); this.interactiveAccentHover = getComputedStyle(root) .getPropertyValue("--interactive-accent-hover") diff --git a/src/views/graph/ForceGraph.ts b/src/views/graph/ForceGraph.ts index be52503..5f670d4 100644 --- a/src/views/graph/ForceGraph.ts +++ b/src/views/graph/ForceGraph.ts @@ -21,20 +21,27 @@ export class ForceGraph { private readonly isLocalGraph: boolean; private graph: Graph; + private readonly plugin: Graph3dPlugin; - constructor(rootHtmlElement: HTMLElement, isLocalGraph: boolean) { + constructor( + plugin: Graph3dPlugin, + rootHtmlElement: HTMLElement, + isLocalGraph: boolean + ) { this.rootHtmlElement = rootHtmlElement; this.isLocalGraph = isLocalGraph; + this.plugin = plugin; - this.createGraph(); + console.log("ForceGraph constructor", rootHtmlElement); + this.createGraph(); this.initListeners(); } private initListeners() { - Graph3dPlugin.settingsState.onChange(this.onSettingsStateChanged); + this.plugin.settingsState.onChange(this.onSettingsStateChanged); if (this.isLocalGraph) - Graph3dPlugin.openFileState.onChange(this.refreshGraphData); + this.plugin.openFileState.onChange(this.refreshGraphData); EventBus.on("graph-changed", this.refreshGraphData); } @@ -54,19 +61,20 @@ export class ForceGraph { .nodeLabel( (node: Node) => `
${node.name}
` ) - .nodeRelSize(Graph3dPlugin.getSettings().display.nodeSize) + .nodeRelSize(this.plugin.getSettings().display.nodeSize) .backgroundColor(rgba(0, 0, 0, 0.0)) .width(width) .height(height); } private getGraphData = (): Graph => { - if (this.isLocalGraph && Graph3dPlugin.openFileState.value) { - this.graph = Graph3dPlugin.globalGraph + if (this.isLocalGraph && this.plugin.openFileState.value) { + this.graph = this.plugin.globalGraph .clone() - .getLocalGraph(Graph3dPlugin.openFileState.value); + .getLocalGraph(this.plugin.openFileState.value); + console.log(this.graph); } else { - this.graph = Graph3dPlugin.globalGraph.clone(); + this.graph = this.plugin.globalGraph.clone(); } return this.graph; @@ -83,22 +91,22 @@ export class ForceGraph { this.instance.linkWidth(data.newValue); } else if (data.currentPath === "display.particleSize") { this.instance.linkDirectionalParticleWidth( - Graph3dPlugin.getSettings().display.particleSize + this.plugin.getSettings().display.particleSize ); } this.instance.refresh(); // other settings only need a refresh }; - public update_dimensions() { + public updateDimensions() { const [width, height] = [ this.rootHtmlElement.offsetWidth, this.rootHtmlElement.offsetHeight, ]; - this.set_dimensions(width, height); + this.setDimensions(width, height); } - public set_dimensions(width: number, height: number) { + public setDimensions(width: number, height: number) { this.instance.width(width); this.instance.height(height); } @@ -114,11 +122,11 @@ export class ForceGraph { if (this.isHighlightedNode(node)) { // Node is highlighted return node === this.hoveredNode - ? Graph3dPlugin.theme.interactiveAccentHover - : Graph3dPlugin.theme.interactiveAccent; + ? this.plugin.theme.interactiveAccentHover + : this.plugin.theme.textAccent; } else { - let color = Graph3dPlugin.theme.textMuted; - Graph3dPlugin.getSettings().groups.groups.forEach((group) => { + let color = this.plugin.theme.textMuted; + this.plugin.getSettings().groups.groups.forEach((group) => { // multiple groups -> last match wins if (NodeGroup.matches(group.query, node)) color = group.color; }); @@ -128,7 +136,7 @@ export class ForceGraph { private doShowNode = (node: Node) => { return ( - Graph3dPlugin.getSettings().filters.doShowOrphans || + this.plugin.getSettings().filters.doShowOrphans || node.links.length > 0 ); }; @@ -152,7 +160,7 @@ export class ForceGraph { if (nodeLinks) nodeLinks.forEach((link) => this.highlightedLinks.add(link)); } - this.hoveredNode = node || null; + this.hoveredNode = node ?? null; this.updateHighlight(); }; @@ -168,22 +176,22 @@ export class ForceGraph { this.instance .linkWidth((link: Link) => this.isHighlightedLink(link) - ? Graph3dPlugin.getSettings().display.linkThickness * 1.5 - : Graph3dPlugin.getSettings().display.linkThickness + ? this.plugin.getSettings().display.linkThickness * 1.5 + : this.plugin.getSettings().display.linkThickness ) .linkDirectionalParticles((link: Link) => this.isHighlightedLink(link) - ? Graph3dPlugin.getSettings().display.particleCount + ? this.plugin.getSettings().display.particleCount : 0 ) .linkDirectionalParticleWidth( - Graph3dPlugin.getSettings().display.particleSize + this.plugin.getSettings().display.particleSize ) .onLinkHover(this.onLinkHover) .linkColor((link: Link) => this.isHighlightedLink(link) - ? Graph3dPlugin.theme.interactiveAccent - : Graph3dPlugin.theme.textMuted + ? this.plugin.theme.textAccent + : this.plugin.theme.textMuted ); }; diff --git a/src/views/graph/Graph3dView.ts b/src/views/graph/Graph3dView.ts index 7eedbef..dd5a595 100644 --- a/src/views/graph/Graph3dView.ts +++ b/src/views/graph/Graph3dView.ts @@ -2,37 +2,47 @@ import { ItemView, WorkspaceLeaf } from "obsidian"; import Node from "../../graph/Node"; import { ForceGraph } from "./ForceGraph"; import { GraphSettingsView } from "../settings/GraphSettingsView"; +import Graph3dPlugin from "src/main"; export class Graph3dView extends ItemView { private forceGraph: ForceGraph; private readonly isLocalGraph: boolean; + private readonly plugin: Graph3dPlugin; - constructor(leaf: WorkspaceLeaf, isLocalGraph = false) { + constructor( + plugin: Graph3dPlugin, + leaf: WorkspaceLeaf, + isLocalGraph = false + ) { super(leaf); this.isLocalGraph = isLocalGraph; + this.plugin = plugin; } - onload() { - super.onload(); - const viewContent = this.getViewContent(); + onunload() { + super.onunload(); + this.forceGraph?.getInstance()._destructor(); + } + + showGraph() { + const viewContent = this.containerEl.querySelector( + ".view-content" + ) as HTMLElement; if (viewContent) { viewContent.classList.add("graph-3d-view"); this.appendGraph(viewContent); - const settings = new GraphSettingsView(); + const settings = new GraphSettingsView( + this.plugin.settingsState, + this.plugin.theme + ); viewContent.appendChild(settings); } else { console.error("Could not find view content"); } } - onunload() { - super.onunload(); - console.log("Unloading 3D Graph"); - this.forceGraph.getInstance()._destructor(); - } - getDisplayText(): string { return "3D-Graph"; } @@ -43,19 +53,15 @@ export class Graph3dView extends ItemView { onResize() { super.onResize(); - const viewContent = this.getViewContent(); - - if (viewContent) { - this.forceGraph.update_dimensions(); - } - } - - private getViewContent(): HTMLElement | null { - return this.containerEl.querySelector(".view-content"); + this.forceGraph.updateDimensions(); } private appendGraph(viewContent: HTMLElement) { - this.forceGraph = new ForceGraph(viewContent, this.isLocalGraph); + this.forceGraph = new ForceGraph( + this.plugin, + viewContent, + this.isLocalGraph + ); this.forceGraph .getInstance() diff --git a/src/views/settings/GraphSettingsView.ts b/src/views/settings/GraphSettingsView.ts index 614881c..a2c2bfc 100644 --- a/src/views/settings/GraphSettingsView.ts +++ b/src/views/settings/GraphSettingsView.ts @@ -1,6 +1,5 @@ import { TreeItem } from "../atomics/TreeItem"; import DisplaySettingsView from "./categories/DisplaySettingsView"; -import Graph3dPlugin from "../../main"; import { FilterSettings } from "../../settings/categories/FilterSettings"; import { GroupSettings } from "../../settings/categories/GroupSettings"; import { DisplaySettings } from "../../settings/categories/DisplaySettings"; @@ -9,10 +8,20 @@ import State, { StateChange } from "../../util/State"; import EventBus from "../../util/EventBus"; import GroupSettingsView from "./categories/GroupSettingsView"; import FilterSettingsView from "./categories/FilterSettingsView"; +import GraphSettings from "src/settings/GraphSettings"; +import ObsidianTheme from "src/util/ObsidianTheme"; export class GraphSettingsView extends HTMLDivElement { - settingsButton: ExtraButtonComponent; - graphControls: HTMLDivElement; + private settingsButton: ExtraButtonComponent; + private graphControls: HTMLDivElement; + private readonly settingsState: State; + private readonly theme: ObsidianTheme; + + constructor(settingsState: State, theme: ObsidianTheme) { + super(); + this.settingsState = settingsState; + this.theme = theme; + } private isCollapsedState = new State(true); @@ -33,26 +42,17 @@ export class GraphSettingsView extends HTMLDivElement { ); this.appendSetting( - Graph3dPlugin.settingsState.createSubState( - "value.filters", - FilterSettings - ), + this.settingsState.createSubState("value.filters", FilterSettings), "Filters", FilterSettingsView ); this.appendSetting( - Graph3dPlugin.settingsState.createSubState( - "value.groups", - GroupSettings - ), + this.settingsState.createSubState("value.groups", GroupSettings), "Groups", - GroupSettingsView + (...args) => GroupSettingsView(...args, this.theme) ); this.appendSetting( - Graph3dPlugin.settingsState.createSubState( - "value.display", - DisplaySettings - ), + this.settingsState.createSubState("value.display", DisplaySettings), "Display", DisplaySettingsView ); @@ -89,6 +89,7 @@ export class GraphSettingsView extends HTMLDivElement { } private onSettingsButtonClicked = () => { + console.log("settings button clicked"); this.isCollapsedState.value = !this.isCollapsedState.value; }; diff --git a/src/views/settings/categories/GroupSettingsView.ts b/src/views/settings/categories/GroupSettingsView.ts index 3dfc0ba..28bfe9d 100644 --- a/src/views/settings/categories/GroupSettingsView.ts +++ b/src/views/settings/categories/GroupSettingsView.ts @@ -1,18 +1,19 @@ import { ButtonComponent, ExtraButtonComponent, TextComponent } from "obsidian"; -import Graph3dPlugin from "src/main"; import { GroupSettings, NodeGroup, } from "src/settings/categories/GroupSettings"; +import ObsidianTheme from "src/util/ObsidianTheme"; import State, { StateChange } from "src/util/State"; import ColorPicker from "src/views/atomics/ColorPicker"; const GroupSettingsView = ( groupSettings: State, - containerEl: HTMLElement + containerEl: HTMLElement, + theme: ObsidianTheme ) => { NodeGroups(groupSettings, containerEl); - AddNodeGroupButton(groupSettings, containerEl); + AddNodeGroupButton(groupSettings, containerEl, theme); groupSettings.onChange((change: StateChange) => { if ( @@ -21,7 +22,7 @@ const GroupSettingsView = ( ) { containerEl.empty(); NodeGroups(groupSettings, containerEl); - AddNodeGroupButton(groupSettings, containerEl); + AddNodeGroupButton(groupSettings, containerEl, theme); } }); }; @@ -47,7 +48,8 @@ const NodeGroups = ( const AddNodeGroupButton = ( groupSettings: State, - containerEl: HTMLElement + containerEl: HTMLElement, + theme: ObsidianTheme ) => { containerEl.querySelector(".graph-color-button-container")?.remove(); @@ -58,11 +60,9 @@ const AddNodeGroupButton = ( .setClass("mod-cta") .setButtonText("Add Group") .onClick(() => { - groupSettings.value.groups.push( - new NodeGroup("", Graph3dPlugin.theme.textMuted) - ); + groupSettings.value.groups.push(new NodeGroup("", theme.textMuted)); containerEl.empty(); - GroupSettingsView(groupSettings, containerEl); + GroupSettingsView(groupSettings, containerEl, theme); }); }; const GroupSettingItem = ( diff --git a/styles.css b/styles.css index 38f6517..d0730f9 100644 --- a/styles.css +++ b/styles.css @@ -44,7 +44,7 @@ .graph-3d-view .graph-settings-view > .clickable-icon { position: absolute; top: 8px; - left: 8px; + right: 8px; } .graph-3d-view .node-label { diff --git a/versions.json b/versions.json index 26382a1..18af01b 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,3 @@ { - "1.0.0": "0.15.0" + "1.0.1": "0.15.0" }