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: dont loop over each group of binPackedItems #376

Merged
merged 3 commits into from
May 16, 2023

Conversation

SgtPooki
Copy link
Contributor

@SgtPooki SgtPooki commented May 16, 2023

  • fix: dont loop over each group of binPackedItems

@vercel
Copy link

vercel bot commented May 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
starmaps ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2023 8:43pm

@SgtPooki SgtPooki changed the base branch from main to 237-enhancement-bug-migrate-rendering-to-d3 May 16, 2023 20:37
@SgtPooki SgtPooki requested a review from whizzzkid May 16, 2023 20:37
Copy link
Collaborator

@whizzzkid whizzzkid left a 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] => {
Copy link

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.

@SgtPooki SgtPooki merged commit 7251e5f into 237-enhancement-bug-migrate-rendering-to-d3 May 16, 2023
@SgtPooki SgtPooki deleted the d3-max-x-and-y branch May 16, 2023 20:43
SgtPooki added a commit that referenced this pull request May 19, 2023
* 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>
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.

2 participants