In this assignment, you will expand the previous data visualization assistant by adding data analysis capabilities. It should be able to respond to both visual queries (chart generation) and data-driven queries (such as data aggregation for averages or medians).
We will use the same user interface from the previous assignment. Your interface should support data loading through both drag-and-drop and click-to-upload, and it should display a data preview. Additionally, your chat interface should be able to render a Vega-Lite chart and provide a textual response.
Clear Messages
Button👉 We will deduct points for other issues related to usability, even if not explicitly mentioned. Ensure you provide a good user experience. For example, we have previously deducted points for chat history not functioning smoothly (e.g., not auto-scrolling to the most recent conversation).
👉If you are using react-markdown
, it may not render a table correctly. You will need the remark-gfm
package to handle this:
import remarkGfm from 'remark-gfm'
<Markdown remarkPlugins={[remarkGfm]}>{message.content}</Markdown>
👉 If you are using vanilla Javascript/HTML, then you could marked. Example:
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Marked in the browser</title>
</head>
<body>
<div id="content"></div>
<script src="<https://cdn.jsdelivr.net/npm/marked/marked.min.js>"></script>
<script>
document.getElementById('content').innerHTML =
marked.parse('# Marked in the browser\\n\\nRendered by **marked**.');
</script>
</body>
</html>
You will reuse your previous assignment to implement this tool. You need to define a function that can be easily called within the tool's calling loop below. Additionally, you will need to describe this function to LLMs so they can consider it when deciding which tools to use based on the user's question.
Your implementation may vary depending on your previous assignment. Below are some potential guidelines: