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 {
7979 }
8080
8181 updatePlot ( value ) {
82- const update = customTraceToPlotlyTrace ( value ) ;
82+ const { container} = this . props ;
83+ const update = customTraceToPlotlyTrace ( value , container ) ;
8384
8485 if ( this . props . updateContainer ) {
8586 this . props . updateContainer ( update ) ;
Original file line number Diff line number Diff line change @@ -9,19 +9,22 @@ export function plotlyTraceToCustomTrace(trace) {
99 return 'area' ;
1010 } else if (
1111 trace . type === 'scatter' &&
12- trace . mode &&
13- ( trace . mode === 'lines' || trace . mode === 'lines+markers' )
12+ ( ! trace . mode || trace . mode === 'lines' || trace . mode === 'lines+markers' )
1413 ) {
1514 return 'line' ;
1615 }
1716 return trace . type ;
1817}
1918
20- export function customTraceToPlotlyTrace ( customTraceType ) {
21- if ( customTraceType === 'line' ) {
19+ export function customTraceToPlotlyTrace ( customTraceType , container ) {
20+ if ( customTraceType === 'line' && container . mode ) {
2221 return { type : 'scatter' , mode : 'lines' , fill : 'none' } ;
2322 }
2423
24+ if ( customTraceType === 'line' && ! container . mode ) {
25+ return { type : 'scatter' , mode : 'lines+markers' , fill : 'none' } ;
26+ }
27+
2528 if ( customTraceType === 'scatter' ) {
2629 return { type : 'scatter' , mode : 'markers' , fill : 'none' } ;
2730 }
You can’t perform that action at this time.
0 commit comments