Overview
Intuit's core mission involves empowering users with financial insights. A critical component of our data visualization tools is the ability for users to customize how their data is presented. This problem focuses on building a dynamic configuration panel for a chart, allowing users to select key data dimensions and aggregation methods, which then dictates how a hypothetical chart would render.
What you need to do / Task
Your goal is to implement a ChartConfigurator component that allows users to define the X-axis, Y-axis, and an aggregation method for a dataset.
- Render a configuration panel: Create a UI with three distinct dropdowns:
- X-Axis: Selects a dimension for the X-axis from available dataset fields.
- Y-Axis: Selects a dimension for the Y-axis from available dataset fields.
- Aggregation: Selects an aggregation method (e.g., 'Sum', 'Average', 'Count') to apply to the Y-axis data.
- Dynamic Data Display: Below the configuration controls, display the simulated processed data based on the current selections. This processed data should reflect the chosen X-axis, Y-axis, and aggregation.
- Default Selections: Initialize the configurator with sensible default selections for X-axis, Y-axis, and Aggregation.
- State Management: Ensure that changing any dropdown selection immediately updates the displayed processed data.
- Input Validation/Feedback: Prevent selecting the same field for both X-axis and Y-axis. If this occurs, display an appropriate error message and prevent data processing. Additionally, consider how to handle aggregation methods ('Sum', 'Average') if the chosen Y-axis field is non-numeric.
UI/UX expectations
- The configuration panel should be clearly laid out, with labels for each dropdown.
- Dropdowns should be standard HTML select elements or a simple custom equivalent.
- The "Processed Data" display area should show the results in a readable format (e.g., a simple list or table).
- Error messages (e.g., for duplicate axis selection or invalid aggregation) should be clearly visible and accessible.
- Basic styling for readability and separation of elements is expected (e.g., using flexbox/grid for layout, padding, margins).
Acceptance criteria
- The component renders three dropdowns: X-Axis, Y-Axis, and Aggregation.
- Dropdowns are populated with appropriate options (dataset fields for axes, aggregation types for aggregation).
- Changing any dropdown selection dynamically updates the displayed processed data.
- The "Processed Data" output correctly reflects the chosen X-axis, Y-axis, and aggregation.
- A user cannot select the same field for both X-Axis and Y-Axis. An error message is displayed if this condition is met, and data processing is halted.
- If a non-numeric field is selected for Y-Axis and the aggregation method is 'Sum' or 'Average', an appropriate error message is displayed, and data processing is halted.
- The component initializes with valid default selections and displays corresponding processed data.
- The UI is reasonably styled for clarity and usability.