Browse Source
			
			
			Create separate page for audio features
			
				
		Create separate page for audio features
	
		
	
			
				An additional page where the user will be directed after logging in was created. A link to the audio features display page was added to the aforementioned page. Changes were made to the audio features graphing function so that the categories are displayed in ascending order (was random before).master
				 5 changed files with 40 additions and 40 deletions
			
			
		- 
					26spotifyvis/static/spotifyvis/scripts/user_data.js
 - 
					21spotifyvis/templates/spotifyvis/audio_features.html
 - 
					12spotifyvis/templates/spotifyvis/logged_in.html
 - 
					1spotifyvis/urls.py
 - 
					20spotifyvis/views.py
 
@ -1,26 +0,0 @@ | 
			
		|||||
/** | 
				 | 
			
		||||
 * Retrieves data for a specific audio feature for a certain user | 
				 | 
			
		||||
 * @param audioFeature: the audio feature for which data will be retrieved | 
				 | 
			
		||||
 * @param clientSecret: the client secret, needed for security | 
				 | 
			
		||||
 * @param chartElement: the SVG element in which the data will be plotted | 
				 | 
			
		||||
 */ | 
				 | 
			
		||||
function plotAudioFeatureData(audioFeature, userSecret, chartElement) { | 
				 | 
			
		||||
    let httpRequest = new XMLHttpRequest(); | 
				 | 
			
		||||
    /* | 
				 | 
			
		||||
     * Handler for the response | 
				 | 
			
		||||
     */ | 
				 | 
			
		||||
    httpRequest.onreadystatechange = function() { | 
				 | 
			
		||||
        if (httpRequest.readyState === XMLHttpRequest.DONE) { | 
				 | 
			
		||||
            if (httpRequest.status === 200) { | 
				 | 
			
		||||
                let responseData = JSON.parse(httpRequest.responseText); | 
				 | 
			
		||||
 | 
				 | 
			
		||||
            } else { | 
				 | 
			
		||||
                alert("There was a problem with the login request, please try again!"); | 
				 | 
			
		||||
            } | 
				 | 
			
		||||
        } | 
				 | 
			
		||||
    }; | 
				 | 
			
		||||
 | 
				 | 
			
		||||
    let queryString = `/audio_features/${audioFeature}/${userSecret}`; | 
				 | 
			
		||||
    httpRequest.open('GET', queryString, true); | 
				 | 
			
		||||
    httpRequest.send(); | 
				 | 
			
		||||
} | 
				 | 
			
		||||
@ -0,0 +1,12 @@ | 
			
		|||||
 | 
				<!DOCTYPE html> | 
			
		||||
 | 
				{% load static %} | 
			
		||||
 | 
				<html lang="en"> | 
			
		||||
 | 
				<head> | 
			
		||||
 | 
				    <meta charset="UTF-8"> | 
			
		||||
 | 
				    <title>Logged In</title> | 
			
		||||
 | 
				    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | 
			
		||||
 | 
				</head> | 
			
		||||
 | 
				<body> | 
			
		||||
 | 
				    <a class="btn btn-primary" href="/audio_features/{{ user_secret }}" role="button">Audio Features</a> | 
			
		||||
 | 
				</body> | 
			
		||||
 | 
				</html> | 
			
		||||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue