Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Z
zwemtijden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tools
swimming
zwemtijden
Commits
0a33c871
Commit
0a33c871
authored
1 year ago
by
Ruben van Dijk
Browse files
Options
Downloads
Plain Diff
Merge branch 'betereTabellen' into 'master'
Changed and added tables. See merge request
!14
parents
d8d9a926
bd5a554a
Branches
Branches containing commit
No related tags found
1 merge request
!14
Changed and added tables.
Pipeline
#7938
passed
1 year ago
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+1
-1
1 addition, 1 deletion
Dockerfile
code.R
+55
-20
55 additions, 20 deletions
code.R
with
56 additions
and
21 deletions
Dockerfile
+
1
−
1
View file @
0a33c871
FROM
ubuntu:22.
1
0
AS
base
FROM
ubuntu:22.0
4
AS
base
RUN
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive
TZ
=
Etc/UTC apt-get
install
-y
--no-install-recommends
r-base-core
&&
apt-get clean
FROM
base
AS
libraries
...
...
This diff is collapsed.
Click to expand it.
code.R
+
55
−
20
View file @
0a33c871
...
...
@@ -24,6 +24,17 @@ doId <- function(input) {
appendPlot
<-
function
(
item
)
{
appendPlotly
(
ggplotly
(
item
))
}
lettergrootte
=
18
regelhoogte
=
23
plot_tabel
<-
function
(
input_tabel
){
kolombreedte
=
unname
(
sapply
(
input_tabel
,
function
(
x
)
max
(
nchar
(
as.character
(
x
)))))
kolombreedte2
=
nchar
(
colnames
(
input_tabel
))
kolombreedte_totaal
=
pmax
(
kolombreedte
,
kolombreedte2
)
tabel_als_plot
<-
plot_ly
(
type
=
'table'
,
columnwidth
=
kolombreedte_totaal
,
header
=
list
(
values
=
colnames
(
input_tabel
),
font
=
list
(
size
=
lettergrootte
)),
cells
=
list
(
values
=
t
(
input_tabel
),
font
=
list
(
size
=
lettergrootte
),
height
=
regelhoogte
))
return
(
tabel_als_plot
)}
dates_to_drop
=
as.list
(
strsplit
(
dates_to_drop
,
","
))[[
1
]]
dates_to_drop
=
strptime
(
dates_to_drop
,
format
=
"%Y-%m-%d"
)
dates_to_drop
=
ymd
(
dates_to_drop
)
...
...
@@ -75,27 +86,29 @@ doId <- function(input) {
bron
<-
bron
[
order
(
bron
$
date
),]
bron
$
city
=
trimws
(
gsub
(
'\\s+'
,
' '
,
gsub
(
"-|'"
,
' '
,
str_replace_all
(
bron
$
city
,
"\\s"
,
" "
))))
bron
$
city
<-
paste
(
toupper
(
substr
(
bron
$
city
,
1
,
1
)),
substr
(
bron
$
city
,
2
,
nchar
(
bron
$
city
)),
sep
=
""
)
zonder_split
<-
bron
[
bron
$
ranking
!=
"Split"
,]
zonder_split
<-
bron
[
bron
$
ranking
!=
"Split"
,]
#So even if your splittime is a Pb, it is not displayed by this application.
bovennul
<-
zonder_split
[
zonder_split
$
points
!=
0
,]
DateAndPool
<-
bron
%>%
select
(
'city'
,
'MeetId'
,
'date'
)
%>%
unique
()
%>%
select
(
'city'
,
'date'
)
DateAndPool
<-
DateAndPool
[
order
(
DateAndPool
$
date
),]
freqtabel
=
as.data.frame
(
table
(
DateAndPool
$
city
))
freqtabel
=
freqtabel
[
order
(
freqtabel
$
Freq
,
decreasing
=
TRUE
),]
kolombreedte
=
unname
(
sapply
(
freqtabel
,
function
(
x
)
max
(
nchar
(
as.character
(
x
)))
+5
))
freqtabel_plot
<-
plot_ly
(
type
=
'table'
,
columnwidth
=
kolombreedte
,
cells
=
list
(
values
=
t
(
as.matrix
(
unname
(
freqtabel
))),
align
=
'left'
,
font
=
list
(
size
=
16
)))
%>%
layout
(
title
=
'Number of meets par city'
)
appendPlotly
(
freqtabel_plot
)
plotfreq
=
DateAndPool
%>%
group_by
(
city
)
%>%
mutate
(
count
=
row_number
())
tussentabel
=
plotfreq
%>%
group_by
(
city
)
%>%
filter
(
count
==
max
(
count
))
tussentabel
$
date
=
max
(
plotfreq
$
date
)
plotfreq
=
rbind
(
plotfreq
,
tussentabel
)
CountsParPool_dates
=
ggplot
(
plotfreq
,
aes
(
x
=
date
,
y
=
count
,
color
=
city
))
+
geom_step
()
+
labs
(
title
=
'Cumulative number of meets par city'
)
CountsParPool_dates
<-
ggplotly
(
CountsParPool_dates
,
dynamicTicks
=
TRUE
)
appendPlotly
(
CountsParPool_dates
)
freqtabel
=
tussentabel
%>%
select
(
c
(
'city'
,
'count'
))
freqtabel
=
freqtabel
[
order
(
freqtabel
$
count
,
decreasing
=
TRUE
),]
freqtabel_plot
=
plot_tabel
(
freqtabel
)
%>%
layout
(
title
=
'Number of meets par city'
)
appendPlotly
(
freqtabel_plot
)
CountsParAfstandSlag_dates
=
bron
%>%
group_by
(
AfstandSlag
)
%>%
mutate
(
count
=
row_number
())
tussentabel
=
CountsParAfstandSlag_dates
%>%
group_by
(
AfstandSlag
)
%>%
filter
(
count
==
max
(
count
))
tussentabel
$
date
=
max
(
CountsParAfstandSlag_dates
$
date
)
CountsParAfstandSlag_dates
=
rbind
(
CountsParAfstandSlag_dates
,
tussentabel
)
Plot_CountsParAfstandSlag_dates
=
ggplot
(
CountsParAfstandSlag_dates
,
aes
(
x
=
date
,
y
=
count
,
text
=
AfstandSlag
,
color
=
interaction
(
distance
,
stroke
,
sep
=
"m "
)))
+
geom_step
()
+
labs
(
color
=
'Afstand & Slag'
,
title
=
'Cumulative count par distance/stroke'
)
...
...
@@ -135,19 +148,41 @@ doId <- function(input) {
appendPlotly
(
heatmap_prs
)
tabel_LastEntrys
<-
zonder_split
%>%
group_by
(
distance
,
stroke
,
poolType
,
Lap
)
%>%
filter
(
Lap
==
FALSE
)
%>%
group_by
(
distance
,
stroke
,
poolType
)
%>%
filter
(
date
==
max
(
date
,
na.rm
=
TRUE
))
tabel_lastswam
=
tabel_LastEntrys
%>%
select
(
c
(
'distance'
,
'stroke'
,
'poolType'
,
'date'
,
'Lap'
))
kolombreedte
=
unname
(
sapply
(
tabel_lastswam
,
function
(
x
)
max
(
nchar
(
as.character
(
x
)))
+5
))
plottabel_LastSwam
=
plot_ly
(
type
=
'table'
,
columnwidth
=
kolombreedte
,
header
=
list
(
values
=
colnames
(
tabel_lastswam
),
font
=
list
(
size
=
16
)),
cells
=
list
(
values
=
t
(
tabel_lastswam
[
order
(
tabel_lastswam
$
date
),]),
for
(
pooltype_loop
in
unique
(
tabel_LastEntrys
$
poolType
)){
title_plot
=
paste
(
"Last date swam - "
,
pooltype_loop
,
'pool'
)
heatmap_lastswam
=
ggplot
(
tabel_LastEntrys
[
tabel_LastEntrys
$
poolType
==
pooltype_loop
,],
aes
(
distance
,
stroke
,
text
=
date
))
+
geom_tile
(
aes
(
fill
=
date
))
+
geom_text
(
aes
(
label
=
format
(
date
,
format
=
"%e %b\n%Y"
)),
size
=
4
)
+
labs
(
title
=
title_plot
)
+
theme_bw
()
heatmap_lastswam
=
ggplotly
(
heatmap_lastswam
,
tooltip
=
FALSE
)
%>%
layout
(
dragmode
=
FALSE
)
appendPlotly
(
heatmap_lastswam
)
}
tabel_lastswam
=
tabel_LastEntrys
%>%
select
(
c
(
'distance'
,
'stroke'
,
'poolType'
,
'date'
))
kolombreedte
=
unname
(
sapply
(
tabel_lastswam
,
function
(
x
)
max
(
nchar
(
as.character
(
x
)))))
kolombreedte2
=
nchar
(
colnames
(
tabel_lastswam
))
kolombreedte_totaal
=
pmax
(
kolombreedte
,
kolombreedte2
)
plottabel_LastSwam
=
plot_ly
(
type
=
'table'
,
columnwidth
=
kolombreedte_totaal
,
header
=
list
(
values
=
colnames
(
tabel_lastswam
),
font
=
list
(
size
=
lettergrootte
)),
cells
=
list
(
values
=
t
(
tabel_lastswam
),
fill
=
list
(
color
=
list
(
kleurenset_pooltypes
[
tabel_lastswam
$
poolType
])),
align
=
'left'
,
font
=
list
(
size
=
16
)))
plottabel_LastSwam
<-
plottabel_LastSwam
%>%
layout
(
title
=
'Last swam par distance and pooltype'
)
align
=
c
(
'right'
,
'middle'
,
'middle'
,
'middle'
),
height
=
regelhoogte
,
font
=
list
(
size
=
lettergrootte
)))
plottabel_LastSwam
<-
plottabel_LastSwam
%>%
layout
(
title
=
'Last swam par distance and pooltype - no Laptimes'
)
appendPlotly
(
plottabel_LastSwam
)
for
(
pooltype_loop
in
unique
(
tabel_LastEntrys
$
poolType
)){
title_plot
=
paste
(
"Last swam par distance and stroke - no Laptimes' - "
,
pooltype_loop
,
'pool'
)
tabel_lastswam
=
tabel_LastEntrys
[
tabel_LastEntrys
$
poolType
==
pooltype_loop
,]
%>%
ungroup
()
tabel_lastswam
=
tabel_lastswam
%>%
select
(
c
(
'distance'
,
'stroke'
,
'date'
))
plottabel_LastSwam
<-
plot_tabel
(
tabel_lastswam
)
%>%
layout
(
title
=
title_plot
)
appendPlotly
(
plottabel_LastSwam
)
}
breedte_perslag
=
unique
(
tabel_Prs_metpooltype
[,
c
(
'distance'
,
'stroke'
)])
%>%
group_by
(
stroke
)
%>%
count
()
breedte_perslag
=
breedte_perslag
$
n
...
...
@@ -171,7 +206,7 @@ doId <- function(input) {
tabel_lasts
=
tabel_LastEntrys
[
order
(
tabel_LastEntrys
$
poolType
),]
%>%
filter
(
points
!=
0
)
facetwrap_lasts
=
tabel_lasts
%>%
split
(
.
$
stroke
)
%>%
map
(
barplot_facets
)
facetwrap_lasts
=
facetwrap_lasts
%>%
subplot
(
widths
=
breedte_perslag
,
margin
=
0.01
,
shareY
=
TRUE
)
%>%
layout
(
showlegend
=
FALSE
,
dragmode
=
FALSE
,
title
=
'Last entrys.
P
oints >0,
so
no laptimes
, 25m-times, disqualifiactions etc
.'
)
layout
(
showlegend
=
FALSE
,
dragmode
=
FALSE
,
title
=
'Last entrys.
Only p
oints >0,
and
no laptimes.'
)
appendPlotly
(
facetwrap_lasts
)
stippenplot_sizes
<-
ggplot
(
bovennul
,
aes
(
x
=
date
,
y
=
points
,
color
=
stroke
,
size
=
distance
,
group
=
AfstandSlag
))
+
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment