Skip to content

Commit

Permalink
fix: don't bother displaying end marker in Timelines
Browse files Browse the repository at this point in the history
  • Loading branch information
starpit committed Apr 9, 2023
1 parent 2388228 commit 5ec57c0
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,22 @@ export default class Timeline extends React.PureComponent<Props> {
* Render one cell to represent the average over the given `workers`
* for the given grid, for the given time.
*/
private cell(workers: Worker[], spec: GridSpec, timeIdx: number, isLatest: boolean) {
private cell(workers: Worker[], spec: GridSpec, timeIdx: number) {
const metricIdx = avg(workers, "metricIdxTotal", timeIdx)
const style = spec.states[metricIdx] ? spec.states[metricIdx].style : { color: "gray", dimColor: true }

return (
<React.Fragment key={timeIdx}>
<Text {...style}>{this.block.historic}</Text>
<Text dimColor>{isLatest ? this.block.latest : ""}</Text>
</React.Fragment>
<Text {...style} key={timeIdx}>
{this.block.historic}
</Text>
)
}

/** Render one horizontal array of cells for the given grid */
private cells(workers: Worker[], spec: GridSpec, nTimes: number, timeStartIdx: number) {
return Array(nTimes - timeStartIdx)
.fill(0)
.map((_, idx, A) => this.cell(workers, spec, idx + timeStartIdx, idx === A.length - 1))
.map((_, idx) => this.cell(workers, spec, idx + timeStartIdx))
}

/** Render the timeline UI for the given grid */
Expand Down

0 comments on commit 5ec57c0

Please sign in to comment.