Viewing a saved revision (read-only)
c383af4b51104e0e98627589ff9ba0ea
Mental Health
This example visualizes the first record of a mental health survey dataset from Kaggle, showing parsed survey responses as a JSON string. The code loads `MentalHealthSurvey.csv` via a data import statement, then converts quantitative fields like age, CGPA, sleep hours, and Likert-scale ratings (depression, anxiety, isolation) from strings to numbers using unary plus and `parseFloat`. The parsed object is displayed in a `<pre>` element with a fixed font size, providing a quick reference for the data structure. The visualization relies on the CSV parsing and string interpolation in JavaScript, without additional libraries.
AI-generated descriptionThe Mental Health Dataset, loaded and parsed as CSV.
Fork and modify this template to import your data to VizHub and export it for use in other vizzes! To do that:
- Fork this viz
- Clear out the README
- Update the README with details about your dataset (including original source)
- Replace
data.csvwith your own data - Replace the parsing logic in
index.jswith your own - Set the custom URL so you can import from it easily
Challenge
- Find 3 datasets on a topic you are interested in
- For each of those, fork this viz and replace the data
- Parse the quantitative attributes into numbers
- Update
README.mdto indicate the original data source