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

modifications in the plotted tables (i.e. conditional formatting) and one...

modifications in the plotted tables (i.e. conditional formatting) and one small improvement in another plot.
parent 00bad0bf
Branches
No related tags found
1 merge request!11barplots and plotted tables
......@@ -44,7 +44,7 @@ doId <- function(input) {
#Wat als iets niet in kleurenset_afstanden valt?
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')
bron=separate(bron, col = heatType, into = c("hoofdafstand", "heatType"), sep = ", ", fill='left')
bron$heatType <- as.factor(bron$heatType)
......@@ -77,8 +77,9 @@ doId <- function(input) {
DateAndPool<-DateAndPool[order(DateAndPool$date),]
freqtabel=as.data.frame(table(DateAndPool$city))
freqtabel=freqtabel[order(freqtabel$Freq, decreasing=TRUE),]
freqtabel_plot<-plot_ly(type = 'table',
cells = list(values =t(as.matrix(unname(freqtabel))))) %>%
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')) %>%
layout(title = 'Number of meets par city')
appendPlotly(freqtabel_plot)
......@@ -103,7 +104,7 @@ doId <- function(input) {
tijdlijn_alles<-ggplot(zonder_split, aes(x=date, y=interaction(distance, stroke, sep='m '), shape=poolType))+
geom_point()+
geom_point(data = tabel_Prs, color="green", alpha=0.7, size=2, show.legend=FALSE)+
labs(y='distance & stroke')+
labs(y='distance & stroke')+ggtitle(" ")+
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',
......@@ -126,10 +127,13 @@ doId <- function(input) {
group_by(distance, stroke, poolType) %>%
filter(date == max(date, na.rm=TRUE))
tabel_lastswam=tabel_LastEntrys%>%select(c('distance', 'stroke', 'poolType', 'date', 'city'))
plottabel_LastSwam=plot_ly(type='table',
tabel_lastswam=tabel_LastEntrys%>%select(c('distance', 'stroke', 'poolType', 'date'))
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)),
cells=list(values=t(tabel_lastswam[order(tabel_lastswam$date),])))
cells=list(values=t(tabel_lastswam[order(tabel_lastswam$date),]),
fill= list(color = list(kleurenset_pooltypes[tabel_lastswam$poolType])),
align='left'))
plottabel_LastSwam<-plottabel_LastSwam %>% layout(title='Last swam par distance and pooltype')
appendPlotly(plottabel_LastSwam)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment