Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart events not exposed - Feature request #37

Closed
temecom opened this issue Oct 15, 2015 · 7 comments
Closed

Chart events not exposed - Feature request #37

temecom opened this issue Oct 15, 2015 · 7 comments
Assignees

Comments

@temecom
Copy link

temecom commented Oct 15, 2015

As a C3 user/developer it would be nice to have the chart actions linked to the ember action chain. This would provide interaction with other components on the view eg:

A group selection on the chart could trigger a refresh of a table showing the data details.

This would involve catching the 'once' method callback in D3 and emitting it as an Ember action.

Thanks

Chris (expatriate Canadian in San Diego)

@Glavin001
Copy link
Owner

Absolutely agree. This is planned. For whatever reason I neglected to create an Issue. Thank you!

@Glavin001 Glavin001 self-assigned this Oct 15, 2015
@Glavin001
Copy link
Owner

I would love to receive a Pull Request adding this functionality 😄.

@temecom
Copy link
Author

temecom commented Oct 16, 2015

I will give it a shot.

I looked for the D3 instance but could not find it. Where is it buried?

Chris

On 10/15/2015 03:03 PM, Glavin Wiechert wrote:

I would love to receive a Pull Request adding this functionality 😄.


Reply to this email directly or view it on GitHub
#37 (comment).

@Glavin001
Copy link
Owner

@Glavin001
Copy link
Owner

How about this for expected usage:

{{c3-chart data=model chart-created=(action "chartCreated")}

And your Controller or Route would have an action named chartCreated that could save the chart instance passed to itself to be used later.

{
    actions: {
        chartCreated: function(chart) {
            this.set('myChartProperty', chart);
        }
    }
}

This would also work without any internal changes to Ember-C3:

{{c3-chart data=model chart-created=(mut chart)}

Where (mut chart) would generate a function that access the chart instance and would set the property chart on the controller.

@maxwondercorn
Copy link
Collaborator

See issue #77

@maxwondercorn
Copy link
Collaborator

chart actions/events were available on the component but have been updated with pr #79. Dummy app has examples using closure actions on chart events. Update will be published when issue #77 checklist is completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants