[READ-ONLY] Mirror of https://github.com/probablykasper/starchart. GitHub star history graph starchart.kasper.space
chart github github-api github-star graph history star star-history stargazers stars
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix fillerLine

Kasper (Mar 3, 2023, 8:39 AM +0100) cb3dc7bd e845c14a

+7 -6
+7 -6
src/routes/chart.ts
··· 33 33 } 34 34 35 35 /** Used to invalidate old localStorage */ 36 - const jsonTypeVersion = 3 36 + const jsonTypeVersion = 2 37 37 type Json = { 38 38 lines: LineJson[] 39 39 v: number ··· 158 158 line.instance.update(dataPoint) 159 159 } 160 160 } 161 - 162 - updateFiller(chart.lines) 163 - if (fresh) { 164 - store.resetZoom() 165 - } 166 161 }, 167 162 168 163 appendStargazers(line: Line, data: DataPoint[]) { 164 + const fresh = line.data.length === 0 169 165 store._appendChartData(line, data) 170 166 line.data.push(...data) 167 + if (fresh) { 168 + updateFiller(chart.lines) 169 + store.resetZoom() 170 + } 171 171 set(chart) 172 172 }, 173 173 174 174 addFinal(line: Line, data: DataPoint) { 175 175 store._appendChartData(line, [data]) 176 176 line.final = data 177 + updateFiller(chart.lines) 177 178 set(chart) 178 179 }, 179 180