@@ -45,11 +45,12 @@ module.exports = function calc(gd, trace) {
4545
4646 // For category aggregation, we need to set the right properties
4747 // The category aggregation looks for:
48- // - catIndex = cdi.p (position) or cdi[axLetter] (x/y coordinate)
48+ // - catIndex = cdi.p (position) or cdi[axLetter] (x/y coordinate)
4949 // - value = cdi.s (size) or cdi.v (value) or opposite coordinate
50- // We'll let the axis system handle the category index mapping
51- cdi . s = Math . sqrt ( u [ i ] * u [ i ] + v [ i ] * v [ i ] ) ; // magnitude as size/value
52- cdi . v = cdi . s ; // also set v for value-based aggregation
50+ // For scatterquiver, use u component as the value for category ordering
51+ cdi . s = u [ i ] ; // use u component for size/value
52+ cdi . v = u [ i ] ; // use u component for value-based aggregation
53+
5354
5455 // Calculate arrow components for rendering
5556 var dx = u [ i ] * scale * ( scaleRatio || 1 ) ;
@@ -100,6 +101,9 @@ function isNumeric(val) {
100101
101102function calcAxisExpansion ( gd , trace , xa , ya , x , y ) {
102103 var serieslen = trace . _length ;
104+ var fullLayout = gd . _fullLayout ;
105+ var xId = xa . _id ;
106+ var yId = ya . _id ;
103107 var ppad = 0.1 ; // padding for arrows
104108
105109 // Calculate padding based on arrow lengths
@@ -112,6 +116,11 @@ function calcAxisExpansion(gd, trace, xa, ya, x, y) {
112116 }
113117 }
114118
115- xa . expand ( x , { ppad : ppad } ) ;
116- ya . expand ( y , { ppad : ppad } ) ;
119+ // Use the same approach as scatter trace
120+ var xOptions = { padded : true , ppad : ppad } ;
121+ var yOptions = { padded : true , ppad : ppad } ;
122+
123+ // N.B. asymmetric splom traces call this with blank {} xa or ya
124+ if ( xId ) trace . _extremes [ xId ] = Axes . findExtremes ( xa , x , xOptions ) ;
125+ if ( yId ) trace . _extremes [ yId ] = Axes . findExtremes ( ya , y , yOptions ) ;
117126}
0 commit comments