#SQLSatSlovenia visualizing currently submitted tracks per country.

And again, playing with data currently submitted sessions (23 submitted sessions on June, 28th, 2015) for SQLSaturday Slovenia 2015 from SQLSaturday website is giving me this beautiful diagram prepared with SQL Server and R.

Circle_of_tracks_country_SQLSatSlovenia2015

So keep submitting the sessions and we will see you in December 2015 in Ljubljana, Slovenia.

Code for creating this diagram:

rm(podatki)
podatki = matrix(c(1,2,2,2,0,0,0,1,0,1,0,1,1,0,2,0,0,0,0,0,2,0,0,2,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0), 7, 7)
# rownames(podatki) <- c("BI Platform Architecture, Development & Administration",
#                    "BI Inforpodatkiion Delivery",
#                    "Enterprise Database Administration & Deployment",
#                    "Professional Development",
#                    "Cloud Application Development & Deployment",
#                    "Application & Database Development",
#                    "Advanced Analysis Techniques"
#                    )
rownames(podatki) <- c("BI Plat.Arch.,Dev.&Adm.",
                   "BI Info.Deliv.",
                   "Ent.DBA&Dep.",
                   "Prof.Dev.",
                   "Cloud App.Dev.",
                   "App.&DB Dev.",
                   "Adv_Analysis Tec."
)
colnames(podatki) = c("Germany", "Denmark", "Poland", "USA", "BUL", "A","RUS")

#View(podatki)

rn <- rownames(podatki)
cn <- colnames(podatki)

factors <- c(rn, cn)
factors <- factor(factors, levels = factors)

col_sum <- apply(podatki, 2, sum)
row_sum <- apply(podatki, 1, sum)
xlim <- cbind(rep(0, length(factors)), c(row_sum, col_sum))

circos.par(cell.padding = c(0,0,0,0))
circos.initialize(factors = factors, xlim = xlim)
circos.trackPlotRegion(factors = factors, ylim = c(0,1), bg.border= NA,
                       bg.col = c("blue","green","red","brown","yellow","magenta","orange", rep(grey(0.8), 8)), track.height= 0.04,
                       panel.fun = function(x,y){
                         sector.name = get.cell.meta.data("sector.index")
                         xlim = get.cell.meta.data("xlim")
                         circos.text(mean(xlim), 1.5, sector.name, adj = c(0.5, 0))
                       })
col <- c("#00A0B1","#2E8DEF","#A700AE","#643EBF","#BF1E4B","#DC572E","#00A600","#0A5BC4")
for(i in seq_len(nrow(podatki))) {
  for(j in seq_len(ncol(podatki))) {
    circos.link(rn[i], c(sum(podatki[i, seq_len(j-1)]), sum(podatki[i, seq_len(j)])),
                cn[j], c(sum(podatki[seq_len(i-1), j]), sum(podatki[seq_len(i), j])),
                col = col[i], border= "white")
  }   
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s