-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heat Map with Backend Data #77
base: heat-map
Are you sure you want to change the base?
Conversation
gracetian6
commented
Jul 31, 2020
•
edited
Loading
edited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
heatMapValues.push(new HeatMapRow(data.slice(i, i + numRows))); | ||
} | ||
return heatMapValues.reverse(); | ||
} | ||
|
||
/** | ||
* renders heat map onto html | ||
* @param {number[]} data array of all 0s/1s heat map data | ||
* @param {number} dataLength size of data array | ||
* @param {number[]} allBinaryData array of all 0s/1s heat map data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider renaming to just binaryData
, allBinaryData
insinuates that there's some other array with just a segment of the data, which there isn't so we can simplify this name
@@ -88,4 +88,9 @@ function createHeatMap(data, dataLength) { | |||
chart.render(); | |||
} | |||
|
|||
createHeatMap(likedMusicBinaryHist, TOTAL_LIKED); | |||
GENRE_ANALYSIS.then((genreAnalysisInfo) => { | |||
const LIKED_MUSIC_BINARY_HIST = makeBinaryArr( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I don't think this is a true constant, it should just use lowerCamelCase
} | ||
|
||
export const GENRE_ANALYSIS_PROMISE = fetchMusicGenre(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See earlier PR about not calling a function with side effects (such as making a web request) on import