Skip to content

Commit

Permalink
update minesweeper page
Browse files Browse the repository at this point in the history
  • Loading branch information
cesque committed Oct 25, 2024
1 parent 2e6df13 commit 947e208
Show file tree
Hide file tree
Showing 3 changed files with 4,086 additions and 217 deletions.
17 changes: 12 additions & 5 deletions components/MinesweeperGraph/MinesweeperGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ export default function MinesweeperGraph() {
}
}

let pb = +pbs[pbs.length - 1].duration
let pb = pbs[pbs.length - 1]

pbs.push({
...pb,
dateTime: data[data.length - 1].dateTime,
r: 0,
})

// ----- generate average line -----
const window = 50
Expand All @@ -65,13 +71,14 @@ export default function MinesweeperGraph() {
}

// ----- generate ticks for x (time) axis -----
let endDate = data[data.length - 1].dateTime.plus({ months: 1 }).endOf('month')
let endDate = data[data.length - 1].dateTime.plus({ months: 1 }).startOf('month')
let xTickDate = data[0].dateTime.startOf('month')
let xTickDates = []
while(xTickDate < endDate) {
let xTickDates = [xTickDate]
while(xTickDate <= endDate) {
xTickDate = xTickDate.plus({ months: 3 })
xTickDates.push(xTickDate)
xTickDate = xTickDate.plus({ months: 1 })
}

let xTicks = xTickDates.map(tick => tick.toMillis())

function formatXTicks(value) {
Expand Down
Loading

0 comments on commit 947e208

Please sign in to comment.