diff --git a/spotifyvis/static/spotifyvis/scripts/test_db.js b/spotifyvis/static/spotifyvis/scripts/test_db.js new file mode 100644 index 0000000..6830820 --- /dev/null +++ b/spotifyvis/static/spotifyvis/scripts/test_db.js @@ -0,0 +1,11 @@ +console.log("{{ user_id }}"); +artist_data = JSON.parse('{{ artist_data }}'); +artist_data.forEach(function(d) { + console.log(d.name, d.num_songs); +}); + +d3.json("{% url "get_artist_data" user_id %}", function(error, data) { + data.forEach(function(d) { + console.log(d.name, d.num_songs); + }); +}); diff --git a/spotifyvis/templates/spotifyvis/index.html b/spotifyvis/templates/spotifyvis/index.html index 32d6db9..5964b34 100644 --- a/spotifyvis/templates/spotifyvis/index.html +++ b/spotifyvis/templates/spotifyvis/index.html @@ -20,6 +20,7 @@
diff --git a/spotifyvis/templates/spotifyvis/test_db.html b/spotifyvis/templates/spotifyvis/test_db.html new file mode 100644 index 0000000..3f7a0d0 --- /dev/null +++ b/spotifyvis/templates/spotifyvis/test_db.html @@ -0,0 +1,27 @@ + + + + + + + + +{% filter force_escape %} {% debug %} {% endfilter %}+ + {% load static %} + + + diff --git a/spotifyvis/templates/spotifyvis/user_data.html b/spotifyvis/templates/spotifyvis/user_data.html index fce7fef..99823f6 100644 --- a/spotifyvis/templates/spotifyvis/user_data.html +++ b/spotifyvis/templates/spotifyvis/user_data.html @@ -21,6 +21,6 @@ {% for genre_name, genre_count in genre_dict.items %}