Skip to content

Conversation

@wbrgss
Copy link
Contributor

@wbrgss wbrgss commented Dec 15, 2020

Fixes #5318 + adds a test. Many thanks to @alexcjohnson for uncovering this solution and reproducing in CodePen! 🙂

All Jasmine expectations in the new test should fail on master.

Demo:
Before vs After


I also recreated the Angular environment in #5318 and confirmed that this fixes the problem. However, while I can use the build of plotly.js from this PR locally following the plotly via window module instructions, I unfortunately can't find a way to do the same in the stackblitz example — it can't find the Plotly window global on an uploaded plotly.js file.

@plotly/plotly_js


afterEach(destroyGraphDiv);

function _hover(gd, opts) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Borrowed from hover_label_test.js

function _hover(gd, opts) {
Fx.hover(gd, opts);
Lib.clearThrottle();
}

return Plotly.react(gd, fig);
})
.then(function() {
expect(gd._fullLayout.xaxis._categories).toEqual(['a', 'b', 'c', 'd']);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fails with empty array ([]) on master

})
.then(function() {
_hover(gd, { xval: fig.data[0].x.indexOf('a') });
expect(d3.selectAll('g.axistext').select('text').html()).toEqual('a');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fails with empty string ('') on master

@archmoj
Copy link
Contributor

archmoj commented Dec 15, 2020

Great fix.
Thanks very much for the PR.
💃

@wbrgss wbrgss merged commit 5bb74bc into master Dec 15, 2020
@wbrgss wbrgss deleted the fix-5318-missing-axes-tick-labels branch December 15, 2020 20:51
@archmoj archmoj added bug something broken regression this used to work labels Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug something broken regression this used to work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tick labels missing after interacting with plot from angular-plotly

3 participants