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

Merge branch 'graphs' into 'master'

Removed some graphs, and multiple changes in line graphs

See merge request !9
parents 30fa27ca e5a1f2e7
Branches
No related tags found
1 merge request!9Removed some graphs, and multiple changes in line graphs
Pipeline #3770 passed
......@@ -77,25 +77,17 @@ doId <- function(input) {
tabel_LastEntrys<-zonder_split%>%
group_by(distance, stroke) %>%
filter(date == max(date, na.rm=TRUE))
tabel_LastEntrys_beide<-zonder_split %>%
group_by(distance, stroke, poolType) %>%
filter(date==max(date, na.rm=TRUE))
tijdlijn_alles<-ggplot(zonder_split, aes(x=date, y=stroke, shape=poolType))+
tijdlijn_alles<-ggplot(zonder_split, aes(x=date, y=interaction(distance, stroke, sep='m '), shape=poolType))+
geom_point()+
geom_point(data = . %>% group_by(stroke, distance, poolType) %>% summarise(date = max(date)),
color='orange', size=2)+
geom_point(data = tabel_Prs, color="green", alpha=0.7, size=2, show.legend=FALSE)+
labs(title="Datum van alle gezwommen slagen per afstand")+guides(color='none')+
facet_grid(vars(distance), scales='free_y')
tijdlijn_alles<-ggplotly(tijdlijn_alles, tooltip=c('x', 'shape', 'color'))
labs(y='distance & stroke')+
guides(color='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: last entrys','</sup>')))
appendPlotly(tijdlijn_alles)
andere_tijdlijn<-ggplot(tabel_LastEntrys_beide,
aes(x=date, y=poolType, color=AfstandSlag, group=AfstandSlag))+
geom_point()+geom_line()+labs(title='Andere tijdlijn laatst gezwommen')
appendPlot(andere_tijdlijn)
kleurentabel_prs <- ggplot(tabel_Prs, aes(distance, stroke)) +
geom_tile(aes(fill = points)) +
geom_text(aes(label = points)) +
......@@ -115,100 +107,97 @@ doId <- function(input) {
filter(points == max(points, na.rm = TRUE)) %>%
filter(time == min(time, na.rm=TRUE))
norm_barplot <- ggplot(tabel_Prs, aes(fill = distance, y = points, x = stroke,
label=poolType, text=date)) +
barplot_original <- ggplot(tabel_Prs, aes(fill = distance, y = points, x = stroke, label=poolType, text=date)) +
geom_col(position = position_dodge2(preserve = "single")) +
scale_fill_manual(values=kleurenset_afstanden, limits=force)+
labs(title = "Prs: Punten per afstand per slag. Zowel lange - als kortebaan.")
norm_barplot<-ggplotly(norm_barplot, tooltip=c('label', 'text', 'y'))%>%
labs(title = "Barplot_original -Prs")
barplot_original<-ggplotly(barplot_original, tooltip=c('label', 'text', 'y'))%>%
layout(legend=list(orientation='h'), dragmode=FALSE)
appendPlotly(norm_barplot)
appendPlotly(barplot_original)
norm_barplot2<-ggplot(tabel_Prs, aes(fill=distance, y=points, x=AfstandSlag, label=poolType, text=date))+
barplot_rotatedlabels<-ggplot(tabel_Prs, aes(fill=distance, y=points, x=AfstandSlag, label=poolType, text=date))+
geom_col(position=position_dodge2(preserve='single'))+
scale_fill_manual(values=kleurenset_afstanden, limits=force)+
labs(title = "Prs: Punten per afstand per slag. Zowel lange - als kortebaan.")
norm_barplot2<-ggplotly(norm_barplot2, tooltip=c('label', 'text', 'y'))%>%layout(legend=list(orientation='h'), dragmode=FALSE)
appendPlotly(norm_barplot2)
theme(axis.text.x = element_text(angle = 45, hjust=1))+
labs(title = "Barplot_rotatedlabels- prs")
barplot_rotatedlabels<-ggplotly(barplot_rotatedlabels, tooltip=c('label', 'text', 'y'))%>%
layout(dragmode=FALSE)
appendPlotly(barplot_rotatedlabels)
norm_barplot3<-ggplot(tabel_Prs, aes(fill=distance, y=points, x=distance, label=poolType, text=date))+
barplot_everydistance<-ggplot(tabel_Prs, aes(fill=distance, y=points, x=distance, label=poolType, text=date))+
geom_col(position=position_dodge2(preserve='single'))+
scale_fill_manual(values=kleurenset_afstanden, limits=force)+
labs(title = "Prs: Punten per afstand per slag. Zowel lange - als kortebaan.")+
labs(title = "Barplot_everydistance- Prs")+
facet_grid(cols=vars(stroke), space ='free_x')
norm_barplot3<-ggplotly(norm_barplot3, tooltip=c('label', 'text', 'y'))%>%layout(legend=list(orientation='h'), dragmode=FALSE)
appendPlotly(norm_barplot3)
norm_barplot4<- ggplot(tabel_Prs, aes(fill=distance, y=points, x=distance, label=poolType, text=date))+
geom_col(position=position_dodge2(preserve='single'))+
scale_fill_manual(values=kleurenset_afstanden, limits=force)+
labs(title = "Prs: Punten per afstand per slag. Zowel lange - als kortebaan.")+
facet_grid(cols=vars(stroke), scales='free_x')
norm_barplot4<-ggplotly(norm_barplot4, tooltip=c('label', 'text', 'y'))%>%layout(dragmode=FALSE)
appendPlotly(norm_barplot4)
barplot_everydistance<-ggplotly(barplot_everydistance, tooltip=c('label', 'text', 'y'))%>%layout(legend=list(orientation='h'), dragmode=FALSE)
appendPlotly(barplot_everydistance)
tabel_LastEntrys<-zonder_split%>%
group_by(distance, stroke, poolType) %>%
filter(date == max(date, na.rm=TRUE))
norm_barplot_last <- ggplot(tabel_LastEntrys[tabel_LastEntrys$points!=0, ],
barplot_original_last <- ggplot(tabel_LastEntrys[tabel_LastEntrys$points!=0, ],
aes(fill = distance, y = points, x = stroke, text=date, label=poolType)) +
geom_col(position = position_dodge2(preserve = "single")) +
labs(title = "Laatste tijden: Punten >0 per afstand per slag", fill = "afstand")+
scale_fill_manual(values=kleurenset_afstanden, drop=TRUE, limits=force)
norm_barplot_last<-ggplotly(norm_barplot_last, tooltip=c('y', 'label', 'text')) %>%
barplot_original_last<-ggplotly(barplot_original_last, tooltip=c('y', 'label', 'text')) %>%
layout(dragmode=FALSE, legend=list(orientation='h'))
appendPlotly(norm_barplot_last)
appendPlotly(barplot_original_last)
bovennul_sorted=bovennul[order(bovennul$distance, decreasing=TRUE),]
stippenplot_plotly<-plot_ly(data=bovennul_sorted, x=~date, y=~points, type='scatter', mode='markers', color=~stroke)
appendPlotly(stippenplot_plotly)
stippenplot_alles<-ggplot(bovennul_sorted, aes(x=date, y=points, color=stroke,
size=distance, group=AfstandSlag))+
stippenplot_sizes<-ggplot(bovennul_sorted, aes(x=date, y=points, color=stroke, size=distance, group=AfstandSlag))+
geom_point() +
scale_color_manual(values=kleurenset_strokes)+
labs(title = "Punten >0 per datum per afstand")
stippenplot_alles<-ggplotly(stippenplot_alles, tooltip=c('x', 'y'))
appendPlotly(stippenplot_alles)
stippenplot_sizes<-ggplotly(stippenplot_sizes, tooltip=c('x', 'y', 'size'))
appendPlotly(stippenplot_sizes)
lijnenplot_ineen_25m <- ggplot(bovennul[bovennul$poolType=='25m',],
aes(x = date, y = points, text=AfstandSlag,
color = interaction(distance, stroke, sep='m '))) +
labs(title = "Points - 25m pool") +
geom_line()+geom_point()+labs(color = "Distance & stroke")
lijnenplot_ineen_25m=ggplotly(lijnenplot_ineen_25m, dynamicTicks=TRUE, tooltip=c('x','y', 'text'))
appendPlotly(lijnenplot_ineen_25m)
lijnenplot_ineen=ggplot(bovennul, aes(x = date, y = points, text=AfstandSlag,
color=interaction(distance, stroke, sep='m '),
linetype=poolType, shape=poolType)) +
labs(title = "Points, grouped by pooltype", color='Distance & stroke') +guides(shape='none', linetype='none')+
geom_line()+geom_point()
lijnenplot_ineen=ggplotly(lijnenplot_ineen, tooltip=c('date', 'points', 'text', 'shape'))
naam_laatstgezien=''
for (i in 1:length(lijnenplot_ineen$x$data)){
goede_naam=substring(unlist(strsplit(lijnenplot_ineen$x$data[[i]]$name, ','))[1], 2)
lijnenplot_ineen$x$data[[i]]$name <- goede_naam
lijnenplot_ineen$x$data[[i]]$legendgroup <- goede_naam
if (naam_laatstgezien==goede_naam){
lijnenplot_ineen$x$data[[i]]$showlegend=FALSE
}
naam_laatstgezien=goede_naam}
appendPlotly(lijnenplot_ineen)
lijnenplot_ineen_50m <- ggplot(bovennul[bovennul$poolType=='50m',],
aes(x = date, y = points, text=AfstandSlag,
color = interaction(distance, stroke, sep='m '))) +
labs(title = "Points - 50m pool") +
geom_line()+geom_point()+labs(color = "Distance & stroke")
lijnenplot_ineen_50m=ggplotly(lijnenplot_ineen_50m, dynamicTicks=TRUE, tooltip=c('x', 'y', 'text'))
appendPlotly(lijnenplot_ineen_50m)
for (pooltype_loop in c('25m', '50m')){
title_plot=paste("Points - ", pooltype_loop, 'pool')
lijnenplot_pooltype=ggplot(bovennul[bovennul$poolType==pooltype_loop,],
aes(x = date, y = points, text=AfstandSlag,
color = interaction(distance, stroke, sep='m '))) +
labs(title = title_plot, color="Distance & stroke") + geom_line()+geom_point()
lijnenplot_pooltype=ggplotly(lijnenplot_pooltype, dynamicTicks=TRUE, tooltip=c('x','y', 'text'))
appendPlotly(lijnenplot_pooltype)
}
lijnenplot_gesplitst_25m <- ggplot(zonder_split[zonder_split$poolType=='25m',],
datumformat="'%y"
for (pooltype in unique(zonder_split$poolType)){
lijnenplot_gesplitst <- ggplot(zonder_split[zonder_split$poolType==pooltype,],
aes(x = date, y = tijdsduur, color = stroke)) +
labs(y = "Tijd in seconden", title = "Times - 25meter pool") +
geom_line() + geom_point(size=1)+
scale_y_continuous(breaks=seq(0,15*60,30), minor_breaks=seq(0,15*60,10))+
scale_colour_manual(values=kleurenset_strokes)+
facet_wrap(vars(distance), scales = 'free_y')
lijnenplot_gesplitst_25m=ggplotly(lijnenplot_gesplitst_25m, tooltip=c('x', 'y')) %>%
layout(dragmode=FALSE, legend=list(orientation='h'))
appendPlotly(lijnenplot_gesplitst_25m)
labs(y = "Time", title = pooltype) +
geom_line() + geom_point(size=1)+
scale_y_time(labels = function(t) strftime(t, "%M:%S"))+
scale_x_date(labels=function(t) strftime(t, datumformat))+
scale_colour_manual(values=kleurenset_strokes)+
facet_wrap(vars(distance), scales = 'free_y')
lijnenplot_gesplitst=ggplotly(lijnenplot_gesplitst, tooltip=c('x', 'y')) %>%
layout(dragmode=FALSE, legend=list(orientation='h'))
appendPlotly(lijnenplot_gesplitst)
}
lijnenplot_gesplitst_50m <- ggplot(zonder_split[zonder_split$poolType=='50m',],
aes(x = date, y = tijdsduur, color = stroke)) +
labs(y = "Tijd in seconden", title = "Times - 50meter pool") +
geom_line() + geom_point(size=1)+
scale_y_continuous(breaks=seq(0,15*60,30), minor_breaks=seq(0,15*60,10))+
scale_colour_manual(values=kleurenset_strokes)+
facet_wrap(vars(distance), scales = 'free_y')
lijnenplot_gesplitst_50m=ggplotly(lijnenplot_gesplitst_50m, tooltip=c('x', 'y')) %>%
layout(dragmode=FALSE, legend=list(orientation='h'))
appendPlotly(lijnenplot_gesplitst_50m)
return(response)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment