Variable itemWidth based on time between dates. #425
MicroMichaelIE
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In file
src/components/timeline-horizontal/timeline-horizontal.tsx
you could include a function in which, if dates are provided, loops through and calculates the width for each item relative to the distance of the whole length of time. Can be turned on via boolean flag something likewithTrueTimeSpacing
.I've read through the code and this wouldn't be too difficult, you'd mainly have to pass down the date with the elements as currently the check is only done in
src/components/index.tsx
for the title text and not futher.Type then for itemWidth would be
itemWidth?: number | (items: TimelineItemModel[]) => {id: string, width: number}[]
You can then access via indexing the returned object for the width it should be, always leaving a minimum width in the function.
I can try to implement this if needed, as I think it would help to become a true "timeline" in this way. @prabhuignoto
Beta Was this translation helpful? Give feedback.
All reactions