File tree 3 files changed +32
-13
lines changed
3 files changed +32
-13
lines changed Original file line number Diff line number Diff line change 10
10
'use strict' ;
11
11
12
12
13
+ // remove opacity for any trace that has a fill or is filled to
13
14
module . 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
+
25
22
tracei . opacity = undefined ;
26
23
27
24
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
+
30
28
if ( ( tracej . type === 'scatter' ) &&
31
29
( tracej . xaxis === tracei . xaxis ) &&
32
30
( 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