New graphs

This commit is contained in:
Pieter Vander Vennet 2022-03-11 00:17:34 +01:00
parent 65fc2c5de4
commit 27b6872666
32 changed files with 53607 additions and 29 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

Before After
Before After

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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 578 KiB

Before After
Before After

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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 131 KiB

Before After
Before After

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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 KiB

After

Width:  |  Height:  |  Size: 280 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 KiB

After

Width:  |  Height:  |  Size: 652 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 332 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 887 KiB

After

Width:  |  Height:  |  Size: 890 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 213 KiB

Before After
Before After

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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 208 KiB

Before After
Before After

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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Before After
Before After

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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 227 KiB

Before After
Before After

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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Before After
Before After

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff