Graphs and tables for your Spotify account.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.5 KiB

  1. <!-- header {{{ -->
  2. <!DOC
  3. <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
  4. <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
  5. <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
  6. <!--[if gt IE 8]><!-->
  7. {% load static %}
  8. <html class="no-js"> <!--<![endif]-->
  9. <head>
  10. <meta charset="utf-8">
  11. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  12. <title>Test DB Page</title>
  13. <meta name="description" content="">
  14. <meta name="viewport" content="width=device-width, initial-scale=1">
  15. <link rel="stylesheet" href="{% static 'spotifyvis/css/dark_bg.css' %}">
  16. </head>
  17. <!-- }}} header -->
  18. <body>
  19. <script src="https://d3js.org/d3.v5.min.js"></script>
  20. <script src="https://cdnjs.cloudflare.com/ajax/libs/randomcolor/0.5.2/randomColor.min.js"></script>
  21. {% load static %}
  22. <script src="{% static "spotifyvis/scripts/genre_graph.js" %}"></script>
  23. <svg width="1920" height="740"></svg>
  24. <script>
  25. var svg = d3.select("svg"),
  26. margin = {top: 20, right: 20, bottom: 30, left: 40},
  27. width = +svg.attr("width") - margin.left - margin.right,
  28. height = +svg.attr("height") - margin.top - margin.bottom,
  29. g = svg.append("g").attr("transform", "translate(" + margin.left + "," + margin.top + ")");
  30. var x = d3.scaleBand()
  31. .rangeRound([0, width])
  32. .paddingInner(0.05)
  33. .align(0.1);
  34. var y = d3.scaleLinear()
  35. .rangeRound([height, 0]);
  36. d3.json("{% url "get_genre_data" user_secret %}").then(create_genre_graph);
  37. </script>
  38. </body>
  39. </html>