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

Item misplacement #103

Open
TimothyAerts opened this issue Mar 21, 2020 · 0 comments
Open

Item misplacement #103

TimothyAerts opened this issue Mar 21, 2020 · 0 comments

Comments

@TimothyAerts
Copy link

Overview

Items are in the wrong position. Only when zooming in the position shifts to the correct on.
Initially I though this was due to a bug in the 1.20 version of visjs however downgrading did not solve the issue.

Package versions

react-visjs-timeline:7.3.4
vis version:4.19.1

Code Snippet

  const createGanttItems = () =>{
    let items = []
    let groups = []
    props.project.gates.forEach(gate=>{
      groups.push({id:gate["gate"],content:`Gate ${gate["gate"]+1}`});
      items.push({
        id:`planned_${gate.gate}`,
        start: Date.parse(gate["planned_start"]),
        group:gate["gate"],
        title: `Gate ${gate["gate"]+1} Planned`,
        content: `Gate ${gate["gate"]+1} Planned`
      })
      if(gate["real_start"]){
        let item = {
          id:`real_${gate.gate}`,
          start:gate["real_start"],
          content: `Gate ${gate["gate"]+1} Real`,
          group: gate["gate"],
          title:`Gate ${gate["gate"]} Real`
        }
        if (gate["real_end"]){
          //item["end"] = gate["real_end"]
        }
        items.push(item)
      }
    })
    setItems(items);
    setGroups(groups);
    console.log(items);
  }
<Grid item xs={12}>
  <Timeline
        items={items}
        groups={groups}
      />
</Grid>

Related issues

Any issue which is related to this issue

  • e.g. issue 123

Screenshots (if appropriate)

zoom_out
zoomed_in

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

No branches or pull requests

1 participant