Merge master

This commit is contained in:
pietervdvn 2022-03-11 01:31:13 +01:00
commit 1455a87077
51 changed files with 62670 additions and 150 deletions

View file

@ -533,10 +533,10 @@ function stackHists<K, V>(hists: [V, Histogram<K>][]): [V, Histogram<K>][] {
}
function createGraphs(allFeatures: ChangeSetData[], appliedFilterDescription: string) {
function createGraphs(allFeatures: ChangeSetData[], appliedFilterDescription: string, cutoff = undefined) {
const hist = new Histogram<string>(allFeatures.map(f => f.properties.metadata.theme))
hist
.createOthersCategory("other", 20)
.createOthersCategory("other", cutoff ?? 20)
.addCountToName()
.asBar({name: "Changesets per theme (bar)" + appliedFilterDescription})
.render()
@ -545,7 +545,7 @@ function createGraphs(allFeatures: ChangeSetData[], appliedFilterDescription: st
new Histogram<string>(allFeatures.map(f => f.properties.user))
.binPerCount()
.stringifyName()
.createOthersCategory("25 or more", (key, _) => Number(key) >= 25).asBar(
.createOthersCategory("25 or more", (key, _) => Number(key) >=(cutoff ?? 25)).asBar(
{
compare: (a, b) => Number(a) - Number(b),
name: "Contributors per changeset count" + appliedFilterDescription
@ -598,7 +598,7 @@ function createGraphs(allFeatures: ChangeSetData[], appliedFilterDescription: st
}).render()
new Histogram<string>(allFeatures.map(f => f.properties.metadata.theme))
.createOthersCategory("< 25 changesets", 25)
.createOthersCategory("< 25 changesets", (cutoff ?? 25))
.addCountToName()
.asPie({
name: "Changesets per theme (pie)" + appliedFilterDescription
@ -608,14 +608,14 @@ function createGraphs(allFeatures: ChangeSetData[], appliedFilterDescription: st
"Changesets per theme" + appliedFilterDescription,
allFeatures,
f => f.properties.metadata.theme,
25
cutoff ?? 25
)
Group.createStackedBarChartPerDay(
"Changesets per version number" + appliedFilterDescription,
allFeatures,
f => f.properties.editor.substr("MapComplete ".length, 6).replace(/[a-zA-Z-/]/g, ''),
1
cutoff ?? 1
)
Group.createStackedBarChartPerDay(
@ -627,14 +627,14 @@ function createGraphs(allFeatures: ChangeSetData[], appliedFilterDescription: st
return major+"."+minor
},
1
cutoff ??1
)
Group.createStackedBarChartPerDay(
"Deletion-changesets per theme" + appliedFilterDescription,
allFeatures.filter(f => f.properties.delete > 0),
f => f.properties.metadata.theme,
1
cutoff ?? 1
)
{
@ -715,7 +715,8 @@ async function main(): Promise<void>{
createGraphs(allFeatures, "")
// createGraphs(allFeatures.filter(f => f.properties.date.startsWith("2020")), " in 2020")
// createGraphs(allFeatures.filter(f => f.properties.date.startsWith("2021")), " in 2021")
createGraphs(allFeatures.filter(f => f.properties.date.startsWith("2022")), " in 2022")
createGraphs(allFeatures.filter(f => f.properties.date.startsWith("2022")), " in 2022"),
createGraphs(allFeatures.filter(f => f.properties.metadata.theme==="toerisme_vlaanderen"), " met pin je punt", 0)
}
main().then(_ => console.log("All done!"))

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 KiB

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 KiB

After

Width:  |  Height:  |  Size: 368 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 578 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 KiB

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 KiB

After

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 887 KiB

After

Width:  |  Height:  |  Size: 890 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 KiB

After

Width:  |  Height:  |  Size: 582 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 671 KiB

After

Width:  |  Height:  |  Size: 687 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 98 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@ import {Utils} from "../Utils";
export default class Constants {
public static vNumber = "0.17.0-alpha";
public static vNumber = "0.17.0-alpha-1";
public static ImgurApiKey = '7070e7167f0a25a'
public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85"

View file

@ -46,15 +46,7 @@ export default class CreateNoteImportLayer extends Conversion<LayerConfigJson, L
if(firstRender === undefined){
throw `Layer ${layerJson.id} does not have a pointRendering: `+context
}
const icon = firstRender.icon
const iconBadges = []
const title = layer.presets[0].title
if (icon !== undefined) {
iconBadges.push({
if: {and: []},
then: icon
})
}
const importButton = {}
{
@ -123,7 +115,7 @@ export default class CreateNoteImportLayer extends Conversion<LayerConfigJson, L
"tagRenderings": [
{
"id": "Intro",
"render": "{_intro}"
render: "{_intro}"
},
{
"id": "conversation",
@ -138,12 +130,12 @@ export default class CreateNoteImportLayer extends Conversion<LayerConfigJson, L
{
"id": "close_note_",
"render": embed(
"{close_note(", t.notFound.Subs({title}), ", ./assets/svg/close.svg, id, This feature does not exist)}"),
"{close_note(", t.notFound.Subs({title}), ", ./assets/svg/close.svg, id, This feature does not exist, 18)}"),
condition: "closed_at="
},
{
"id": "close_note_mapped",
"render": embed("{close_note(", t.alreadyMapped.Subs({title}), ", ./assets/svg/checkmark.svg, id, Already mapped)}"),
"render": embed("{close_note(", t.alreadyMapped.Subs({title}), ", ./assets/svg/duplicate.svg, id, Already mapped, 18)}"),
condition: "closed_at="
},
{
@ -172,7 +164,6 @@ export default class CreateNoteImportLayer extends Conversion<LayerConfigJson, L
then: "circle:white;checkmark:black"
}]
},
iconBadges,
"iconSize": "40,40,center"
}
]

View file

@ -2,22 +2,24 @@ import {UIElement} from "../UIElement";
import BaseUIElement from "../BaseUIElement";
import {UIEventSource} from "../../Logic/UIEventSource";
import ExtraLinkConfig from "../../Models/ThemeConfig/ExtraLinkConfig";
import MapControlButton from "../MapControlButton";
import Link from "../Base/Link";
import Img from "../Base/Img";
import {SubtleButton} from "../Base/SubtleButton";
import Toggle from "../Input/Toggle";
import Loc from "../../Models/Loc";
import Locale from "../i18n/Locale";
import {Utils} from "../../Utils";
import Svg from "../../Svg";
import Translations from "../i18n/Translations";
import {Translation} from "../i18n/Translation";
export default class ExtraLinkButton extends UIElement {
private readonly _config: ExtraLinkConfig;
private readonly state: {
layoutToUse: {id: string};
featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>};
layoutToUse: { id: string, title: Translation };
featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>
};
constructor(state: {featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>, layoutToUse: {id: string}},
constructor(state: { featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>, layoutToUse: { id: string, title: Translation } },
config: ExtraLinkConfig) {
super();
this.state = state;
@ -52,21 +54,25 @@ export default class ExtraLinkButton extends UIElement{
return Utils.SubstituteKeys(c.href, subs)
})
if(c.text === undefined){
link = new MapControlButton(
new Link(new Img(c.icon), href, c.newTab).SetClass("block w-full h-full p-1.5")
)
}else {
let img : BaseUIElement = undefined
let img: BaseUIElement = Svg.pop_out_ui()
if (c.icon !== undefined) {
img = new Img(c.icon).SetClass("h-6")
}
link = new SubtleButton(img,c.text, {url:
href,
newTab: c.newTab})
let text: Translation
if (c.text === undefined) {
text = Translations.t.general.screenToSmall.Fuse(this.state.layoutToUse.title, "{theme}")
} else {
text = c.text.Clone()
}
link = new SubtleButton(img, text, {
url:
href,
newTab: c.newTab
})
if (c.requirements.has("no-welcome-message")) {
link = new Toggle(undefined, link, this.state.featureSwitchWelcomeMessage)
}

View file

@ -168,6 +168,11 @@ export default class DefaultGUI {
]).SetClass("flex flex-col")
.AttachTo("userbadge")
new Combine([
new ExtraLinkButton(state, {...state.layoutToUse.extraLink, newTab: true, requirements: new Set<"iframe" | "no-iframe" | "welcome-message" | "no-welcome-message">( ) })
]).SetClass("flex items-center justify-center normal-background h-full")
.AttachTo("on-small-screen")
Toggle.If(state.featureSwitchSearch,
() => new SearchAndGo(state))
.AttachTo("searchbox");

View file

@ -191,7 +191,7 @@ ${Utils.special_visualizations_importRequirementDocs}
importFlow,
isImported
),
t.zoomInMore,
t.zoomInMore.SetClass("alert"),
state.locationControl.map(l => l.zoom >= 18)
),
pleaseLoginButton,

View file

@ -71,7 +71,7 @@ export default class NewNoteUi extends Toggle {
new Combine([new Toggle(undefined, t.warnAnonymous.SetClass("alert"), state?.osmConnection?.isLoggedIn),
new Toggle(postNote,
t.textNeeded.SetClass("alert"),
text.GetValue().map(txt => txt.length > 3)
text.GetValue().map(txt => txt?.length > 3)
)
]).SetClass("flex justify-end items-center")

View file

@ -46,6 +46,7 @@ import FileSelectorButton from "./Input/FileSelectorButton";
import {LoginToggle} from "./Popup/LoginButton";
import {start} from "repl";
import {SubstitutedTranslation} from "./SubstitutedTranslation";
import {Feature} from "@turf/turf";
export interface SpecialVisualization {
funcName: string,
@ -95,6 +96,88 @@ export class AllTagsPanel extends VariableUiElement {
}
}
class CloseNoteButton implements SpecialVisualization {
public readonly funcName = "close_note"
public readonly docs = "Button to close a note. A predifined text can be defined to close the note with. If the note is already closed, will show a small text."
public readonly args = [
{
name: "text",
doc: "Text to show on this button",
},
{
name: "icon",
doc: "Icon to show",
defaultValue: "checkmark.svg"
},
{
name: "idkey",
doc: "The property name where the ID of the note to close can be found",
defaultValue: "id"
},
{
name: "comment",
doc: "Text to add onto the note when closing",
},
{
name: "minZoom",
doc: "If set, only show the closenote button if zoomed in enough"
},
{
name: "zoomButton",
doc: "Text to show if not zoomed in enough"
}
]
public constr(state: FeaturePipelineState, tags, args): BaseUIElement {
const t = Translations.t.notes;
const params: {
text: string,
icon: string,
idkey: string,
comment: string,
minZoom: string,
zoomButton: string
} = Utils.ParseVisArgs(this.args, args)
let icon = Svg.checkmark_svg()
if (params.icon !== "checkmark.svg" && (args[2] ?? "") !== "") {
icon = new Img(args[1])
}
let textToShow = t.closeNote;
if ((params.text ?? "") !== "") {
textToShow = Translations.T(args[0])
}
let closeButton: BaseUIElement = new SubtleButton(icon, textToShow)
const isClosed = tags.map(tags => (tags["closed_at"] ?? "") !== "");
closeButton.onClick(() => {
const id = tags.data[args[2] ?? "id"]
state.osmConnection.closeNote(id, args[3])
?.then(_ => {
tags.data["closed_at"] = new Date().toISOString();
tags.ping()
})
})
if((params.minZoom??"") !== "" && !isNaN(Number(params.minZoom))){
closeButton = new Toggle(
closeButton,
params.zoomButton ?? "",
state. locationControl.map(l => l.zoom >= Number(params.minZoom))
)
}
return new LoginToggle(new Toggle(
t.isClosed.SetClass("thanks"),
closeButton,
isClosed
), t.loginToClose, state)
}
}
export default class SpecialVisualizations {
public static specialVisualizations = SpecialVisualizations.init()
@ -655,58 +738,7 @@ export default class SpecialVisualizations {
})
}
},
{
funcName: "close_note",
docs: "Button to close a note. A predifined text can be defined to close the note with. If the note is already closed, will show a small text.",
args: [
{
name: "text",
doc: "Text to show on this button",
},
{
name: "icon",
doc: "Icon to show",
defaultValue: "checkmark.svg"
},
{
name: "Id-key",
doc: "The property name where the ID of the note to close can be found",
defaultValue: "id"
},
{
name: "comment",
doc: "Text to add onto the note when closing",
}
],
constr: (state, tags, args) => {
const t = Translations.t.notes;
let icon = Svg.checkmark_svg()
if (args[1] !== "checkmark.svg" && (args[2] ?? "") !== "") {
icon = new Img(args[1])
}
let textToShow = t.closeNote;
if ((args[0] ?? "") !== "") {
textToShow = Translations.T(args[0])
}
const closeButton = new SubtleButton(icon, textToShow)
const isClosed = tags.map(tags => (tags["closed_at"] ?? "") !== "");
closeButton.onClick(() => {
const id = tags.data[args[2] ?? "id"]
state.osmConnection.closeNote(id, args[3])
?.then(_ => {
tags.data["closed_at"] = new Date().toISOString();
tags.ping()
})
})
return new LoginToggle(new Toggle(
t.isClosed.SetClass("thanks"),
closeButton,
isClosed
), t.loginToClose, state)
}
},
new CloseNoteButton(),
{
funcName: "add_note_comment",
docs: "A textfield to add a comment to a node (with the option to close the note).",

View file

@ -171,6 +171,13 @@
"nl": "Enkel <b>klanten van de bijhorende plaats</b> mogen dit oplaadpunt gebruiken<br/><span class='subtle'>Bv. op de parking van een hotel en enkel toegankelijk voor klanten van dit hotel</span>"
}
},
{
"if": "access=key",
"then": {
"en": "A <b>key</b> must be requested to access this charging station<br/><span class='subtle'>E.g. a charging station operated by hotel which is only usable by their guests, which receive a key from the reception to unlock the charging station</span>",
"nl": "Een <b>sleutel</b> is nodig om dit oplaadpunt te gebruiken<br/><span class='subtle'>Bv. voor klanten van een hotel of een bar, die de sleutel aan de receptie kunnen krijgen</span>"
}
},
{
"if": "access=private",
"then": {

View file

@ -162,6 +162,13 @@
"nl": "Enkel <b>klanten van de bijhorende plaats</b> mogen dit oplaadpunt gebruiken<br/><span class='subtle'>Bv. op de parking van een hotel en enkel toegankelijk voor klanten van dit hotel</span>"
}
},
{
"if": "access=key",
"then": {
"en": "A <b>key</b> must be requested to access this charging station<br/><span class='subtle'>E.g. a charging station operated by hotel which is only usable by their guests, which receive a key from the reception to unlock the charging station</span>",
"nl": "Een <b>sleutel</b> is nodig om dit oplaadpunt te gebruiken<br/><span class='subtle'>Bv. voor klanten van een hotel of een bar, die de sleutel aan de receptie kunnen krijgen</span>"
}
},
{
"if": "access=private",
"then": {

8868
assets/svg/duplicate.svg Normal file

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 273 KiB

View file

@ -381,6 +381,14 @@
"https://commons.wikimedia.org/wiki/File:Download-icon.svg"
]
},
{
"path": "duplicate.svg",
"license": "CC0",
"authors": [
"Pieter Vander Vennet"
],
"sources": []
},
{
"path": "envelope.svg",
"license": "CC0; trivial",

View file

@ -1103,10 +1103,6 @@ video {
max-height: 2rem;
}
.max-h-6 {
max-height: 1.5rem;
}
.w-full {
width: 100%;
}
@ -1504,10 +1500,6 @@ video {
padding: 0px;
}
.p-1\.5 {
padding: 0.375rem;
}
.p-0\.5 {
padding: 0.125rem;
}

View file

@ -9,6 +9,29 @@ Contains tweaks for small screens
}
}
@media only screen and (min-height: 300px) and (min-width: 225px) {
.very-small-screen {
display: none !important;
}
.hidden-on-very-small-screen {
}
}
@media not screen and (min-height: 300px) and (min-width: 225px) {
.very-small-screen {
}
.hidden-on-very-small-screen {
display: none !important;
}
}
@media only screen and (max-width: 768px), only screen and (max-height: 768px) {

View file

@ -189,6 +189,7 @@
"removeLocationHistory": "Delete the location history",
"returnToTheMap": "Return to the map",
"save": "Save",
"screenToSmall": "Open {theme} in a new window",
"search": {
"error": "Something went wrong…",
"nothing": "Nothing found…",

View file

@ -1584,6 +1584,9 @@
"then": "Only customers of the place this station belongs to can use this charging station<br/><span class='subtle'>E.g. a charging station operated by hotel which is only usable by their guests</span>"
},
"3": {
"then": "A <b>key</b> must be requested to access this charging station<br/><span class='subtle'>E.g. a charging station operated by hotel which is only usable by their guests, which receive a key from the reception to unlock the charging station</span>"
},
"4": {
"then": "Not accessible to the general public (e.g. only accessible to the owners, employees, ...)"
}
},

View file

@ -1593,6 +1593,9 @@
"then": "Enkel <b>klanten van de bijhorende plaats</b> mogen dit oplaadpunt gebruiken<br/><span class='subtle'>Bv. op de parking van een hotel en enkel toegankelijk voor klanten van dit hotel</span>"
},
"3": {
"then": "Een <b>sleutel</b> is nodig om dit oplaadpunt te gebruiken<br/><span class='subtle'>Bv. voor klanten van een hotel of een bar, die de sleutel aan de receptie kunnen krijgen</span>"
},
"4": {
"then": "Niet toegankelijk voor het publiek <br/><span class='subtle'>Bv. enkel toegankelijk voor de eigenaar, medewerkers ,...</span> "
}
},

View file

@ -54,7 +54,7 @@
"importTags": "Het element zal deze tags krijgen: {tags}",
"officialThemesOnly": "In onofficiële thema's is de importeerknop uitgeschakeld om ongelukjes te vermijden",
"wrongType": "Dit object is geen punt of lijn, en kan daarom niet geïmporteerd worden",
"zoomInMore": "Zoom verder in om dit kaart-object te kunnen importeren"
"zoomInMore": "Zoom verder in om dit object af te handelen"
},
"importTags": "Het object zal deze tags krijgen: {tags}",
"intro": "Kies hieronder welk punt je wilt toevoegen<br/>",

View file

@ -13,12 +13,8 @@
},
"2": {
"then": "Anjing diperbolehkan, tetapi mereka harus diikat"
},
"3": {
"then": "Anjing diperbolehkan dan dapat berkeliaran dengan bebas"
}
},
"question": "Apakah anjing diperbolehkan dalam bisnis ini?"
}
},
"email": {
"question": "Apa alamat surel dari {title()}?"

View file

@ -47,8 +47,9 @@
<!-- DECORATION 0 END -->
</div>
<div class="hidden md:hidden fixed inset-0 block z-above-controls" id="fullscreen"></div>
<div class="z-index-above-map pointer-events-none" id="topleft-tools">
<div class="very-small-screen fixed inset-0 block z-above-controls" id="on-small-screen"></div>
<div class="hidden md:hidden fixed inset-0 block z-above-controls hidden-on-very-small-screen" id="fullscreen"></div>
<div class="z-index-above-map pointer-events-none" id="topleft-tools">'
<div class="p-3 flex flex-col items-end sm:items-start sm:flex-row sm:flex-wrap w-full sm:justify-between">
<div class="shadow rounded-full h-min w-full overflow-hidden sm:max-w-sm pointer-events-auto"
id="searchbox"></div>
@ -83,7 +84,6 @@
<div id="leafletDiv"></div>
<script src="./index.ts"></script>
<script async data-goatcounter="https://pietervdvn.goatcounter.com/count" src="//gc.zgo.at/count.js"></script>