Skip to content

Conversation

@VeraZab
Copy link
Contributor

@VeraZab VeraZab commented Sep 25, 2018

closes: https://github.com/plotly/streambed/issues/11524
A few issues were discovered by this bug:

data = [scatterTrace, scatterTrace, fitOfScatter1, fitOfScatter2]

In Style/Traces/By Type, we'd have 1 Area TraceFold, and setMultivaluedContainer would pick the first trace: a scatter, and compare all other traces against it to see if they have a different value. The problem would occur when it would arrive at the transforms key, a normal scatter wouldn't have that key, and so we'd enter into a gd mutating state, and start writing MIXED_VALUES into gd. To prevent this, simply using deepCopy.

  • fc8f4b3: cleans up index logic in TraceAccordion. The logic here got a bit murky once we've added the ability to filter certain trace types from accordions and styling of transformed traces. this.filteredTracesDataIndexes is always meant to indicate the position in the data array of this.filteredTraces, no matter their base (fullData or Data). We're using this.filteredTracesDataIndexes in the traceIndexes prop on TraceFolds, and those are going to be the indexes used on gd.data to make changes to our traces. _expandedIndex is what we can use on a fullTrace to get its position in gd._fullData.

  • a44d192: clear up logic in connectTraceToPlot. Reading in _fullInput is no longer necessary. This was added at the time that financial traces were transforms and as such, did not have all of the required info in their gd._fullData to make all the styling widgets appear. This is no longer the case, and I think it's better to remove to simplify the logic.

@VeraZab VeraZab force-pushed the fits branch 2 times, most recently from 592eb69 to a44d192 Compare September 27, 2018 14:25
@VeraZab
Copy link
Contributor Author

VeraZab commented Sep 27, 2018

While I figure out what's wrong with the test @dmt0 @nicolaskruchten , this is ready for review and questions.

@nicolaskruchten
Copy link
Contributor

Can you drop the test plz to get the checkbox back? :)


break;
}
let fullTrace = fullData.filter(t => t && traceIndexes[0] === t.index)[0] || {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this logic is in three places now, could we extract it out into a util or something?

</TraceFold>
));
}
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change this to null from []?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to avoid the .length check below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah... that was just when I was trying things to get the breaking test to work..
and I thought, well, since this function is called renderTraceFolds then it felt more reacty to return null if those shouldn't display..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe I don't think that feels more reacty at all :) but ok.

@nicolaskruchten
Copy link
Contributor

💃

@VeraZab VeraZab merged commit f53f127 into master Sep 28, 2018
@VeraZab VeraZab deleted the fits branch September 28, 2018 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants