[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove chart feature flag, remove unused code [WEB-930] #6064

Merged
merged 5 commits into from
Feb 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
checkpoint helper for points > 1000 and points > maxDatapoints
  • Loading branch information
mapmeld committed Feb 27, 2023
commit 4d7cf19300e05ddc185f23d8f957c04d372a0582
30 changes: 16 additions & 14 deletions webui/react/src/pages/TrialDetails/TrialDetailsOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,27 @@ const TrialDetailsOverview: React.FC<Props> = ({ experiment, trial }: Props) =>

const checkpointsDict = useMemo<CheckpointsDict>(() => {
const timeHelpers: Record<XAxisVal, CheckpointWorkloadExtended> = {};
if (data && xAxis === XAxisDomain.Time && checkpoint?.totalBatches) {
if (data && checkpoint?.totalBatches) {
Object.values(data).forEach((metric) => {
const matchIndex = metric.data[XAxisDomain.Batches]?.findIndex(
(pt) => pt[0] === checkpoint.totalBatches,
);
const matchIndex =
metric.data[XAxisDomain.Batches]?.findIndex((pt) => pt[0] >= checkpoint.totalBatches) ||
(metric.data[XAxisDomain.Batches]?.length || 0) - 1;
if (matchIndex !== undefined && matchIndex >= 0) {
const timeVals = metric.data[XAxisDomain.Time];
if (timeVals && timeVals.length > matchIndex) {
timeHelpers[Math.floor(timeVals[matchIndex][0])] = checkpoint;
if (xAxis === XAxisDomain.Time) {
const timeVals = metric.data[XAxisDomain.Time];
if (timeVals && timeVals.length > matchIndex) {
timeHelpers[Math.floor(timeVals[matchIndex][0])] = checkpoint;
}
} else if (xAxis === XAxisDomain.Batches) {
const batchX = metric.data[XAxisDomain.Batches]?.[matchIndex][0];
if (batchX) {
timeHelpers[batchX] = checkpoint;
}
}
}
});
}
return checkpoint?.totalBatches
? {
[checkpoint.totalBatches]: checkpoint,
...timeHelpers,
}
: {};
return checkpoint?.totalBatches ? timeHelpers : {};
}, [data, checkpoint, xAxis]);

const pairedMetrics: ([Metric] | [Metric, Metric])[] | undefined = useMemo(() => {
Expand Down Expand Up @@ -121,7 +123,7 @@ const TrialDetailsOverview: React.FC<Props> = ({ experiment, trial }: Props) =>
xValSet.add(pt[0]);
});
});
const xVals = Array.from(xValSet).sort();
const xVals = Array.from(xValSet).sort((a, b) => a - b);

const MouseEvent, point: UPlotPoint) => {
const xVal = xVals[point.idx];
Expand Down