Compare commits
1 Commits
2-mouselea
...
5-remove-u
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3aec5e6b2 |
@@ -24,15 +24,13 @@ export default function UpsChart({ config, upsRows, timeMode, onEdit, onDelete }
|
|||||||
(el, w, h, lRef) => {
|
(el, w, h, lRef) => {
|
||||||
if (upsRows.length < 2) return null;
|
if (upsRows.length < 2) return null;
|
||||||
|
|
||||||
const sorted = [...upsRows].sort((a, b) =>
|
const data = timeMode === 'tick'
|
||||||
timeMode === 'tick'
|
? [...upsRows].sort((a, b) => a.game_tick - b.game_tick)
|
||||||
? a.game_tick - b.game_tick
|
: upsRows;
|
||||||
: new Date(a.real_time).getTime() - new Date(b.real_time).getTime(),
|
const xs = data.map((r) =>
|
||||||
);
|
|
||||||
const xs = sorted.map((r) =>
|
|
||||||
timeMode === 'tick' ? r.game_tick : new Date(r.real_time).getTime() / 1000,
|
timeMode === 'tick' ? r.game_tick : new Date(r.real_time).getTime() / 1000,
|
||||||
);
|
);
|
||||||
const ys = sorted.map((r) => r.ups);
|
const ys = data.map((r) => r.ups);
|
||||||
|
|
||||||
const xAxis: uPlot.Axis = {
|
const xAxis: uPlot.Axis = {
|
||||||
...AXIS_BASE,
|
...AXIS_BASE,
|
||||||
|
|||||||
Reference in New Issue
Block a user