Only a small part of the examples are hosted.
The reset of the examples are in the repository, check it out: https://github.com/samuelarbibe/dnd-timeline/tree/main/examplesarrow-up-right
This examples uses @tanstack/react-virtualarrow-up-right to create a virtualized list. This means that only the viewable rows will be rendered.
@tanstack/react-virtual
You can implement virtuallization with any library you want.
This approach is highly recommended, as it vastly improves performance for large datasets.
In this example, 1000 items and 1000 rows are rendered, and eveything still runs very smoothly.
This example uses @dnd-kit's Sortablearrow-up-right preset to allow re-ordering of rows by dragging and dropping.
@dnd-kit
This shows simple integration of internal drag-and-drop interactions.
This example uses @dnd-kit's Draggablearrow-up-right and Droppablearrow-up-right to enable dragging and dropping from an external location into the timeline.
You can also apply a policy to what can be dragged where by dynamically disabling unhallowed rows.
Just like this example, you can implement a couple other things:
Dragging and Dropping items from the timeline to an external droppable
Dragging and Dropping items from one timeline to another
And any other drag-and-drop interaction you can think of.
This examples adds a time axis and time cursor to indicate the current time and the timeframe represented in the timeline.
These components are external to the library, and are an example of how to use dnd-timeline's context to create custom components.
dnd-timeline
This example adds a debounce or a throttle mechanism to the timeframe, in order to greatly improve the zoom and pan performance.
debounce
throttle
Play around with the different options to see how they feel!
Last updated 1 year ago