Add new statistics view

This commit is contained in:
Pieter Vander Vennet 2022-08-22 13:34:47 +02:00
parent 6f6a5d7092
commit 716fda39aa
10 changed files with 342 additions and 171 deletions

View file

@ -11,6 +11,7 @@ import ShowOverlayLayerImplementation from "./UI/ShowDataLayer/ShowOverlayLayerI
import {DefaultGuiState} from "./UI/DefaultGuiState";
import {QueryParameters} from "./Logic/Web/QueryParameters";
import DashboardGui from "./UI/DashboardGui";
import StatisticsGUI from "./UI/StatisticsGUI";
// Workaround for a stupid crash: inject some functions which would give stupid circular dependencies or crash the other nodejs scripts running from console
MinimapImplementation.initialize()
@ -38,11 +39,13 @@ class Init {
// This 'leaks' the global state via the window object, useful for debugging
// @ts-ignore
window.mapcomplete_state = State.state;
const mode = QueryParameters.GetQueryParameter("mode", "map", "The mode the application starts in, e.g. 'map' or 'dashboard'")
if(mode.data === "dashboard"){
const mode = QueryParameters.GetQueryParameter("mode", "map", "The mode the application starts in, e.g. 'map', 'dashboard' or 'statistics'")
if (mode.data === "statistics") {
new StatisticsGUI().AttachTo("leafletDiv")
} else if (mode.data === "dashboard") {
new DashboardGui(State.state, guiState).setup()
}else{
} else {
new DefaultGUI(State.state, guiState).setup()
}
}