this post was submitted on 21 Oct 2023
13 points (93.3% liked)
Web Development
3440 readers
12 users here now
Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development
What is web development?
Web development is the process of creating websites or web applications
Rules/Guidelines
- Follow the programming.dev site rules
- Keep content related to web development
- If what you're posting relates to one of the related communities, crosspost it into there to help them grow
- If youre posting an article older than two years put the year it was made in brackets after the title
Related Communities
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Wormhole
Some webdev blogs
Not sure what to post in here? Want some web development related things to read?
Heres a couple blogs that have web development related content
- https://frontendfoc.us/ - [RSS]
- https://wesbos.com/blog
- https://davidwalsh.name/ - [RSS]
- https://www.nngroup.com/articles/
- https://sia.codes/posts/ - [RSS]
- https://www.smashingmagazine.com/ - [RSS]
- https://www.bennadel.com/ - [RSS]
- https://web.dev/ - [RSS]
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Thanks for your answer!
Actually I already have the entries in a proper JSON format. I build my django API endpoints to get a batch of entries with all their details, including URLs for the actual media. Only the visualization is not how I would like it to be. I already have a visualization, that is list-like and looks good, but is not suitable for the mass of entries the endproduct will have to hold. Thus a zoomable timeline.
I know about TImelineJS's events, but that didn't really help me. One of the problems I encountered was with stacking or not stacking the elements, when zooming out. Maybe I need to dig more in CSS to dynamically size each entry based on ... what exactly? Zoom position? Collision with other entries? Somehow calculated density of entries? You see, I'm very much confused and overwhelmed. I don't want to invest much time in a direction, that will not lead to the right place.
I will have a look at the tutorial and vueuse. Previously I followed a 4h tutorial on youtube, which was about vue and django in conjunction. Maybe after that tutorial I understand, how I might build the timeline myself.
EDIT: Ok, I did go through the tutorial now. Almost all concepts where not new to me, but I definitely learned a bit about reactivity (used it unknowning of the concept through the data function of a component). Though I still don't know how I would start building a Timeline. I can create and use components in Vue (already using that in my app), but I have problems handling the low level visual part, which is not just some HTML objects nested, like my list of entries.
Can you explain a bit more about "zooming, different levels of detail" you mention? Maybe break them down to separate issue you are having with the library, what does it do, what do you want that it's not doing. If there is a way to tweak it then you don't have to build the component from scratch.
But if you already abandoned the idea of tweaking timeline-js then you can have full control in vue, have to build it yourself though. Start by breaking the functionality of the timeline into separate interaction. From a quick look, timeline-js just make style attribute reactive. Have a box? good. Now put really long div in it with placeholder texture. Can you drag/scroll it? no? grab a suitable function from vueuse and make it scrollable. Follow with markers, zoom, dummy event items, data fetching (the actual width, marker spacing, events placement can be calculated from timestamp in json after this step), lazy loading, styling, animation, so on.
I don't know how much experience do you have with each things required (html, css, js, vue) so it is a bit difficult to give useful answer.
With TimelineJS I first tried with title-only entries. If you zoom out the entries get compresses along the time axis of course. Either they are overlapping, which looks bad and is not useful for the interaction, or you can let TimelineJS stack them. But then they stack higher and higher, overflowing the height of the timeline. A good vertical scrolling mechanism doesn't seem to be a feature (like seeing at what vertical postion you currently are).
I thought about, what I want to try. I want each entry represented by a bubble, connected to the timeline with a vertical line. The size of the bubble should change depending on how much space is available. Shrinking to a small point at minimum, growing to accomodate a small image and maybe a title (for that morphing to a rounded rectangle would be better).
Maybe this is possible with clever CSS styling of timelinejs. CSS is really a weak part for me
Your bubble idea could work and you will have to be comfortable with css, no way around it I guess.
I see vis.js have a lot of timeline examples you might be able to adapt to your need.