Skip to content

Refactor annotations to be another type of datum. #358

@mauriciopoppe

Description

@mauriciopoppe

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' }),
  ]
})

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions