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

fixes pie label conflict resolution #15410

Merged
merged 2 commits into from
Dec 5, 2017

Conversation

ppisljar
Copy link
Member

@ppisljar ppisljar commented Dec 5, 2017

resolves #15406

scenario when two labels would be positioned at exactly the same place was not handled correctly

@ppisljar ppisljar added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) review v6.1.0 v6.2.0 v7.0.0 labels Dec 5, 2017
@@ -244,7 +244,7 @@ export function VislibVisualizationsPieChartProvider(Private) {
x: pos[0],
y: pos[1],
left: midAngle < Math.PI ? pos[0] : pos[0] - bbox.width,
right: midAngle > Math.PI ? pos[0] + bbox.width : pos[0],
right: midAngle < Math.PI ? pos[0] + bbox.width : pos[0],
Copy link
Contributor

Choose a reason for hiding this comment

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

why this flip?

Copy link
Member Author

Choose a reason for hiding this comment

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

ups, that shouldn't be there. thanks!

Copy link
Contributor

@kobelb kobelb left a comment

Choose a reason for hiding this comment

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

LGTM

@ppisljar ppisljar merged commit e169dd3 into elastic:master Dec 5, 2017
ppisljar added a commit to ppisljar/kibana that referenced this pull request Dec 5, 2017
* fixes pie label conflict resolution

* fixing based on review
ppisljar added a commit to ppisljar/kibana that referenced this pull request Dec 5, 2017
* fixes pie label conflict resolution

* fixing based on review
ppisljar added a commit that referenced this pull request Dec 5, 2017
* fixes pie label conflict resolution
ppisljar added a commit that referenced this pull request Dec 5, 2017
* fixes pie label conflict resolution
@@ -258,8 +258,8 @@ export function VislibVisualizationsPieChartProvider(Private) {
const current = d.position;
if (point) {
const horizontalConflict = (point.left < 0 && current.left < 0) || (point.left > 0 && current.left > 0);
const verticalConflict = (point.top > current.top && point.top <= current.bottom) ||
(point.top < current.top && point.bottom >= current.top);
const verticalConflict = (point.top >= current.top && point.top <= current.bottom) ||
Copy link

Choose a reason for hiding this comment

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

This fix does solve the conflict but It hide the label which conflict with other which looks like a bug. (missing label)
What it should do is to try to find a better place to be shown. Usually there is still plenty of space

Copy link
Member Author

@ppisljar ppisljar Dec 12, 2017

Choose a reason for hiding this comment

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

The same happens with labels on the same level as well, if conflict is detected its just hidden. Could you open a separate enhancement request for trying to find new position for the label if it is in conflict with another ? (i had this implemented but we decided to move it out of the original PR as the algorithm i was using was resource intensive)

Copy link

Choose a reason for hiding this comment

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

where can I see the code for trying to find new position for the label if it is in conflict with another?

Copy link

Choose a reason for hiding this comment

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

In addition ,I opened feature request: #15571

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks @ofirmgr
this is the PR: #12174 however it seems i forced pushed after rebasing on master and that commit is no longer available.

basically it tried to move the label up/down if conflict was detected and ran the conflict resolution again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) review v6.1.0 v6.2.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pie labels overlaps each other on multiple split slices buckets
4 participants