Open
Description
The current API looks like this:
functionPlot({
target: '#tip',
tip: {
xLine: true, // dashed line parallel to y = 0
yLine: true, // dashed line parallel to x = 0
renderer: function (x, y, index) {
// the returning value will be shown in the tip
}
},
yDomain: [-1, 9],
data: [
{ fn: 'x^2' },
{
fn: 'x',
skipTip: true
}
]
})
It provides some options for configuration but a user can't bring it's own tip or make it more customizable, examples:
- What if I want to show data for both polylines at the same time? Right now it's one or the other.
Ideas for API
Move tip to be another type of datum.
functionPlot({
target: '#tip',
yDomain: [-1, 9],
data: [
{ fn: 'x^2' },
{ fn: 'x', skipTip: true },
functionPlot.Tip({ x: true, y: true, renderer: () => {} })
]
})