Repository navigation
feat(ui): choose the timeframe of the candles and bars - #57
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The candles and bars of the chart of lines over time span a day, a week or a month, picked from the span of the history shown. There was no way to read the same history by week instead of by day, or to see how much each commit changed, which a trading chart offers by switching its timeframe. The decisions are in ADR 0049.
Timeframes
A row of buttons beside the legend offers Auto, Commit, Day, Week and Month (CumulativeChart.tsx), reusing the segmented control of the settings dialog. The candles and the bars both follow it. Auto keeps the earlier choice of the shortest calendar period that fits about sixty candles, so the chart looks as before until another timeframe is picked. As with the legend, the choice is not saved.
Commit
Commit cuts the time axis into columns 4 pixels wide, and the commits drawn in one column share a candle and a bar (
byColumn). A short history gets one per commit. Over a long one, commits a few hours apart fall in the same column; their bars add up rather than drawing over each other, and their candle runs from before the first to after the last. Since the columns follow the pixels, these candles redraw when the chart's width changes. The roadmap item for bars per commit is removed, since Commit covers it.The candles take any cut of the time axis, by the calendar or by the columns (
candles,byTimeframe).Tests