mauriciopoppe / function-plot

A 2d function plotter for the web
https://mauriciopoppe.github.io/function-plot/
MIT License
914 stars 112 forks source link

[Cherry-pick to 1.x] Add the sticky positioning to center the origin axes #302

Closed mauriciopoppe closed 3 weeks ago

mauriciopoppe commented 3 weeks ago

Added the option position: sticky to the axis, when set the axis will float in the viewport if the origin is visible.

Example:

      functionPlot({
        target: '#playground',
        title: 'quadratic with different axes position',
        width: 580,
        height: 400,
        xAxis: {
          position: 'sticky'
        },
        yAxis: {
          position: 'left'
        },
        data: [{
          fn: 'x^2'
        }]
      })

Ref #291 Cherry pick of #295

simone-panico commented 3 weeks ago

Quick question, but when will you make the release? I need the Function to Center the Axes for my Personal Project

mauriciopoppe commented 3 weeks ago

Done, it should be available in https://github.com/mauriciopoppe/function-plot/releases/tag/v1.25.0