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

fix: marker positioning #1538

Merged
merged 3 commits into from
Mar 11, 2024
Merged

fix: marker positioning #1538

merged 3 commits into from
Mar 11, 2024

Conversation

illetid
Copy link
Contributor

@illetid illetid commented Mar 8, 2024

Type of PR: bugfix, enhancement

PR checklist:

Overview of change:
Fixed an issue where marginBelow wasn't applied. Added an enhancement that fixes #1382: When a series has only one type of markers, we apply only one margin, i.e. for markers with position: "aboveBar" we remove bottom margin and vice versa.

Is there anything you'd like reviewers to focus on?

@SlicedSilver
Copy link
Contributor

We should also have a look at the e2e graphics test cases. I think there are more tests failing than expected such as the tests which have markers positioned above, and below.

@SlicedSilver SlicedSilver added the bug Unexpected problem or unintended behavior. label Mar 11, 2024
@SlicedSilver SlicedSilver added this to the 5.0 milestone Mar 11, 2024
Copy link
Contributor

@SlicedSilver SlicedSilver left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@illetid illetid merged commit 3f66b76 into master Mar 11, 2024
17 of 22 checks passed
@illetid illetid deleted the fix/whitespace-when-makrers-added branch March 11, 2024 12:28
@@ -131,14 +131,16 @@ export class SeriesMarkersPaneView implements IUpdatablePaneView {
}

public autoScaleMargins(): AutoScaleMargins | null {
if (this._autoScaleMarginsInvalidated) {
if (this._autoScaleMarginsInvalidated && this._dataInvalidated) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This condition is always false if this._makeValid() is called first

Copy link
Contributor

Choose a reason for hiding this comment

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

And margins depend not only on data but also on bar spacing

Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies, my mistake for mentioning to try run the calculation less often at that point.
We can instead limit the _dataInvalidated check to only the _hasAllMarkerSamePosition() method because that doesn't rely on barSpacing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes we can, but we need to add one additional flag like _hasAllMarkerSamePositionInvalidated and use it in _hasAllMarkerSamePosition or update cached value in _makeValid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Histogram has some space below bars when markers are added
3 participants