ember-cli-d3
ember-cli-d3 copied to clipboard
D3-HTMLBars interop
pangratz/ember-cli-htmlbars-inline-precompile
Sounds like a great idea. No solid idea on how it could work out.
There is advantage to this. D3 is very good with structured DOM that aligns nicely with data. But HTMLBars template is better with unstructured DOM that is sometimes needed to construct compound shapes.
barLayer: join('model.data[model.key]', '.bar', {
enter: hbs`
<line y1="0" y2="0"></line>
<text>0</text>
`,
update(selection) {
selection.select('line').attr('y2', this.get('yScale'));
selection.select('text').text(accessor('value'));
}
})
Things that still needs answers:
- How is this template going to be scoped? The template has nothing to do with Ember's Component system, so it can't be scoped the same.