neuronetio / gantt-elastic

Gantt Chart [ javascript gantt chart, gantt component, vue gantt, vue gantt chart, responsive gantt, project manager , vue projects ]
https://neuronet.io/gantt-elastic/
MIT License
1.3k stars 315 forks source link

Add group task type #69

Closed demaryhuerto closed 5 years ago

demaryhuerto commented 5 years ago

Add 'Group' task type and component. A group has a 'task' property with task object array. See #17

Example model:

{
    id: 1,
    label: 'Make some noise',
    user:
        '<a href="https://www.google.com/search?q=John+Doe" target="_blank" style="color:#0077c0;">John Doe</a>',
    start: getDate(-24 * 5),
    duration: 15 * 24 * 60 * 60 * 1000,
    percent: 85,
    type: 'project',
  },
{
    id: 2,
    label: 'Group',
    user: '<a href="https://www.google.com/search?q=Clark+Kent" target="_blank" style="color:#0077c0;">Clark Kent</a>',
    start: getDate(-24 * 2),
    duration: 6 * 24 * 60 * 60 * 1000,
    percent: 25,
    type: 'group',
    tasks: [
      {
        id: 21,
        label: 'Group subtask 1',
        user: '<a href="https://www.google.com/search?q=Clark+Kent" target="_blank" style="color:#0077c0;">Clark Kent</a>',
        start: getDate(-24 * 2),
        duration: 2 * 24 * 60 * 60 * 1000,
        percent: 50,
        type: 'project',
      },
      {
        id: 22,
        label: 'Group subtask 2',
        user: '<a href="https://www.google.com/search?q=Clark+Kent" target="_blank" style="color:#0077c0;">Clark Kent</a>',
        start: getDate(24 * 2),
        duration: 2 * 24 * 60 * 60 * 1000,
        percent: 50,
        type: 'task',
      },
    ],
  },
pdyba commented 5 years ago

What is the difference between group task and a parent with children ?

neuronetio commented 5 years ago

same as here https://github.com/neuronetio/gantt-elastic/pull/70 - no big changes right now, sorry

demaryhuerto commented 5 years ago

Parent and children tasks are both regular task with their own row, and children tasks can be collapsed and only parent task is shown. Each task "draws" a line (and only one) between start time and end time.

With this new "group", there could be some "subtasks" drawing some lines in the same row, between different start and end time ranges. I know that is not really a Gantt diagram, but I needed in my project.