@@ -12,11 +12,25 @@ const TraceFold = connectTraceToPlot(PlotlyFold);
1212class TraceAccordion extends Component {
1313 render ( ) {
1414 const { data = [ ] , localize : _ } = this . context ;
15- const { canAdd, canGroup, children, messageIfEmptyFold} = this . props ;
15+ const {
16+ canAdd,
17+ canGroup,
18+ children,
19+ messageIfEmptyFold,
20+ excludeFits,
21+ } = this . props ;
22+
23+ // we don't want to include analysis transforms when we're in the create panel
24+ const filteredData = data . filter ( t => {
25+ if ( excludeFits ) {
26+ return ! ( t . transforms && t . transforms . every ( tr => tr . type === 'fit' ) ) ;
27+ }
28+ return true ;
29+ } ) ;
1630
1731 const individualTraces =
18- data . length &&
19- data . map ( ( d , i ) => {
32+ filteredData . length &&
33+ filteredData . map ( ( d , i ) => {
2034 return (
2135 < TraceFold
2236 key = { i }
@@ -46,7 +60,7 @@ class TraceAccordion extends Component {
4660 </ PlotlyPanel >
4761 ) ;
4862 }
49- const tracesByGroup = data . reduce ( ( allTraces , nextTrace , index ) => {
63+ const tracesByGroup = filteredData . reduce ( ( allTraces , nextTrace , index ) => {
5064 const traceType = plotlyTraceToCustomTrace ( nextTrace ) ;
5165 if ( ! allTraces [ traceType ] ) {
5266 allTraces [ traceType ] = [ ] ;
@@ -67,7 +81,7 @@ class TraceAccordion extends Component {
6781 ) ;
6882 } ) ;
6983
70- if ( canGroup && data . length > 1 && groupedTraces . length > 0 ) {
84+ if ( canGroup && filteredData . length > 1 && groupedTraces . length > 0 ) {
7185 return (
7286 < TraceRequiredPanel noPadding >
7387 < Tabs >
@@ -102,9 +116,10 @@ TraceAccordion.contextTypes = {
102116} ;
103117
104118TraceAccordion . propTypes = {
105- children : PropTypes . node ,
106119 canAdd : PropTypes . bool ,
107120 canGroup : PropTypes . bool ,
121+ children : PropTypes . node ,
122+ excludeFits : PropTypes . bool ,
108123 messageIfEmptyFold : PropTypes . string ,
109124} ;
110125
0 commit comments