-
Notifications
You must be signed in to change notification settings - Fork 32
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
Switch Bar Chart to Radar Chart for Song Features #12
base: main
Are you sure you want to change the base?
Conversation
@DevApeAI review this PR |
@DevApeAI can you can you review this pr |
{ name: 'Liveness', value: features.liveness * 100, description: 'Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live.' }, | ||
{ name: 'Valence', value: features.valence * 100, description: 'A measure of the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence sound more negative (e.g. sad, depressed, angry).' }, | ||
{ name: 'Speechiness', value: features.speechiness * 100, description: 'Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the higher the attribute value.' } | ||
// ... existing featuresData array ... |
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.
Replacing BarChart
with RadarChart
is a significant change in how data is presented. Ensure that this change aligns with the user's expectations and provides a better experience. Also, consider accessibility when using charts, as screen readers and other assistive technologies might interpret them differently.
When importing from recharts
, it's good practice to only import the components you need to reduce bundle size. However, it looks like you've done that correctly here.
The removal of detailed descriptions for each feature (featuresData
array) might impact user understanding. If these descriptions are still relevant, consider keeping them accessible to the user, perhaps as tooltips or an expandable section.
window.scrollTo(0,0) | ||
getSong(id).then(res => setSong(res.data)); | ||
getSongFeatures(id).then(res => setFeatures(res.data)); | ||
// ... existing useEffect ... | ||
}, [id]); |
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.
It's good to see that you've maintained the ResponsiveContainer
to ensure the chart is responsive. However, make sure to test the new RadarChart
across different devices and screen sizes to ensure that it scales properly and remains legible.
Also, the PolarRadiusAxis
has a fixed domain of [0, 100]
. Ensure that this domain is appropriate for all possible data values that features.value
might have to avoid misrepresenting the data.
Lastly, the fillOpacity
of 0.6
for the Radar
component might affect the readability of the chart, especially if the background or overlapping sections are of similar color. Consider testing with different opacities to find a balance between aesthetics and readability.
loading="lazy"> | ||
</iframe> | ||
</div> | ||
</div> |
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.
The removal of the feature descriptions section could detract from the user's understanding of what each feature represents. If the descriptions are no longer displayed on the page, consider other ways to inform the user, such as tooltips on hover or a separate help section.
Additionally, ensure that the removal of this section does not leave any unused code or styles that were specifically for displaying these descriptions. Keeping the codebase clean and free of dead code helps maintainability and reduces potential confusion for future developers.
Hi @suitedaces! I've completed a thorough review of PR #12. Here's a summary of my findings:
Please take a look at the comments for detailed feedback. If you have any questions or need further clarification, don't hesitate to ask! Happy coding! 🤓 📊 ➡️ 📈 |
This PR replaces the existing BarChart with a RadarChart for displaying song features. The change includes importing necessary components from
recharts
and adjusting the properties to fit the radar chart. Styling has been updated to maintain consistency with the application's design language.