From 1a2e6f49f28d3338716740a1ca4ab747f66e8747 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 15 Jun 2023 16:26:43 +0200 Subject: [PATCH] Refactoring: revive statistics GUI --- UI/StatisticsGUI.ts | 6 +++--- package.json | 2 +- statistics.html | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 statistics.html diff --git a/UI/StatisticsGUI.ts b/UI/StatisticsGUI.ts index 1e43a2a91..673ef0b87 100644 --- a/UI/StatisticsGUI.ts +++ b/UI/StatisticsGUI.ts @@ -17,7 +17,7 @@ import SvelteUIElement from "./Base/SvelteUIElement" import Filterview from "./BigComponents/Filterview.svelte" import FilteredLayer from "../Models/FilteredLayer" -class StatisticsForOverviewFile extends Combine { +class StatsticsForOverviewFile extends Combine { constructor(homeUrl: string, paths: string[]) { paths = paths.filter((p) => !p.endsWith("file-overview.json")) const layer = new LayoutConfig(mcChanges, true).layers[0] @@ -177,7 +177,7 @@ class StatisticsForOverviewFile extends Combine { } } -export default class StatisticsGUI extends VariableUiElement { +class StatisticsGUI extends VariableUiElement { private static readonly homeUrl = "https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/changeset-metadata/" private static readonly stats_files = "file-overview.json" @@ -192,7 +192,7 @@ export default class StatisticsGUI extends VariableUiElement { return new Loading("Loading overview...") } - return new StatisticsForOverviewFile(StatisticsGUI.homeUrl, paths) + return new StatsticsForOverviewFile(StatisticsGUI.homeUrl, paths) }) ) this.SetClass("block w-full h-full") diff --git a/package.json b/package.json index 9c17ed7be..7124ffb35 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "prepare-deploy": "npm run generate:service-worker && ./scripts/build.sh", "format": "prettier --write '**/*.ts' '**/*.svelte'", "clean:tests": "(find . -type f -name \"*.doctest.ts\" | xargs -r rm)", - "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|test\\|preferences\\|customGenerator\\|professional\\|automaton\\|import_helper\\|import_viewer\\|theme\\|style_test\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm) && (ls | grep \".*.webmanifest$\" | grep -v \"manifest.webmanifest\" | xargs -r rm)", + "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|test\\|preferences\\|studio\\|professional\\|automaton\\|import_helper\\|import_viewer\\|theme\\|style_test\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm) && (ls | grep \".*.webmanifest$\" | grep -v \"manifest.webmanifest\" | xargs -r rm)", "generate:dependency-graph": "node_modules/.bin/depcruise --exclude \"^node_modules\" --output-type dot Logic/State/MapState.ts > dependencies.dot && dot dependencies.dot -T svg -o dependencies.svg && rm dependencies.dot", "weblate-add-upstream": "git remote add weblate-github git@github.com:weblate/MapComplete.git && git remote add weblate-hosted-core https://hosted.weblate.org/git/mapcomplete/core/ && git remote add weblate-hosted-layers https://hosted.weblate.org/git/mapcomplete/layers/", "weblate-merge": "git remote update weblate-github; git merge weblate-github/weblate-mapcomplete-core weblate-github/weblate-mapcomplete-layers weblate-github/weblate-mapcomplete-layer-translations", diff --git a/statistics.html b/statistics.html new file mode 100644 index 000000000..f20993e89 --- /dev/null +++ b/statistics.html @@ -0,0 +1,20 @@ + + + + + MapComplete statistics + + + + + + + + + +
Loading statistics...
+ + + + +