From bc558f29ea17b8aefde6cdffbaa74d4d5ee1f445 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Thu, 22 Feb 2024 13:04:47 +0100 Subject: [PATCH 01/18] chore: Update dependencies --- app/package.json | 6 +- yarn.lock | 162 +++++++++++++++++++++++------------------------ 2 files changed, 83 insertions(+), 85 deletions(-) diff --git a/app/package.json b/app/package.json index 7f7d2858e..85bc82657 100644 --- a/app/package.json +++ b/app/package.json @@ -41,7 +41,8 @@ "@next/mdx": "^11.0.1", "@preconstruct/next": "^3.0.1", "@prisma/client": "^4.5.0", - "@rdfjs/namespace": "^1.1.0", + "@rdfjs/data-model": "^2.0.2", + "@rdfjs/namespace": "^2.0.1", "@reach/auto-id": "^0.15.0", "@sentry/nextjs": "^7.7.0", "@tpluscode/rdf-ns-builders": "2.0.1", @@ -169,7 +170,8 @@ "@types/qs": "^6.9.8", "@types/rdf-ext": "^1.3.8", "@types/rdf-js": "^4.0.1", - "@types/rdfjs__namespace": "^1.1.3", + "@types/rdfjs__data-model": "^2.0.7", + "@types/rdfjs__namespace": "^2.0.10", "@types/react-beautiful-dnd": "^13.1.4", "@types/react-table": "^7.7.15", "@types/react-window": "^1.8.2", diff --git a/yarn.lock b/yarn.lock index 9b7121d75..050920b18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -191,29 +191,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== -"@babel/core@7.12.9": - version "7.12.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" - integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.5" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helpers" "^7.12.5" - "@babel/parser" "^7.12.7" - "@babel/template" "^7.12.7" - "@babel/traverse" "^7.12.9" - "@babel/types" "^7.12.7" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.1" - json5 "^2.1.2" - lodash "^4.17.19" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - -"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.10.5", "@babel/core@^7.12.3", "@babel/core@^7.12.9", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.7.7": +"@babel/core@7.12.9", "@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.10.5", "@babel/core@^7.12.3", "@babel/core@^7.12.9", "@babel/core@^7.14.6", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.7.7": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.9.tgz#b028820718000f267870822fec434820e9b1e4d1" integrity sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw== @@ -243,16 +221,6 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.12.5", "@babel/generator@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" - integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== - dependencies: - "@babel/types" "^7.23.6" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" - "@babel/generator@^7.20.14": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" @@ -263,6 +231,16 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" + integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== + dependencies: + "@babel/types" "^7.23.6" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.14.5": version "7.14.5" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz" @@ -374,17 +352,6 @@ dependencies: "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" - integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.20" - "@babel/helper-module-transforms@^7.14.5": version "7.15.8" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz" @@ -399,6 +366,17 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.6" +"@babel/helper-module-transforms@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" + integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-simple-access" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/helper-validator-identifier" "^7.22.20" + "@babel/helper-optimise-call-expression@^7.14.5", "@babel/helper-optimise-call-expression@^7.15.4": version "7.15.4" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz" @@ -521,7 +499,7 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== -"@babel/helpers@^7.12.5", "@babel/helpers@^7.23.9": +"@babel/helpers@^7.23.9": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.9.tgz#c3e20bbe7f7a7e10cb9b178384b4affdf5995c7d" integrity sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ== @@ -566,12 +544,7 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@7.12.16": - version "7.12.16" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.16.tgz#cc31257419d2c3189d394081635703f549fc1ed4" - integrity sha512-c/+u9cqV6F0+4Hpq01jnJO+GLp2DdT63ppz9Xa+6cHaajM9VFzK/iDXiKK65YtpeVwu+ctfS6iqlMqRgQRzeCw== - -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.20.15", "@babel/parser@^7.21.4", "@babel/parser@^7.22.15", "@babel/parser@^7.23.9", "@babel/parser@^7.7.2": +"@babel/parser@7.12.16", "@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.20.15", "@babel/parser@^7.21.4", "@babel/parser@^7.22.15", "@babel/parser@^7.23.9", "@babel/parser@^7.7.2": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.9.tgz#7b903b6149b0f8fa7ad564af646c4c38a77fc44b" integrity sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA== @@ -935,15 +908,6 @@ resolved "https://registry.npmjs.org/@babel/standalone/-/standalone-7.14.6.tgz" integrity sha512-oAoSp82jhJFnXKybKTOj5QF04XxiDRyiiqrFToiU1udlBXuZoADlPmmnOcuqBrZxSNNUjzJIVK8vt838Qoqjxg== -"@babel/template@^7.12.7", "@babel/template@^7.23.9": - version "7.23.9" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.23.9.tgz#f881d0487cba2828d3259dcb9ef5005a9731011a" - integrity sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA== - dependencies: - "@babel/code-frame" "^7.23.5" - "@babel/parser" "^7.23.9" - "@babel/types" "^7.23.9" - "@babel/template@^7.15.4", "@babel/template@^7.3.3": version "7.15.4" resolved "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz" @@ -962,6 +926,15 @@ "@babel/parser" "^7.22.15" "@babel/types" "^7.22.15" +"@babel/template@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.23.9.tgz#f881d0487cba2828d3259dcb9ef5005a9731011a" + integrity sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/parser" "^7.23.9" + "@babel/types" "^7.23.9" + "@babel/traverse@7.12.13": version "7.12.13" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.13.tgz" @@ -992,7 +965,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.12.9", "@babel/traverse@^7.23.9": +"@babel/traverse@^7.23.9": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.9.tgz#2f9d6aead6b564669394c5ce0f9302bb65b9d950" integrity sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg== @@ -1025,15 +998,6 @@ "@babel/helper-validator-identifier" "^7.14.9" to-fast-properties "^2.0.0" -"@babel/types@^7.12.7", "@babel/types@^7.23.6", "@babel/types@^7.23.9": - version "7.23.9" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.9.tgz#1dd7b59a9a2b5c87f8b41e52770b5ecbf492e002" - integrity sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q== - dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" - "@babel/types@^7.16.7": version "7.17.0" resolved "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz" @@ -1069,6 +1033,15 @@ "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" +"@babel/types@^7.23.6", "@babel/types@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.9.tgz#1dd7b59a9a2b5c87f8b41e52770b5ecbf492e002" + integrity sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q== + dependencies: + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" @@ -3564,6 +3537,11 @@ resolved "https://registry.yarnpkg.com/@rdfjs/data-model/-/data-model-2.0.1.tgz#410aeaea65de9bac605b63172baa64384b65ca98" integrity sha512-oRDYpy7/fJ9NNjS+M7m+dbnhi4lOWYGbBiM/A+u9bBExnN6ifXUF5mUsFxwZaQulmwTDaMhKERdV6iKTBUMgtw== +"@rdfjs/data-model@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@rdfjs/data-model/-/data-model-2.0.2.tgz#65a57fb8c1bc95aa6a1b0843b5c952270248294b" + integrity sha512-v5LRNkLRJazMCGU7VtEzhz5wKwz/IrOdJEKapCtd35HuFbQfeGpoJP6QOXGyFHhWwKmtG+UMlZzYFyNDVE1m6g== + "@rdfjs/dataset@^1.1.1": version "1.1.1" resolved "https://registry.npmjs.org/@rdfjs/dataset/-/dataset-1.1.1.tgz" @@ -3612,6 +3590,13 @@ dependencies: "@rdfjs/data-model" "^2.0.0" +"@rdfjs/namespace@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@rdfjs/namespace/-/namespace-2.0.1.tgz#954a9340e9f3cc9289559b5d7e85ba9c426c00a2" + integrity sha512-U85NWVGnL3gWvOZ4eXwUcv3/bom7PAcutSBQqmVWvOaslPy+kDzAJCH1WYBLpdQd4yMmJ+bpJcDl9rcHtXeixg== + dependencies: + "@rdfjs/data-model" "^2.0.1" + "@rdfjs/normalize@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@rdfjs/normalize/-/normalize-2.0.0.tgz#87f6872043e3459da7baa09946f746fd3d3144f1" @@ -3725,6 +3710,13 @@ dependencies: "@types/node" "*" +"@rdfjs/types@^1.0.1": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@rdfjs/types/-/types-1.1.0.tgz#098f180b7cccb03bb416c7b4d03baaa9d480e36b" + integrity sha512-5zm8bN2/CC634dTcn/0AhTRLaQRjXDZs3QfcAsQKNturHT7XVWcKy/8p3P5gXl+YkZTAmy7T5M/LyiT/jbkENw== + dependencies: + "@types/node" "*" + "@reach/auto-id@^0.15.0": version "0.15.0" resolved "https://registry.npmjs.org/@reach/auto-id/-/auto-id-0.15.0.tgz" @@ -4987,13 +4979,27 @@ dependencies: rdf-js "*" -"@types/rdfjs__namespace@*", "@types/rdfjs__namespace@^1.1.3": +"@types/rdfjs__data-model@^2.0.10": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@types/rdfjs__data-model/-/rdfjs__data-model-2.0.7.tgz#50979f582651ee112d5eea0e064c8c2e67f42595" + integrity sha512-ysEnLulluo12hQLPulSheQIFrU3J+cV0X46NGUFO+TVsMDO4oc25KdrGD+9UnVAlUZTKJO6YYKWbDCl7V/0ADA== + dependencies: + "@rdfjs/types" "^1.0.1" + +"@types/rdfjs__namespace@*": version "1.1.5" resolved "https://registry.npmjs.org/@types/rdfjs__namespace/-/rdfjs__namespace-1.1.5.tgz" integrity sha512-g6oZJzFNdR5W8yMrhLHtwguenwLEZuqHH8xbnybhMwYABZABCLhcY9tt9xZsVHrzLm3SujVR4OYvb8M0OfU3qw== dependencies: rdf-js "^4.0.2" +"@types/rdfjs__namespace@^2.0.10": + version "2.0.10" + resolved "https://registry.yarnpkg.com/@types/rdfjs__namespace/-/rdfjs__namespace-2.0.10.tgz#d55e8c60d2d02d5703d57f72e2787dc0b1c10367" + integrity sha512-xoVzEIOxcpyteEmzaj94MSBbrBFs+vqv05joMhzLEiPRwsBBDnhkdBCaaDxR1Tf7wOW0kB2R1IYe4C3vEBFPgA== + dependencies: + "@rdfjs/types" "*" + "@types/rdfjs__namespace@^2.0.2": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/rdfjs__namespace/-/rdfjs__namespace-2.0.3.tgz#4d290fd7d5d89982056b9d124dc3e921f144ec67" @@ -7116,11 +7122,6 @@ convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.6.0: dependencies: safe-buffer "~5.1.1" -convert-source-map@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" - integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== - convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" @@ -9331,7 +9332,7 @@ fwd-stream@^1.0.4: dependencies: readable-stream "~1.0.26-4" -gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: +gensync@^1.0.0-beta.2: 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== @@ -14567,7 +14568,7 @@ resolve.exports@^1.1.0: resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@1.22.8, resolve@^1.3.2: +resolve@1.22.8: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== @@ -14859,11 +14860,6 @@ semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: dependencies: lru-cache "^6.0.0" -semver@^5.4.1: - version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" From 3c7dffff583af85f36493f6543e4eb831d739988 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Thu, 22 Feb 2024 13:55:51 +0100 Subject: [PATCH 02/18] perf: Remove not necessary query --- app/components/chart-filters-list.tsx | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/app/components/chart-filters-list.tsx b/app/components/chart-filters-list.tsx index f44d0ca03..1e777061a 100644 --- a/app/components/chart-filters-list.tsx +++ b/app/components/chart-filters-list.tsx @@ -21,8 +21,6 @@ import { isTemporalOrdinalDimension, } from "@/domain/data"; import { useTimeFormatUnit } from "@/formatters"; -import { useDataCubesComponentsQuery } from "@/graphql/hooks"; -import { useLocale } from "@/locales/use-locale"; import { useInteractiveFilters } from "@/stores/interactive-filters"; type ChartFiltersListProps = { @@ -33,8 +31,7 @@ type ChartFiltersListProps = { }; export const ChartFiltersList = (props: ChartFiltersListProps) => { - const { dataSource, chartConfig, dimensions, measures } = props; - const locale = useLocale(); + const { chartConfig, dimensions, measures } = props; const timeFormatUnit = useTimeFormatUnit(); const timeSlider = useInteractiveFilters((d) => d.timeSlider); const animationField = getAnimationField(chartConfig); @@ -44,23 +41,8 @@ export const ChartFiltersList = (props: ChartFiltersListProps) => { measures, componentIris: extractChartConfigComponentIris(chartConfig), }); - const [{ data }] = useDataCubesComponentsQuery({ - variables: { - sourceType: dataSource.type, - sourceUrl: dataSource.url, - locale, - cubeFilters: - filters?.map((filter) => ({ - iri: filter.iri, - componentIris: filter.componentIris, - filters: filter.filters, - joinBy: filter.joinBy, - })) ?? [], - }, - pause: !filters, - }); const allFilters = React.useMemo(() => { - if (!data?.dataCubesComponents || !filters || !dimensions || !measures) { + if (!filters || !dimensions || !measures) { return []; } @@ -132,7 +114,6 @@ export const ChartFiltersList = (props: ChartFiltersListProps) => { return namedFilters; }); }, [ - data?.dataCubesComponents, dimensions, measures, filters, From a4020e69127848dbcbac588917ec27a5491db84e Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Thu, 22 Feb 2024 15:36:33 +0100 Subject: [PATCH 03/18] perf: Allow bypassing dimension values loading --- app/graphql/query-hooks.ts | 1 + app/graphql/resolver-types.ts | 1 + app/graphql/resolvers/rdf.ts | 8 ++++---- app/graphql/schema.graphql | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/graphql/query-hooks.ts b/app/graphql/query-hooks.ts index 1acad2aa5..8404732bc 100644 --- a/app/graphql/query-hooks.ts +++ b/app/graphql/query-hooks.ts @@ -101,6 +101,7 @@ export type DataCubeComponentFilter = { filters?: Maybe; componentIris?: Maybe>; joinBy?: Maybe; + loadValues?: Maybe; }; diff --git a/app/graphql/resolver-types.ts b/app/graphql/resolver-types.ts index d62abb6e2..cb6c4e5e1 100644 --- a/app/graphql/resolver-types.ts +++ b/app/graphql/resolver-types.ts @@ -102,6 +102,7 @@ export type DataCubeComponentFilter = { filters?: Maybe; componentIris?: Maybe>; joinBy?: Maybe; + loadValues?: Maybe; }; diff --git a/app/graphql/resolvers/rdf.ts b/app/graphql/resolvers/rdf.ts index 69cd3f3a0..066d26ace 100644 --- a/app/graphql/resolvers/rdf.ts +++ b/app/graphql/resolvers/rdf.ts @@ -153,7 +153,7 @@ export const dataCubeComponents: NonNullable< const { loaders, sparqlClient, sparqlClientStream, cache } = await setup( info ); - const { iri, latest = true, componentIris, filters } = cubeFilter; + const { iri, latest = true, componentIris, filters, loadValues } = cubeFilter; const rawCube = await loaders.cube.load(iri); if (!rawCube) { @@ -183,9 +183,9 @@ export const dataCubeComponents: NonNullable< cache, filters ); - const values: DimensionValue[] = await dimensionValuesLoader.load( - component - ); + const values: DimensionValue[] = loadValues + ? await dimensionValuesLoader.load(component) + : []; values.sort((a, b) => ascending( a.position ?? a.value ?? undefined, diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index eea01b77a..48fc917bd 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -344,6 +344,7 @@ input DataCubeComponentFilter { filters: Filters componentIris: [String!] joinBy: String + loadValues: Boolean } input DataCubeMetadataFilter { From d9583a2d7ffe1c69070fd3004d1fb647d9dae1fb Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Thu, 22 Feb 2024 15:37:32 +0100 Subject: [PATCH 04/18] refactor: Explicitly specify loading of dimension values --- app/charts/area/chart-area.tsx | 1 + app/charts/column/chart-column.tsx | 1 + app/charts/combo/chart-combo-line-column.tsx | 1 + app/charts/combo/chart-combo-line-dual.tsx | 1 + app/charts/combo/chart-combo-line-single.tsx | 1 + app/charts/line/chart-lines.tsx | 1 + app/charts/map/chart-map.tsx | 1 + app/charts/pie/chart-pie.tsx | 1 + app/charts/scatterplot/chart-scatterplot.tsx | 1 + app/charts/table/chart-table.tsx | 1 + .../components/chart-options-selector.tsx | 1 + .../components/chart-type-selector.tsx | 1 + app/configurator/configurator-state.tsx | 22 +++++++++++-------- .../interactive-filters-configurator.tsx | 1 + .../table/table-chart-configurator.hook.tsx | 1 + 15 files changed, 27 insertions(+), 9 deletions(-) diff --git a/app/charts/area/chart-area.tsx b/app/charts/area/chart-area.tsx index b4dfc675f..101df95fa 100644 --- a/app/charts/area/chart-area.tsx +++ b/app/charts/area/chart-area.tsx @@ -56,6 +56,7 @@ export const ChartAreasVisualization = ({ iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/charts/column/chart-column.tsx b/app/charts/column/chart-column.tsx index 069c99bee..2c0b7b6c9 100644 --- a/app/charts/column/chart-column.tsx +++ b/app/charts/column/chart-column.tsx @@ -70,6 +70,7 @@ export const ChartColumnsVisualization = ({ iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/charts/combo/chart-combo-line-column.tsx b/app/charts/combo/chart-combo-line-column.tsx index a6dc4f178..cf53b55a5 100644 --- a/app/charts/combo/chart-combo-line-column.tsx +++ b/app/charts/combo/chart-combo-line-column.tsx @@ -52,6 +52,7 @@ export const ChartComboLineColumnVisualization = ( iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/charts/combo/chart-combo-line-dual.tsx b/app/charts/combo/chart-combo-line-dual.tsx index 39e34822e..9749e392f 100644 --- a/app/charts/combo/chart-combo-line-dual.tsx +++ b/app/charts/combo/chart-combo-line-dual.tsx @@ -52,6 +52,7 @@ export const ChartComboLineDualVisualization = ( iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/charts/combo/chart-combo-line-single.tsx b/app/charts/combo/chart-combo-line-single.tsx index a652930a7..ff7b7d033 100644 --- a/app/charts/combo/chart-combo-line-single.tsx +++ b/app/charts/combo/chart-combo-line-single.tsx @@ -57,6 +57,7 @@ export const ChartComboLineSingleVisualization = ( iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/charts/line/chart-lines.tsx b/app/charts/line/chart-lines.tsx index b98306fd3..a9be87332 100644 --- a/app/charts/line/chart-lines.tsx +++ b/app/charts/line/chart-lines.tsx @@ -57,6 +57,7 @@ export const ChartLinesVisualization = ({ iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/charts/map/chart-map.tsx b/app/charts/map/chart-map.tsx index f6b3cdcac..6fc04bd60 100644 --- a/app/charts/map/chart-map.tsx +++ b/app/charts/map/chart-map.tsx @@ -60,6 +60,7 @@ export const ChartMapVisualization = ({ iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/charts/pie/chart-pie.tsx b/app/charts/pie/chart-pie.tsx index fd915c61f..015dc0d4e 100644 --- a/app/charts/pie/chart-pie.tsx +++ b/app/charts/pie/chart-pie.tsx @@ -53,6 +53,7 @@ export const ChartPieVisualization = ({ iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/charts/scatterplot/chart-scatterplot.tsx b/app/charts/scatterplot/chart-scatterplot.tsx index 6416075ea..665d6ae6d 100644 --- a/app/charts/scatterplot/chart-scatterplot.tsx +++ b/app/charts/scatterplot/chart-scatterplot.tsx @@ -65,6 +65,7 @@ export const ChartScatterplotVisualization = ({ iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/charts/table/chart-table.tsx b/app/charts/table/chart-table.tsx index 4cb9b9175..9c4bfc56e 100644 --- a/app/charts/table/chart-table.tsx +++ b/app/charts/table/chart-table.tsx @@ -41,6 +41,7 @@ export const ChartTableVisualization = ({ iri: cube.iri, componentIris, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/configurator/components/chart-options-selector.tsx b/app/configurator/components/chart-options-selector.tsx index 3d39d3191..4192b9032 100644 --- a/app/configurator/components/chart-options-selector.tsx +++ b/app/configurator/components/chart-options-selector.tsx @@ -106,6 +106,7 @@ export const ChartOptionsSelector = ({ cubeFilters: chartConfig.cubes.map((cube) => ({ iri: cube.iri, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/configurator/components/chart-type-selector.tsx b/app/configurator/components/chart-type-selector.tsx index 5fd7b9fb4..4e2f2ae32 100644 --- a/app/configurator/components/chart-type-selector.tsx +++ b/app/configurator/components/chart-type-selector.tsx @@ -50,6 +50,7 @@ export const ChartTypeSelector = (props: ChartTypeSelectorProps) => { cubeFilters: chartConfig.cubes.map((cube) => ({ iri: cube.iri, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/configurator/configurator-state.tsx b/app/configurator/configurator-state.tsx index bea084287..df6db65fb 100644 --- a/app/configurator/configurator-state.tsx +++ b/app/configurator/configurator-state.tsx @@ -6,7 +6,7 @@ import setWith from "lodash/setWith"; import sortBy from "lodash/sortBy"; import unset from "lodash/unset"; import { NextRouter, useRouter } from "next/router"; -import { createContext, Dispatch, useContext, useEffect, useMemo } from "react"; +import { Dispatch, createContext, useContext, useEffect, useMemo } from "react"; import { Reducer, useImmerReducer } from "use-immer"; import { @@ -34,20 +34,20 @@ import { ConfiguratorStatePublishing, ConfiguratorStateSelectingDataSet, DataSource, - decodeConfiguratorState, - enableLayouting, - Filters, FilterValue, + Filters, GenericField, GenericFields, - getChartConfig, - getChartConfigFilters, ImputationType, InteractiveFiltersConfig, + Layout, + decodeConfiguratorState, + enableLayouting, + getChartConfig, + getChartConfigFilters, isAreaConfig, isColorFieldInConfig, isTableConfig, - Layout, makeMultiFilter, } from "@/config-types"; import { mapValueIrisToColor } from "@/configurator/components/ui-helpers"; @@ -59,9 +59,9 @@ import { DataCubeComponents, Dimension, DimensionValue, + ObservationValue, isGeoDimension, isMeasure, - ObservationValue, } from "@/domain/data"; import { DEFAULT_DATA_SOURCE } from "@/domain/datasource"; import { client } from "@/graphql/client"; @@ -359,7 +359,11 @@ const getCachedComponents = ( sourceType: draft.dataSource.type, sourceUrl: draft.dataSource.url, locale, - cubeFilter: { iri: cubeFilter.iri, joinBy: cubeFilter.joinBy }, + cubeFilter: { + iri: cubeFilter.iri, + joinBy: cubeFilter.joinBy, + loadValues: true, + }, })!; }); diff --git a/app/configurator/interactive-filters/interactive-filters-configurator.tsx b/app/configurator/interactive-filters/interactive-filters-configurator.tsx index 72b5f2599..8c84f2099 100644 --- a/app/configurator/interactive-filters/interactive-filters-configurator.tsx +++ b/app/configurator/interactive-filters/interactive-filters-configurator.tsx @@ -43,6 +43,7 @@ export const InteractiveFiltersConfigurator = ({ cubeFilters: chartConfig.cubes.map((cube) => ({ iri: cube.iri, joinBy: cube.joinBy, + loadValues: true, })), }, }); diff --git a/app/configurator/table/table-chart-configurator.hook.tsx b/app/configurator/table/table-chart-configurator.hook.tsx index e9edf32c0..5cc794c94 100644 --- a/app/configurator/table/table-chart-configurator.hook.tsx +++ b/app/configurator/table/table-chart-configurator.hook.tsx @@ -28,6 +28,7 @@ export const useTableChartController = ( cubeFilters: chartConfig.cubes.map((cube) => ({ iri: cube.iri, joinBy: cube.joinBy, + loadValues: true, })), }, }); From 5493b0617937ec92eceb8cf8147d7faa2b7d12e6 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Thu, 22 Feb 2024 15:38:35 +0100 Subject: [PATCH 05/18] perf: Only send filters when makes sense --- app/charts/shared/chart-data-filters.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/charts/shared/chart-data-filters.tsx b/app/charts/shared/chart-data-filters.tsx index 400b356b0..c25653e8c 100644 --- a/app/charts/shared/chart-data-filters.tsx +++ b/app/charts/shared/chart-data-filters.tsx @@ -242,7 +242,7 @@ const DataFilter = (props: DataFilterProps) => { { iri: cubeIri, componentIris: [dimensionIri], - filters: keys.length > 0 ? interactiveFilters : undefined, + filters: keys.length > 1 ? interactiveFilters : undefined, }, ], // This is important for urql not to think that filters From c786eb77b277d0a3a2d2740ca90d35c770acc1a9 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Thu, 22 Feb 2024 15:38:49 +0100 Subject: [PATCH 06/18] fix: Value can be undefined --- app/configurator/components/field.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/configurator/components/field.tsx b/app/configurator/components/field.tsx index 682fd0fcb..9514dc848 100644 --- a/app/configurator/components/field.tsx +++ b/app/configurator/components/field.tsx @@ -243,7 +243,7 @@ export const DataFilterSelect = ({ const canUseMostRecentValue = isTemporalOrdinalDimension(dimension); const usesMostRecentValue = isDynamicMaxValue(fieldProps.value); - const maxValue = sortedValues[sortedValues.length - 1].value; + const maxValue = sortedValues[sortedValues.length - 1]?.value; return (