Simulate a timeline
Closed this issue · 2 comments
Hi, I'm trying to figure out if there is a way to render a "timeline" with existing elements from ftxui. A "timeline" is a horizontal bar, that encodes interesting things with color. For example,
in this timeline, white portion denotes events A, and red portion denotes event B. There is an arrow showing what event users is inspecting. They are able to move left or right, to "seek" to interesting events. Note that, a white segment may contain more than one "white" events.
I'm thinking about using multiple gauges horizontally (with 1) and color them but I don't know how I can overlay an arrow to indicate the current position. Is there any other way to compose existing elements to achieve this?
It would be nice to also supporting scrolling the timeline bar if there are tons of events.
Thanks!
You can consider implementing your own Element and draw it manually.
I don't know how I can overlay an arrow to indicate the current position
What about dbox
(aka depth box)? to stack two elements?
It would be nice to also supporting scrolling the timeline bar if there are tons of events.
You can put a focused
or selected
element representing where the focus should be put. If drawn inside a frame
, you will get scrolling.
Note that I recently added support for horizontal scrolling events.
Hoping it helps.
thanks! I will look into these