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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ui/public/vislib/visualizations/pie_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

(point.top <= current.top && point.bottom >= current.top);

if (horizontalConflict && verticalConflict) {
point.point = node.point;
Expand Down