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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pileup calculation works when start and end fields are the same #891

Merged
merged 1 commit into from May 5, 2023

Conversation

sehilyi
Copy link
Member

@sehilyi sehilyi commented May 5, 2023

Toward #883

Change List

  • Fix an issue that pileup was not working in a case of startField and endField being the same.
  • 馃И Add tests
  • 馃Ч Remove an unused pileup algorithm

Screenshot 2023-05-05 at 16 10 12

local demo

cc @ThHarbig

Checklist

  • Ensure the PR works with all demos on the online editor
  • Unit tests added or updated
  • Examples added or updated
  • Documentation updated (e.g., added API functions)
  • Screenshots for visual changes (e.g., new encoding support or UI change on Editor)

const { boundingBox, method, newField } = t;
const { startField, endField, groupField } = boundingBox;

let padding = 0; // This is a pixel value.
Copy link
Member Author

Choose a reason for hiding this comment

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

It was a wrong comment statement. This is actually a value in BP

Comment on lines +271 to +272
const start = +d[startField] - paddingInBp;
const end = +d[endField] + paddingInBp;
Copy link
Member Author

@sehilyi sehilyi May 5, 2023

Choose a reason for hiding this comment

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

These are the lines that solve the issue. The d[endField] was not converted to number properly previously.

This line was previously const end = (d[endField] as number) + paddingInBp; which led to assigning a string value to end, e.g., "3145234.102033".

@sehilyi sehilyi merged commit 7754a15 into master May 5, 2023
4 checks passed
@sehilyi sehilyi deleted the sehilyi/fix-pile branch May 5, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant