Gantt Chart Example 1
✓ Published0🌍 Public
This example presents a Gantt chart that visualizes the time intervals of multiple named jobs, with each horizontal bar colored by job status (running, succeeded, failed, or killed). The chart is built with React and D3 v4, using an SVG rendering approach. The code defines a reusable `d3.gantt` function that creates the chart, and it includes a `redraw` method, demonstrating animated transitions for updates. The x-axis uses a time scale with `d3.axisBottom`, while the y-axis is a band scale for task names, with bars rendered as SVG rects.
AI-generated descriptionBoilerplate code for a React + D3 visualization with:
- CDN links for React, ReactDOM, and D3
- Basic React boilerplate
- Variables for dimensions and margins
- A
VizContainercomponent that:- Abstracts SVG/group container elements
- Follows the margin convention
- Show the margins, which can be easily removed by deleting the
showMargins={true} prop
MIT Licensed