laurens94 / vue-timeline-chart

A timeline component for Vue3
https://laurens94.github.io/vue-timeline-chart/
MIT License
32 stars 2 forks source link

Feature Request: Row slot and Dependancy #15

Closed njvb closed 2 months ago

njvb commented 2 months ago

Thank you for the fantastic component, and the recent draggable example! There are two features I'm hoping are possible in future versions:

  1. A slot to add HTML content at the start of a row. This would allow more custom information related to the item
  2. More challenging: to have dependancies to be able to move one or more items when the parent moves

Thanks again for the amazing work!

laurens94 commented 2 months ago

Hi! You're welcome! I'm glad you like the component. 😄

  1. This should be possible using the group-label slot. You can add any HTML and it will be shown on the place of the group labels.
  2. What do you mean exactly? Could you give an example?
njvb commented 2 months ago

Group-label will replace but hover over the content, minimising how much you can put in there. I've attached an example from a project plan where there is often need for columns of data on any row, so generic way to extend a row out for user info would be amazing!

The screenshot also shows a dependancy. It draws a visual connection from one task to another, so you can move the parent item, and all the children move with it. Incredibly useful to update sizeable projects at speed!

Screenshot 2024-08-02 at 11 27 40

laurens94 commented 2 months ago

I see! In case of your screenshot I would suggest placing the labels next to the component (so outside of the component) and just hide the in-component labels altogether.

Unless you don't mind not having any labels above the columns, then you could use the fixedLabels prop to position them absolutely over the row content:

image

If you want to drag multiple items at the same time, you could simply modify the start and end positions of all related items simultaneously. So if you use the draggable example I made as a starting point, you can modify the handleItemDrag function to find related items and for each of those items you simply modify the start and end positions using the delta.

Good luck!