"Timeline" with just Numeric Value #31
-
Hi there, I was trying to build a 'timeline' when given just a min and max value rather than a start/end date. As I was going about it, there was no doubt that I had to make certain adjustments to the built in types and functions that dnd-timeline had to offer. Essentially having to create my own versions of these types and functions (e.g. ItemDefinition, generateItems, groupItemstoRow). This pretty much led me down a rabbit hole of customizing everything that had to do with Relevance and/or datetime especially when I came across having to look into potentially customizing my own useItem as it appears to rely on the type Relevance and time-related functions in pieces of the code. So before I continue the rabbit hole, I just wanted to ask, if dnd-timeline offers a simpler way to handle min-max numeric values (whether it be time axis or items), or would it require a bit of customization/overhaul as I've been doing? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey! The library was initially planned to be used only with dates, but does use numbers instead of dates internally for performance purposes (see #19) There should be no problem using numbers instead of dates and make the library more generic, it just means the library pivots to a different direction. Let me look into it this weekend and update you. In the meantime, I can recommend using the library like suggested, with dates, but creating the dates with any number of your choice. {
start: new Date(min),
end: new Date(max)
} |
Beta Was this translation helpful? Give feedback.
-
Update: a new version has been release, version 2.0.0, and it now supports using plain number ranges instead of date ranges. There should now be no problem to use it without using dates. |
Beta Was this translation helpful? Give feedback.
Update: a new version has been release, version 2.0.0, and it now supports using plain number ranges instead of date ranges.
Thank you for the great Idea! 💡
#32
There should now be no problem to use it without using dates.
Please update me!