navigator chart with d3fc brush
This example demonstrates a navigator chart that allows users to brush over a small overview to control the time range displayed in a larger detail chart. It plots surface temperature from weather data collected by the University of Edinburgh. The visualization uses the `d3fc` brush component (`fc.brushX`), which integrates with the `d3fc` Cartesian chart (`chartSvgCartesian`) and its series types (`seriesSvgArea`, `seriesSvgLine`). The brush selection is data-driven, updates the main chart’s domain, and enables efficient exploration of the dataset.
AI-generated descriptionThis is a simple example of how to build a 'navigator' chart using the d3fc brush component. The example chart plots weather data collected by the University of Edinburgh.
The d3fc brush is built using the d3-brush component, but provides a simpler interface. This exampe highlights some of the d3fc-brush features:
- The brush is data-driven, with the location of the brush determined by the data supplied via a data join.
- The brush integrates with the d3fc cartesian chart component, with the extent of the brush automatically set based on the range of each axis.
- The d3fc-brush selection (which defines the brushed range), is represented as a percentage, whereas d3-brush uses pixels. The use of a percentage selection makes it easier to resize a brushed chart.
- The brush events expose utility functions for computing the axis domain based on the current selection, making it easier to handle brush events and update the chart.