@@ -311,34 +311,43 @@ function setOffsetAndWidth(gd, pa, sieve, opts) {
311
311
// if there aren't any overlapping positions,
312
312
// let them have full width even if mode is group
313
313
var overlap = ( positions . length !== distinctPositions . length ) ;
314
- var barGroupWidth = minDiff * ( 1 - opts . gap ) ;
315
314
316
- var groupId = getAxisGroup ( fullLayout , pa . _id ) + calcTraces [ 0 ] [ 0 ] . trace . orientation ;
317
- var alignmentGroups = fullLayout . _alignmentOpts [ groupId ] || { } ;
315
+ var barGroupWidth = minDiff * ( 1 - opts . gap ) ;
316
+ var barWidthPlusGap ;
317
+ var barWidth ;
318
+ var offsetFromCenter ;
319
+ var alignmentGroups ;
320
+ if ( pa . _id === 'angularaxis' ) {
321
+ barWidthPlusGap = barGroupWidth ;
322
+ barWidth = barWidthPlusGap * ( 1 - ( opts . groupgap || 0 ) ) ;
323
+ offsetFromCenter = - barWidth / 2 ;
324
+ } else { // collect groups and calculate values in loop below
325
+ var groupId = getAxisGroup ( fullLayout , pa . _id ) + calcTraces [ 0 ] [ 0 ] . trace . orientation ;
326
+ alignmentGroups = fullLayout . _alignmentOpts [ groupId ] || { } ;
327
+ }
318
328
319
329
for ( var i = 0 ; i < nTraces ; i ++ ) {
320
330
var calcTrace = calcTraces [ i ] ;
321
331
var trace = calcTrace [ 0 ] . trace ;
332
+ if ( pa . _id !== 'angularaxis' ) {
333
+ var alignmentGroupOpts = alignmentGroups [ trace . alignmentgroup ] || { } ;
334
+ var nOffsetGroups = Object . keys ( alignmentGroupOpts . offsetGroups || { } ) . length ;
322
335
323
- var alignmentGroupOpts = alignmentGroups [ trace . alignmentgroup ] || { } ;
324
- var nOffsetGroups = Object . keys ( alignmentGroupOpts . offsetGroups || { } ) . length ;
325
-
326
- var barWidthPlusGap ;
327
- if ( nOffsetGroups ) {
328
- barWidthPlusGap = barGroupWidth / nOffsetGroups ;
329
- } else {
330
- barWidthPlusGap = overlap ? barGroupWidth / nTraces : barGroupWidth ;
331
- }
336
+ if ( nOffsetGroups ) {
337
+ barWidthPlusGap = barGroupWidth / nOffsetGroups ;
338
+ } else {
339
+ barWidthPlusGap = overlap ? barGroupWidth / nTraces : barGroupWidth ;
340
+ }
332
341
333
- var barWidth = barWidthPlusGap * ( 1 - ( opts . groupgap || 0 ) ) ;
342
+ barWidth = barWidthPlusGap * ( 1 - ( opts . groupgap || 0 ) ) ;
334
343
335
- var offsetFromCenter ;
336
- if ( nOffsetGroups ) {
337
- offsetFromCenter = ( ( 2 * trace . _offsetIndex + 1 - nOffsetGroups ) * barWidthPlusGap - barWidth ) / 2 ;
338
- } else {
339
- offsetFromCenter = overlap ?
340
- ( ( 2 * i + 1 - nTraces ) * barWidthPlusGap - barWidth ) / 2 :
341
- - barWidth / 2 ;
344
+ if ( nOffsetGroups ) {
345
+ offsetFromCenter = ( ( 2 * trace . _offsetIndex + 1 - nOffsetGroups ) * barWidthPlusGap - barWidth ) / 2 ;
346
+ } else {
347
+ offsetFromCenter = overlap ?
348
+ ( ( 2 * i + 1 - nTraces ) * barWidthPlusGap - barWidth ) / 2 :
349
+ - barWidth / 2 ;
350
+ }
342
351
}
343
352
344
353
var t = calcTrace [ 0 ] . t ;
@@ -358,7 +367,11 @@ function setOffsetAndWidth(gd, pa, sieve, opts) {
358
367
setBarCenterAndWidth ( pa , sieve ) ;
359
368
360
369
// update position axes
361
- updatePositionAxis ( pa , sieve , overlap ) ;
370
+ if ( pa . _id !== 'angularaxis' ) {
371
+ updatePositionAxis ( pa , sieve ) ;
372
+ } else {
373
+ updatePositionAxis ( pa , sieve , overlap ) ;
374
+ }
362
375
}
363
376
364
377
function applyAttributes ( sieve ) {
@@ -579,7 +592,8 @@ function stackBars(sa, sieve, opts) {
579
592
580
593
isFunnel = ( fullTrace . type === 'funnel' ) ;
581
594
582
- var offset = calcTrace [ 0 ] . t . poffset ;
595
+ var offset = fullTrace . type === 'barpolar' ? 0 : calcTrace [ 0 ] . t . poffset ;
596
+
583
597
var pts = [ ] ;
584
598
585
599
for ( j = 0 ; j < calcTrace . length ; j ++ ) {
0 commit comments