Treemaps and JSON
in
Programming Questions
•
3 months ago
Hi guys,
I'm relatively new to treemaps (and processing for that matter) and have read through Ben Fry's Visualising Data Chapter 7 and still don't quite understand how to integrate it into my own code.
What my goal is:
I'm relatively new to treemaps (and processing for that matter) and have read through Ben Fry's Visualising Data Chapter 7 and still don't quite understand how to integrate it into my own code.
What my goal is:
I'm trying to create a treemap visualisation of the frequency of each tempo of each song released on Beatport over a date range (in this case 1 month).
What I have so far:
Download the code here. (includes libraries and the .CSV data file, so you don't need to worry about the one that will print out.)
- Fetching JSON data using Beatport's API and extracting 'bpm' and 'datePublished' information.
- Writing this data to a CSV file.
What I need help with:
- I need to sort my data in a way that frequency of 'bpm' values are counted for each unique date. For example:
- Date 1 e.g. 01/01/01
Frequency of each bpm that was released on that date:
127: 10
122: 20 - Date 2 e.g. 02/01/01
Frequency of each bpm that was released on that date:
127: 15
122: 10 - So, for the date range 1st Jan 2001-2nd Jan 2001, bpm 127 occurred 25 times, while 122 occurred 30 times.
- It is this data I want to visualise for each 'bpm' on a treemap.
From what I've read I think I may need to implement a treemap within a treemap? Any help would be very much appreciated!
1