forked from voxel51/fiftyone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request voxel51#3765 from voxel51/merge/release_v0.22.3_to…
…_main Merge/release v0.22.3 to main
- Loading branch information
Showing
45 changed files
with
699 additions
and
488 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ export const prettify = ( | |
); | ||
} | ||
|
||
return v; | ||
return result; | ||
}; | ||
|
||
export const genSort = (a, b, asc) => { | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { useEffect, useRef, useState } from "react"; | ||
import { useRecoilValue, useSetRecoilState } from "recoil"; | ||
import { isEqual } from "lodash"; | ||
import { | ||
ExecutionContext, | ||
fetchRemotePlacements, | ||
resolveLocalPlacements, | ||
} from "./operators"; | ||
import { operatorPlacementsAtom, operatorThrottledContext } from "./state"; | ||
|
||
export function useOperatorPlacementsResolver() { | ||
const context = useRecoilValue(operatorThrottledContext); | ||
const setOperatorPlacementsAtom = useSetRecoilState(operatorPlacementsAtom); | ||
const [resolving, setResolving] = useState(false); | ||
const lastContext = useRef(null); | ||
|
||
useEffect(() => { | ||
async function updateOperatorPlacementsAtom() { | ||
setResolving(true); | ||
try { | ||
const ctx = new ExecutionContext({}, context); | ||
const remotePlacements = await fetchRemotePlacements(ctx); | ||
const localPlacements = await resolveLocalPlacements(ctx); | ||
const placements = [...remotePlacements, ...localPlacements]; | ||
setOperatorPlacementsAtom(placements); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
setResolving(false); | ||
} | ||
if (!isEqual(lastContext.current, context) && context?.datasetName) { | ||
lastContext.current = context; | ||
updateOperatorPlacementsAtom(); | ||
} | ||
}, [context, setOperatorPlacementsAtom]); | ||
|
||
return { resolving }; | ||
} |
Oops, something went wrong.