The current API looks like this:
functionPlot({
target: '#tip',
annotations: [
{
x: -1
},
{
x: 1,
text: 'x = 1'
},
{
y: 2,
text: 'y = 2'
}
]
data: [
{ fn: 'x^2' },
]
})
Ideas for API
Move the annotation to be another type of datum.
functionPlot({
target: '#tip',
yDomain: [-1, 9],
data: [
{ fn: 'x^2' },
{ fn: 'x', skipTip: true },
functionPlot.Annotation({ x: -1 }),
functionPlot.Annotation({ y: 2, text: 'y = 2' }),
]
})