Refactoring: revive statistics GUI

This commit is contained in:
Pieter Vander Vennet 2023-06-15 16:26:43 +02:00
parent 9661ade80c
commit 1a2e6f49f2
3 changed files with 24 additions and 4 deletions

View file

@ -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(<any>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")

View file

@ -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",

20
statistics.html Normal file
View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MapComplete statistics</title>
<meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport">
<link href="./css/mobile.css" rel="stylesheet"/>
<link href="./css/openinghourstable.css" rel="stylesheet"/>
<link href="./css/tagrendering.css" rel="stylesheet"/>
<link href="css/ReviewElement.css" rel="stylesheet"/>
<link href="./css/index-tailwind-output.css" rel="stylesheet"/>
<link href="./css/wikipedia.css" rel="stylesheet"/>
</head>
<body>
<div id="main">Loading statistics...</div>
<script src="./UI/StatisticsGUI.ts" type="module"></script>
<script async data-goatcounter="https://pietervdvn.goatcounter.com/count" src="//gc.zgo.at/count.js"></script>
</body>
</html>