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

feat!: render roadmaps with d3 #358

Merged
merged 78 commits into from
May 19, 2023

Conversation

SgtPooki
Copy link
Contributor

@SgtPooki SgtPooki commented Apr 28, 2023

Follow #237 for updates, and please feel free to comment on that issue with concerns/questions/requests.

  • 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

fixes #237

@SgtPooki SgtPooki linked an issue Apr 28, 2023 that may be closed by this pull request
2 tasks
@vercel
Copy link

vercel bot commented Apr 28, 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:44pm

@SgtPooki SgtPooki changed the title feat!: render roadmaps with d3 [WIP] feat!: render roadmaps with d3 Apr 28, 2023
maxHeight: number;
}

export default function NewRoadmapHeader ({ scale, yMin, leftMostX, rightMostX, width, maxHeight }: NewRoadmapHeaderProps) {
Copy link

Choose a reason for hiding this comment

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

Function NewRoadmapHeader has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.

@SgtPooki SgtPooki changed the title [WIP] feat!: render roadmaps with d3 feat!: render roadmaps with d3 May 15, 2023
@SgtPooki SgtPooki self-assigned this May 15, 2023
@SgtPooki SgtPooki marked this pull request as ready for review May 15, 2023 22:57
import styles from './Roadmap.module.css'
import { TodayMarkerToggle } from './today-marker-toggle'

export function RoadmapTabbedView () {
Copy link

Choose a reason for hiding this comment

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

Function RoadmapTabbedView has 90 lines of code (exceeds 25 allowed). Consider refactoring.


function NewRoadmap({ issueData }: { issueData: IssueData; isLocal: boolean }) {
if (!issueData) return null;
function NewRoadmap () {
Copy link

Choose a reason for hiding this comment

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

Function NewRoadmap has 244 lines of code (exceeds 25 allowed). Consider refactoring.

})
}, [])

const zoomBehavior = useMemo(() => {
Copy link

Choose a reason for hiding this comment

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

Function zoomBehavior has 65 lines of code (exceeds 25 allowed). Consider refactoring.

import styles from './Roadmap.module.css'
import { TodayMarkerToggle } from './today-marker-toggle'

export function RoadmapTabbedView () {
Copy link

Choose a reason for hiding this comment

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

Function RoadmapTabbedView has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.


function NewRoadmap({ issueData }: { issueData: IssueData; isLocal: boolean }) {
if (!issueData) return null;
function NewRoadmap () {
Copy link

Choose a reason for hiding this comment

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

Function NewRoadmap has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.

@SgtPooki SgtPooki requested a review from whizzzkid May 15, 2023 23:00
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.

This PR becomes larger with each pass 😛. Can you merge this: #375?

Then 🚀 just send it.

* fix: 📦 Fixing box model

* 🤦 lint

* fix: ⚡ reducing number of comparisons

---------

Co-authored-by: Russell Dempsey <[email protected]>
*
* 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[] => {
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.

* fix: dont loop over each group of binPackedItems

* fix: top/bottom y semantics

* Revert "fix: top/bottom y semantics"

This reverts commit 5d275b3.

function NewRoadmap({ issueData }: { issueData: IssueData; isLocal: boolean }) {
if (!issueData) return null;
function NewRoadmap () {
Copy link

Choose a reason for hiding this comment

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

Function NewRoadmap has 242 lines of code (exceeds 25 allowed). Consider refactoring.

*
* 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[], 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.

}, [zoomBehavior, ref, zoomTransform])

const titlePadding = 30
const binPackedGroups: BinPackedGroup[] = useMemo(() => {
Copy link

Choose a reason for hiding this comment

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

Function binPackedGroups has 30 lines of code (exceeds 25 allowed). Consider refactoring.

@SgtPooki SgtPooki merged commit 6c085b3 into main May 19, 2023
@SgtPooki SgtPooki deleted the 237-enhancement-bug-migrate-rendering-to-d3 branch May 19, 2023 14:37
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.

bug: milestone alignment - migrate rendering to d3
3 participants