Apply functional techniques to make d3.compose easier to reason about, more testable, and better match d3's standard approach
Use a "smart"/"dumb" components approach (reference) with "smart" component handling logic, state, and context and "dumb" component handling rendering.
- The "dumb" component is stateless and is a simple, idempotent function that takes in a
d3.selection
and properties and renders the chart. - The "smart" component provides the API for interacting with
Compose
, prepares properties for the "dumb" component, and handles any logic/state