spotify/reactochart

resolvers in `resolveXYScale` should recursively traverse `children` tree

開放

#36 建立於 2017年1月6日

 (1 則留言) (0 個反應) (0 位負責人)JavaScript (50 個分叉)auto 404
help wanted

倉庫指標

星標
 (554 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

The new code in 0.2.1 is improving but has a significant regression - All of the resolvers in resolveXYScales used to recursively check the component's children to find the necessary props. However @thehindenburg 's new mapOverChildren, while being a nicer abstraction, does not do recursion - it only maps over an element's direct children.

Recursion is necessary IMHO because we want to support the use case of the user having intermediate layer components between XYPlot and their charts, eg.:

<XYPlot>
  <CustomChartWrapper>
    <LineChart />
    <AreaChart />
    <BarChart />
  </CustomChartWrapper>
</XYPlot>

Without recursion, this would never try to resolve anything on the actual chart components, it would stop at CustomChartWrapper. We should improve the general resolution functions in resolveXYScales to handle this case

貢獻者指南