Skip to content

Chart component yielding selection is not handled by child chart component correctly #44

@ming-codes

Description

@ming-codes
{{#data-visual as |stage width height|}}
  {{#parent-chart select=stage.svg.select.chart as |selection|}}
    {{child-chart-component select=selection}}
  {{/parent-chart}}
{{/data-visual}}
// parent-chart.js
Ember.Component.extend({
  call(selection) {
    this.set('yieldDown', selection.append('g'));
  }
})
// parent-chart.hbs
{{yield yieldDown}}

This is expected to work, but it doesn't. Because select= is expecting a selection proxy.

Do this instead.

// parent-chart.js
Ember.Component.extend({
  call(selection) {
    selection.append('g').classed('cls');

    this.set('yieldDown', this.get('select.cls'));
  }
})

This will make the select proxy correctly wrap the element to yield down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions