Skip to content

Axis auto-range improvements #1876

Open
@etpinard

Description

@etpinard

This issue attempts to combine ideas from several individual feature requests into coherent picture (i.e. the least number of new attribute possible).

In a private conversation with @alexcjohnson , we proposed adding two new (cartesian) axis attributes: bounds and boundmode. bounds would expect 2-item array values similar to the current range. bounds can be thought of as representing the maximum possible extend of the axis ranges. In turn, boundmode would determine if bounds applies during the auto-range routine (i.e. on first view - discuss in #1861 (comment)) or during interactions as well (as proposed in #887). For example,

xaxis: {
  autorange: true,
  boundmode: 'soft',
  bounds: [0, 100]
}

would restrict the auto-range logic to compute an x-axis range between 0 and 100. This might be useful when plotting percentages where users don't want the axis ranges to go beyond 100%.

xaxis: {
  boundmode: 'hard',
  bounds: [0, 100]
}

would restrict the axis range to [0,100] in the auto-range logic and during interactions.

In doing so, 1-way bounds values such as [null, 100] or [0, null] should be allowed. null items here mean don't restrict the min (or max) bound acting. This behavior is similar to cmin and cmax for color scales. This call signature should also be extended to the axis range attribute - taking care of #400


A few more things to think about:

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions