Skip to content

Item misplacement #103

@TimothyAerts

Description

@TimothyAerts

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions