You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks a lot for the work of adding an abstract layer to d3, although I'm still climbing the learning curve.
I'm trying to add a layer to the contributed chart d3.chart.candlestick in the miso project page...The layer depends on another set of data namely a set of transactions. I initially tried extend the chart as I thought I was only adding a layer, however as the dataset now consists of additional data, the whole base chart functions break down. What is the strategy for such as case, should I be composing 2 charts in one using .attach and <?>.demux ? one doubt I have is that both charts share the same scales, so not sure how to re-use was is available in the candlestick chart.
thanks,
Stefan
The text was updated successfully, but these errors were encountered:
If I understand your problem correctly, this sounds like a case for attach. You should be able to re-use the scales; how you do it depends on how you structure your code. Here are two approaches that come to mind:
You could define a single chart that initializes the chart you wish to extend, retrieves references to that instance's scales immediately following initialization, and defines the new layer in terms of that reference.
You could define two charts. "Chart A" would define the layer you want to add, and it would accept a set of scales as an initialization option. "Chart B" would create one instance of the chart you wish to reuse and one instance of Chart A, passing in the scales as appropriate. Finally, Chart B would use attach to hook up the draw cycles.
The second approach requires more abstraction, but it's also more composable and potentially more flexible for it. Would either work for you?
Hi,
thanks a lot for the work of adding an abstract layer to d3, although I'm still climbing the learning curve.
I'm trying to add a layer to the contributed chart d3.chart.candlestick in the miso project page...The layer depends on another set of data namely a set of transactions. I initially tried extend the chart as I thought I was only adding a layer, however as the dataset now consists of additional data, the whole base chart functions break down. What is the strategy for such as case, should I be composing 2 charts in one using .attach and <?>.demux ? one doubt I have is that both charts share the same scales, so not sure how to re-use was is available in the candlestick chart.
thanks,
Stefan
The text was updated successfully, but these errors were encountered: