sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
075b3215485ee6e2d07a387e9224e5a85bec33580e1b0f2aad80ee194e452cb3
TypeScript
703
28
import type { SidebarEntry } from "@fiftyone/state"; import type { Controller } from "@react-spring/web"; export type InteractiveItems = { [key: string]: { el: null | HTMLDivElement; controller: Controller; entry: SidebarEntry; active: boolean; }; }; export type RenderEntry = ( key: string, gr...
c65a4b41fe0dea01e1ab10309878d1a983b1341227b1d6868c688b52b8132885
TypeScript
704
22
import { useEffect } from "react"; import { useAnnotationEventBus } from "../hooks"; /** * Hook which emits a persistence request at the specified interval. * * @param enabled If true, enables auto-save functionality * @param autoSaveInterval Interval in milliseconds to trigger persistence */ export const useAuto...
483c6f9caf06fae3468dc85aafa729cb6497b5164b1be2d99015c8f82cdd2f1a
TypeScript
705
34
/** * Copyright 2017-2025, Voxel51, Inc. */ /** * Provides a unit of execution. This can * be executed by the ActionManager to optionally * support automatic undo/redo by implementing the * Undoable extension of the interface. */ export interface Action { id: string; /** * Executes the action */ ex...
34e6bc175a0a27193b93e7be0a9434dae65c25626fe97b282c99595eea59e8ee
TypeScript
709
26
import { ImaVidState } from "../../state"; import { BaseElement } from "../base"; import { createBufferingIndicator, setBufferingShown, } from "../common/buffering"; export class LoaderBar extends BaseElement<ImaVidState> { private buffering = false; isShown({ thumbnail }: Readonly<ImaVidState["config"]>) { ...
74816bbefc4db0ea011d690b20eb8c21154255b46cc50e2876668051bc603acf
TypeScript
712
26
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { SelectionType } from "@fiftyone/state"; import { useSessionSetter } from "@fiftyone/state"; import { useCallback } from "react"; import type { EventHandlerHook } from "./registerEvent"; const useSelectSamples: EventHandlerHook = () => { const setter = useS...
fdda44ff3b3a07f257262304b17b13fdabd2a49541c9aaad8ba172706d9392ca
TypeScript
712
18
import { useTheme } from "@fiftyone/components"; import type { BaseOverlay } from "@fiftyone/lighter"; import { getOverlayColor } from "@fiftyone/lighter"; import { useMemo } from "react"; import useColorMappingContext from "../../../Lighter/useColorMappingContext"; import { useAnnotationContext } from "./useAnnotation...
e06b0197903f80cb2851fddce615a0b2b20ddbea8a2d1e071f198d95c1a5d02e
TypeScript
718
32
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Undoable } from "@fiftyone/commands"; import type { Rotatable } from "../types"; /** * Command for rotating an overlay with undo/redo support. */ export class RotateOverlayCommand implements Undoable { readonly id: string; readonly description: string;...
427b65c299d8d827b3953a1e5b6d7a90d1c36f875380b4f2fbc6e1f3ef9f1116
TypeScript
719
27
import { Scene2D } from "@fiftyone/lighter"; import { useSaveModalViewport } from "@fiftyone/state"; import { useLayoutEffect } from "react"; /** * Captures the zoom/pan state before this component is removed from the DOM * so the state can be restored when EXPLORE mode (Looker) remounts. */ const useRetrieveViewpo...
2eeeb24e9b18381ac1bbe73a6c66d258f7a742cbca903849bf3b38f3725f6f6d
TypeScript
721
27
import type { LevaInputProps } from "leva/plugin"; export type ButtonProps = { label?: string; icon: React.ReactNode; disabled: boolean; onClick: ({ checked, label }: { checked: boolean; label: string }) => void; }; type BooleanButtonSettings = { checked: boolean; onClick: (props: { checked: boolean; labe...
3f0594b1b56b04e71e80355a4cddd883a4d18b35e1213e3d591778f7a4eb72c5
TypeScript
730
22
import { describe, expect, it } from "vitest"; import { Vec3, projectTo2D } from "./label-3d-projection-utils"; describe("projectTo2D", () => { it("should project a point to the xz plane", () => { const point: Vec3 = [1, 2, 3]; const projectedPoint = projectTo2D(point, "xz"); expect(projectedPoint).toEqu...
1395f68d0834a2ecd1bdcdd5b5367075c05b8375df17da260b35952baa747946
TypeScript
738
21
import { describe, expect, it } from "vitest"; import { isMaskDetection } from "./maskDetection"; describe("isMaskDetection", () => { it("accepts a masked detection typed by its Detection or Detections field", () => { expect(isMaskDetection({ type: "Detection", data: { mask: [[1]] } })).toBe( true, ); ...
6dbf623b98b0809b85d8ea7f8290dc72710475f926506a3e659f8f72ec783e38
TypeScript
738
27
import { atom, useAtom } from "jotai"; import { useMemo } from "react"; import { AgentTaskType } from "../types"; const activeTaskAtom = atom<AgentTaskType | null>(null); /** * Read/write access to the active annotation task type. */ export interface ActiveTask { /** The currently selected task, or `null` if none...
76dc47058dbcae046499d18611eb18de250eae4975c06cc4a334fd8cbbfaebcb
TypeScript
742
14
/** * Public production surface for episode-backed views. */ export { default as ModalRenderer } from "./shell/ModalRenderer"; export { GridRenderer } from "./grid/GridRenderer"; export { GridStreamSelector } from "./grid/GridStreamSelector"; export { default as RightSidebar } from "./shell/RightSidebar"; export { So...
40be4b3aac816fc4141f69ef5e71f8f6aeeb3a81fc51be798fd6083a0d4e2d32
TypeScript
743
21
/** * Bridges Recoil's `datasetName` into the Jotai `schemaDatasetName` atom * that scopes the label-schema atoms (a Jotai getter can't read Recoil — * the same pattern as `exploreActiveFields`). Mount once at app level * (`SchemaManagerOutlet`), for every viewer. */ import * as fos from "@fiftyone/state"; import...
c7f7e352c2ec6220a9cf6a94507fcfd94b999343e999cf6c7717f8e01a636e26
TypeScript
745
29
import { describe, expect, it } from "vitest"; import * as deserializer from "./deserializer"; describe("filter resolves correctly", () => { it("skips undefined detection", () => { expect( deserializer.DeserializerFactory.Detection(undefined, []), ).toBeUndefined(); }); it("skips undefined detect...
a9d2f71c1396a3f002310b5dcb2769d092d45afcf8e7a362bd84fbcb260f8b21
TypeScript
752
34
import { describe, expect, it } from "vitest"; import { handleNode } from "./utils"; const NODE = { __typename: "ImageSample" as const, aspectRatio: 1, id: "", sample: {}, urls: [], }; describe("spotlight paging", () => { it("handles object sample nodes", () => { expect(handleNode(NODE)).toStrictEqual...
13e9d0a0e8f881cd272dafd31057ea84da715de6b6c66b2fde17d5b53d26b5b2
TypeScript
754
31
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Undoable } from "@fiftyone/commands"; import type { Scene2D } from "../core/Scene2D"; import type { BaseOverlay } from "../overlay/BaseOverlay"; /** * Command for removing an overlay from the scene with undo/redo support. */ export class RemoveOverlayComma...
49b5b5bc83651a43e92d85b601c7f790f39a21788e4dda3549b0b5f1df474d92
TypeScript
756
26
import { useDebounceCallback } from "@fiftyone/state"; import { useEffect } from "react"; import { useRecoilValue, useSetRecoilState } from "recoil"; import { stringSearch, stringSearchResults } from "./state"; const DEBOUNCE_DELAY = 200; export default function ({ modal, path }: { modal: boolean; path: string }) { ...
a396eaeb5bd1fd1395f076f0f02f0a7cff9fcedc81ebeac784dd97e161d0392e
TypeScript
756
25
import { decode } from "fast-png"; import { OverlayMask } from "../numpy"; export const customDecode16BitPng = async (blob: Blob) => { const arrayBuffer = await blob.arrayBuffer(); const decodedPng = decode(arrayBuffer); if (decodedPng.palette?.length) { // spec doesn't allow palettes for 16-bit PNGs th...
d8815ad8a485295f0d4ed1e56c2cb9bd1a5c044feb6550c942f1a60fcc53b4e0
TypeScript
758
21
export * from "./useActiveCapabilities"; export * from "./useActiveTask"; export * from "./useAgentRegistry"; export * from "./useAgentSelector"; export * from "./useAIAnnotationActionGroup"; export * from "./useAnnotationAgent"; export * from "./useApplyInferenceResult"; export * from "./useClearPointPrompts"; export ...
91b5fe9e61dfdfabbf83dc7cee3b920b7a9aa238ce481cf7252e87f2c14affbc
TypeScript
761
30
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Resource } from "@fiftyone/utilities"; import type { ConcreteRequest, OperationType, VariablesOf, } from "relay-runtime"; import type { LocationState, Route } from "."; export interface RouteDefinition<T extends OperationType> { component: Resource<R...
d76e6778c45e34ea34c7b9ba923195ce1e84c6dffb89edf41a9a4907a9af9d6d
TypeScript
763
28
/** * Copyright 2017-2026, Voxel51, Inc. */ import { getEnvironment, setCurrentEnvironment } from "@fiftyone/state"; import { useMemo, useRef } from "react"; import { useErrorHandler } from "react-error-boundary"; import { type Router, createRouter } from "."; import makeRoutes, { type Queries } from "../makeRoutes...
857607b669a9f99cf0378d0fb9778178cd8b4a0812dddbcc0014164908860012
TypeScript
771
32
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Session } from "@fiftyone/state"; import { snakeCase } from "lodash"; import type { MutableRefObject } from "react"; import type { Queries } from "../makeRoutes"; import type { RoutingContext } from "../routing"; export enum AppReadyState { CONNECTING = 0,...
95ca45f3f89a689cb62c6e233e1aee4e760a47e09a2a86faa6a6d0c7a9d69332
TypeScript
776
26
/** * Copyright 2017-2026, Voxel51, Inc. */ import { setSampleSelectionStyle, type setSampleSelectionStyleMutation, } from "@fiftyone/relay"; import { DEFAULT_SELECTION_STYLE } from "@fiftyone/state"; import { DefaultValue } from "recoil"; import { commitMutation } from "relay-runtime"; import type { RegisteredW...
b098049d7c7292f94f16097bb38f4657f3a2fa7cf4a8941a96a9c27b0a4821e7
TypeScript
777
23
import { activeLabelFields } from "@fiftyone/state"; import { useCallback } from "react"; import { useRecoilCallback } from "recoil"; import { gridActivePathsLUT } from "../Sidebar/useDetectNewActiveLabelFields"; /** * Callbacks for the cache to sync {@link gridActivePathsLUT} */ export default () => ({ onDispose:...
7b2692c5d351f9257daeb5520c4ce714b2035f476485560a2c874332d8838221
TypeScript
781
31
import { field, parentField } from "@fiftyone/state"; import { BOOLEAN_FIELD, KEYPOINTS_POINTS_FIELD, KEYPOINT_FIELD, LIST_FIELD, } from "@fiftyone/utilities"; import { selectorFamily } from "recoil"; export const isBooleanField = selectorFamily({ key: "isBooleanField", get: (path: string) => ({ ge...
4f96c067bf83d3e809ce5606874f29696ea1f4d5a67f433a0a70a9bf576b9e58
TypeScript
785
21
import { useMemo } from "react"; import type { FrustumData } from "../../frustum/types"; import type { PolylineTransformData } from "../types"; import { computePolylineProjection } from "./geometry"; import type { PolylineProjectionData } from "./types"; /** * Computes the 2D projection of a polyline onto an image sl...
7e2b588ddbc482d0544939c3739aff2af4b2fc853976ba6adbc51d3390bd105c
TypeScript
785
18
export * from "./use-fo3d"; export * from "./use-fo3d-camera-controls-config"; export * from "./use-fo3d-camera-initialization"; export * from "./use-fo3d-camera-look-at"; export * from "./use-fo3d-camera-view-events"; export * from "./use-fo3d-derived-scene-state"; export * from "./use-fo3d-interaction-lifecycle"; exp...
15667e2909bed48777584ba5fb7a2cb0463efa79e098164bdb1f3add64ea2c64
TypeScript
789
29
import { registerComponent, PluginComponentType } from "@fiftyone/plugins"; import { BUILT_IN_PANEL_PRIORITY_CONST, Schema } from "@fiftyone/utilities"; import MapIcon from "@mui/icons-material/Map"; import { lazy } from "react"; import MapTabIndicator from "./MapTabIndicator"; const Map = lazy(() => import("./Map"));...
a22702dd02c94a6c5e7205cf5b69caabdae0c030bc714f688f37a23302509a26
TypeScript
790
33
import { field } from "@fiftyone/state"; import { atom, selector } from "recoil"; import { ACTIVE_FIELD } from "./utils"; export const activeColorEntry = atom<{ path: string } | ACTIVE_FIELD | null>({ key: "activeColorEntry", default: null, }); export const activeColorPath = selector<string>({ key: "activeColor...
a36e8e0e8cb0b57afa06c3644851e54365a95b3205fc4f35f7b91fe80eaab1e7
TypeScript
791
27
/** * Copyright 2017-2026, Voxel51, Inc. */ import { setLabelSelectionStyle, type setLabelSelectionStyleMutation, } from "@fiftyone/relay"; import { DEFAULT_LABEL_SELECTION_STYLE } from "@fiftyone/state"; import { DefaultValue } from "recoil"; import { commitMutation } from "relay-runtime"; import type { Registe...
96f5a03905d2d06ca8efcbd4d8ee8ad57c51df6a26bf418fcc120ec1dd925841
TypeScript
793
27
import { useFirstExistingUri, usePanelEvent } from "@fiftyone/operators"; import { usePanelId } from "@fiftyone/spaces"; import { useCallback } from "react"; const IS_OSS = true; // false in fiftyone-teams export default function useComputeVisualization() { const { firstExistingUri: computeVisUri, exists: hasComput...
828ab5d3c9c8466237f14bf7139d576c72b0282b3bb9b617f2dd45bed121f5c2
TypeScript
797
24
import { expect, it, vi } from "vitest"; import { FrameElement } from "../elements/frame"; import type { FrameState } from "../state"; import { FrameLooker } from "./frame"; it("boots frame elements with their event controller and state updater", () => { const abortController = new AbortController(); const updater...
9e1fad35335dbaf1008384780e1f02f9701d6e2d6d663db6e9d3243920b4ec3a
TypeScript
797
29
import * as fos from "@fiftyone/state"; import { get as getPath } from "lodash"; import { useRecoilCallback } from "recoil"; export default <T extends fos.Lookers>(store: fos.LookerStore<T>) => { return useRecoilCallback( ({ set, snapshot }) => async (_, id: string, __) => { const current = await s...
ac683c1fd38d211eba4840f060b1c5763389e5eefdd199bf226812781c907ed0
TypeScript
807
25
type SubsetAction = "delete" | "remove"; const KEYS: Record<SubsetAction, string> = { delete: "fiftyone.subsets.skipDeleteConfirmation.v1", remove: "fiftyone.subsets.skipRemoveConfirmation.v1", }; /** Reads this browser's opt-out for the requested subset operation. */ export function skipSubsetConfirmation(action...
452a3a354900b7506d90373b7e4a85b2d6eb82a1e4efe3c8ccef4f07430b7dab
TypeScript
811
23
import { getPlayhead, subscribePlayhead, usePlaybackStore, } from "@fiftyone/playback"; import { useCallback, useSyncExternalStore } from "react"; /** * Reads the latest playhead during render, but only subscribes to RAF-rate * changes when `subscribed` is true. Content-driven parents can therefore * sample p...
e200a322e47188168b1bc4b8fd2b0ea649354b8e558b2bfcfa94bb16d014f917
TypeScript
811
26
import { createHttpByteClient } from "./http-byte-client"; import { createLocalFileByteClient } from "./local-file-byte-client"; import type { ByteClient } from "./types"; /** * Creates the default browser byte reader. Local File-backed sources are read * from Blob slices; all other sources use HTTP range requests. ...
203a387ff8818a742959e669649c3a91245551f0465bb468af671baedb46ca6a
TypeScript
812
20
export const KEY_COLOR = "hsl(25,100%,51%)"; export const SECONDARY_KEY_COLOR = "hsl(25,100%,61%)"; export const TERTIARY_KEY_COLOR = "hsl(25,100%,71%)"; export const COMPARE_KEY_COLOR = "hsl(199,98%,48%)"; export const COMPARE_KEY_SECONDARY_COLOR = "hsl(201,92%,75%)"; export const COMPARE_KEY_TERTIARY_COLOR = "hsl(201...
b2795dca58719bba5153e792809720f771f3f25aed3affb2d1cea9945c7be6cb
TypeScript
813
33
import { HEATMAP } from "@fiftyone/utilities"; export const RENDER_STATUS_PENDING = "pending"; export const RENDER_STATUS_PAINTING = "painting"; export const RENDER_STATUS_PAINTED = "painted"; export const RENDER_STATUS_DECODED = "decoded"; export type DenseLabelRenderStatus = | null | typeof RENDER_STATUS_PENDIN...
c8e247e5145e38feac8bb2327916a6341d58c8fd089ac4c75158560e7e3c0110
TypeScript
813
28
/** Runtime exports from the optional Spark renderer package. */ export type SparkModule = typeof import("@sparkjsdev/spark"); /** Creates a loader that caches successes and retries rejected imports. */ export const createLazyModuleLoader = <Module>( loadModule: () => Promise<Module>, ) => { let modulePromise: Pro...
86a28f41ed702d7918794be93c0855ca5eed0c9ae5638c583fc1c041a54c0ca2
TypeScript
815
22
import { useCallback } from "react"; import { usePointSelection } from "./usePointSelection"; import { useToolsState } from "./useToolsContext"; /** * Clears the pending point prompts, leaving point selection active so the user * can keep placing points on an empty canvas. * * Both halves are required: `clearPoint...
172cdf86b870ce6c6aec108f0da05cca440359af4d00208d8cf79818b362bc6f
TypeScript
816
31
import { VISUALIZATION_KIND, type PointCloudVisualization, } from "../../../../ir"; import { describe, expect, it } from "vitest"; import { pointCloudPlacementFrameIds } from "./use-scene-3d-placed-layers"; describe("scene 3D placed layers", () => { it("deduplicates populated point-cloud coordinate frames", () ...
8822ba13583d65a5329344c16915d26bdbeacbf2049cc6e6d6d9e28acad55f64
TypeScript
817
25
/** Stable source-profile values shared across transport-neutral layers. */ export const BYTE_SOURCE_READ_PROFILE = Object.freeze({ LOCAL: "local", REMOTE: "remote", } as const); /** Source-locality hint used by byte resources to choose cache behavior. */ export type ByteSourceReadProfile = (typeof BYTE_SOURCE_R...
cbfeab73fd6e57dfd64973e24f7b3f0b2f03eb1f448e6ce3ac4ae39a3312ef5d
TypeScript
820
25
import { useCallback } from "react"; import { useRecoilValue } from "recoil"; import { analyticsInfo } from "./state"; import type { AnalyticsInfo } from "./usingAnalytics"; import usingAnalytics from "./usingAnalytics"; /** * Track an event. This can be called from any component to track an event, however * only wh...
8a95da7318ea4a1818ac63a0fae98789631ace376f18086cccb4ee8e81027372
TypeScript
822
31
import react from "@vitejs/plugin-react"; import nodePolyfills from "rollup-plugin-polyfill-node"; import { defineConfig } from "vite"; import relay from "vite-plugin-relay"; export default defineConfig(({ mode }) => { return { base: mode === "desktop" ? "" : "/", plugins: [react(), relay, nodePolyfills()], ...
198beb4f26be250366e952c91a87d1f846ebf1709b764a3c39a61cfc8513b25b
TypeScript
824
30
export { TimelineExtensionHost } from "./host"; export { registerTimelineExtension, useTimelineExtensions } from "./registry"; export { AnnotationStreamsProvider, useSelectedAnnotationStreams, usePublishAnnotationStreams, } from "./selected-annotation-streams"; export type { TimelineComposition, TimelineContr...
4de543f45a9028bfc6c1d426c27f3aa6f130cd73c248002a6e1ff28aa763b9d4
TypeScript
824
25
/** * Moves ArrayBuffer backing stores out of the current V8 isolate and drops * them. Transferring through a closed MessageChannel detaches synchronously; * closing both ports discards the queued payload without creating another * long-lived worker or cache owner. */ export function releaseArrayBuffers(candidates...
d1302328f0215fd46ff73088f802c597edec271a8a469ab51968fcb8d1fae3e6
TypeScript
824
29
import { PCDFileFormat } from "./types"; /** * Reads a single field value from DataView. * * DataView ref: https://developer.mozilla.org/en-US/docs/Web/API/DataView */ export const getDataView = ( dv: DataView, offset: number, type: PCDFileFormat, size: number, littleEndian: boolean, ): number => { swi...
354780ebfc7f041d85a5b9db06bfd732d5d989f881fd06cb5936f5f0d4ad727c
TypeScript
825
29
import { useEventBus } from "@fiftyone/events"; import { pathCanBeOptimized } from "@fiftyone/state"; import { useEffect } from "react"; import { useRecoilValue } from "recoil"; import { QP_WAIT, type QueryPerformanceEvents } from "../QueryPerformanceToast"; export default function useQueryPerformanceTimeout( modal:...
b3c85fd4414691c761b6e2fd3ea20c388e628921fac92d560cda6333192d035f
TypeScript
830
34
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Session } from "@fiftyone/state"; import type { MutableRefObject } from "react"; import type { Environment } from "react-relay"; import type { Queries } from "../makeRoutes"; import type { RoutingContext } from "../routing"; type WriterKeys = keyof Omit< S...
41294df4c127c1a0ab0351fcd0b3e85def5550e60673afe026b7ee049bcefc1d
TypeScript
831
23
import type { EpisodeSelection } from "@fiftyone/state/src/selection"; /** Prefer a slice represented by the captures, even after browsing elsewhere. */ export function capturedGroupSlice( captures: readonly EpisodeSelection[], groupField: string | null, currentSlice: string | undefined, ): string | undefined { ...
82c58fa1876eed7458051ca2a788391440b9a7ab57b66dd5209e73b0e8a180a0
TypeScript
831
22
/** * Copyright 2017-2026, Voxel51, Inc. */ import onRefresh from "./onRefresh"; import onSetColorScheme from "./onSetColorScheme"; import onSetDataset from "./onSetDataset"; import onSetFieldVisibilityStage from "./onSetFieldVisibilityStage"; import onSetSimilarityParameters from "./onSetSimilarityParameters"; impo...
6cebd1e4b99089df7c7ccde32b62112116bf1e4009582734cdb60f977fe896c3
TypeScript
833
23
/** * Returns the React key for the 3D viewer subtree. * * Grouped direct-3D selections render through a synthetic FO3D scene, so * swapping the representative sample should not remount the viewer. Real FO3D * slice changes still get a distinct key so scene-local state resets when the * source scene changes. Layo...
688e64935e7ce0ce546340e7b94f8ce50fcc8b47b55ba9f7c20618e8a11d6cac
TypeScript
839
35
import type { useTheme } from "@fiftyone/components"; /** Inline styles shared by the Schema Manager overview and its parts. */ export function makeStyles(theme: ReturnType<typeof useTheme>) { const onSurface = theme.text.primary; const onSurfaceMuted = theme.text.secondary; return { bar: { display: "...
96c69f588529a7eb03c83cacf25ed7653495bbb4ebe7c081d697477c87a2f61d
TypeScript
840
34
import { PolylineLabel } from "@fiftyone/looker/src/overlays/polyline"; import type { AnnotationLabel } from "@fiftyone/state"; import { POLYLINE } from "@fiftyone/utilities"; import { useCallback } from "react"; import type { LabelType } from "./Edit/useAnnotationContext"; /** * This hook returns a function which is...
3fce18c886b2841387a6c336e48972953ed1d8869a9858bd6a94c7dfeeb25c46
TypeScript
842
32
/** * Copyright 2017-2026, Voxel51, Inc. */ import { subscribeBefore } from "@fiftyone/relay"; import { useCallback } from "react"; import type { EventHandlerHook } from "./registerEvent"; const useSetGroupSlice: EventHandlerHook = ({ router, session }) => { return useCallback( ({ slice }) => { const se...
8e1732f2dd3a2a5abd7d0a27b15e6324fd699d9b36e147fd0a7082872101e4e0
TypeScript
842
31
/** * Copyright 2017-2026, Voxel51, Inc. * * Shared data types for the data-driven ActionToolbar renderer. * These live in @fiftyone/components so both @fiftyone/core (2D segmentation) * and @fiftyone/looker-3d (3D annotation) can depend on them without creating * a cross-package dependency between those two pack...
b79215d090ad7efafcc7a4ca2f616767a7c9c5fe1c48ecd25690475fb16d5826
TypeScript
850
28
export interface DestinationPosterIdentity { readonly committedSourceKey: string | null; readonly committedStream: string | null; readonly dataStreamSourceKey: string; readonly posterSourceKey: string; readonly posterStreamId: string | null; readonly stream: string; } /** * Shows a source-authenticated bo...
4b7b7f774bb9ae07511993d1996f5bc4051a3f49127146e36ceb5e0011c699fe
TypeScript
852
35
export type ViewStage = { _cls: string; }; export type Filters = { [key: string]: {}; } | null; const PATCHES_VIEW_STAGE = "fiftyone.core.stages.ToPatches"; export function shouldResolveSelection( view: ViewStage[], filters: Filters, patchesField?: string, pointsField?: string, ) { const samplesType = ...
c4c8097540f7bc17b374255be6a1df4921844138fae19f1509fd65098f1e06f1
TypeScript
853
27
// This barrel is deliberately three.js-free at runtime: the chart (and // all WebGL code) loads lazily inside EmbeddingsView on first mount. // Statically re-exporting the chart here would fold three.js back into // the panel's initial chunk — which is why depcruise routes all panel // imports through this file and no...
09c476d2f01f353e1a2badf889807fed912af6f4a7b86a8ff01c9c0be7c43be3
TypeScript
854
22
/** Public cloneable byte-source values. */ export * from "./bytes"; /** Public frame intermediate representation. */ export * from "./frames"; /** Public episode and stream intermediate representation. */ export * from "./manifest"; /** Public normalized log records. */ export * from "./log"; /** Public numeric-field ...
42363d410992047e2c7c80e2af9a01cb5e63f0ee75e16578ecbad2f291488574
TypeScript
858
23
import { useMemo } from "react"; import type { Vector3 } from "three"; import type { FrustumData } from "../../frustum/types"; import type { CuboidTransformData } from "../types"; import { computeCuboidProjection } from "./geometry"; import type { CuboidProjectionData } from "./types"; /** * Computes the 2D projectio...
f87a0db705551cc83a4f51ff47e15a090b0f4bd0d3a1fd04ad91642d4a9dc9ac
TypeScript
860
22
import { relativeTimeParts } from "../../../utils/relative-time"; /** Formats one exact message time relative to the recording origin. */ export function formatRawMessageTime(timeNs: bigint, originNs: bigint): string { const { milliseconds, negative, seconds } = relativeTimeParts( timeNs - originNs, ); retur...
20944778c992e83abad53ce0b7c84deb936087e07c906b2a1ea38745581a46fb
TypeScript
868
28
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Setter } from "@fiftyone/relay"; import type { Session, useSessionSetter } from "@fiftyone/state"; import type { MutableRefObject } from "react"; import type { Environment } from "react-relay"; import type { Queries } from "../makeRoutes"; import type { Routi...
7a39bd0f0a24702bc20e01547c973418a191b45971781ed894656abe00ab97a7
TypeScript
872
22
import { describe, expect, it } from "vitest"; import { getFo3dRoot } from "../utils"; describe("getFo3dRoot", () => { it("should extract the root of a valid fo3d file", () => { const url = "/Users/johndoe/fiftyone/store/assets/file.fo3d"; const expectedRoot = "/Users/johndoe/fiftyone/store/assets/"; exp...
bc016c6f7528ce902f080b74b4e0bf6cc15590cf81e90bf0efb068b0409d8441
TypeScript
872
37
import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; import { viteExternalsPlugin } from "vite-plugin-externals"; const isPluginBuild = process.env.STANDALONE !== "true"; // https://vitejs.dev/config/ export default defineConfig({ mode: "development", plugins: [ ...
a0db98c6199dba1329b69a7d7f3be1a0e07c5a1fe1beb60caa1b68ee513a23cb
TypeScript
875
37
import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; import { viteExternalsPlugin } from "vite-plugin-externals"; const isPluginBuild = process.env.STANDALONE !== "true"; // https://vitejs.dev/config/ export default defineConfig({ mode: "development", plugins: [ ...
189aa9ba891e8a9a6df2e33c9f20f1fc67e0a9b18e04f474d3ff9709b24bbb65
TypeScript
879
37
import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; import { viteExternalsPlugin } from "vite-plugin-externals"; const isPluginBuild = process.env.STANDALONE !== "true"; // https://vitejs.dev/config/ export default defineConfig({ mode: "development", plugins: [ ...
1ecda40db80493b082a04a69f0afe1f92d7d5661f998820b4550ceef7437a38a
TypeScript
879
37
import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; import { viteExternalsPlugin } from "vite-plugin-externals"; const isPluginBuild = process.env.STANDALONE !== "true"; // https://vitejs.dev/config/ export default defineConfig({ mode: "development", plugins: [ ...
ce9ecc8791b642b1b24539c551b8b2a5821050977c0017da762e7df66e3bca9f
TypeScript
880
29
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it } from "vitest"; import { SaveHealth, deriveSaveHealth } from "./saveStatus"; describe("deriveSaveHealth", () => { it("is healthy when attempts are allowed and not unhealthy", () => { expect(deriveSaveHealth({ canAttempt: true, isUnheal...
cc0479f8d987e41614af9f2e66d27ea8a5d46e7cc8856aefbbf6f8ff4120c17c
TypeScript
881
37
import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; import { viteExternalsPlugin } from "vite-plugin-externals"; const isPluginBuild = process.env.STANDALONE !== "true"; // https://vitejs.dev/config/ export default defineConfig({ mode: "development", plugins: [ ...
85117bcde0f1bb8769deb5ffbb9fe3fc24026a340e079c5f983155c39f879391
TypeScript
888
26
import { describe, expect, it } from "vitest"; import { fnv1aBytesHex, fnv1aFingerprint, fnv1aString } from "./fnv1a"; describe("FNV-1a helpers", () => { it("hashes bytes with the canonical offset basis", () => { expect(fnv1aBytesHex(new TextEncoder().encode("hello"))).toBe("4f9f2cab"); }); it("hashes UTF-...
fd1ecab08af4b0e412b190f46991efa4446ca0305375d5e0ecf1d1d3f7c02678
TypeScript
894
29
/** * Copyright 2017-2026, Voxel51, Inc. */ import { useMemo } from "react"; import { get } from "lodash"; export type DependencyHash = string | null; /** * Computes a stable hash of dependency values from params. * Returns null if no dependencies are specified (meaning "only load on mount"). * * @param params...
966c27e198a58ee13134c725d846b3b7f25ca5535a074449ff79e40100d96b49
TypeScript
897
23
import { describe, expect, it } from "vitest"; import { isFrameScopedPath, toSchemaField } from "./framePath"; describe("isFrameScopedPath", () => { it("scopes frames.* paths on a real video", () => { expect(isFrameScopedPath("frames.detections", false)).toBe(true); expect(isFrameScopedPath("events", false))...
872c460c52e716bf7aba20b30723e7519499fbb0d91e26d2051f8dd8512e2e52
TypeScript
898
26
/** * What a click on empty plot space clears. * * Layers come off topmost first: a selection (focus), then the legend filter * (scope). A search is exempt — it shares one published slot with the lasso, * so a count cannot tell them apart, but `origin` can, and a prompt that cost * a server encode plus a parquet ...
25a834972053806c2e040915fb556200e16c52eab2b7835fe17c8cb2ccd8b901
TypeScript
901
31
import { useMemo } from "react"; import { LABEL_3D_HOVERED_AND_SELECTED_COLOR, LABEL_3D_HOVERED_COLOR, LABEL_3D_INSTANCE_HOVERED_COLOR, LABEL_3D_SIMILAR_SELECTED_COLOR, } from "../constants"; export const use3dLabelColor = ({ isSelected, isHovered, isSimilarLabelHovered, defaultColor, }: { isSelected...
eaec298cfa961fa7e6de18b23e41775ed35721565ad7a68874a317ca0110f901
TypeScript
903
24
import type { LighterInteractionPolicy } from "@fiftyone/annotation"; import { isGeneratedView } from "@fiftyone/state"; import { useCallback, useMemo, useRef } from "react"; import { useRecoilValue } from "recoil"; /** * The generated-view (patches/clips/frames) interaction ownership: edit mode * is sticky for the ...
95ab27a006a7f5aea1273527b06eb65c95326adae69262cef372d17ff9f4b6ba
TypeScript
905
21
import { Line2 } from "three/examples/jsm/lines/Line2"; import { LineGeometry } from "three/examples/jsm/lines/LineGeometry"; import { LineSegments2 } from "three/examples/jsm/lines/LineSegments2"; import { LineSegmentsGeometry } from "three/examples/jsm/lines/LineSegmentsGeometry"; import { LineMaterial } from "three/...
2ef93f1be220ac04cf94d436a96d267c781f79a0921551ef254043eac8036ff7
TypeScript
906
29
import { viewConversion } from "@fiftyone/state/src/selection/model"; /** Whether navigation changes the entity IDs used by the sample selection. */ export const changesSampleIdentity = ( previous: readonly unknown[], next: readonly unknown[], ) => viewConversion(previous)?.key !== viewConversion(next)?.key; /** ...
2c5febd8f487f93ba004816b83b95c73a53bf04d35bb7eed24739c89da7d95cd
TypeScript
911
34
import { useFeatureCache } from "./useFeatureCache"; import { FeatureFlag } from "../client"; import { useTrackEvent } from "@fiftyone/analytics"; import { useEffect } from "react"; /** * Hook which provides the status of a given feature. * * @param feature Feature identifier * @param enableTracking If enabled, wi...
5d292121d81d76be5dbf9e2acf71dec7a2d41ff273be4bc959edf3220cd6bfec
TypeScript
912
26
import { useTileRegistry } from "@fiftyone/tiling"; import { useEffect } from "react"; import type { TileType } from "../tiles/tile-types"; import { getTileDefinition } from "./tile-catalog"; /** Registers the shell-owned tile catalog for the active episode. */ export function useRegisterTiles(tileTypes: readonly Til...
0fb07f0290e2f17a549cbf67974e48f02aa3dcfb1ce89486cf415f3f71ff30d3
TypeScript
916
27
import { atom, useAtom } from "jotai"; import { atomWithStorage } from "jotai/utils"; import type { SetStateAction } from "react"; import { DEFAULT_SPLAT_SETTINGS, type Fo3dSplatSettings, normalizeSplatSettings, } from "../fo3d/splat/settings"; const storedSplatSettingsAtom = atomWithStorage<unknown>( "fo3d-sp...
a7d29150fe7ebae851cd41d0eb93dd3a0fb357d5128973693465c0f0da39aba6
TypeScript
923
42
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Undoable } from "@fiftyone/commands"; import type { Rect, Spatial } from "../types"; /** * Options for transforming an overlay. */ export interface TransformOverlayOptions { /** New bounds for the overlay */ bounds?: Rect; /** New scale factors */ ...
cd4bd53b531d63d97730a9ea0a4056f906f2a14a9e5e9b1251170ebb5a7e4d27
TypeScript
924
32
/** * Copyright 2017-2026, Voxel51, Inc. */ import { useSessionSetter } from "@fiftyone/state"; import { useCallback } from "react"; import type { LocationState } from "../routing"; import { resolveURL } from "../utils"; import type { EventHandlerHook } from "./registerEvent"; const useSetSpaces: EventHandlerHook =...
85766e85d7e6503088105d5edf41154844b0a016ee2e345407cebd99c3afe335
TypeScript
927
36
import type { Decoder } from "../../../../decoders/index"; import { jsonPoseDecoder } from "./pose"; import { jsonFoxgloveCompressedAudioDecoder } from "./compressed-audio"; import { jsonFoxgloveRawAudioDecoder } from "./raw-audio"; import { jsonRosDecoders } from "./ros"; /** * JSON Pose decoder export. */ export {...
933968b565d8fb41a647d13e4844d9ef742fe1084729b1eedd75d35a1cb3e14f
TypeScript
928
34
/** * Copyright 2017-2026, Voxel51, Inc. */ import { type Session, useSession } from "@fiftyone/state"; import { env } from "@fiftyone/utilities"; import type { MutableRefObject } from "react"; import type { Environment } from "react-relay"; import type { Queries } from "../makeRoutes"; import type { RoutingContext ...
3bcfdef991b339170307d0d8ffe8674ccdf0724da5574e0e89f8fe28043472f1
TypeScript
931
39
/** * Copyright 2017-2026, Voxel51, Inc. */ /** * Interface for overlays that can be selected. */ export interface Selectable { /** * Gets the unique identifier for this selectable overlay. */ readonly id: string; /** * Checks if this overlay is currently selected. * @returns True if the overlay...
0d0786c5bbda32d5ccb1531a4fb2c7908523c49ed1bdaf3e18999a559c0c2774
TypeScript
934
19
export * from "./ActivityToast"; export { default as Checkbox } from "./Common/Checkbox"; export { default as Dataset } from "./Dataset"; export { DatasetGridRendererFailover } from "./DatasetGridRendererFailover"; export { SubsetDetailsContext } from "./Grid/Selection/SubsetDetailsContext"; export { SelectionAssistant...
229035b8b9d4aa85c7226b671a94c24bdc17c03f7cd67f6c667dcc32be2c6408
TypeScript
934
39
/** * Copyright 2017-2026, Voxel51, Inc. */ import { BaseState } from "../../state"; import { BaseElement, Events } from "../base"; import commonControls from "../common/controls.module.css"; export class ImaVidControlsElement< State extends BaseState, > extends BaseElement<State> { getEvents(): Events<State> ...
341ceeb356bbe29ecc048d635b4b30d8d05f70c57b9c82d52f43bcb24c71f53b
TypeScript
938
25
import { useCallback, useRef } from "react"; import type { DemandHandlers, DemandRegistry } from "../demand-bridge"; /** Creates stable demand refs and an idempotent key subscription helper. */ export function useDemandRegistry< THandlers extends DemandHandlers, >(): DemandRegistry<THandlers> { const handlersRef =...
d0b413ba46621c91e5af4c0f5899738f6aca3e07b9b1725e4bb1aa223dbf547c
TypeScript
938
29
import { describe, expect, it } from "vitest"; import { cameraScopeKey } from "./camera-scope"; describe("cameraScopeKey", () => { it("isolates datasets and selected media fields", () => { expect(cameraScopeKey("dataset-a", "mcap")).not.toBe( cameraScopeKey("dataset-a", "alternate_mcap"), ); expect...
2aa9508cd504e15ba49395a8fc33f0bdce69da167d696ff1a9609b8e408bd0dd
TypeScript
944
31
import type { SceneSource } from "../../../ir"; import { findBestMatchingAnnotationStreams } from "../../../stream-selection"; interface ImageLabelSourceGroups { readonly matching: readonly SceneSource[]; readonly remaining: readonly SceneSource[]; } /** Groups annotation sources by semantic source name while ret...
bca215258a95a55e0626a1be455734728c6d0ccd74862e4fcfccb7645593541a
TypeScript
945
25
import { leRobotAdapterDescriptor } from "../adapters/lerobot/descriptor"; import { mcapAdapterDescriptor } from "../adapters/mcap/descriptor"; import { registerFormatAdapter } from "../runtime/adapter-registry"; import { loadLeRobotViewExtensions, registerEpisodeViews, } from "../views/entry"; // Format-specific ...
c9122aeaf017968e2466dd0dc249521c39b4434561bec4bd6df488033638cb6e
TypeScript
948
26
import type { AdapterDescriptor, SampleDescriptor } from "../../ports"; /** The stored reference class a LeRobot episode carries. */ const LEROBOT_EPISODE_REFERENCE = "LeRobotEpisodeReference"; /** Returns whether lightweight sample facts identify a LeRobot episode. */ export function detectLeRobotSample(sample: Samp...
55c4b897eff9ab390eee04a5903fb06ee0d115d0146bdbc1c62e14933a5d9ad0
TypeScript
949
29
import { useCallback, useMemo } from "react"; import { CommandContext } from "../context"; import { resolveContext } from "./utils"; /** * Hook to get a command context by id. * The context is resolved from the fixed stack managed by CommandContextManager. * * TODO: duct-tape — activate/deactivate are no-ops since...
5162f395866373c5e331878e1e8acd42bfa0407ad86455dfc575a15539179a36
TypeScript
951
31
import { describe, expect, it } from "vitest"; import { messagesFromMcapWorkerResult } from "./worker-result-traversal"; describe("MCAP worker result traversal", () => { it("applies the caller predicate across nested result arrays and windows", () => { const decoded = { decoded: { output: {} }, topic: "/camera"...
32cd307e37b4a089ca235a18e99fcbcc2da3df64f34ce0b4e107ff9d1a581eaf
TypeScript
954
29
import { useMemo } from "react"; import type { Box3 } from "three"; import { Vector3 } from "three"; import { useRenderModel } from "../annotation/store/renderModel"; import { DEFAULT_BOUNDING_BOX } from "../constants"; import { useCursorBounds } from "./use-cursor-bounds"; import { useLabelBounds } from "./use-label-b...
93b2e05c1aace52f9d5fcf288d9a4c0b8aeb64174edcd98700a669643bf9daa3
TypeScript
956
32
/** * Coerces string booleans to true booleans. * Note: this happens often in SchemaIO, and ideally would be fixed there. * * @todo: Because it means we do not accept string "true" or "false" as valid values, * it's a temporary fix and we should address this in SchemaIO. * * @param records - The records to sanit...
7f4c026a2ece446d8de2c967d63bd9bef307b4e9077d08bddfda38ef5402cdd2
TypeScript
958
38
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it } from "vitest"; import { matchPath } from "./matchPath"; describe("matches with proxy", () => { const RESULT = { path: "/datasets/:name", url: "/datasets/my-dataset", variables: { name: "my-dataset" }, }; const matchWithPr...
498cf6db9c3c294ed8e6785f86bffb2221cbdcd3aa74fca8cb0f10c4debedaab
TypeScript
959
35
import { getEventBus } from "@fiftyone/events"; import { useEffect } from "react"; /** * e2e specs wait on the schema manager mounting and unmounting, and on a * fields section rendering its field rows */ type SchemaManagerE2EEvents = { "e2e:schema-manager:opened": undefined; "e2e:schema-manager:closed": undefi...