CSNW / d3.compose

Compose complex, data-driven visualizations from reusable charts and components with d3
http://CSNW.github.io/d3.compose/
MIT License
697 stars 24 forks source link

Start New Architecture #39

Closed timhall closed 8 years ago

timhall commented 8 years ago

Goal: Apply functional techniques to make d3.compose easier to reason about, more testable, and better match d3's standard approach

Implementation: Use a "container"/"smart" and "presentation"/"dumb" components approach (reference) with "smart" component handling logic, state, and context and "dumb" component handling rendering.

This PR applies this approach to the Axis component while being interoperable with the pre-existing architecture. Notable improvements to Axis with this new architecture:

Roughly the same lines of code now, but when general methods are extracted (to helpers and base Chart class), it'll be smaller and much easier to understand compared to the existing implementation.

timhall commented 8 years ago

Seems to be working well and maintains current functionality. Merging to continue iterating towards the new design in future PRs.