Overview
Netflix produces a vast array of content, requiring meticulous planning and scheduling across various teams. Visualizing these complex timelines is crucial for tracking progress, identifying bottlenecks, and ensuring timely delivery. In this problem, you'll build a simplified Gantt chart component to help production managers visualize episode and post-production schedules. This exercise focuses on rendering dynamic, date-based data into an intuitive UI, a common challenge in many Netflix internal tools.
What you need to do / Task
Your primary task is to create a React component that displays a Gantt chart:
- Render Tasks: Display a list of production tasks as horizontal bars on a timeline. Each task has a
category, name, startDate, and endDate.
- Category Grouping (Swimlanes): Group tasks by their
category. Each category should have its own "swimlane" in the chart, making it easy to see all tasks belonging to that category together.
- Timeline Header: Implement a dynamic header displaying the dates covered by the chart. For simplicity, assume a daily granularity.
- Date Calculation & Positioning: Accurately calculate the width and horizontal position (
left CSS property) of each task bar based on its startDate, endDate, and the overall timeline scale.
- Horizontal Scrolling: The chart should be horizontally scrollable if the total timeline width exceeds the viewport.
- Task Details on Hover: When a user hovers over a task bar, display a tooltip or popover showing the task's
name, startDate, and endDate.
- Visual Distinction for Overlapping Tasks: If multiple tasks within the same category overlap significantly, ensure they are visually distinct (e.g., slightly offset vertically or stacked clearly within their swimlane).
UI/UX expectations
- The overall layout should be clean and easy to read, resembling a classic Gantt chart.
- Tasks should be represented by distinct colored bars. Use the provided
color for each category's tasks.
- The timeline header should clearly indicate days.
- Horizontal scrolling should be smooth and intuitive.
- The hover tooltip should appear near the hovered task and disappear when the mouse leaves.
- Each category's swimlane should be clearly labeled.
Acceptance criteria
- The Gantt chart component renders without errors.
- All provided
Task data is displayed visually on the timeline.
- Tasks are correctly grouped under their respective
Category labels.
- Task bars accurately reflect their
startDate and endDate on the timeline.
- The timeline header displays a sequence of dates, corresponding to the visible chart range.
- The chart supports horizontal scrolling when the content width exceeds the container.
- Hovering over a task bar displays a tooltip with the task's
name, startDate, and endDate.
- Overlapping tasks within the same category are visually distinguishable (e.g., by vertical offset).