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

[XYChart] fixed incorrect spacing between data points #5556

Merged
merged 4 commits into from
Jun 21, 2024
Merged

[XYChart] fixed incorrect spacing between data points #5556

merged 4 commits into from
Jun 21, 2024

Conversation

OG-NI
Copy link
Contributor

@OG-NI OG-NI commented Jun 1, 2024

📑 Summary

This fixes the issue of XYCharts, where the spacing between the data points is sometimes incorrect and some data points not being displayed.

Resolves #5555

📏 Design Decisions

The formula calculating the distance between two data points when using a numeric range on the x-axis has been changed from const step = (max - min + 1) / data.length; to const step = (max - min) / (data.length - 1);. This maps the first value to the minimum on the x-axis, the last value to the maximum and evenly distributes all other values between the two ends.

The changes made do not affect the way any existing demo chart is being rendered.

Feel free to ask if any additional documentation is needed.

📋 Tasks

Make sure you

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

netlify bot commented Jun 1, 2024

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 0c49d2b
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/6674799fbafeaf0008ac3db4
😎 Deploy Preview https://deploy-preview-5556--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 site configuration.

Copy link

codecov bot commented Jun 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 5.73%. Comparing base (1e43ad1) to head (0c49d2b).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5556   +/-   ##
=======================================
  Coverage     5.73%   5.73%           
=======================================
  Files          278     278           
  Lines        42019   42019           
  Branches       516     516           
=======================================
  Hits          2409    2409           
  Misses       39610   39610           
Flag Coverage Δ
unit 5.73% <0.00%> (ø)

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

Files Coverage Δ
packages/mermaid/src/diagrams/xychart/xychartDb.ts 0.00% <0.00%> (ø)

@OG-NI OG-NI changed the title fixed incorrect spacing, added e2e-test [XYChart] fixed incorrect spacing between data points Jun 1, 2024
Copy link

argos-ci bot commented Jun 20, 2024

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

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 1 added Jun 20, 2024, 7:00 PM

@sidharthv96 sidharthv96 added this pull request to the merge queue Jun 21, 2024
Merged via the queue into mermaid-js:develop with commit 9f37513 Jun 21, 2024
19 checks passed
Copy link

mermaid-bot bot commented Jun 21, 2024

@OG-NI, Thank you for the contribution!
You are now eligible for a year of Premium account on MermaidChart.
Sign up with your GitHub account to activate.

@OG-NI OG-NI deleted the bug/5555_xychart_incorrect_spacing branch June 21, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[XYChart] incorrect spacing between data points
2 participants