sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
856527ff9d670bd45410b71dec492e8d40581c8ad381d58a3b49014a081e6624
TypeScript
432
10
export * from "./useAnnotationEventBus"; export * from "./useAnnotationEventHandler"; export * from "./useAnnotationController"; export * from "./useDeleteAnnotation"; export * from "./useDeleteTrack"; export * from "./useGetVersionToken"; export * from "./usePatchSample"; export * from "./useRegisterAnnotationEventHan...
be3b87ffa7b97c1254cfd7520317527f819a9c166a97490f901e1b1d6cb5a9b4
TypeScript
432
16
/// <reference types="vite/client" /> interface ImportMetaEnv { readonly VITE_AUTH0_AUDIENCE: string; readonly VITE_AUTH0_CLIENT_ID: string; readonly VITE_AUTH0_DOMAIN: string; readonly VITE_AUTH0_; readonly VITE_API?: string; readonly VITE_HAS_UPDATES: boolean; readonly VITE_DEV_WORKTREE_NAME?: string; ...
186693c8309cbee1ce27fb7f728f7996a4af977641d708f6c5277841f39b9146
TypeScript
434
11
import { useRegisterAnnotationToolEventHandlers } from "./useRegisterAnnotationToolEventHandlers"; /** * Hook which registers event handlers for AI-assisted annotation functionality. * * **Note: this hook must only be invoked in a single top-level component; * reuse will cause duplicate event handler registration....
23c87399c770ffa328911cc62a11cda4ff8d1ae36cccfc5ae66a7407599283c1
TypeScript
440
18
/** * Copyright 2017-2026, Voxel51, Inc. */ import { useCallback } from "react"; import { useSetAppCount } from "../sharedSession/hooks"; import type { EventHandlerHook } from "./registerEvent"; const useAppCountUpdate: EventHandlerHook = () => { const setAppCount = useSetAppCount(); return useCallback( (p...
3bdfbf6edbef841552d7fd52452cf888c9c53e900cce6017c58dd566e58704df
TypeScript
440
22
import { UserConfig } from "vite"; import inject from "@rollup/plugin-inject"; export default <UserConfig>{ esbuild: true, build: { lib: { entry: "src/index.ts", formats: ["es"], }, rollupOptions: { plugins: [inject({ Buffer: ["Buffer", "Buffer"] })], }, target: "es2015", ...
c7eb39a18c6df6c1bc4c45ec1e38814a05ed50c95ad02bf347ece562e0efa2a3
TypeScript
440
17
import { snackbarErrors } from "@fiftyone/state"; import { useCallback } from "react"; import { useSetRecoilState } from "recoil"; export default function useTimeout() { const setErrors = useSetRecoilState(snackbarErrors); return useCallback( (queryTime: number) => { setErrors([ `Grid request tim...
8d0bfd9c934f8f2e211f3664067fb5df666fe249c16d2c4f6d08157233d43697
TypeScript
446
14
/** * Create a FIFO async task queue. The returned `enqueue` runs tasks strictly * one at a time in submission order; a task's failure rejects its own caller * but never blocks later tasks. */ export const createTaskQueue = () => { let tail: Promise<unknown> = Promise.resolve(); return <T>(task: () => Promise<...
972fb5d686ca9d891531c0593e42615797db0e84c9d6d311f8933b76efce6c0e
TypeScript
450
20
export function positiveIntegerOption({ context, defaultValue, name, value, }: { readonly context: string; readonly defaultValue: number; readonly name: string; readonly value: number | undefined; }): number { if (value === undefined) { return defaultValue; } if (Number.isFinite(value) && Numb...
b6af8a4b12a5ec5e8116e6f4359e3975a3deaca25892213b5913517019f9e0c7
TypeScript
451
16
export { getGridPosterProvider, registerGridPosterProvider, useGridPosterProvider, } from "./registry"; export { filterDefaultStreamEquivalents } from "../../stream-selection"; export type { GridPosterCameraPose, GridPosterMediaKind, GridPosterProvider, GridPosterProviderDescriptor, GridPosterProviderMe...
51b31d1375a750cf2bc457e193bf83c4c239ff1140f7460e34fd82ec4abe2afd
TypeScript
452
15
export { useTileMediaEpisode, useTileMediaSurfaces } from "./media-surfaces"; export type { TileMediaEpisode, TileMediaRect, TileMediaSurface, TileMediaSurfaceSource, } from "./media-surfaces"; export { registerEpisodeTileExtension } from "./registry"; export { useEpisodeTileExtensionSettings } from "./settings...
0e45f07a124e589d830d897c7936e885fc2ac603cb170a8b092074f69ef6d922
TypeScript
455
15
import { colorScheme, colorSeed } from "@fiftyone/state"; import { useMemo } from "react"; import { useRecoilValue } from "recoil"; export default function useColorMappingContext() { const currentColorScheme = useRecoilValue(colorScheme); const currentColorSeed = useRecoilValue(colorSeed); return useMemo( ()...
fb07e6bc173059722a508fd57e4a5cf3bbe94adb059b1d08aa898a6da9b2be97
TypeScript
455
21
import path from "path"; import { UserConfig } from "vite"; export default <UserConfig>{ esbuild: true, build: { lib: { entry: path.resolve(__dirname, "lib/main.js"), name: "@fiftyone/components", fileName: (format) => `components.${format}.js`, }, }, rollupOptions: { external: ["...
95d5024c95fd39595b5d05c0578f3ee5092eecceb2ae641a592a220dcd987be5
TypeScript
460
19
import { KnownContexts, useKeyBindings } from "@fiftyone/commands"; import { useLighter } from "@fiftyone/lighter"; export const useRegisterAnnotationKeybindings = () => { const { scene } = useLighter(); useKeyBindings( KnownContexts.ModalAnnotate, [ { commandId: "lighter-reset-zoom-pan", ...
f1381a037ae37ff2966c709358b3ff4a1535cc7d5bdaa3e1a36415c5d0955a76
TypeScript
461
14
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it } from "vitest"; import { isSystemReadOnlyField } from "./constants"; describe("isSystemReadOnlyField", () => { it("treats a video frame's number as a system field", () => { expect(isSystemReadOnlyField("frames.frame_number")).toBe(true...
0915e46aaf2fccd582516aed6f4a71d05c27cc47360ce5a0e8075c5dac950e17
TypeScript
463
8
export * from "./geometry"; export { Projected3dOverlays } from "./Projected3dOverlays"; export { ProjectedCuboidItem } from "./ProjectedCuboidItem"; export { ProjectedPointOverlay } from "./ProjectedPointOverlay"; export { ProjectedPolylineItem } from "./ProjectedPolylineItem"; export { useProjected3dPoint } from "./u...
4ac1c87b1363c661e979c05297adf9b10bc324404dae44a1f8279006391ebf53
TypeScript
469
15
/** * Converts a `bigint` byte length to a `number`, throwing if the value * exceeds `Number.MAX_SAFE_INTEGER`. Container formats often encode byte * offsets and lengths as `uint64`; larger values would silently corrupt * arithmetic. */ export function safeNumber(value: bigint): number { if (value > BigInt(Numbe...
290c6d8aede5ebef87401faf888d4dec068f1a1b67e24339770c749e8b2d54e3
TypeScript
472
13
/** Compares normalized frame identifiers in stable lexical order. */ export function compareFrameIds(left: string, right: string): number { return left === right ? 0 : left < right ? -1 : 1; } /** Trims, removes empty and duplicate frame identifiers, then sorts them. */ export function uniqueSortedFrameIds( frame...
97a8193992e6ffd7a7a57460fbbc9d2428da604a3e039f8d215c48b39e8bd6dc
TypeScript
473
16
import * as fos from "@fiftyone/state"; import { useRecoilValue } from "recoil"; import * as state from "./state"; export default function useShow(modal: boolean, named: boolean, path: string) { const queryPerformance = useRecoilValue(fos.queryPerformance); const hasBounds = useRecoilValue( state.hasBounds({ ...
9d1bc8d3f3f3a9d225a96c6bd8eb24f0a63d8429cb09b268d7449eb466c70f80
TypeScript
474
27
/** * Types for 3D-to-2D cuboid projection. */ export interface ProjectedEdge { x1: number; y1: number; x2: number; y2: number; } export interface ProjectedCorner { u: number; v: number; z: number; } export interface CuboidProjectionData { edges: ProjectedEdge[]; corners: (ProjectedCorner | null)...
ec29185ca4fbbc108977382d419095eddec39e49cfc5043a2a58030396db3500
TypeScript
479
19
import type { JSONDeltas } from "@fiftyone/core"; /** * Metadata for generated views (patches/clips/frames). * Used to route the patch to the correct label on the source sample. */ export type DeltaMetadata = { labelId?: string; labelPath?: string; }; /** * A function which provides annotation deltas when cal...
4bb0ae2638fefea2e174c03b1a10d21820f5f5905f516fa3679bf2e2a5adb638
TypeScript
481
15
/** * Copyright 2017-2026, Voxel51, Inc. */ import { atom } from "jotai"; /** * The number of App clients connected to the server, as last reported over * the event stream, or `null` while this client is not connected. * * The initial value carries its type rather than `atom<number | null>(null)`: * a bare `nu...
6dfbfffed7e772cb5295e0f63c3f68dbbbab0f10dc7e6a6aecef1663fb09ce3f
TypeScript
481
19
import { useCallback } from "react"; import useZoomSetting from "./useZoomSetting"; const MAX = 14; const MIN = 10; const SCALE_FACTOR = 0.09; export default (id: string) => { const zoom = useZoomSetting(); return useCallback(() => { const width = document.getElementById(id)?.getBoundingClientRect().width; ...
844cc8fb70a6a9327fa039994f727745c2dcae27ed442ffd09638305d75f0df4
TypeScript
486
10
/** Public deterministic format adapter for contract and performance tests. */ export { createFixtureFormatAdapter } from "./fixture-adapter"; export type { FixtureAdapterOptions } from "./fixture-adapter"; /** Reference state/action provider for the capability contract tests. */ export { createFixtureStateActionProvid...
74f2a85942c13a34ecc7e1655e34a8883f33c83bd1f417ae163baf48d0f458bd
TypeScript
491
16
import { describe, expect, it } from "vitest"; import { optionalBigInt } from "./foxglove/protobuf/records"; describe("Foxglove protobuf record coercion", () => { it("treats invalid optional bigint protobuf fields as absent", () => { expect(optionalBigInt({ seconds: "not-a-number" }, "seconds")).toBe( unde...
d02f3aa8754dea561d3a1ac93d1d14f714cb67d8dd109c2cc0dddaff36e6709a
TypeScript
492
24
/** * Response type for an error from the plot API. */ export type PlotErrorResponse = { error: string; stack: string; details?: string; }; /** * Response type for a successful plot API call. */ export type PlotSuccessResponse = { index_size: number; available_count: number; missing_count: number; pa...
32d2d89590dd013568de6336bfe50a1f3e50f3146fcd9d093a214a85b4576eb3
TypeScript
493
20
import { Action } from "./actions"; export function isUndoable(object: object) { return "undo" in object && typeof object.undo === "function"; } /** * Return whether the provided object adheres to the {@link Action} interface. * * @param data Object to check */ export const isAction = (data: unknown): data is A...
3b2d6cc134acba4122350af9352003113329b0a3290910dd32ee563952b599e6
TypeScript
493
14
import type { EncodedVideoPrerollUnit } from "../ir"; import type { EncodedVideoAccessUnit } from "./types"; /** * `unit` carrying `preroll`, the payloads a decoder takes immediately before * its own, with any other field of its frame `frame` overrides. */ export function withPreroll<T extends EncodedVideoAccessUni...
087fe9643773b4695fce1958deddc01f4a220627de1f22fd1bb3ff654fd17236
TypeScript
495
18
export { DataStreamProvider, useDataStream, useSetDataStream, } from "./data-stream-context"; export { useDemandRegistry } from "./demand-registry"; export { createDemandContextProvider, useResetDemandContextOnUnmount, type DemandContextController, type DemandContextHandlers, type DemandContextProviderF...
0c5d9ec03375f140cb385cddafeca7ed5e42c8431a9bf0bac385d75fbb7ead57
TypeScript
500
13
/** * Vite's `?worker&url` suffix: transpiles and bundles the target as a * separate module-format entry and yields its URL, which is what * `AudioWorklet.addModule()` needs. A plain `new URL(…, import.meta.url)` * would hand the raw `.ts` to the browser untranspiled. * * `multimodal` has no `vite-env.d.ts`, so t...
c53b9a536e0cfb19a912e72aa49dca3e5826cbae03860f8abf6b78e44e648723
TypeScript
506
24
/** * Copyright 2017-2026, Voxel51, Inc. */ export function argMin<T>(array: T[]): number { return array .map((x, i): [T, number] => [x, i]) .reduce((r, a) => (a[0] < r[0] ? a : r), [array[0], 0])[1]; } export const getDims = ( horizontal: boolean, element: HTMLElement, ): { width: number; height: num...
21431c8b1d0f7bef32bf4c9a8ef350921040cb1b2cb572c8675bcd9cff348f99
TypeScript
508
10
export { createMaskCanvas } from "./createMaskCanvas"; export { decodeMask } from "./maskDecoding"; export { MaskBitmapCache, maskBitmapCache } from "./maskBitmapCache"; export type { MaskSource } from "./maskBitmapCache"; export { maskSourceOf } from "./maskSource"; export { decodeMaskToRaster } from "./maskRaster"; e...
9b7d6438a058662d94690bd1c7ce76572a52fdb543267db57ab60837670dd767
TypeScript
510
25
import styled from "styled-components"; export const NodeInfoContainer = styled.div` display: flex; flex-direction: column; width: 100%; `; export const NodeInfoHeader = styled.div` display: flex; flex-direction: row; justify-content: space-between; align-items: center; `; export const NodeInfoBody = s...
1b36a3506a20a31d5ba823ae57600ea093fd7602c31c80ae56f7698516cf2b1b
TypeScript
511
18
/** * Worker-backed MCAP resource client facade. */ export { createWorkerMcapResourceClient } from "./worker-client"; /** * Options for creating a worker-backed MCAP resource client. */ export type { CreateWorkerMcapResourceClientOptions } from "./worker-client"; /** * Shared bounded worker pool for MCAP grid pr...
eeb209e4fae7c54dd827229c1d8729017152de816ab3e50a40b63bb3f38d47c1
TypeScript
515
14
/** Opacity for annotations in their normal (idle) state */ export const DEFAULT_OPACITY = 0.7; /** Reduced opacity for annotations when another label is selected */ export const DESELECTED_OPACITY = 0.3; /** Color for when a label is hovered */ export const HOVERED_COLOR = "#ffffff"; /** Default stroke color when a...
f2bda7b5595c9e91163410b0e8a92c1b36451c3208c1fdb4e1078b11900f643b
TypeScript
519
19
/** * Copyright 2017-2026, Voxel51, Inc. */ import { ensureColorScheme, useSessionSetter } from "@fiftyone/state"; import { useCallback } from "react"; import type { EventHandlerHook } from "./registerEvent"; const useSetColorScheme: EventHandlerHook = () => { const setter = useSessionSetter(); return useCallba...
61103ff6e273d57d1b4e4440f6850ae65aaef765685ce46adf523a0bd506eb3d
TypeScript
524
14
import { describe, expect, it } from "vitest"; import { createBufferingIndicator } from "./buffering"; describe("createBufferingIndicator", () => { it("is announced as a buffering status, its icon hidden from screen readers", () => { const indicator = createBufferingIndicator(); expect(indicator.getAttribut...
7bc5f0f3f7d3aa2c5689cf8ef65725a14172e32d1a64287da49df125713ef704
TypeScript
524
19
import { useEffect, useRef } from "react"; const useEventHandler = (target, eventType, handler, useCapture = false) => { const handlerRef = useRef(handler); handlerRef.current = handler; useEffect(() => { if (!target) return undefined; const wrapper = (e) => handlerRef.current(e); target && target....
723e3bd99e7952df2c3f71d6553c675be4e25cc2538144c272b23bb32973018d
TypeScript
528
21
/** * Recoil state atoms for camera frustum visualization. */ import { getBrowserStorageEffectForKey } from "@fiftyone/state/src/recoil/customEffects"; import { atom } from "recoil"; /** * Global toggle for frustum visibility. * When false, no frustums are rendered. * Persisted in browser storage. */ export con...
2179c553ac39eeb398d0f6248ecd92bdb1f58bff9e60b832cec28bdbf70c1948
TypeScript
529
17
import { ColorscaleInput } from "@fiftyone/looker/src/state"; import * as THREE from "three"; import type { PointCloudCrop } from "../../../utils/point-cloud-crop"; export type Gradients = [number, string][]; export type ShaderProps = { colorMap: Readonly<ColorscaleInput["list"]>; min: number; max: number; poi...
0f19319813a6410d1aa54f03a62aad7bc39c47b27dd876b97901965ad290de80
TypeScript
530
17
import { usePrimitiveFieldPaths } from "@fiftyone/state"; import { useAtomValue } from "jotai"; import { activeLabelSchemas } from "./state"; const useSamplePrimitives = (): string[] => { const activeFields = useAtomValue(activeLabelSchemas); // both spaces: a video's `frames.*` primitives list alongside the sampl...
4955ba9d98ba9e51f30e81e54929549146a808762f7b70ad7f29e10a6a3c1310
TypeScript
530
17
import { VISUALIZATION_KIND } from "../../../ir/index"; import type { McapGridPreviewFrame } from "./grid-preview"; export function imageFrame( frame: McapGridPreviewFrame | null, ): Extract<McapGridPreviewFrame, { kind: "image" }> | null { return frame?.kind === "image" ? frame : null; } export function firstIma...
0e66ab9046d7d172eaf824053b966f07483b0f1f095cffc7e99844357857cfb1
TypeScript
539
21
/** * Copyright 2017-2026, Voxel51, Inc. */ import { DEFAULT_SELECTION_STYLE, useSessionSetter } from "@fiftyone/state"; import { useCallback } from "react"; import type { EventHandlerHook } from "./registerEvent"; const useSetSampleSelectionStyle: EventHandlerHook = () => { const setter = useSessionSetter(); ...
4075d7e4c96fff7e6b0b9c43b05f4f37ad46d143e3d9d9637dbe049134f0fc66
TypeScript
539
11
export * from "./client"; export * from "./components"; export { default as useCanAnnotate } from "./components/Modal/Sidebar/Annotate/useCanAnnotate"; export { default as SchemaManagerOutlet } from "./components/SchemaManagerOutlet"; export { useSchemaManagerModal } from "./components/Modal/Sidebar/Annotate/SchemaMana...
287da8dc2d94feb153a30d292d30b70c719a28a72148d622db500266493a812e
TypeScript
548
16
import type React from "react"; /** * One independently registered sidebar tray. * * A tray receives no props. Whether a surface hosts trays at all is the * surface's decision, made where the sidebar is built — so a tray never has to * interpret facts about where it ended up. */ export interface SidebarTrayExten...
975d9ee179288164d0ca42537faaac3b5043df2b837d367399219ffc13f96c42
TypeScript
548
20
import { describe, expect, it } from "vitest"; import HeatmapOverlay from "./overlays/heatmap"; import SegmentationOverlay from "./overlays/segmentation"; import { filter } from "./processOverlays"; const EMPTY = { id: "", tags: [], }; describe("test overlay processing", () => { it("filters heatmap without a m...
96958cf1df7e812be513f2fd06b2ac177c4197d986ec6707b9626d408e1fe644
TypeScript
549
15
/** Basemap choices understood by the neutral map renderer. */ export const MAP_BASE_LAYER = { DEFAULT: "default", NONE: "none", } as const; /** A supported neutral map basemap choice. */ export type MapBaseLayer = (typeof MAP_BASE_LAYER)[keyof typeof MAP_BASE_LAYER]; /** Public OpenFreeMap style used by the defa...
4253589461b22a8fe1c411d49392403d817da743fc40baa53d9d98b17c55ab51
TypeScript
552
19
const BYTES_PER_MEGABYTE = 1024 * 1024; export { BYTE_SOURCE_READ_PROFILE } from "../../ir"; /** * Default in-memory raw byte cache budget. */ export const DEFAULT_BYTE_CACHE_SIZE_BYTES = 128 * BYTES_PER_MEGABYTE; /** * Default block size for local/unknown read-through byte cache fills. */ export const DEFAULT_L...
15cbd4131d54b26cb86c82794cfb582464090561f5dc7d4492a9d16c86b168b4
TypeScript
554
15
import { DETECTION, DETECTIONS } from "@fiftyone/utilities"; /** * Whether `label` is a detection carrying a mask. A selected label's type is * its field's, so a detection in a `Detections` field reads as `Detections`. */ export const isMaskDetection = ( label: { type?: string; data?: unknown } | null | undefined...
362f30895a84b848f0103fd8cf6bc37543602beb7097135a70100d3a6c322dc2
TypeScript
555
23
import type { DecodedResourceHints } from "../ir"; /** * Builds decoded-output resource hints for transferable typed-array payloads. */ export function resourceHintsForArrayBufferViews( ...views: readonly ArrayBufferView[] ): DecodedResourceHints { const transferables = new Set<ArrayBuffer>(); let sizeBytes = ...
933d05c37d1193b31390757c64431017082b8ede886735894d7817e87c225235
TypeScript
558
16
import { describe, expect, it } from "vitest"; import { compareFrameIds, uniqueSortedFrameIds } from "./frame-ids"; describe("frame id utilities", () => { it("normalizes frame ids consistently", () => { expect( uniqueSortedFrameIds([" child ", "", "base", "child", " "]), ).toEqual(["base", "child"]); ...
a9d92cf14be4d3a18d6f0955cef1c6a534a52124632f024097169be7af252413
TypeScript
559
18
export interface RelativeTimeParts { readonly milliseconds: string; readonly negative: boolean; readonly seconds: string; } /** Splits a nanosecond delta into sign, whole seconds, and truncated millis. */ export function relativeTimeParts(deltaNs: bigint): RelativeTimeParts { const negative = deltaNs < 0n; c...
addd1732a9cad69a8e50b483030eb7701d130d1e7a148b3afb3064996d8fe851
TypeScript
559
24
/** * Copyright 2017-2026, Voxel51, Inc. */ import { type State, useSessionSetter } from "@fiftyone/state"; import { toCamelCase } from "@fiftyone/utilities"; import { useCallback } from "react"; import type { EventHandlerHook } from "./registerEvent"; const useSelectLabels: EventHandlerHook = () => { const sette...
09dc0db898b221b431ddff8a8044bdf1ac397f5cf430efe8c363fac53ec7afba
TypeScript
562
16
import type { State } from "@fiftyone/state"; export const toLabelMap = ( labels: State.SelectedLabel[], ): State.SelectedLabelMap => Object.fromEntries(labels.map(({ labelId, ...rest }) => [labelId, rest])); export const hasSetDiff = <T>(a: Set<T>, b: Set<T>) => { return new Set([...a].filter((e) => !b.has(e))...
ef3be57d0242a2893e49ca9ac8767f57f3c0db6a7e9d4513b154304ba6800d83
TypeScript
567
15
/** Default width shared by the loading scaffold and live playback shell. */ export const SIDEBAR_SIZE_PX = 360; /** Keeps settings controls readable while leaving room for the media panes. */ export const SIDEBAR_MIN_WIDTH_PX = 280; /** Maximum width of the resizable settings sidebar. */ export const SIDEBAR_MAX_WIDT...
39023dac4d37ac8c25ff8ea75b51f1a4e1cc81cd6d8980fb801657052ad715c8
TypeScript
573
19
/** * Copyright 2017-2026, Voxel51, Inc. */ import type React from "react"; import type { PreloadedQuery } from "react-relay"; import type { OperationType } from "relay-runtime"; export { default as Renderer } from "../Renderer"; export * from "./RouteDefinition"; export * from "./RouterContext"; export * from "./ma...
7bae42858d694253ad818ff8f1deacc31bbdb9f1b12ad2aaceddc01b6b2b4675
TypeScript
574
23
/** Keeps the first unique, non-empty strings within explicit size bounds. */ export function sanitizeBoundedStringList( raw: readonly unknown[], maxItems: number, maxLength: number, ): readonly string[] { const result: string[] = []; const seen = new Set<string>(); for (const value of raw) { if (result...
1eee09dcb8d4d03298ba5d8951661abdc1f75c7a1ace2de2698889e3568c2d24
TypeScript
575
21
import { describe, expect, it } from "vitest"; import { mapStatusText } from "./MapStatus"; describe("mapStatusText", () => { it("distinguishes incomplete history from actual render decimation", () => { const state = { enabledStreamCount: 1, errorCount: 0, locationStreamCount: 1, readyTr...
538c2ec1983904168b1ea3b8d7b6570e531ec0aaf25a494bd4917d400240236f
TypeScript
578
28
/** * Public decode cache constants. */ export * from "./constants"; /** * Public decode query client factories. */ export { createDecodeClient, inlineDecodeExecutor } from "./client"; /** * Public decoded-output cache factories and key helpers. */ export { createMemoryDecodedOutputCache, decodedOutputCacheKey ...
5a98d5124625bb39f8b13457beff458ff9756f8888b742c2d4c8875969f308bb
TypeScript
578
13
import type { SampleRendererProps } from "@fiftyone/plugins"; /** * All an interval lane needs to identify what it is drawing over. Not * `SampleRendererProps["ctx"]`, so a lane is reachable from tiles that have * no sample renderer; a renderer context satisfies it structurally. */ export interface IntervalTileCon...
f06f8f467e00d70e83c06060bb2ec62c42668fa3088b2bab46a92f4ec03710e0
TypeScript
579
21
/** * Bridge for accessing detection mode state from non-React code. */ import { getDefaultStore } from "jotai"; import { _unsafeDetectionModeActiveAtom } from "./useDetectionMode"; /** * Detection mode bridge for non-React code. * Provides read-only access to detection mode state. */ export const detectionModeB...
6f72af21a1cb1c1cebfaaac3af8802769e2cd243b925e2ebdeb901b21466e389
TypeScript
580
23
// NOTE: CODE FORK import { getFetchFunction } from "@fiftyone/utilities"; import { useCallback } from "react"; import type { FiftyoneSceneRawJson } from "../utils"; /** * Returns a memoized fetcher for loading raw fo3d scene JSON by URL. */ export default () => { const fetcher = useCallback(async (url: string, _...
d0a5d8d9e8a8e116a319e3ddf4b8d9eab4431036d2c242f98a6523624cff5f45
TypeScript
582
23
import { act, renderHook } from "@testing-library/react"; import { describe, expect, it } from "vitest"; import useRecords from "./useRecords"; describe("useRecords", () => { it("return new records when clear string changes", () => { const { result, rerender } = renderHook( (clear: string) => useRecords(cl...
61b5bbd2aba60a79b6372a977468265f94c881a38a7d885f01c58c1d0ae961da
TypeScript
583
10
import { extend } from "@react-three/fiber"; import { LineMaterial } from "three/examples/jsm/lines/LineMaterial"; import { LineSegments2 } from "three/examples/jsm/lines/LineSegments2"; import { LineSegmentsGeometry } from "three/examples/jsm/lines/LineSegmentsGeometry"; // Registers the three.js "fat lines" JSX intr...
3fd2f24e88715a1ee7208f9d3371b155bfff5f48a07819ea209e3c0689455687
TypeScript
588
25
import { SampleDescriptor } from "../types"; import { useMemo } from "react"; import { useCurrentDatasetName, useCurrentSampleId, useModalMediaPath, } from "@fiftyone/state"; /** * Hook which returns a {@link SampleDescriptor} for the active modal media. */ export const useSampleDescriptor = (): SampleDescript...
ac205f7837dd16d62c82ad0b1040e577685b72bdd07b23af5344ad2caa5a0de3
TypeScript
593
24
/** * Copyright 2017-2026, Voxel51, Inc. */ import { useScreenshot } from "@fiftyone/state"; import { useCallback } from "react"; import type { EventHandlerHook } from "./registerEvent"; const useDeactivateNotebookCell: EventHandlerHook = (ctx) => { const screenshot = useScreenshot( new URLSearchParams(window...
fb88d9e56f91b8a93ac11d2fa9ca50fc5d384ff4dc074512a0b49149246294e4
TypeScript
593
15
import { describe, expect, it } from "vitest"; import BoundedMap from "./BoundedMap"; describe("bounded navigation cache", () => { it("bounds visited entries and refreshes entries that are fetched again", () => { const records = new BoundedMap<string, number>(100); for (let i = 0; i < 1_000_000; i++) records...
1449f9c98c06932a0a8bd0f1d14e4df2e8a12fa372396dcc6e3d3a58c1867fc9
TypeScript
616
23
import { afterEach, describe, expect, it, vi } from "vitest"; import { monotonicNowMs } from "./monotonic-time"; describe("monotonicNowMs", () => { afterEach(() => { vi.restoreAllMocks(); vi.unstubAllGlobals(); }); it("uses the current realm's monotonic clock when available", () => { vi.stubGlobal(...
77602594ebce3706da022aeab098fa665199e34392e9581651962bc5daf5c044
TypeScript
616
24
import { LRUCache } from "lru-cache"; import { ImaVidFramesController } from "./controller"; import { ImaVidFrameSamples } from "./ima-vid-frame-samples"; import { PartitionId } from "./types"; /** * Each entry in the cache stores frames for ONE ordered dynamic group. */ export const ImaVidStore = new LRUCache<Parti...
c9827be6c114a485d64c908e90f6ef56c4eeb258c10a8c4418dc81caabcb2b87
TypeScript
616
21
import { getEventBus } from "@fiftyone/events"; import { useEffect } from "react"; import { LINE_WIDTHS_EVENT, type Looker3dE2EEvents } from "../constants"; /** * Dispatches {@link LINE_WIDTHS_EVENT} with the line widths the main panel's * labels render with, once they have committed to the scene */ export const us...
8fa730605ca73afb5219b8dd18cb3af227a6c5c7d5d969555daa47e516086151
TypeScript
624
18
import { v4 as uuidv4 } from "uuid"; /** * Generates a unique source ID for events. * * @param prefix - Optional prefix to add context to the source ID of an event * @returns A unique source ID string in the format: `prefix-uuidv4` or just `uuidv4` if no prefix is provided * * @example * ```typescript * const ...
e1c54917dbde17e58816d348006c13a115b1e31d98f710deb05c39d651a72dba
TypeScript
624
21
import type { SampleRendererProps } from "@fiftyone/plugins"; import { useSampleTemporalTags } from "@fiftyone/state"; import type { TemporalTagFilter, TemporalTagsClient } from "@fiftyone/state"; /** * Loads temporal tags for a sample renderer context. */ export function useSampleRendererTemporalTags( ctx: Sample...
6f234cd0183392767318167155410f7afe05d0647c81ac43d218b240cbad6306
TypeScript
627
20
import { describe, expect, it } from "vitest"; import { prioritizedStreams } from "./playback-policy"; describe("prioritizedStreams", () => { it("deduplicates requested streams without changing their order", () => { expect( prioritizedStreams(["camera", "state", "camera"], undefined), ).toEqual(["came...
218e86af19dd6b74448fb9ef2724368f39233be483b278f982ccbceda0638ecf
TypeScript
634
26
export interface MemoizedReadCache<Value> { delete(key: string): boolean; get(key: string): Promise<Value> | undefined; set(key: string, value: Promise<Value>): unknown; } /** Memoizes one async read and evicts only the same rejected promise. */ export function memoizedRead<Value>( cache: MemoizedReadCache<Val...
4f650dec4e5737988343bef8cb267030f329f0af4bd501d2c99a0f0a14e4581a
TypeScript
637
28
/** * Actions hook for frustum state mutations. */ import { useCallback } from "react"; import { useSetRecoilState } from "recoil"; import { frustumsVisibleAtom } from "../../state"; /** * Actions hook for frustum state mutations. * @returns Object with action functions */ export function useFrustumActions() { ...
4ee735bf3c5cf57f8e381d8b884e7fcdccc52b9e53ae84ab432d970ccb77f432
TypeScript
638
29
/** * Copyright 2017-2026, Voxel51, Inc. */ import { subscribe } from "@fiftyone/relay"; import { hiddenLabels, savedLookerOptions, similaritySorting, } from "@fiftyone/state"; import type { RegisteredSetter } from "./registerSetter"; const onSetSimilarityParameters: RegisteredSetter = ({ router }) => () ...
7935a0cb0a43205e3c7dc24e0dfc165533b48a84dbac21e31a1e0f1e3039e1ae
TypeScript
639
19
/** Stable visual artifact kinds emitted by decoders. */ export const VISUALIZATION_KIND = Object.freeze({ CAMERA_CALIBRATION: "camera-calibration", ENCODED_AUDIO: "encoded-audio", ENCODED_IMAGE: "encoded-image", ENCODED_VIDEO: "encoded-video", GRID: "grid", IMAGE_ANNOTATIONS: "image-annotations", LOCATIO...
253c18db47c1a0e2e969ae6eea9d1719794f3dc69afb1f20152939eb461b5e78
TypeScript
643
27
export default class Aggregation { _cls: string; _nameMap: Map<string, string>; params: object; toJSON(): { _cls: string; kwargs: Array<Array<any>>; } { const _cls = this._cls; const kwargs = []; if (this.params) { for (const [paramName, paramValue] of Object.entries(this.params)) { ...
0be8bd3de05f166497e386d036eb17506667bc7335b14058a76b8c80bb591778
TypeScript
649
21
import { createNetworkTransportMeter, type LaneTransportSnapshot, type NetworkTransportSnapshot, type TransportLane, } from "../../../query/bytes"; /** * Worker lane a transport snapshot came from. Kept structural here so the * resource-client contract can reference it without importing worker internals. */...
2990441743f4cada3328c94d7fbf29b3614d7d44ebdfa23d7dfb8d150467a4d7
TypeScript
652
20
/** * Adds the hovered point source to an image pane's projection inputs without * enabling its full point-cloud overlay. This lets a calibrated pane render a * one-point correspondence marker while keeping ordinary projection settings * and picking unchanged. */ export function projectionStreamsForHover( render...
9eebb24084fc9cdd4d0055c7e24b6fe8124ba42e42ec7f34148145e902b28f33
TypeScript
656
15
export function getSubsetDef(scenario, subset) { const { type, field, subsets_code } = scenario; if (type === "view") { return { type, view: subset }; } else if (type === "sample_field") { return { type: "field", field, value: subset }; } else if (type === "label_attribute" && typeof field === "string")...
6310490ca4f1b0392996b9d59d5ccd284353c5c2a7f9b4143b634a60f475c577
TypeScript
661
29
/** * Camera frustum visualization module. * * Exports components and hooks for rendering camera frustums * in the fo3d viewer for grouped datasets. */ export { Frustum } from "./Frustum"; export { FrustumCollection } from "./FrustumCollection"; export { useFrustumActions, useFrustums } from "./hooks/public"; e...
d1201521ab69d4641522357d8e968bea9405f2c0081f5578ce75c5c0dbdcc086
TypeScript
663
21
// Multimodal viewers use their own right-panel tabs (Inspect/Fields) and // don't populate the classic sidebar's projection/aggregation data, so // mounting it here would only fire redundant queries. export const shouldShowClassicSidebar = ( isSidebarVisible: boolean, isMultimodal: boolean, ): boolean => isSidebar...
29f529a8b8de3e4bc7072427a117b47fc74376bdf70fae2a42c5ccdccb682a0c
TypeScript
671
19
import { describe, expect, it } from "vitest"; import { projectionStreamsForHover } from "./hover-projection-streams"; describe("image hover projection streams", () => { it("subscribes to a hovered source without enabling its full overlay", () => { expect(projectionStreamsForHover([], ["/lidar"], "/lidar")).toE...
338cd9fc69e2c405d3cc040f09a6f35953a44818a860d8518d3a80efc4edbe56
TypeScript
672
20
import type { PaginateSamplesNode } from "@fiftyone/relay"; export const handleNode = ( node: PaginateSamplesNode | { __typename: "%other" }, ) => { if (node.__typename === "%other") { throw new Error("unexpected sample type"); } return { ...node, sample: // Relay will not allow objects when...
4db53f813c94d6201e4ad5e8a57213cc3134f5c077f2100c061e7aef4338ed45
TypeScript
672
21
import { useModalSample } from "@fiftyone/state"; import { useSetAtom } from "jotai"; import { useEffect } from "react"; import { primitivesCount } from "./GroupEntry"; import useSamplePrimitives from "./useSamplePrimitives"; export const usePrimitivesCount = () => { const currentSample = useModalSample()?.sample; ...
1afc3019b43772cbd34bfb7d7c238249f397b6f9ec90d76333004c43aa1d2153
TypeScript
675
20
import { ImaVidState } from "../../state"; import { BaseElement } from "../base"; import { lookerTime } from "../common/controls.module.css"; export class FrameCountElement extends BaseElement<ImaVidState> { createHTMLElement() { const element = document.createElement("div"); element.setAttribute("data-cy", ...
42acabcf807db3081be8fb0a8ce5303ff7fac7af062a9f1178c6daffe1c0ebeb
TypeScript
676
23
import { KnownContexts, useUndoHistory, useUndoRedo } from "@fiftyone/commands"; /** * Undo/redo for the annotate toolbar, read from the ModalAnnotate command stack * (the single authority — see {@link useEngineUndoableBridge}). Returns the * actions, live enabled state, and the newest-first history views for the ...
32ff1dd1016503fec05a6d5dbaacb9ce52b39c7b0902eb1b42fe204579efec31
TypeScript
679
19
import type { CameraImageRayModel } from "../../../../visualization/scene-3d"; import { unprojectCameraPixel, type CameraModel } from "./camera-model"; const rayModelCache = new WeakMap<CameraModel, CameraImageRayModel>(); /** Adapts the episode camera model to the renderer-neutral 3D ray contract. */ export function...
dd7c481332b92da8acd3de808401df54ee4f26f8713b75c08dd4047020b96d4a
TypeScript
679
22
export * from "./annotation/store"; export { CUBOID_RESIZE_FACES, getCuboidResizeFaceFromNormal, type CuboidResizeFace, } from "./annotation/cuboid-face-resize"; export { computeCuboidHeadingAndUpRelabel, getCuboidUpFace, isValidHeadingUpFacePair, } from "./annotation/cuboid-heading-relabel"; export type { ...
1c4c9980b7ead64ccbb210c10435a4bc66034c8af8c1e46d3f658b4425f8a4a1
TypeScript
680
22
import { describe, expect, it } from "vitest"; import { cameraRayModel } from "./camera-ray-model"; import type { CameraModel } from "./camera-model"; describe("episode camera ray model", () => { it("is stable per camera model and preserves behind-camera fisheye rays", () => { const model: CameraModel = { ...
6887fbc953e5d572a3e1cf8bfe5679957a31855223663d1beebee9590eb4df86
TypeScript
683
23
import { useCallback } from "react"; import { type LabelPatchSignal, type LabelRef, publishLabelPreview, } from "../engine"; import { useAnnotationEngine } from "./useEngine"; /** * Declarative live preview: a stable callback bound to the session engine that * publishes a render-only label patch (no commit). ...
ce9ce2045c1c15a296a7bc847926395c9859812072c51d34cd63925162db63e6
TypeScript
690
26
/** * Copyright 2017-2026, Voxel51, Inc. */ import { setSelectedLabels, type setSelectedLabelsMutation, } from "@fiftyone/relay"; import { DefaultValue } from "recoil"; import { commitMutation } from "relay-runtime"; import type { RegisteredWriter } from "./registerWriter"; const onSelectLabels: RegisteredWrite...
eb65660709c5a3d473c50a529d4f3b4b9b4183181300812136405c21140b1312
TypeScript
690
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"; export default function useColor(overlay?: BaseOverlay)...
f5a20f41acdcb3cea77db3fa5f411f8fab9100745849e98f5889a57b3984a593
TypeScript
692
32
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Undoable } from "@fiftyone/commands"; import type { Rect, Spatial } from "../types"; /** * Command for moving an overlay with undo/redo support. */ export class MoveOverlayCommand implements Undoable { readonly id: string; readonly description: string;...
48f163253b2556aefd6caab6dbf83123add068301869af3ba68f522604965722
TypeScript
693
17
import type { TimelineIndex } from "../../../runtime/timeline-index"; /** * The playhead seconds that make the content frame at `timeNs` the one * presented. Everything downstream of the playhead quantizes to the * timeline's tick grid via nearest-tick rounding, so seeking to a content * time's raw seconds can lan...
6aa1ab05d93284e565caf9d0d565ea7b249ebf53513ff5bfb56f6431bd57f017
TypeScript
696
20
import type { AdapterDescriptor, SampleDescriptor } from "../../ports"; /** Returns whether lightweight sample facts identify an MCAP episode. */ export function detectMcapSample(sample: SampleDescriptor): boolean { return ( sample.mediaType === "multimodal" && !sample.mediaReference && (sample.path == n...
b0c6647ca7d0bbaf70b58dc375f4c64a1f7ca517194a34911329d49caf3dbc89
TypeScript
696
25
import { Categories, PluginComponentType, registerComponent, } from "@fiftyone/plugins"; import WorkspacesIcon from "@mui/icons-material/Workspaces"; import { lazy } from "react"; import EmbeddingsTabIndicator from "./EmbeddingsTabIndicator"; import { BUILT_IN_PANEL_PRIORITY_CONST } from "@fiftyone/utilities"; c...
01c586093b643a8f87a93ccb447a22bc3efbecf608c20eae24b5d528a80f981a
TypeScript
698
22
import { describe, expect, it } from "vitest"; import { releaseArrayBuffers } from "./release-array-buffers"; describe("releaseArrayBuffers", () => { it("detaches unique backing stores synchronously", () => { const first = new ArrayBuffer(16); const second = new ArrayBuffer(32); expect(releaseArrayBuff...
8c0831cef4557f1e7d958fa800782fe85acb313f21adb03a2228228bef671b52
TypeScript
698
28
/** * Copyright 2017-2026, Voxel51, Inc. */ import { DEFAULT_LABEL_SELECTION_STYLE, useSessionSetter, } from "@fiftyone/state"; import { useCallback } from "react"; import type { EventHandlerHook } from "./registerEvent"; const useSetLabelSelectionStyle: EventHandlerHook = () => { const setter = useSessionSet...
59fe9f19add2143f98dde65b7c451306e9c4ac4e94e661fe3f661110c62c6d47
TypeScript
700
22
import { createUseEventHandler, useEventBus } from "@fiftyone/events"; /** * Event group for the Schema Manager. * * These events signal the completion of async operations (scan, validate, save) * and are consumed by e2e tests for synchronization. */ export type SchemaManagerEventGroup = { "schema-manager:scan-...