Skip to content

Commit

Permalink
feat: optimize the initial states of charts (#173)
Browse files Browse the repository at this point in the history
1. only show live cell count by default;
2. unify selection of avg-block-time of its thumnail and large chart;
3. offset 1% start point of uncle rate because its initial
value makes the chart obsure, similar to an outlier at the
start point.
  • Loading branch information
Keith-CY authored Dec 12, 2023
1 parent 93af4dc commit 794b12b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/pages/StatisticsChart/activities/CellCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ const useOption = (
name: t('statistic.dead_cell'),
},
],
selected: {
[t('statistic.all_cells')]: false,
[t('statistic.live_cell')]: true,
[t('statistic.dead_cell')]: false,
},
},
grid: isThumbnail ? gridThumbnail : grid,
dataZoom: isThumbnail ? [] : DATA_ZOOM_CONFIG,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/StatisticsChart/block/AverageBlockTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const useOption = (
: undefined,
grid: isThumbnail ? gridThumbnail : grid,
/* Selection starts from 1% because the average block time is extremely high on launch */
dataZoom: isThumbnail ? [] : DATA_ZOOM_CONFIG.map(zoom => ({ ...zoom, start: 1 })),
dataZoom: DATA_ZOOM_CONFIG.map(zoom => ({ ...zoom, show: !isThumbnail, start: 1 })),
xAxis: [
{
name: isMobile || isThumbnail ? '' : t('statistic.date'),
Expand Down
3 changes: 2 additions & 1 deletion src/pages/StatisticsChart/mining/UncleRate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const useOption = (
}
: undefined,
grid: isThumbnail ? gridThumbnail : grid,
dataZoom: isThumbnail ? [] : DATA_ZOOM_CONFIG,
/* Selection starts from 1% because the uncle rate starts from 0 on launch */
dataZoom: DATA_ZOOM_CONFIG.map(zoom => ({ ...zoom, show: !isThumbnail, start: 1 })),
xAxis: [
{
name: isMobile || isThumbnail ? '' : t('statistic.date'),
Expand Down

0 comments on commit 794b12b

Please sign in to comment.