Skip to content

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Jan 8, 2019

Fix #3419
@plotly/plotly_js

@archmoj archmoj added bug something broken status: reviewable labels Jan 8, 2019
// scl->scale, reversescl->reversescale
if('scl' in trace) {
trace.colorscale = trace.scl;
if(!('colorscale' in trace)) { trace.colorscale = trace.scl; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be just one if-statement?

if('scl' in trace && !('colorscale' in trace)) {
  // ...
}

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could be namely if we want to leave scl on the input trace in that scenario.


Plotly.plot(gd, data);
expect(gd.data[0].colorscale).toBe('Greens');
expect(gd.data[0].scl).toBe(undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

.... this here would be 'Reds', but that's not a big deal, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes now that the logic changed it should not be undefined.
Done in 168bb68

expect(gd.data[0].reversescl).toBe(undefined);
});

it('should not rename \'scl\' to \'colorscale\' when colorscale is defined ', function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrong description it looks like

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good 👁️ Thanks.

@etpinard
Copy link
Contributor

etpinard commented Jan 9, 2019

💃 - thanks for fixing 4+ year-old deprecation logic 😄

@archmoj archmoj merged commit 2d205e7 into master Jan 9, 2019
@archmoj archmoj deleted the fix3419-rename-colorscale branch January 9, 2019 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug something broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants