Skip to content

Bug: Graph not shown if at least 2 points exists with same date #86

Description

@michaelpomogajko

When multiple points have exactly the same date, the graph doesn't show at all.

<LineGraph 
 points={[
    {
       value: 1,
       date: new Date('2023-01-01')
    },
    {
       value: 2,
       date: new Date('2023-01-01')
    }
 ]}
...
/>

Activity

  1. michaelpomogajko commented on Aug 16, 2023

    @michaelpomogajko
    Author

    Also for some reason this is not being rendered as well

    points={[
      {
        value: 1,
        date: new Date('2023-07-16T00:00:00.000Z'),
      },
      {
        value: 2,
        date: new Date('2023-07-19T14:23:21.723Z'),
      },
      { 
        value: 3, 
        date: new Date('2023-07-19T14:23:31.384Z') 
      },
    ]}
  2. huytdps13400 commented on Aug 26, 2026

    @huytdps13400
    Contributor

    A focused fix is now open in #131.

    The reproduction still fails on current main because the zero-duration X range produces NaN, so both points are filtered before path creation. The patch keeps the matching timestamps, centers their shared X coordinate, and draws both values as a finite vertical Skia path. The regression failed before the implementation and now passes; full Jest, TypeScript, lint, and package build gates pass on Node 22.20.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions