@@ -508,12 +508,13 @@ proto.updateFancy = function(options) {
508
508
var colors = convertColorScale ( markerOpts , markerOpacity , traceOpacity , len ) ;
509
509
var borderWidths = convertNumber ( markerOpts . line . width , len ) ;
510
510
var borderColors = convertColorScale ( markerOpts . line , markerOpacity , traceOpacity , len ) ;
511
- var index , symbol , symbolSpec , _colors , _borderColors , bwFactor , isOpen ;
511
+ var index , size , symbol , symbolSpec , isOpen , _colors , _borderColors , bw , minBorderWidth ;
512
512
513
513
sizes = convertArray ( markerSizeFunc , markerOpts . size , len ) ;
514
514
515
515
for ( i = 0 ; i < pId ; ++ i ) {
516
516
index = idToIndex [ i ] ;
517
+
517
518
symbol = symbols [ index ] ;
518
519
symbolSpec = MARKER_SYMBOLS [ symbol ] ;
519
520
isOpen = isSymbolOpen ( symbol ) ;
@@ -530,19 +531,24 @@ proto.updateFancy = function(options) {
530
531
_borderColors = borderColors ;
531
532
}
532
533
533
- if ( symbolSpec . bwFactor ) {
534
- bwFactor = symbolSpec . bwFactor ;
535
- } else if ( symbolSpec . noBorder ) {
536
- bwFactor = 0.25 ;
537
- } else if ( symbolSpec . noFill ) {
538
- bwFactor = 0.1 ;
539
- } else {
540
- bwFactor = 0.5 ;
541
- }
534
+ size = sizes [ index ] ;
535
+ bw = borderWidths [ index ] ;
536
+ minBorderWidth = 0.1 * size ;
542
537
543
- this . scatter . options . sizes [ i ] = 4.0 * sizes [ index ] ;
538
+ this . scatter . options . sizes [ i ] = 4.0 * size ;
544
539
this . scatter . options . glyphs [ i ] = symbolSpec . unicode ;
545
- this . scatter . options . borderWidths [ i ] = bwFactor * borderWidths [ index ] ;
540
+
541
+ // From https://github.com/plotly/plotly.js/pull/1781#discussion_r121820798
542
+ // I would think we'd do better with something like a minimum border
543
+ // width, as a fraction of size, that corresponds to the line width
544
+ // already baked into the unicode symbol, so the symbol gets no
545
+ // explicit border until you provide a width greater than this, and
546
+ // at greater widths you set a border borderWidth - minBorderWidth.
547
+
548
+ //this.scatter.options.borderWidths[i] = (bw > minBorderWidth) ? bw - minBorderWidth : 0;
549
+
550
+ // but I found better results with:
551
+ this . scatter . options . borderWidths [ i ] = ( bw > minBorderWidth ) ? bw - minBorderWidth : bw ;
546
552
547
553
if ( isOpen && ! symbolSpec . noBorder && ! symbolSpec . noFill ) {
548
554
fillColor ( this . scatter . options . colors , transparent , i , 0 ) ;
0 commit comments