sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
4919f6312dfe57542c00518f3a371f55d9c5fb8e30d60a72d4764316365e39c6
TypeScript
1,224
37
/** * Episode intervals: the shared seam through which anything that holds over a * span of an episode reaches the grid tile's lane and the modal timeline. * * Open source contributes one source (temporal tags). Enterprise concepts — * events, label tags, signals, summaries — register their own and get the tile *...
3c81c808f9f3ecd9b2359efb5957c90f2fd36f77b0f5e87906e3a47779f865d7
TypeScript
1,225
52
import { shouldResolveSelection } from "./utils"; import { it, expect, describe } from "vitest"; describe("shouldResolveSelection", () => { it("returns false when canUseSpatialSelection is true and filters are empty", () => { const view = []; const filters = {}; const patchesField = undefined; const ...
31d853e017f492d6363c91dcf10ce103533fb1c821fb8061de634ac04476aaea
TypeScript
1,229
33
import type { ExtendedSelectionResetParticipant } from "@fiftyone/state"; import { describe, expect, it, vi } from "vitest"; // vi.mock below is hoisted above this import, so the module registers its // participant with the mock at load import { selectionCountState, selectionSampleCountState } from "./state"; const re...
f496614863acf6011a3a9e0d52a7f982ffe80dae737a242b79e20872ac8a90c2
TypeScript
1,232
43
import { createContext } from "react"; import type { SubsetPage } from "@fiftyone/state/src/selection"; interface CachedPage { expires: number; value?: SubsetPage; pending: Promise<SubsetPage>; } /** Short-lived metadata pages, shared by the workspace's subset pickers. */ export class SubsetPages { private re...
3f4e94b02af85092498ea23e33ccee67658cb386a1a0dd096ef01b3f25181682
TypeScript
1,235
32
import { isPatchesView } from "@fiftyone/state"; import { useCallback } from "react"; import { useRecoilValue } from "recoil"; import { useSampleInstance } from "../state"; import type { DeltaSupplier } from "./deltaSupplier"; /** * Hook which provides a {@link DeltaSupplier} for all annotation sources. * * Sidebar...
d33f81228fb58448b39568ac4dc7c67fa709d501f177cc6a24ca32baf1479531
TypeScript
1,236
48
import { describe, expect, it } from "vitest"; import { addRange, removeRange } from "./useSelectSample"; describe("range selection tests", () => { it("adds only the clicked sample when all previous locations were evicted", () => { expect( addRange(20_000, new Set(["old"]), new Map([["new", 20_000]])), ...
36cafb3852991667e9386b0419f3ac4172256830f288251443965595b144960f
TypeScript
1,237
37
import { beforeEach, describe, expect, it, vi } from "vitest"; import { CAMERA_SAVED_EVENT } from "../../constants"; import { saveCameraStateIfMoved } from "../utils"; const { dispatch } = vi.hoisted(() => ({ dispatch: vi.fn() })); vi.mock("@fiftyone/events", () => ({ getEventBus: () => ({ dispatch }), })); const ...
5191989d254857d6dbe2044cf906b21b02d289197ef1a7046d58db39a9f4fb8f
TypeScript
1,240
46
import { getEventBus } from "@fiftyone/events"; import { act, renderHook } from "@testing-library/react"; import { afterEach, describe, expect, it, vi } from "vitest"; import { patchHistoryOnce, URL_CHANGED_EVENT, useUrlSearch, writeUrlSearch, type UrlEvents, } from "./useUrlSearchSubscription"; describe("UR...
ba64ec17c1e2863e6097806fa0f5e5817121131c27c969141a5439c264e51584
TypeScript
1,243
44
import type { CameraFrustumParentPosition, PointCloudFrameTransform, } from "../../../../visualization/scene-3d/types"; /** * Reduces a freshly wrapped transform to the values that affect scene output. * This lets keyed layer decorators survive unrelated source-toggle renders. */ export function frameTransformI...
c52aa3a89d8a39af6f439a86d8e7b0d3afeb1a7474b56de4e5cdc9086028cfb4
TypeScript
1,244
31
import { currentSlice, groupMediaTypesMap, isGroup } from "@fiftyone/state"; import { useSetAtom } from "jotai"; import { useEffect } from "react"; import { useRecoilValue } from "recoil"; import { annotationSliceMediaType } from "./state"; /** * Bridge the media type of the slice currently open in the modal into the...
12cb7b94ce4b470acbdee74260b38bbf5af66468d9c8d2d4d586ce8a61f4bafe
TypeScript
1,245
45
/** * Copyright 2017-2026, Voxel51, Inc. */ import { renderHook } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; let mockIsGenerated = false; vi.mock("@fiftyone/state", () => ({ isGeneratedView: { key: "isGeneratedView" }, })); vi.mock("recoil", () => ({ useRecoi...
f2120dd07698190c767afd6414fb04be32abada91f2db3f6895f30f1f678ef04
TypeScript
1,245
47
import { describe, expect, it } from "vitest"; import { MAP_MARKER_ZOOM, mapPlaybackCameraTarget, mapRouteCameraTarget, } from "./camera"; const routeBounds = { east: 20, north: 10, south: 5, west: 15 }; const trailBounds = { east: 18, north: 8, south: 7, west: 17 }; const marker = { latitude: 7.5, longitude: 17...
4e45efe842e3ecc5435f3194cb46113a7282645d7e9775d0b3afafbbd7ede0fc
TypeScript
1,249
45
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Undoable } from "@fiftyone/commands"; import type { KeypointOverlay } from "../overlay/KeypointOverlay"; /** * Undoable command for adding a single point to a KeypointOverlay. */ export class AddKeypointPointCommand implements Undoable { readonly id: str...
53d10814c470cf75c7e14be0d2e0608d30ce5d17776f50ada7a9510575f0f5df
TypeScript
1,262
32
export * from "./components"; export * from "./engine"; // Seam for the video-annotation surface (which owns the video-coupled // hooks). Explicit re-exports rather than `export * from "./agents"` so the // agents subsystem stays internal and agents' generic `InferenceResult<T>` // wins over the providers' same-named i...
6f71ad1cc7b3eaaa250720a91a1039558db01da4e19b2d7361fbd7fc39ed8160
TypeScript
1,262
44
import { describe, expect, it } from "vitest"; import { hoverMatchesPointFrame, hoverMatchesSceneEntity, type HoverEcho, } from "./hover-echo"; const HOVER: HoverEcho = { color: [1, 0, 0], contentTimeNs: 42n, fields: { intensity: 0.5 }, frameId: "lidar", kind: "point", pointIndex: 7, position: [1,...
d28af7bd0552d87f521bcb29fb6e1edef7b1fbeda16d0a274d1aa58e54bf0bff
TypeScript
1,262
51
import type { Decoder } from "../../../decoders/index"; import { DecoderRegistry } from "../../../decoders/index"; import { foxgloveDecoders } from "./foxglove/index"; import { jsonDecoders } from "./json/index"; import { rosDecoders } from "./ros/index"; /** * Foxglove MCAP decoder exports provided by the MCAP adapt...
8617aa8297ae60244f78273fe12db3bc74aed8b3499ac0c86a5a411f8278478c
TypeScript
1,263
54
/** Focused mp4box surface used by the LeRobot adapter. */ declare module "mp4box" { export interface Sample { cts: number; data?: Uint8Array; description: unknown; dts: number; duration: number; is_sync: boolean; number: number; offset: number; size: number; timescale: number;...
612248672eb08b425f11a513fcade055895f720c7c2b80e058316c5d8084afef
TypeScript
1,265
37
import { Operator, OperatorConfig, types } from "@fiftyone/operators"; import type { ExecutionContext } from "@fiftyone/operators/src/operators"; import type { Property } from "@fiftyone/operators/src/types"; import * as fos from "@fiftyone/state"; import { getBrainKeysFromDataset, useBrainResult } from "./useBrainResu...
489f1d433fafcfd236579f303d7622e6acac1cc0e272c08a4c84148e1dbcdbd6
TypeScript
1,269
36
/** * Copyright 2017-2026, Voxel51, Inc. */ /** * The persist chain per annotation engine. * * Every persist PATCHes a sample under an `If-Match` version token, and the * server rejects a stale token with 412. Persistence has independent callers * — the autosave tick, a delete's immediate flush, the merge tool ...
75ba4cc09a77aee2a073e2814dadecd2aa5d761ae77d04ab46bdfa7bab2fbb66
TypeScript
1,269
49
import { describe, expect, it } from "vitest"; import { DEFAULT_POINT_CLOUD_COLOR, resolvePointCloudColorOptions, } from "./storage"; describe("resolvePointCloudColorOptions", () => { it("resolves defaults and overrides into render-ready colors", () => { const sources = [ { id: "radar", sourceName: "/r...
a9c8f4c7efee3124d94cad4d88c690b6b0be92dee1796011d7f3a6eac4abd157
TypeScript
1,274
50
/** * Copyright 2017-2026, Voxel51, Inc. */ type SelectionSymbol = { description: string; }; export type ThumbnailSelectionModifiers = { shiftKey: boolean; altKey: boolean; ctrlKey: boolean; metaKey: boolean; }; export type ThumbnailSelectionDetail<TSample = unknown> = ThumbnailSelectionModifiers & { ...
f8f86722bcfde10261395aece1b7b1fe1909811fa1d8353b577ee3260072fd79
TypeScript
1,277
54
import { useEffect, useState } from "react"; export interface ImageSize { w: number; h: number; } /** * Resolves the natural (pixel) dimensions of an image URL. Used to size the 2D * overlay's SVG viewBox so normalized label coordinates map to the same * `object-fit: contain` box the <img> is displayed in. * ...
abfa6637404923fd8dbabdbc8aa19d62f2efef83915c39ed4901a8e0253208e0
TypeScript
1,279
37
/** * Copyright 2017-2026, Voxel51, Inc. */ import { useAtomValue, useSetAtom } from "jotai"; import { useEffect, useState } from "react"; import { appCountAtom } from "./model/atoms"; /** * How long a new App count must hold before it is believed. A reload briefly * overlaps the old event stream with its replace...
8d9bb33d2b456ba7b42e5e0d8cc9f72e9c360b70626801ad6c54023304652210
TypeScript
1,281
48
/** * Copyright 2017-2025, Voxel51, Inc. */ import { Action, DelegatingAction } from "./Action"; /** * Provides an undoable unit of execution. * This is used by the ActionManager to support * undo/redo */ export interface Undoable extends Action { undo(): void | Promise<void>; /** Optional human-readable de...
8a1405d1c895435cce2d934aabaa75ca8a468ffaef515b582bd5319e7be0aecf
TypeScript
1,301
45
/** * Copyright 2017-2026, Voxel51, Inc. */ import { useMemo } from "react"; import { CommandDispatcher, getCommandBus } from "../dispatch"; /** * Hook that provides access to the default command bus. * The dispatcher is shared across all components. * * @returns Command dispatcher with register and execute met...
fcc1a64cee7d81fa95ac35d440f92eadc13a6ea19255656150285a37fed0d42b
TypeScript
1,305
37
import { useEffect } from "react"; import { isPointerInTileSelectionRegion, setHoveredTile, tileIdAt, } from "./gridTileRegistry"; /** * Publishes which grid tile the pointer is over, resolved through the tile * registry from delegated events on the Spotlight host. Spotlight owns the * tile elements, so liste...
0fcb74a443707ee8cd6db909236daa8c76dffccdba810de3061ebc4000c9bac9
TypeScript
1,312
42
export { createDefaultMcapReader } from "./default-reader"; export type { CreateMcapBoundedReaderOptions } from "./bounded-read"; export { isMcapBoundedReadCancelledError, McapBoundedReadCancelledError, type McapBoundedReadCancellation, } from "./bounded-read-cancellation"; export { type CreateMcapReaderStoreOp...
1dfaac1402aa9f7850071f9a95ddb8b78c6894c17df4b21165374cd8cc224a53
TypeScript
1,314
40
import { describe, expect, it } from "vitest"; import { resolveFrustumImageStreams } from "./camera-association"; describe("resolveFrustumImageStreams", () => { it("keeps inventory-owned associations without overrides", () => { expect( resolveFrustumImageStreams({ cameraStreams: ["/front/info", "/...
092b1a54f72a252a45eaca7dcf35d1fb9aa1b9f84715f1d1b02b8d080238ba10
TypeScript
1,320
40
import type { McapTypes } from "@mcap/core"; import type { McapIndexedMessageTime, McapIndexedReaderLike } from "./types"; type McapMessage = McapTypes.TypedMcapRecords["Message"]; /** Materializes indexed entries while enforcing the reader's positional contract. */ export async function materializeIndexedEntries( ...
110c12dfba4dcd4221e27aa1394f025d91302fb85ae25aba247b9cd7cb33702b
TypeScript
1,321
47
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it } from "vitest"; import type { DetectionLabel } from "../overlays/detection"; import type { Sample } from "../state"; import { process3DLabels } from "./threed-label-processor"; const schema = { ground_truth: { dbField: "ground_truth",...
8b0e2001a5a98da378ef5d384bcc1f0196e8429024d1586fd7bd08c891c67990
TypeScript
1,323
61
import { LRUCache } from "lru-cache"; const MAX_COLOR_CACHE_SIZE = 1000; export interface ResolveColor { key: string | number; seed: number; color: string; } export default (): [ (pool: string[], seed: number, key: string | number) => Promise<string>, (result: ResolveColor) => void, ] => { const cache = ...
e5ec11a9ad3d28aee02af52816af54d037c75d61a8c6cad6f84b6af4e2ea8bde
TypeScript
1,325
50
/** * Copyright 2017-2026, Voxel51, Inc. */ import { useAnnotationEventHandler } from "@fiftyone/annotation"; import useTrackEvent from "@fiftyone/analytics/src/useTrackEvent"; import { useAnnotationSurface } from "@fiftyone/state"; import { useCallback, useEffect } from "react"; /** * Reports annotation usage: th...
86bd79b9b258eee335b4267d5123b78be9bbe0678d1a8af4f89e1ed0b058c316
TypeScript
1,328
42
import { beforeEach, describe, expect, it, vi } from "vitest"; const spark = vi.hoisted(() => ({ moduleLoads: vi.fn() })); vi.mock("@sparkjsdev/spark", () => { spark.moduleLoads(); return { SparkRenderer: class SparkRenderer {} }; }); beforeEach(() => { vi.resetModules(); spark.moduleLoads.mockClear(); }); ...
37340061b33496e6fb7c0cb56ddd5d464abb5d356d956966388e811078859ef8
TypeScript
1,329
39
/** * Copyright 2017-2026, Voxel51, Inc. */ import { atom, type PrimitiveAtom, useAtomValue, useSetAtom } from "jotai"; import type { ReactElement } from "react"; import { useMemo } from "react"; export type StatusContent = { /** * Live state the user cannot read anywhere else — inference progress, a * chos...
cfdfb1795214258bde13535949cf1b92a48026a3303b8be03df29dee809cac7e
TypeScript
1,335
31
/** * Other panels' selections, as the plot emphasizes them. * * Panels narrow the grid through `fos.extendedSelection` — the Map panel's * lasso writes its polygon AND the sample ids inside it, and any panel can * write ids via the `set_extended_selection` operator. This panel never * writes that atom (its own s...
9d1d551d139a100bc73b8de3f78d495ff3ae1be4ac80be0fce48e84ed7e1003f
TypeScript
1,336
43
import { useSyncExternalStore } from "react"; import { createExtensionRegistry } from "../host/registry"; import type { TimelineExtension } from "./types"; const REGISTRY_KEY = Symbol.for( "@fiftyone/multimodal:timeline-extension-registry", ); const registry = createExtensionRegistry<TimelineExtension>( REGISTRY_K...
b1b9830b8c15b5db8e1490528e27ffef558dc1e92159cb4f08201d7d3eeff524
TypeScript
1,337
46
/** * Pure state + math for the map tile's two-click WGS84 ruler. */ import { haversineDistanceMeters, type GeoPoint } from "./wgs84"; import { nextTwoClickState } from "../../../utils/two-click-state"; export type MapMeasurementPoint = GeoPoint; export interface MapMeasurementState { readonly a: MapMeasurementP...
02933074a5f9ee8ab0e35e110999eb4fc8b13a3c8678d8755c696344fee2fa26
TypeScript
1,339
77
export function detection2DRecord({ classId, id, score, x, y, }: { readonly classId: string; readonly id: string; readonly score: number; readonly x: number; readonly y: number; }) { return { bbox: { center: { position: { x, y }, theta: 0, }, size_x: 20, ...
4395cb2fc9768d0cef42a5b2ef6b82905b787c547446663604803aba3335f85c
TypeScript
1,343
59
import { getFetchFunction } from "@fiftyone/utilities"; import { useEffect, useState } from "react"; /** * Resolves an image URL into a browser-local object URL before passing it to * Three. This keeps frustum textures from depending on cross-origin <img> * cache state when the app and media server are served from ...
8ec9dd4dedf71c1a9704973c16c96530c5b7bb6e98d9694a3d2c03aebb8f186c
TypeScript
1,348
35
/** * The cross-surface GEOMETRY signal: a surface publishes a label's live, * mid-gesture geometry (drag/resize/transform) so observers — the sidebar * position panels — can preview it before the gesture commits. Render-only: * publishing touches no label state; the committed write happens at finalize. * * One t...
ae7d9929f000232569c11e2be97fa1df4ea31fdab98ddf64bd1c9ff74f0e4c86
TypeScript
1,350
56
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { AnnotationLabel } from "@fiftyone/state"; import { atom } from "jotai"; import { splitAtom } from "jotai/utils"; import { byLabelName } from "./labelRows"; export const labels = atom<Array<AnnotationLabel>>([]); export const labelAtoms = splitAtom(labels, ({...
2a1a95e7dd06ab9d12f87572906af52e70e57e8af4e180707ef4580c6a5154e2
TypeScript
1,353
37
import type { Decoder } from "../../../../decoders/index"; // Context-only timing helper; nothing protobuf-specific despite its home. import { timingFromContext } from "../foxglove/protobuf/timing"; import { compressedAudioOutput } from "../foxglove/compressed-audio"; import { decodeJsonMediaMessage } from "./decode"; ...
231340d190b956168005568822a4fcbf0b81878960338da1f97be15e55693a7b
TypeScript
1,359
49
import { DetectionLabel } from "@fiftyone/looker"; export const METADATA_FIELDS = [ { name: "Size (bytes)", key: "size_bytes" }, { name: "Type", key: "mime_type" }, { name: "Media type", key: "_media_type" }, { name: "Dimensions", value: (metadata) => { if (!isNaN(metadata.width) && !isNaN(metada...
219d065cc6e5ec773a819fe83d51d6f62c31f0bd45edd2cf2a6ac7e2e790923f
TypeScript
1,366
42
/** Resolves a raw cloud-storage path into a browser-readable URL. */ export type McapCloudSourceResolver = (cloudPath: string) => Promise<string>; interface McapCloudSourceResolverState { resolver: McapCloudSourceResolver | null; } const REGISTRY_KEY = Symbol.for( "@fiftyone/multimodal:mcap-cloud-source-resolver...
c41292b00a5d79afaffa0f7da136ffcb7386fe451a183ef65d0e435fe5096c2f
TypeScript
1,367
50
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Session } from "@fiftyone/state"; import { snakeCase } from "lodash"; import { type MutableRefObject, useCallback, useMemo } from "react"; import type { Queries } from "../makeRoutes"; import type { RoutingContext } from "../routing"; import { type AppReadySt...
d3e7805d53d1e2205fb5b75b529bbb91d2e4928dce9f53f603026a66c98f3ae7
TypeScript
1,368
37
export const CLIPS_VIEWS = "https://docs.voxel51.com/user_guide/app.html#app-video-clips"; export const COLOR_SCHEME = "https://docs.voxel51.com/user_guide/app.html#app-color-schemes"; export const EVALUATION_PATCHES = "https://docs.voxel51.com/user_guide/app.html#app-evaluation-patches"; export const FRAME_FI...
026800a1276d287a4709d585aa7ec8665f461fd0d6908dbd24a149d14e370b23
TypeScript
1,370
52
declare module "@miris-inc/three" { import { Object3D, Scene as ThreeScene } from "three"; export class Miris { static instance(): Promise<Miris>; } export class MirisScene extends ThreeScene { constructor(init?: { miris?: Miris; viewerKey?: string | null }); viewerKey: string | null; readonly...
d6165d983864523994b977efd2e3b86c3f2330f1432551ef703b7f7af97ba9d8
TypeScript
1,370
53
import { atom, useAtom } from "jotai"; import { useMemo } from "react"; import { useIsPrimitiveField } from "../SchemaManager/hooks"; // the path of the primitive that is currently being edited export const activePrimitiveAtom = atom<string | null>(null); export const useActivePrimitive = () => { return useAtom(act...
edd13d0d06a48989c1b64e2b26e36d4f65f182a39a39a8a716d3105654a534e4
TypeScript
1,378
41
import type { TimeWindow } from "../ir"; import { createKeyedExternalStore } from "./keyed-external-store"; // Every hover session's first frame and every modal open republishes the same // extent as a fresh object, so ranges are compared by value rather than woken // through to every reader. const ranges = createKeye...
cebd67895c84bfa4a4717de1ef71a386038833cba20a7639fc5bdc10b7c7d2ad
TypeScript
1,383
41
/** * Keypoint node checklist row actions: which single button a row of * `KeypointDetails` offers, given the node's status and whether keypoint * placement mode is armed. */ /** * A skeleton node's state in the checklist: `placed` (finite point), * `target` (the node the next guided click places), `skipped` (th...
10a993c83651c81d7fac20259ef2550f2f25348a04f78d976ef533736b7f7e4b
TypeScript
1,384
53
/** * Copyright 2017-2026, Voxel51, Inc. */ export interface MaskBounds { minX: number; minY: number; maxX: number; maxY: number; } /** * Computes the tight axis-aligned bounding box of opaque pixels in an * `ImageData`. A pixel is "opaque" if its alpha byte is non-zero. * * Used to crop the editing can...
dc7250cc714c0e3e43a71ef7c5f9ab4be7fa65458ddce8b9e9f98ada9ed6f26d
TypeScript
1,385
44
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it } from "vitest"; import { framePrimitiveReadOnlyReason } from "./useFramePrimitive"; describe("framePrimitiveReadOnlyReason", () => { it("a video's frame_number is read-only", () => { expect( framePrimitiveReadOnlyReason("frames.f...
b7cd9a026122d0472f741f14a179057a08af6ebe0152d3af6b18f8371ef32482
TypeScript
1,391
47
/** * Copyright 2017-2026, Voxel51, Inc. */ /** * Creates a 2D canvas suited for mask painting and pixel-level read-back. * * The context is configured with `willReadFrequently: true` so repeated * `getImageData` calls (used by hit-testing and `paintEnd`'s threshold pass) * stay on the CPU rather than incurring...
b283786197307198c9ee05451f0f6d284ae1871f19af36617d1e6413a507504f
TypeScript
1,393
57
import { createByteBoundedCache, decodedOutputSizeBytes, type MemoryCacheOptions, serializeCacheKey, setByteBoundedEntry, } from "../cache-utils"; import { byteSourceCacheKey } from "../bytes"; import { payloadDescriptorKey } from "../../decoders/registry"; import type { DecodedOutputCache, DecodedOutputC...
aa402529019b9ea08dcb6a0613a849347e734ec0f5c642e7b1e38108996625cc
TypeScript
1,399
33
/** One byte range a prefetch pass should warm. */ export interface McapPrefetchByteRange { readonly length: bigint; readonly offset: bigint; } /** Log-time window prefetch request for an upcoming indexed read. */ export interface McapPrefetchWindowRequest { /** Inclusive maximum log timestamp, in nanoseconds. *...
406a3c1d3b1bd11753a1ff83a97367910daa7df07bac9f5269598d3bcd57e66c
TypeScript
1,404
34
import { getBasename, resolveParent } from "@fiftyone/utilities"; import { FileObjectType, FileSystemObjectType } from "./types"; export function getNameFromPath(path: string) { return getBasename(path); } export function computeFileObject(path: string, chooseMode: string) { const sanitizedCustomPath = path.trim(...
6494322bf73c7ee2102fe934f1674e345baa1fd33ec850158b9affd5e1175ea4
TypeScript
1,406
56
/** * Copyright 2017-2026, Voxel51, Inc. * * Shared looker actions used by both Looker (image/video) and Lighter (e.g. annotate mode). * Import from here when you need readActions or the common control definitions (json, resetZoom, selectSample). */ import type { BaseState, Control, ControlMap } from "../state"; ...
61a8a2d6a489b47a10e395a7d2aa5107f4b70ab450a83d23568dd053cbd11860
TypeScript
1,407
54
import type { PayloadDescriptor } from "../ir"; import type { Decoder } from "./types"; /** * Stable string key for one encoded payload descriptor. */ export function payloadDescriptorKey(payload: PayloadDescriptor): string { return JSON.stringify([ payload.encoding, payload.schemaEncoding ?? null, pay...
0d1dee508dc7977660fed0c04fb5d3d958a4c7e960d639a1afa054203e8a3d1d
TypeScript
1,412
39
import { describe, expect, it } from "vitest"; import { MISSING_CATEGORY } from "./colors"; import { legendCounts } from "./legendCounts"; // Points: cat, dog, cat, missing, dog, cat const COLUMN = new Uint16Array([0, 1, 0, MISSING_CATEGORY, 1, 0]); describe("legendCounts", () => { it("returns null when there is no...
23b3c187c7c7f1bde1c6e190697773d7c9439db8999b1bd7ccb4eda68d0ade00
TypeScript
1,412
56
import type { ReconciledDetection3D, ReconciledPolyline3D } from "../types"; /** * Precision for numeric rounding to avoid noisy diffs. */ export const PRECISION = 6; /** * Rounds a number to PRECISION decimal places. */ export const round = (n: number): number => Math.round(n * 1e6) / 1e6; /** * Rounds a tuple...
fa40c949733beff2384ff8a327c562807a0af1cfae6c1cd4ca6d5ce678047372
TypeScript
1,412
42
import * as fos from "@fiftyone/state"; import type { RecoilValue } from "recoil"; import { useRecoilValue, useRecoilValueLoadable } from "recoil"; import { isBooleanField } from "../state"; import { CHECKBOX_LIMIT } from "../utils"; import type { Result } from "./Result"; import useUseSearch from "./useUseSearch"; ex...
f13b76b3f10dd3bf0c07368e3325637423ce261212e255e5f3826e1add2e37d4
TypeScript
1,426
40
import { describe, expect, it, vi } from "vitest"; import { SubsetPages } from "./subsetPages"; const page = { subsets: [], total: 0, count: 0 }; describe("subset metadata pages", () => { it("shares pending requests and reuses metadata until the revision changes", async () => { const cache = new SubsetPages(); ...
9ba7375fb32cce7f50e5ca14c268f5105eac2b40f4a341932a1dbd73a521c4fb
TypeScript
1,428
52
import type { McapIndexedReaderLike } from "../../reader/index"; import type { McapReadTopicTimeBoundsRequest, McapTopicTimeBounds, } from "../../contracts/index"; /** * Resolves per-topic first/last message times from summary indexes. * * Auxiliary data for status decoration — never playback-blocking: a * rea...
351cb6c6cd48bd6ce6c3482fe120f94c7e14d2fd0decd0ad17c966f318fe62cc
TypeScript
1,429
54
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Setter } from "@fiftyone/relay"; import { type Session, snackbarErrors, stateSubscription, useSessionSetter, } from "@fiftyone/state"; import { type MutableRefObject, useMemo } from "react"; import type { Environment } from "react-relay"; import { use...
fe0ada8e83bdc993229279a5d9e01f917c1bfb9a52238db80c7568c5b2aa68c0
TypeScript
1,429
48
import type { AnnotationEngine } from "@fiftyone/annotation"; import { describeEntry } from "@fiftyone/annotation"; import type { CommandContext } from "@fiftyone/commands"; import { DelegatingUndoable } from "@fiftyone/commands"; export interface EngineUndoableBinding { engine: AnnotationEngine; context: CommandC...
3b4dd130159cd837ffd1c16ab6b36b6e721b5b6ea99972e163c15874678adcb0
TypeScript
1,438
54
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { AnnotationEventGroup } from "@fiftyone/annotation"; import type { Undoable } from "@fiftyone/commands"; import type { EventDispatcher } from "@fiftyone/events"; import type { BaseOverlay } from "../overlay/BaseOverlay"; import type { RawLookerLabel } from ".....
8d41b9271b37cb7af8a45c2d9d4851213d2286bb01c725e1cfc698529c2f6bb5
TypeScript
1,438
53
import { describe, expect, it, vi } from "vitest"; import { VISUALIZATION_KIND } from "../visualization"; import { DecoderRegistry, payloadDescriptorKey } from "./registry"; import type { Decoder } from "./types"; describe("DecoderRegistry", () => { it("registers and finds runtime decoders", () => { const decode...
8008c568f7b4a2f9865546d4ed102f7a8252f128448ade479117f6a89847b97c
TypeScript
1,439
61
/** * Copyright 2017-2026, Voxel51, Inc. */ export const createScrollReader = ( element: HTMLElement, horizontal: boolean, render: (zooming: boolean) => void, getScrollSpeendThreshold: () => number, ): void => { let zooming = false; let scrolling = false; let prior = 0; let timer = undefined; elem...
e0ad77f0cae7a504fff92a0487f18b7c15c26469f53a54883309d53dcb5821f5
TypeScript
1,439
37
import { getLabelColor, type CustomizeColor, type LabelTagColor, } from "@fiftyone/looker"; import * as fos from "@fiftyone/state"; import { useCallback } from "react"; import type { Native2dLabel } from "./types"; /** * Returns a resolver that colors a stored 2D label using the app's color scheme * (color-by-...
fa9cbd347267546d99d3675996e7c6399ee9d48a1dc36c57fdddc3bcfeba47e7
TypeScript
1,439
48
/** * Copyright 2017-2026, Voxel51, Inc. */ import { subscribeBefore } from "@fiftyone/relay"; import { useSessionRef, useSessionSetter } from "@fiftyone/state"; import { useRecoilCallback } from "recoil"; import { pendingEntry } from "../Renderer"; import { useRouterContext } from "../routing"; import { resolveURL ...
453cf40a276e7564e56c54d56e3e25e27f26f98d4e1cb7e6b07c7438253967cd
TypeScript
1,449
40
import type { AdapterDescriptor, SampleDescriptor } from "../../../ports"; import { findFormatAdapterDescriptor, loadFormatAdapter, } from "../../../runtime/adapter-registry"; let modalModule: Promise<typeof import("./ModalRenderer")> | null = null; /** Shares speculative and on-demand module loading, retrying fa...
16de1491f67d015e5252920775dc2d44bd155379d3d291c3d33639f3285d038b
TypeScript
1,450
61
import { AbstractLooker } from "./abstract"; import { BaseConfig, BaseOptions, BaseState, DEFAULT_BASE_OPTIONS, } from "../state"; import { COMMON_SHORTCUTS, LookerElement } from "../elements/common"; import { Overlay } from "../overlays/base"; import { getMetadataElements } from "../elements"; /** * Looker w...
ceb672edbc818618b8a191c219937d1c599cdca43f9ef531bdd82e2d19e631f0
TypeScript
1,452
40
import { describe, expect, it } from "vitest"; import { sidebarEntryTitle } from "./useTitleTemplate"; describe("sidebarEntryTitle", () => { it("drops the prefix a path shares with its group", () => { expect(sidebarEntryTitle("metadata.size_bytes", "metadata")).toBe( "size_bytes", ); expect(sidebar...
7b3c0957b1a9c02c3c6d6ce58e3bcd4851a7b434a597f403a9ecb246056c44ec
TypeScript
1,454
45
import { useMemo } from "react"; import { Vector3 } from "three"; import { staticTransformToMatrix4 } from "../../frustum/builders"; import type { FrustumData } from "../../frustum/types"; import type { PanelId } from "../../types"; import { projectToPixel } from "./geometry"; import type { ProjectedCorner } from "./ty...
35b8012403ad6cb752b419229707e6976160129d2e1925c2329759d949c51911
TypeScript
1,461
45
import { describe, expect, it } from "vitest"; import { backgroundClickAction, type BackgroundClickAction, type WindowOrigin, } from "./backgroundClick"; describe("backgroundClickAction", () => { it.each< [string, number | null, WindowOrigin | null, boolean, BackgroundClickAction] >([ ["a lasso selec...
fe06ca35abff4a2e15b153b5a5c3d53c25b669d136d9cee17fe98b71b5502c3e
TypeScript
1,463
48
/** * Annex B byte-stream framing, shared by the H.264 and HEVC paths: both are * length-prefixed in ISO BMFF and both need in-band parameter sets once a * decoder is configured without an out-of-band description. */ const START_CODE_LENGTH = 4; /** Frames raw NAL units — a container's codec record — as one Annex...
c98fe8c1b176abc11b1a55431b2df0f98c83459f1b32c2d5a8b62b142db5209a
TypeScript
1,466
44
/** * Copyright 2017-2026, Voxel51, Inc. */ import { act, renderHook } from "@testing-library/react"; import { describe, expect, it } from "vitest"; import { AgentTaskType } from "../types"; import { useActiveTask } from "./useActiveTask"; describe("useActiveTask", () => { it("initial state: activeTask=null", () ...
6f53da33f1ccb4f6bf67a8040683cc934aac9281dda51bccdc76704254ab1eac
TypeScript
1,471
48
/** * Copyright 2017-2025, Voxel51, Inc. */ import { useCallback, useEffect, useState } from "react"; import { CommandContext } from "../context"; import { useCommandContext } from "./useCommandContext"; /** * Hook to access undo and redo. Provides undo/redo methods and the * undo/redo stack states. The clear me...
9ec999a921e23c42a0612ac2c7744be0e98db66459676d8f353a86af9f136204
TypeScript
1,472
62
import { get3dElements } from "../elements"; import { COMMON_SHORTCUTS } from "../elements/common"; import type { ThreeDState } from "../state"; import { DEFAULT_3D_OPTIONS } from "../state"; import { AbstractLooker } from "./abstract"; import { LookerUtils } from "./shared"; export class ThreeDLooker extends Abstract...
794b8d8273e79737061285494bfbb19e02859656063b812dbe8e51f8b03d619d
TypeScript
1,479
45
import { describe, expect, it } from "vitest"; import { parseDatabaseValue, serializeFieldValue } from "./serialization"; // an arbitrary instant: 2026-07-22T00:30:00Z const INSTANT_MS = Date.UTC(2026, 6, 22, 0, 30); describe("parseDatabaseValue", () => { it("converts database date wrappers to ISO instant strings",...
1769059940d6eb8503e6d3ccd398871283e51d4393ae4daeef6a5557ebc9935e
TypeScript
1,481
38
import { useSetCurrent3dAnnotationMode } from "@fiftyone/looker-3d/src/state/accessors"; import { useCallback } from "react"; import { useClassificationMode } from "./Edit/useClassificationMode"; import { useDetectionMode } from "./Edit/useDetectionMode"; import { useKeypointMode } from "./Edit/useKeypointMode"; import...
3ea6d4baafb18e97d07ee4eec4357b51826d8337658f25f6f4cfaca67f31861f
TypeScript
1,485
39
import { LRUCache } from "lru-cache"; import { describe, expect, it, vi } from "vitest"; import { memoizedRead } from "./memoized-read"; describe("memoized read", () => { it("shares hits and retries a rejected load", async () => { const cache = new LRUCache<string, Promise<number>>({ max: 2 }); const load = ...
94c9d20032f86f1fd412a1aa077247c10d4cd025f0ee2f2f657c5c0f927480ad
TypeScript
1,493
53
/** Returns the smaller of two bigint values. */ export function minBigIntPair(left: bigint, right: bigint): bigint { return left < right ? left : right; } /** Returns the larger of two bigint values. */ export function maxBigIntPair(left: bigint, right: bigint): bigint { return left > right ? left : right; } /**...
dfc4ff44eec9e5def5cd6b693fcece55369c46f9afb82b2ca73972cb79e25a3c
TypeScript
1,493
47
/** * Copyright 2017-2026, Voxel51, Inc. */ import { subscribe } from "@fiftyone/relay"; import * as fos from "@fiftyone/state"; import { useCallback } from "react"; import { resolveURL } from "../utils"; import type { EventHandlerHook } from "./registerEvent"; import { processState } from "./utils"; /** * Handles...
3d7c736188fb8431ebfa49e236226362b5c6ac189a240ed54d82b5bd78f6c04b
TypeScript
1,494
60
import { describe, expect, it } from "vitest"; import { interpolateKeypointNodes } from "./KeypointPropagationBrowserAgent"; const HOLE: [number, number] = [NaN, NaN]; describe("interpolateKeypointNodes", () => { it("lerps each node linearly", () => { const result = interpolateKeypointNodes( [ [0,...
5a70777dc2efee0f7a5d194e9b0ce8ad18cf39b2e27de9c2dc02e0820e9020ea
TypeScript
1,503
50
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { AnnotationEngine } from "@fiftyone/annotation"; import { useIsPatchesView } from "@fiftyone/state"; import { useCallback, useRef } from "react"; import { SINGULAR } from "./labelRows"; import { useSetEntranceLabel } from "./useAnnotationContextManager"; /** ...
5e83a1578b4b71aca197931c1c8feae86e7a02a77b89092334b3adc0aa9b3aac
TypeScript
1,506
48
import { CachedLabels, LookerId } from "./useShouldReloadSample"; /** * Synchronizes which label fields a given looker has seen so far. Returns any * new (not-yet-cached) fields as an array, or null if there are no new fields. * * @param lookerId - unique Looker ID * @param lut - look-up table tracking which fiel...
e237752ac9c814ecf3414be6454de07e6ac620f00f4261648bd32133122b1e37
TypeScript
1,506
44
import type { DecodedOutput, DecodedSourceTimestamps, PayloadDescriptor, PointCloudRenderChannelPayload, } from "../ir"; /** Runtime context passed to payload decoders by format adapters. */ export interface DecodeContext { /** Active point-cloud color source requested by the presentation layer. */ readonl...
644432902b2f5a2df7d8510c7510c99ccdf3d4ad00493a38c7562626d9e22487
TypeScript
1,509
49
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Dimensions, Rect } from "@fiftyone/lighter"; /** * Converts normalized [0,1] bounding box coordinates to pixel coordinates * relative to the original image dimensions. * * This is the correct coordinate space for display in the sidebar — values * match ...
cbc41d22d2fe6dd08275fa9224c4a21c443c0e61c3f77b04bf3134f8d4fdbe96
TypeScript
1,509
39
/** * Closes an open header menu on an outside click or Escape. */ import { useEffect, type RefObject } from "react"; export function useMenuDismiss( open: boolean, rootRef: RefObject<HTMLElement | null>, onDismiss: () => void, ) { useEffect(() => { if (!open) return undefined; const onDown = (e: Eve...
c0430cc24ec8fce2b83121dd78f440c22cf6d4225ab7c60a278b65e29ff9de55
TypeScript
1,510
41
import { SCENE_SOURCE_TYPE, STREAM_SYNC_MODE, type SceneSourceType, type StreamSyncPolicies, type StreamSyncPolicy, } from "../ir"; import type { SceneSource } from "../ir"; const LATEST_POLICY: StreamSyncPolicy = { mode: STREAM_SYNC_MODE.LATEST }; // Total by construction: every scene source type resolves ...
452093dafaf99362948674937937a7a9ee58e94e342fef41f686e345d0b82591
TypeScript
1,513
44
import type { McapTypes } from "@mcap/core"; import * as mcapSupport from "@mcap/support"; import type { Root } from "protobufjs"; // @mcap/support@1.1.0 exports these at runtime, but its declaration barrel // re-exports .ts paths from dist. Keep the typing workaround at this boundary. const typedMcapSupport = mcapSup...
55a6e2b5191afa1f2fea9c9f63f836177b92f60f33f2571432433788018a8359
TypeScript
1,518
57
import { beforeEach, describe, expect, it, vi } from "vitest"; import { Command } from "./command"; let execFn: () => void; beforeEach(() => { execFn = vi.fn(() => { return; }); }); describe("Command", () => { it("can execute", async () => { const cmd = new Command("fo.test.cmd", execFn, () => { ...
8428e206f211e35ea3b8249bfdb81b7131050411220f42886bc4a2485dde307e
TypeScript
1,519
61
import { getFetchFunction } from "@fiftyone/utilities"; import type { TreeNode } from "@voxel51/voodo"; import { useEffect, useState } from "react"; interface TaxonomyResponse { taxonomy: { name: string; type: string; version: number; root: TreeNode; }; } export interface UseTaxonomyTreeResult { ...
02bcb55ba508d979fad854467975138633be6e04dd16179755893506523f134f
TypeScript
1,520
51
import { getPlayhead, subscribePlayhead, usePlaybackStore, } from "@fiftyone/playback"; import { useCallback, useEffect, useState } from "react"; import { type DataStream, useDataStream } from "./data-stream-context"; /** * Current episode timeline tick, in nanoseconds, nearest to the playback playhead. */ exp...
86f123add21bf0c47b8f23b3bd56502f87062fad7e32301a90ebec5eac4a12a9
TypeScript
1,521
38
import { describe, expect, it } from "vitest"; import { getDateTimeRangeFormattersWithPrecision } from "./generic"; describe("getDateTimeRangeFormattersWithPrecision", () => { it("returns common formatter with date and diff formatter with time when dates are on same day", () => { const d1 = new Date("2024-03-10T...
2e11a46e27c663e4f2015aae8f2938d17b8dbaebb0622cc7afd6b6135b10817c
TypeScript
1,523
38
/** * The filter-atom path for the color-by field, in the vocabulary the * grid's CURRENT view understands. * * The App names the same data differently by view: from the root * dataset a patch attribute is `<field>.<list>.<leaf>` * (`ground_truth.detections.label`), but in a patches view each * document IS one p...
98a34946e446a3a8e60c1c4085d095efe3c8aa1f1090e4b768a3ae7011cf782f
TypeScript
1,524
70
interface DebouncedNavigatorOptions { isNavigationIllegalWhen: () => boolean; navigateFn: (offset: number) => Promise<void>; onNavigationStart: () => void; debounceTime?: number; } export function createDebouncedNavigator({ isNavigationIllegalWhen, navigateFn, onNavigationStart, debounceTime = 100, }: ...
478e9062c73b08aec1f1827f5b922e620468570c6bf43132439fa9a50e79ee0b
TypeScript
1,525
47
/** * Copyright 2017-2026, Voxel51, Inc. */ /** What a pointer-down should do to the selection. */ export type SelectionClickAction = "toggle" | "select" | "none"; export interface SelectionClickInput { /** Whether a selectable overlay is under the pointer at all. */ isSelectableOverlay: boolean; /** Whether ...
ea6ab05d1c268f3b1c2e6bf688bf03380ea8ac1b10b6f8ca179d57605ad6cfbc
TypeScript
1,525
53
import codeIcon from "../../icons/code.svg"; import documentIcon from "../../icons/document.svg"; import findInPageIcon from "../../icons/findInPage.svg"; import tableViewIcon from "../../icons/tableView.svg"; import terminalIcon from "../../icons/terminal.svg"; import { humanReadableBytes } from "@fiftyone/utilities";...