{"push_id":1108123043,"size":2,"distinct_size":2,"ref":"refs/heads/diffs","head":"c2ed2d98c646283fa11b00361d6a5cff81b5e1c5","before":"57e86aa6bfd778a0937a5ef97665c0233343fbe0","commits":[{"sha":"62f4a988a8aa7dad8999eea317cc7c079900a3aa","author":{"email":"bb9e4bfa14149d47d1e97c061d3a9d69cc9423a1@microsoft.com","name":"Keith Lazuka"},"message":"Optimize the spacing of version dots on the timeline\n\nThe timeline is displayed at a fixed-width, but the variety of Elm\npackages may have anywhere from one version to tens of versions.\nThis may lead to undesirable overlap of the dots that represent versions\nin various common and not-so-common scenarios.\n\nThis change optimizes the spacing of dots on the timeline so that\nthe natural chronology is preserved as much as possible, while still\ngiving each version enough space. If there are simply too many dots\nto be displayed in the allotted space, the algorithm will uniformly\nsquish everything to fit. This should only be necessary in pathological\ncases (e.g. a package which has over 20 releases).\n\nThe key to the algorithm is representing the timeline as a list\nof relative distances. For each version/dot, we store the distance\nto the ADJACENT dot rather than the offset from the timeline origin.\nThis allows us to easily to make room for a dot by simply adjusting\none relative number without requiring a rippling change to each\ndownstream element.\n\nThe algorithm proceeds in multiple steps:\n1) convert from the ProximityTree's representation of normalized\nfractions measured from the origin to relative, adjacent distance\n2) from left-to-right, adjust each element so that it has at least\nits minimum space, stealing from downstream as necessary\n3) after reaching the end, if the sum of the relative distances\nis greater than 1, then we exceeded the fixed width and we need\nto shrink\n4) apply a \"soft\" shrink: proceeding from left-to-right COLLAPSE\nas much empty space as you can without violating any minimum distances\nuntil the overflow is consumed or we reach the end\n5) if there is STILL overflow, apply a \"hard\" shrink: uniformly\nscaling-down the entire timeline so that the last version fits\nthe fixed width\n6) convert back to ProximityTree","distinct":true,"url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/commits/62f4a988a8aa7dad8999eea317cc7c079900a3aa"},{"sha":"c2ed2d98c646283fa11b00361d6a5cff81b5e1c5","author":{"email":"59bd0a3ff43b32849b319e645d4798d8a5d1e889@elm-lang.org","name":"Evan Czaplicki"},"message":"Merge pull request #159 from klazuka/diffs\n\nOptimize the spacing of version dots on the timeline","distinct":true,"url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/commits/c2ed2d98c646283fa11b00361d6a5cff81b5e1c5"}]}