plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Multi-axis Shapes

Open alexshoe opened this issue 3 weeks ago • 0 comments

Description:

Extends xref and yref to accept arrays, allowing shapes to span multiple subplots with each vertex anchored to a different axis. See #7151 for more information.

Example:

shapes: [{  
  type: 'rect',  
  x0: 0, 
  x1: 1, 
  y0: 0, 
  y1: 1,  
  xref: ['x', 'x2'],  // x0 uses 'x', x1 uses 'x2'  
  yref: ['y', 'y2']   // y0 uses 'y', y1 uses 'y2'
}]

Progress:

  • [x] Step 1: Attributes & validation
    • Extend xref and yref to allow array values
    • Add helper function to check number of defining coordinates of a shape
    • Update value validation to work with array values
  • [ ] Step 2: Refactor coordinate conversion
  • [ ] Step 3: Update shape rendering
  • [ ] Step 4: Addressing editable shapes
  • [ ] Step 5: Tests + documentation

alexshoe avatar Dec 04 '25 22:12 alexshoe