All examples By author By category About

ColinEberhardt

Most popular programming languages on StackOverflow

Most popular programming languages on StackOverflow

This D3 block was inspired by a video I saw on Reddit showing an animated chart of StackOverflow tag popularity. I thought it woudl be fun to recreate it with D3 and D3FC.

I obtained the data from the StackOverflow Data Explorer, using the following query:

select
  '##TAG##' as tag, yr,  mo,  COUNT(*) as total
from (
  select
  MONTH(p.CreationDate) AS mo,
  YEAR(p.CreationDate) AS yr
  from Posts p 
    join PostTags pt on (p.id = pt.PostId) 
    join Tags t on (pt.TagId = t.id) 
  where t.TagName = '##TAG##'
) src
group by yr, mo
order by yr, mo

The chart is rendered using various D3FC components, making good use of the built-in transition support. The code has various comments if you're interested in how it was constructed.

Built with blockbuilder.org