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

Multiple changes. Biggest differences: removed some graphs, and multiple...

Multiple changes. Biggest differences: removed some graphs, and multiple changes in the line graphs.
parent 30fa27ca
Branches
No related tags found
1 merge request!9Removed some graphs, and multiple changes in line graphs
......@@ -81,21 +81,14 @@ doId <- function(input) {
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(title="Datum van alle gezwommen slagen per afstand", 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)
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,62 +108,73 @@ 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,
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'))%>%
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)+
theme(axis.text.x = element_text(angle = 45, hjust=1))+
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)
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.")+
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(norm_barplot_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,
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=ggplotly(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") +guides(shape='none', linetype='none')+
geom_line()+geom_point()+labs(color = "Distance & stroke")+ 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_25m <- ggplot(bovennul[bovennul$poolType=='25m',],
aes(x = date, y = points, text=AfstandSlag,
......@@ -181,34 +185,28 @@ doId <- function(input) {
appendPlotly(lijnenplot_ineen_25m)
lijnenplot_ineen_50m <- ggplot(bovennul[bovennul$poolType=='50m',],
aes(x = date, y = points, text=AfstandSlag,
color = interaction(distance, stroke, sep='m '))) +
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)
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