here is the outline for my whole story,read the requirement first and go see my
here is the outline for my whole story,read the requirement first and go see my main.js. combine my sketch and my data pdf wirte the final report, u need add the data pic and screenshort my final work.
FINAL REPORT
Title: The Impact of Diet on Weight and Emotion: A Visual Analysis
I. Introduction and Hypothesis
In the third week of our course, I embarked on a journey to understand the relationship between my daily diet, weight, and emotions. At that time, I was grappling with anxiety about my weight, which prompted me to hypothesize the effects of different types and caloric content of food on my weight and mood.
II. Methodology of Data Collection
I focused on three primary cuisines: Chinese, Italian, and American, each representing a distinct food category in my diet. The caloric content of each meal, especially my homemade dinners, was meticulously recorded to calculate the total caloric intake. Interestingly, I noticed a pattern in my mood fluctuations associated with these cuisines. Chinese meals, often carb-heavy, led to a sense of happiness despite their higher calorie count. In contrast, the balanced nature of Italian cuisine correlated with a more stable mood, and the typically low-calorie American dishes like boiled foods and Caesar salads were linked to lower happiness levels. My morning weight measurements provided a consistent and accurate gauge of my weight fluctuations.
III. Visualization and Analysis
The second draft of my project began with a centered title, styled using CSS. A select box was strategically placed above the draft, establishing a clear connection with my visualization. The box’s functionality was achieved in main.js, using a filter technique to exclude irrelevant data. The select box was programmed with if-else return statements, assigning happiness level as the selection criteria. I borrowed design elements from sketch3, employing emojis to depict my happiness levels and overall mood.
For the chart construction, I used ‘g’ and ‘${}’ to define the y and x axes in D3.js. The y-axis was marked in 100-calorie intervals, with color gradients to visually differentiate calorie levels. The x-axis represented October’s data. All legend maps were positioned on the right for a cohesive and aesthetically pleasing layout. Each legend map featured rounded corners (.attr(“rx”, 10) and .attr(“ry”, 10)) to enhance visual appeal. The color scheme for different food types was inspired by national flags: blue for American, red for Chinese, and green for Italian cuisines. Each map was grouped for easier adjustments.
IV. Interactivity and Design
A key feature of my visualization was the interactive tooltip, inspired by an example from d3-graph-gallery. The tooltip was styled with .(“background-color”, “white”) and (“opacity”, 0.8) to ensure it complemented rather than obscured the chart. This feature allowed users to hover over elements to reveal specific data points, such as the date, weight, calorie count, and happiness index, enriching the user experience and understanding of the data.
V. Conclusions
Chinese Cuisine: Higher average calorie intake correlated with weight gain but also appeared to enhance happiness.
American Cooking: Lower average calories seemed to aid in weight loss but at the expense of reduced happiness.
Italian Cuisine: Offered a balanced calorie range, linked to moderate levels of happiness.
Extended Conclusion:
This study highlighted the complex interplay between calorie intake, type of cuisine, and emotional well-being. While high-calorie Chinese dishes positively influenced mood, they were also associated with weight gain. Conversely, low-calorie American dishes were linked to weight loss but a decrease in happiness. Italian cuisine, with its range of calorie content, corresponded with more stable emotional responses. These findings challenge conventional dietary perceptions, underscoring the importance of considering different food types’ physical and emotional impacts.
References
https://gramener.github.io/d3js-playbook/tooltips.html
https://www.react-graph-gallery.com/scatter-plot#circles
https://d3-graph-gallery.com/graph/interactivity_button.html