File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ class TraceSelector extends Component {
79
79
}
80
80
81
81
updatePlot ( value ) {
82
- const update = customTraceToPlotlyTrace ( value ) ;
82
+ const { container} = this . props ;
83
+ const update = customTraceToPlotlyTrace ( value , container ) ;
83
84
84
85
if ( this . props . updateContainer ) {
85
86
this . props . updateContainer ( update ) ;
Original file line number Diff line number Diff line change @@ -9,19 +9,22 @@ export function plotlyTraceToCustomTrace(trace) {
9
9
return 'area' ;
10
10
} else if (
11
11
trace . type === 'scatter' &&
12
- trace . mode &&
13
- ( trace . mode === 'lines' || trace . mode === 'lines+markers' )
12
+ ( ! trace . mode || trace . mode === 'lines' || trace . mode === 'lines+markers' )
14
13
) {
15
14
return 'line' ;
16
15
}
17
16
return trace . type ;
18
17
}
19
18
20
- export function customTraceToPlotlyTrace ( customTraceType ) {
21
- if ( customTraceType === 'line' ) {
19
+ export function customTraceToPlotlyTrace ( customTraceType , container ) {
20
+ if ( customTraceType === 'line' && container . mode ) {
22
21
return { type : 'scatter' , mode : 'lines' , fill : 'none' } ;
23
22
}
24
23
24
+ if ( customTraceType === 'line' && ! container . mode ) {
25
+ return { type : 'scatter' , mode : 'lines+markers' , fill : 'none' } ;
26
+ }
27
+
25
28
if ( customTraceType === 'scatter' ) {
26
29
return { type : 'scatter' , mode : 'markers' , fill : 'none' } ;
27
30
}
You can’t perform that action at this time.
0 commit comments