c3js / c3js/c3

Add a public API for subchart interactions

Open
#1,387 2 comments 5 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

Would it be appropriate to add a public API that allows for more programmatic subchart interactions? e.g. clearing the subchart selection or setting the extent?

Something along the lines of:

``` javascript
var chart = c3.generate({
...
});

chart.subchart.extent([5,10]).update();
chart.subchart.clear();
```

I'm currently providing a similar functionality in my wrapper API using the internal API's.

``` javascript
function clear(chart) {
if (chart.internal.config.subchart_show) {
chart.internal.brush.clear().update();
chart.internal.redrawForBrush();
}
};
```

I don't really want to be depending on any internal APIs, and would be willing to contribute something back if this is a desired functionality.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.