Skip to content
Snippets Groups Projects
Commit f20465c9 authored by Berinda van Dijk's avatar Berinda van Dijk
Browse files

multiple changes in the 'tijdlijn_alles'-plot: removed the legend, changed the...

multiple changes in the 'tijdlijn_alles'-plot: removed the legend, changed the color of the Pbs, and now the pbs aren't plotted over the non-pbs: there is only one 'layer' of points now.
parent 41f07597
Branches
No related tags found
1 merge request!12Small improvements and bugfixes, mainly in the tijdlijn_alles.
......@@ -45,6 +45,7 @@ doId <- function(input) {
kleurenset_afstanden=c('25'='red', '50'='orange', '100'='yellow', '200'='green', '400'='blue', '800'='purple', '1500'='deeppink1','500'='black')
kleurenset_strokes=c('Backstroke'='red', "Breaststroke"='orange', "Butterfly"="purple", "Freestyle"="green", "Medley"="blue")
kleurenset_pooltypes=c('25m'='orchid', '50m'='cornflowerblue', 'OW'='limegreen')
kleurenset_Pbs=c('Pb'='maroon1', 'noPb'='black')
bron=separate(bron, col = heatType, into = c("hoofdafstand", "heatType"), sep = ", ", fill='left')
bron$heatType <- as.factor(bron$heatType)
......@@ -103,14 +104,17 @@ doId <- function(input) {
filter(points == max(points, na.rm = TRUE)) %>%
filter(time == min(time, na.rm=TRUE))
tijdlijn_alles<-ggplot(zonder_split, aes(x=date, y=interaction(distance, stroke, sep='m '), shape=poolType))+
tijdlijntabel=zonder_split %>% group_by(distance, stroke, poolType) %>%
mutate(Pb=ifelse(tijdsduur==min(tijdsduur),'Pb', 'noPb')) %>% arrange(distance, stroke, poolType)
tijdlijn_alles=ggplot(tijdlijntabel, aes(x=date, y=interaction(distance, stroke, sep='m '), color=Pb, shape=poolType))+
geom_point()+
geom_point(data = tabel_Prs, color="green", alpha=0.7, size=2, show.legend=FALSE)+
labs(y='distance & stroke')+ggtitle(" ")+
guides(color='none')+ scale_x_date()+scale_y_discrete(limits=rev)
scale_color_manual(values=kleurenset_Pbs)+theme(legend.position = "none")+
scale_x_date()+scale_y_discrete(limits=rev)
tijdlijn_alles<-ggplotly(tijdlijn_alles, tooltip=c('x', 'shape'), dynamicTicks=TRUE)%>%
layout(title = list(text = paste0('Datum van alle gezwommen slagen per afstand',
'<br>', '<sup>', 'Green: pbs (Dutch: prs)','</sup>')))
'<br>', '<sup>', 'rose: Pbs (inclusive timed disqualifications, exlusive split-times)','</sup>')))
appendPlotly(tijdlijn_alles)
tabel_Prs_small <- bovennul %>%
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment