alexcode / vue2vis

A Vuejs 2 adapter for Visjs
MIT License
217 stars 59 forks source link

[Timeline] Nested groups with 3 tree levels do not collapse correctly #74

Closed Bentipe closed 3 years ago

Bentipe commented 3 years ago

Hi, awesome project and very helpful.

I have the following items, groups and options:

groups: [ { id: 0, title: 'MO 21', content: 'MO 21', treeLevel: 1, nestedGroups: [1, 6] }, { id: 1, content: 'Process 4141', treeLevel: 2, nestedGroups: [2, 3, 4, 5] }, { id: 2, content: 'Phase 1', treeLevel: 3 }, { id: 3, content: 'Phase 2', treeLevel: 3 }, { id: 4, content: 'Phase 3', treeLevel: 3 }, { id: 5, content: 'Phase 4', treeLevel: 3 }, { id: 6, content: 'Process 121', treeLevel: 2, nestedGroups: [7, 8, 9, 10] }, { id: 7, content: 'Phase 1', treeLevel: 3 }, { id: 8, content: 'Phase 2', treeLevel: 3 }, { id: 9, content: 'Phase 3', treeLevel: 3 }, { id: 10, content: 'Phase 4', treeLevel: 3 } ], items: [ { id: 10, group: 0, start: new Date(), end: vm.returnTomorrow(4), content: 'MO 21' }, { id: 0, group: 1, start: new Date(), end: vm.returnTomorrow(4), content: 'Process 4141', className: 'process' }, { id: 1, group: 2, start: vm.returnTomorrow(0), end: vm.returnTomorrow(2), content: 'Steps', className: 'step' }, { id: 2, group: 3, start: vm.returnTomorrow(1), end: vm.returnTomorrow(2), content: 'Steps', className: 'step' }, { id: 3, group: 4, start: vm.returnTomorrow(2), end: vm.returnTomorrow(3), content: 'Steps', className: 'step' }, { id: 4, group: 5, start: vm.returnTomorrow(3), end: vm.returnTomorrow(4), content: 'Steps', className: 'step' }, { id: 5, group: 6, start: new Date(), end: vm.returnTomorrow(4), content: 'Process 121', className: 'process' }, { id: 6, group: 7, start: vm.returnTomorrow(0), end: vm.returnTomorrow(2), content: 'Steps', className: 'step' }, { id: 7, group: 8, start: vm.returnTomorrow(1), end: vm.returnTomorrow(2), content: 'Steps', className: 'step' }, { id: 8, group: 9, start: vm.returnTomorrow(2), end: vm.returnTomorrow(3), content: 'Steps', className: 'step' }, { id: 9, group: 10, start: vm.returnTomorrow(3), end: vm.returnTomorrow(4), content: 'Steps', className: 'step' } ], options: { horizontalScroll: true, zoomKey: 'ctrlKey', orientation: 'both', autoResize: true },

There are 2 processes that belong to the group MO 21. And each process has 4 steps, but as you can see in the following image, they are not correctly ordered, as it appears that all belong to the same process, the collapsing arrows still work.

image

If remove the MO 21 group, everything looks correct.

image

Bentipe commented 3 years ago

So I have tried to implement it myself. Updating the version of the timeline seems to fix it.

alexcode commented 3 years ago

Hi @Bentipe, it seems that's more related to Vis itself, isn't it ?

Bentipe commented 3 years ago

Hey @alexcode yup, If the timeline dependency is updated the problem is fixed, will close the issue