Skip to content

fix(timeline): ensure consistent vertical line lengths with visible arrowheads #6616

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ashishjain0512
Copy link
Collaborator

@ashishjain0512 ashishjain0512 commented May 26, 2025

Description

Fixes #6610 - Timeline vertical lines now have consistent lengths with clearly visible arrowheads.

Changes

  • Fixed maxEventLineLength calculation to include proper event spacing
  • Extended vertical line depth with sufficient padding for arrowhead visibility
  • Added comprehensive test case with Medical Device Lifecycle example
  • Updated demo file to showcase the improvement

Before/After

  • Before: Vertical lines had inconsistent lengths, arrowheads were barely visible
    image

  • After: All vertical lines extend to same depth with clear dashed lines and full arrowheads
    image

Testing

  • Added test case in timeline.spec.ts
  • Updated demos/timeline.html with complex example
  • Verified fix works for timelines with varying event densities

Resolves #6610

📏 Design Decisions

Describe the way your implementation works or what design decisions you made if applicable.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

…rrowheads

- Fixed inconsistent vertical line lengths in timeline diagrams
- All vertical lines now extend to same depth regardless of event count
- Added sufficient padding for clear visibility of dashed lines and arrowheads
- Added comprehensive test case and demo example

Fixes #6610
Copy link

changeset-bot bot commented May 26, 2025

🦋 Changeset detected

Latest commit: ca80f71

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mermaid Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented May 26, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit ca80f71
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/683441a8ecc95f00085741d9
😎 Deploy Preview https://deploy-preview-6616--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the Type: Bug / Error Something isn't working or is incorrect label May 26, 2025
Copy link

pkg-pr-new bot commented May 26, 2025

Open in StackBlitz

mermaid

npm i https://pkg.pr.new/mermaid-js/mermaid@6616

@mermaid-js/mermaid-zenuml

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@6616

@mermaid-js/layout-elk

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@6616

@mermaid-js/parser

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@6616

@mermaid-js/tiny

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/tiny@6616

commit: ca80f71

Copy link

codecov bot commented May 26, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 3.87%. Comparing base (818699f) to head (ca80f71).

Files with missing lines Patch % Lines
.../mermaid/src/diagrams/timeline/timelineRenderer.ts 0.00% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6616   +/-   ##
=======================================
  Coverage     3.87%   3.87%           
=======================================
  Files          414     414           
  Lines        43303   43300    -3     
  Branches       666     666           
=======================================
  Hits          1679    1679           
+ Misses       41624   41621    -3     
Flag Coverage Δ
unit 3.87% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../mermaid/src/diagrams/timeline/timelineRenderer.ts 0.41% <0.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ashishjain0512 ashishjain0512 changed the title ix(timeline): ensure consistent vertical line lengths with visible arrowheads fix(timeline): ensure consistent vertical line lengths with visible arrowheads May 26, 2025
Copy link

argos-ci bot commented May 26, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 5 changed, 2 added May 26, 2025, 10:38 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Timeline Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arrows are too short in timeline
1 participant