All examples By author By category About

ColinEberhardt

navigator chart with d3fc brush

This 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:

  1. The brush is data-driven, with the location of the brush determined by the data supplied via a data join.
  2. The brush integrates with the d3fc cartesian chart component, with the extent of the brush automatically set based on the range of each axis.
  3. 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.
  4. 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.