Timeline Updates

 A small one, but one I want to draw attention to nonetheless.


I've now updated the Interactive Legacy of Kain Timeline to include a few quality of life improvements:


  1. I updated some of the data, specifically the connections, to be more accurate - as an example, previously some of the connections for the Soul Reaver blade bypassed some nodes. Whilst this was technically correct because they were straight lines, this also meant that the arrows on those connections were drawn under nodes, and it didn't look great.
    Some arrows are still drawn under nodes, but there are fewer instances of this, and it's a difficult problem to avoid.
  2. I've updated it to use the most recent version of simple-as-pie - this doesn't really add much, but at least I'm keeping my own stuff up to date with my own libraries (I still need to update the demo page, which may be a job for tomorrow)
  3. I've made the timeline more responsive - previously it was fixed to a width of 750px, but now it is 100% of the available width (with 750px being the minimum)
    Whilst this may seem simple, it proved to be far from it. Sure, lines and text and circles etc can all do calculations to determine their position consistently. However, path elements, which make up the connections and arrows (arguably the most important part), need absolute values - this meant that I needed to get the width of the svg container itself, and to vastly alter all of the calculations that things were previously using. It was tempting to use redux hooks like I do for literally everything else, but instead I opted for basic React state and effect hooks, and then passed the value directly to the child elements as a property, as they only needed to go one level deep. I may change my approach later, but it is working correctly, so there may not be any need to complicate matters further.

Comments

Popular posts from this blog

Godot - Rotating a Camera in 3d space

Kain Amigurumi

Bowser Amigurumi