Ahh interesting…you bring up a good question about the limitation of components. I have a couple of thoughts…
Is this a D3 Concern?
What you’re describing wanting to do is something that D3 already does very well. What if you let D3 handle the internals of the chart? Then, when a click action occurs, your component could send the action to the controller, update the data, the component updates with the new data, etc. D3 would handle the creation and destruction of the child nodes and you would not need to handle any view hierarchy with Ember.
Should there be a ComponentContainer Class?
I was looking into EmberUI and I found that they were doing some interesting things for pop-over type components. It looks like they want components to programmatically append and remove sub-components…and since you can’t really do that, they have a nifty workaround where they manually append a new component to the
<body> and position it.
The advantage here is that those sub-components do not need to be rendered initially…but should be rendered when the user wants to interact with it. The disadvantage with the current implementation is that there’s a bit of hackery by using the container directly and not a clear way of handling bubbling actions.
Anyway…my thoughts. Any thoughts of your own?