File tree Expand file tree Collapse file tree 3 files changed +32
-13
lines changed Expand file tree Collapse file tree 3 files changed +32
-13
lines changed Original file line number Diff line number Diff line change 1010'use strict' ;
1111
1212
13+ // remove opacity for any trace that has a fill or is filled to
1314module . exports = function cleanData ( fullData ) {
14- var i ,
15- tracei ,
16- filli ,
17- j ,
18- tracej ;
19-
20- // remove opacity for any trace that has a fill or is filled to
21- for ( i = 0 ; i < fullData . length ; i ++ ) {
22- tracei = fullData [ i ] ;
23- filli = tracei . fill ;
24- if ( ( filli === 'none' ) || ( tracei . type !== 'scatter' ) ) continue ;
15+ for ( var i = 0 ; i < fullData . length ; i ++ ) {
16+ var tracei = fullData [ i ] ;
17+ if ( tracei . type !== 'scatter' ) continue ;
18+
19+ var filli = tracei . fill ;
20+ if ( filli === 'none' || filli === 'toself' ) continue ;
21+
2522 tracei . opacity = undefined ;
2623
2724 if ( filli === 'tonexty' || filli === 'tonextx' ) {
28- for ( j = i - 1 ; j >= 0 ; j -- ) {
29- tracej = fullData [ j ] ;
25+ for ( var j = i - 1 ; j >= 0 ; j -- ) {
26+ var tracej = fullData [ j ] ;
27+
3028 if ( ( tracej . type === 'scatter' ) &&
3129 ( tracej . xaxis === tracei . xaxis ) &&
3230 ( tracej . yaxis === tracei . yaxis ) ) {
Original file line number Diff line number Diff line change 1+ {
2+ "data" : [
3+ {
4+ "x" : [
5+ 6 ,
6+ 7 ,
7+ 8
8+ ],
9+ "y" : [
10+ 5 ,
11+ 6 ,
12+ 5
13+ ],
14+ "fill" : " toself" ,
15+ "opacity" : 0.3
16+ }
17+ ],
18+ "layout" : {
19+ "title" : " toself fill with opacity"
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments