Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pattern from funnel attributes and add tests for histogram and barpolar #5537

Merged
merged 9 commits into from
Apr 21, 2021

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Mar 8, 2021

Follow up of #5520
this PR adds tests for histogram and barpolar and refactors pattern logic from bar to drawing and lib.

@plotly/plotly_js
cc: @s417-lama

@archmoj archmoj added bug something broken feature something new status: reviewable labels Mar 8, 2021
@archmoj archmoj added this to the NEXT milestone Mar 8, 2021
@@ -31,6 +31,7 @@ function style(gd, cd, sel) {
}
});

Drawing.pointStyle(gTrace.selectAll('path'), trace, gd);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this call make the loop above, or some of it, moot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The trace variable uses each loop.
I think this part is similar to what bar does here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It just looked to me as though at least the Color.fill and Color.stroke calls (L27-28) might be duplicated by pointStyle. Not Drawing.dashLine and I can't really tell about opacity... but the point is Drawing.pointStyle does more than apply a pattern, yet the other things it does already worked for funnels prior to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually deselect style is broken on funnel now.
Also strangely if you make a selection on barpolar traces of pattern_bars mock, the points from bar traces would be selected!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@s417-lama I am about to log off for today. Would you mind investigating this part?

Copy link
Contributor

Choose a reason for hiding this comment

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

I investigated the selection issue a little bit.
Seems like determining candidates for selection (determineSearchTraces function in src/plots/cartesian/select.js) is broken when polar plot and other plots coexist.

When we try to select barpolar plots, bar plots are wrongly included in the candidate lists for selection.
In determineSearchTraces fn, the following line is executed for bar plots, which is an inappropriate behavior.

searchTraces.push(createSearchInfo(trace._module, cd,

This bug happens because the values of xAxisIds and yAxisIds are set to ["x"] and ["y"] in barpolar plots, but by nature polar plots should not have cartesian axes. As a result, the plot which has x and y axes, that is bar plot in this case, is incorrectly included in searchTraces. I suggest to clear x-axes and y-axes in case of barpolar plots somewhere in codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pattern removed from funnel attributes in 4c4828a. So there is no need to investigate this in the PR.

@archmoj archmoj changed the title Complete pattern implementation for funnel Remove pattern from funnel attributes and add tests for histogram and barpolar Apr 16, 2021
@nicolaskruchten
Copy link
Contributor

Let's land this this week if possible and have pattern fill in 2.0 :)

src/lib/coerce.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

Just two minor comments - looks great! 💃

@archmoj archmoj merged commit cc1c2b0 into master Apr 21, 2021
@archmoj archmoj deleted the followup-5520 branch April 21, 2021 14:58
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.

4 participants