Skip to content

Feature request: Axis boundaries #887

Closed
@g-i-o-

Description

@g-i-o-

Hi, I just recently started using your plotting library (which is awesome by the way) to do some heatmap plots. One of the main complaints I've received have been the ability to pan outside the plot's boundaries (just click and drag the plot outside the viewport and suddenly the axis range point to some non-data containing area). While this can be mitigated with the fixedrange attribute, you end up losing the pan and zoom features for that axis.

So, I was thinking that maybe adding axis boundaries could be a thing? Maybe two more properties could be added to the axes: bounds and boundsmode. bounds gets checked in the panning and zooming logic and, if set, it constrains the range to the specified bounds. boundsmode allows the bounds to be computed automatically from the plot (like autorange). That way users can zoom and pan al around the plot, but cannot get outside the plot bounds.

As proof of concept I have created this pull request g-i-o-/plotly.js#1 on my fork and was thinking maybe you guys could check it out comment on how to improve and, if you like it, add it or something like that.


  1. Here we have a nice little heatmap:
    newplot
  2. But then some user starts using with the panning tool a bit too much:
    newplot 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions