-
Notifications
You must be signed in to change notification settings - Fork 8
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: dont loop over each group of binPackedItems #376
fix: dont loop over each group of binPackedItems #376
Conversation
SgtPooki
commented
May 16, 2023
•
edited
Loading
edited
- fix: dont loop over each group of binPackedItems
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya that'll work.
@@ -29,11 +29,16 @@ function getAllRectsWithCollisionsOnXRange (rects: BinPackItem[], x1: number, x2 | |||
* | |||
* y1 is determined by finding the first empty space where the space between y1 and y2 are not occupied by other items within the same x1 and x2 range. | |||
*/ | |||
export const binPack = (items: ImmutableArray<BinPackIssueData>, { height, width, scale, yMin, ...opts }: BinPackOptions): BinPackItem[] => { | |||
export const binPack = (items: ImmutableArray<BinPackIssueData>, { height, width, scale, yMin, ...opts }: BinPackOptions): [BinPackItem[], BoxItem] => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function binPack
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
This reverts commit 5d275b3.
* chore: fix error when clicking roadmap item in d3 mode * chore: render d3 roadmap with correct header * chore: pull out date logic * feat: get d3 mode rendering * chore: ensure today line toggles properly * chore: roadmap header ticks&labels are rendering * tmp * tmp: attempting panning impl and quit. started on collision detection * chore: expand mode=d3 milestone items width to match text * chore(d3): start work on collision detection * feat: bin-packing algorithm implemented for d3 rendering * feat: bin-packing is working really well * feat: d3 panning works * feat: d3 zooming + panning * fix: d3 roadmap view width * fix: milestone text * fix(milestone): d3 rendering is more accurate * fix(milestone): d3 milestones show progress bar * fix(milestone): text padding, size, polish, truncating * fix(drag): prevent unintentional attempt to drag milestone items * fix: d3 roadmap height + panning and zoom polish * fix: date granularity upon zooming out * feat: SERIOUS polish on zoom, pan, & header labels * tmp: temporarily force rendering of d3 roadmap for preview * chore: fix build errors * tmp: temporarily ignore unused RoadmapDetailed * tmp: dont run tests for d3 preview; for now * fix: zoom and pan controls are more intuitive * chore: remove unused component * fix: tickGuides stretch to full height * fix: invalid foreignObject usage * feat: implement detailed view in d3 NOTE: Currently a bug when switching between simple and detailed view * fix: build * tmp: using issueData context * fix: binPackedGroups doesnt cause infinite re-renders * fix: pan/zoom work when toggling views * fix: use MMM DD, YYYY display format for milestone dates * chore: pull out RoadmapGroupRenderer * chore: fix build, renable tests, skip e2e * fix: todayLine styling * chore: remove unused code * chore: todayLine polish * chore: some more cleanup * chore: set ETA always to EOD * fix: rescale the timeScale with zoom transform * fix: zoom and panning * This allows us to properly recognize when an X value is within view * Removes old hacky way of manually using panX * feat: make zoom/pan level shareable * feat: default zoom finding, and url parameter setting * chore: fix build * tests: fix unit tests * fix: default view finding when all dates are same fixes #369 * fix: d3-migration e2e tests * fix(lint): remove unused legacyView * chore: fix next+eslint * chore: remove dead code * feat: add legacy view button * test: remove tests for removed files * chore(pr-comment): remove redundant null check * chore(pr-comment): clean up components/roadmap/header.tsx * chore(pr-comment): move constants to svgConstants * chore(pr-comment): refactor math into ItemContainerSvg * chore: implement standard style * chore(lint): sort imports * feat: make roadmapHeader smarter * feat: make roadmapHeader even smarter (mobile support) * chore(pr-comment): code cleanup * chore: use Dayjs instead of Date in NewRoadMapHeaderTick * fix: css on hover for clickable milestones * chore: remove RoadmapMode and it's uses * chore: remove unused file * fix: some viewMode issues * fix: breadcrumb nav & zoomTransform+url bug fixes #371 * fix: lint * fix: 📦 Fixing box model (#375) * fix: 📦 Fixing box model * 🤦 lint * fix: ⚡ reducing number of comparisons --------- Co-authored-by: Russell Dempsey <1173416+SgtPooki@users.noreply.github.com> * fix: dont loop over each group of binPackedItems (#376) * fix: dont loop over each group of binPackedItems * fix: top/bottom y semantics * Revert "fix: top/bottom y semantics" This reverts commit 5d275b3. --------- Co-authored-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>