sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
b4451b7d73883c9d59ddad8ed6a6c7b65a2d52b5d8ad8433955a5180ce4f5769
TypeScript
1,836
62
/** * Copyright 2017-2026, Voxel51, Inc. * * Pure render helper for the keypoint ripple animation. * * Draws a series of staggered rings expanding outward from `center`. Knows * nothing about which points should ripple, when to start, or when to stop — * the caller owns that lifecycle and is responsible for inva...
652b1aee6a24bd8a9b0316197b1730ea4a53ed7d2edf2cdac20542b4fc8916a0
TypeScript
1,840
63
import { getEventBus } from "@fiftyone/events"; import { EntryKind, type SidebarEntry } from "@fiftyone/state"; import { useAtomValue } from "jotai"; import { useEffect, useMemo } from "react"; import { LABELS_GROUP_NAME, labelsExpanded } from "./GroupEntry"; import { visibleLabelSchemas } from "./state"; import { useP...
70afbf338cc40257451ad187bc3b0ba54e246aba9d2b379fabf558f16f7290e6
TypeScript
1,840
66
import { describe, expect, it } from "vitest"; import { foxgloveLogCdrDecoders, foxgloveLogDecoder } from "./foxglove/index"; import { LOG_ROOT, LOG_SCHEMA_DATA, ROS2_LOG_SCHEMA, decoderForSchemaEncoding, ros2Message, schemaData, } from "./foxglove.test-helpers"; describe("Foxglove log decoders", () => { ...
90e08a1314705c1623f91ea1714ef3a08ef113991be91a5cc0fa8f129b4d6321
TypeScript
1,840
67
import { create, fromBinary, toBinary } from "@bufbuild/protobuf"; import { describe, expect, it } from "vitest"; import { PlaybackPlanSchema, SceneInventorySchema, TimeTrackRole, TimeTrackSchema, TimeTrackType, } from "."; // Smoke tests that generated TypeScript bindings are importable and usable. // Each ...
7d38891cc61a6656ea9de65ea2545dc34b52c65acf5d37c4907d61edce151a5d
TypeScript
1,851
50
import { ConcurrencyLimitBehavior, useConcurrentCallback, } from "@fiftyone/utilities/src/useConcurrentCallback"; import { useCallback } from "react"; import { useAnnotationEventBus } from "../hooks"; import { useAnnotationEngine } from "../state"; import { usePersistAnnotationDeltas } from "./usePersistAnnotationD...
95856b068718226ce48bd7e823ad10d1dcd186d4ec76e4621264b10de01cdb2e
TypeScript
1,852
62
import { describe, expect, it } from "vitest"; import { dynamicChildFrameIdsForPlacement, EMPTY_EPISODE_FRAME_GRAPH_SUMMARY, summarizeEpisodeFrameGraph, } from "./frame-transform-graph"; describe("frame transform graph policy", () => { it("returns the stable empty summary singleton", () => { expect(summari...
c5973605bce451d71c2cf2d747b5635d4f6a3d4bb57fd831967fd11d386450e1
TypeScript
1,857
48
import * as fos from "@fiftyone/state"; import { useMemo } from "react"; import { useRecoilValue } from "recoil"; import type { VisualizationRun } from "./protocol"; /** The brain config class every visualization run derives from */ const VISUALIZATION_CLS = "fiftyone.brain.visualization."; /** * The dataset's visua...
3fcccfe901a65a419daf39cb6484ea4da8fac368d2c6346a19e7ca428406a0df
TypeScript
1,861
60
/** * The retained-mode integration entry point: registers the bridge * on mount (driving the engine-derived read-half) and returns a stable * {@link SurfaceController} so surface code carries only gesture vocabulary. * Dependencies are injected — the binding-agent hook supplies the * engine. * * `bridge` may be...
a52ec6658bd7b4d5ff41e595e8b357be415805adb649f117d969a009646265b1
TypeScript
1,862
54
import { createKeyedExternalStore } from "./keyed-external-store"; // Republished on every presented frame, so an unchanged instant is dropped // rather than woken through to the lane. const playheads = createKeyedExternalStore<bigint>({ skipUnchanged: (previous, next) => previous === next, }); /** * Publishes the...
41655435a5d4920b50822ce02d78dbcc12af6825a0c8b8e78ad41cd33ed0976f
TypeScript
1,865
53
import { describe, expect, it } from "vitest"; import { VISUALIZATION_KIND } from "../../../ir/index"; import { foxgloveCameraCalibrationDecoder } from "./foxglove/index"; import { CAMERA_CALIBRATION_FIXTURE } from "./foxglove.test-fixtures"; import { concatProtobufFields, protobufBytesField, protobufDoubleField,...
6db4181572f5dc051a11f77108ac2bb57d5d657ff7a20de7e787c3ec3f5abb3b
TypeScript
1,867
71
import { describe, expect, it } from "vitest"; import { shouldPresentDestinationPoster } from "./destination-poster"; describe("shouldPresentDestinationPoster", () => { const base = { committedSourceKey: null, committedStream: null, dataStreamSourceKey: "source-a", posterSourceKey: "source-a", p...
40148666721b94f14c1f02705bd372364118c5719f5702cf275fb39f99ae85f2
TypeScript
1,871
59
import { useCallback } from "react"; import { DelegatingUndoable } from "../actions"; import { CommandContextManager } from "../context"; /** * Hook that provides a convenient way to push undoable actions to a command context. * * @param contextId - Optional ID of a specific command context to push undoables to. *...
93ad8fd26d8d5c382d894f64c7fe63a6ef48eb0c0eafe63b3bc1d724b2edea50
TypeScript
1,872
49
import type { Decoder } from "../../../../decoders/index"; // Context-only timing helper; nothing protobuf-specific despite its home. import { timingFromContext } from "../foxglove/protobuf/timing"; import { rawAudioOutput } from "../foxglove/raw-audio"; import { decodeJsonMediaMessage, finiteNumberField } from "./deco...
753aa753680726d99bf004c1bc28a32270d0b00af63a8e4a5dc6272f721b681b
TypeScript
1,881
60
import { CLICK_SLOP_PX } from "../constants"; interface ClickCallbacks { /** A plain left click (no modifier, no drag) at container CSS px */ onClick: (x: number, y: number) => void; } /** * Plain-click detection for gestures the lasso doesn't own. With the * planar camera the lasso claims plain left pointer-do...
d3b008dee1ed6dd2981d6977ca56810439dc52a67fb98b1d6d80a5e34930cb1b
TypeScript
1,884
63
import type { Quaternion, Vector3 } from "three"; export interface McapFrameTransformSample { readonly childFrameId: string; readonly parentFrameId: string; readonly rotation: Quaternion; /** Source topic retained for topology provenance. */ readonly sourceName?: string; readonly timeNs?: bigint; readonl...
f4b6280dbb99263e4fd45612d4b1bffe02740f16932f60fa41bdae0ad2b09676
TypeScript
1,886
70
/** * Copyright 2017-2025, Voxel51, Inc. */ /** * Base Command abstract class. * * Commands express intent and carry data needed for execution. * The result type is inferred from the generic parameter via CommandResult<C>. * * Commands should extend this class rather than implementing it, so they * don't need...
92d8613060164ad0720eb9be81a52dee74ac31a85d38a0451a5cb3b075383745
TypeScript
1,890
66
import { describe, expect, it, vi } from "vitest"; import type { McapIndexedMessageTime, McapIndexedReaderLike } from "./types"; import { materializeIndexedEntries } from "./materialize-indexed-entries"; describe("materializeIndexedEntries", () => { it("deduplicates chunk prefetch and preserves positional identity"...
208edd6568f9f5aea82458e6f04b22a73cd716cb15c3118aa9c278ebbff82b5f
TypeScript
1,893
68
/** * The signal pipe: high-frequency, NON-persistent cross-surface * observation of surface-owned transient state (mid-drag geometry, cursor). * * Pure firehose: no retention, no replay-on-subscribe — a late subscriber * sees only future events. Anything with a queryable current value is * interaction state, not...
5f5c1cbb1bd6530a84522ce199990e5e98dda8caa25eeb9c436a208fd657df46
TypeScript
1,894
78
import * as jsonpatch from "fast-json-patch"; /** * Normalize data for accurate comparison. * * @param data Data to normalize */ export const normalizeData = (data: unknown): unknown => { if (data && typeof data === "object" && !Array.isArray(data)) { const obj = data as Record<string, unknown>; // conv...
0824e78ef26e0c1b5541156c1b3556edecf60a2cb31ecc025e9a3597eb6718b7
TypeScript
1,895
50
import { describe, expect, it, vi } from "vitest"; import { createMcapWorkerSlotLifecycle } from "./worker-slot-lifecycle"; describe("MCAP worker slot lifecycle", () => { it("wires handlers before init and resets through one disposal path", () => { const worker = new MockWorker(); const slot: { worker?: Wor...
423bb8a8b41de80ffaa572b80da4d09c3ab7a9bc96b6e67be89825ce74ba1a2a
TypeScript
1,903
62
/** * Copyright 2017-2026, Voxel51, Inc. */ import { setFieldVisibilityStage, type setFieldVisibilityStageMutation, subscribeBefore, } from "@fiftyone/relay"; import { type State, stateSubscription } from "@fiftyone/state"; import { DefaultValue } from "recoil"; import { commitMutation } from "relay-runtime"; ...
0502bd063246714dc4b2a8bddc2352f6e07a1921129d60418900edd773387597
TypeScript
1,908
47
import type { PointCloudCameraPose } from "../../../../visualization/scene-3d/types"; import { describe, expect, it, vi } from "vitest"; import { createScene3dViewStateStore } from "./scene-3d-view-state"; import { createScene3dViewpointStore } from "./scene-3d-viewpoint"; import { createScene3dViewpointActions } from...
9ac32205882197ed67b063bdf2819521763e73ab81819b48101cb96cd6b7cafb
TypeScript
1,912
53
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it } from "vitest"; import { deserialize } from "@fiftyone/looker/src/numpy"; import { decodeMaskToRaster } from "./maskRaster"; // Real mask from a FiftyOne detection (base64 zlib numpy uint8). Shared with // maskDecoding.test.ts / maskEncoding...
b775faae4e8d6dd0db8985d73a5905fe46b5b975d681799009bb069a1eed83d8
TypeScript
1,915
53
/** * Scope-aware legend counts: a tally of the color column's class * indices over the points the user is focused on — the lasso/grid * selection when one exists, otherwise the view/filter scope. Returns * null when there is nothing to scope by, in which case the legend * shows the run's full counts unannotated. ...
4935049841552a911aba20f8e2f604419f5dfafd3264245d5556c8fd728f5a28
TypeScript
1,916
61
import { useModalModeController } from "@fiftyone/state"; import { useCallback, useMemo } from "react"; import { useRegisteredAnnotationContextManager } from "../state"; import { useAnnotationEventBus } from "./useAnnotationEventBus"; /** * Controller interface for activating and deactivating annotation mode. */ exp...
6c9e065f6473d2bf0dabf8fed86dc00d0172c2f19c42f92387e05541ce11d525
TypeScript
1,927
49
/** * Two retained selection layers sharing the chart's one emphasis * channel: the HOST layer (external selections — in FiftyOne terms, * grid checkboxes arriving through the `selected` prop) and the LASSO * layer (the chart's own gesture). One channel, last-writer-wins, was * the bug this replaces: checking then...
920896e1bd58674c63cc2728271de881a62900883beacddc76986611b120e98d
TypeScript
1,939
66
import { beforeEach, describe, expect, it } from "vitest"; import { FeatureCache } from "./cache"; describe("FeatureCache", () => { let cache: FeatureCache; const feature = "some-feature"; beforeEach(() => { cache = new FeatureCache(); }); describe("hasFeature", () => { it("should return false if n...
274c0b87b958fdde75b8509382e5a9e04e9d1ee8428e2f4ccb9c6da3fb9894d5
TypeScript
1,940
75
import { useCallback, useEffect } from "react"; import * as recoil from "recoil"; import { useRecoilTransaction_UNSTABLE } from "recoil"; const KEYBOARD_EVENT_NAME = "keydown"; type KeyboardEventUnionType = KeyboardEvent & React.KeyboardEvent; export const useHotkey = ( keyCode: string, cb: (props: { get: re...
67685796e97a568e0c9aad16ad22f65c00f5ebd4c6451a86eaed8223a0f01641
TypeScript
1,944
88
/** * Copyright 2017-2026, Voxel51, Inc. */ export interface Section { getTop: () => number; getBottom: () => number; getHeight: () => number; index: number; itemIndex: number; set: (top: number, width: number) => void; show: (element: HTMLDivElement, hidden: boolean, soft: boolean) => void; hide: ()...
1af63010cf28a2a7a11cde2c9065afac93144d91fc9042e3f88670597a8bc7ec
TypeScript
1,945
64
import { describe, expect, it } from "vitest"; import { EpisodeReadCancelledError, EpisodeReadUnsupportedError, EPISODE_READ_CANCELLED_MESSAGE, isEpisodeReadCancelledError, } from "./errors"; describe("isEpisodeReadCancelledError", () => { it("accepts serialized cancellation errors and AbortErrors", () => {...
b663aee5e3042d7e7685fe1e098461e0a08b36e0afa1ab9d6dc57f3f298b4dd4
TypeScript
1,947
87
import { ItemData, RowData } from "./state"; const lastRow = ( { items }: RowData, horizontal: boolean, threshold: number, ): RowData => { const aspectRatios = items.map(({ aspectRatio }) => horizontal ? 1 / aspectRatio : aspectRatio, ); if (aspectRatios.length && new Set(aspectRatios).size === 1) { ...
6b52a066aacbf5d2d4a16eea2622f556db54b59f9ea0f912a5591ae1ca71c306
TypeScript
1,949
85
import type { DecoderRegistry } from "../decoders"; import type { ByteCacheLayers, ByteClient } from "./bytes"; import type { DecodedOutputCache, DecodeExecutor, DecodeClient, } from "./decoding"; /** * Cache layers used by query clients. */ export interface MultimodalQueryCaches { /** * Raw byte cache co...
c1e9dee01d13ebcfa9436e753baa57a6e2b07d1d53b5f9515da33cc2df6a6258
TypeScript
1,949
59
/** * Copyright 2017-2026, Voxel51, Inc. */ import { cssVar } from "@voxel51/voodo"; import { lookerBuffering, lookerBufferingArc, lookerBufferingIcon, lookerBufferingRing, lookerBufferingShown, } from "./looker.module.css"; const SVG_NS = "http://www.w3.org/2000/svg"; /** * Builds the thumbnail bufferi...
f8a280941d1d1ada976cf2639dde10279c9ef813bf535aacc9f888d714775763
TypeScript
1,950
56
import { AnnotationAgent, InferenceResultProxy } from "./types"; /** * A descriptor of an agent, including a unique ID and human-friendly label * with its {@link AnnotationAgent} instance. */ export type AgentDescriptor<T extends InferenceResultProxy> = { id: string; label: string; agent: AnnotationAgent<T>; ...
9eac4591c387edf6575ad6c49f5fb6dac6e710f530a38c6e5d44df136ecf2ef7
TypeScript
1,953
55
import { useSyncExternalStore } from "react"; import { createExtensionRegistry } from "../host/registry"; import type { SidebarTrayExtension } from "./types"; const REGISTRY_KEY = Symbol.for( "@fiftyone/multimodal:sidebar-tray-extension-registry", ); const registry = createExtensionRegistry<SidebarTrayExtension>( ...
deeabdf3c190017dba1ca934aff45343cb6c4a2a35cc7920911369a0235dc688
TypeScript
1,954
64
import * as foq from "@fiftyone/relay"; import * as fos from "@fiftyone/state"; import { useCallback, useMemo } from "react"; import { loadQuery, useRelayEnvironment } from "react-relay"; import { useRecoilValue } from "recoil"; export const useDynamicGroupSamples = () => { const environment = useRelayEnvironment();...
6c9519a50faedb946dd54ff57a0f2e711d7e5fc9b0dad9d5b4aebbd658faf568
TypeScript
1,957
59
import { ThreeEvent } from "@react-three/fiber"; import { useCallback, useRef } from "react"; import { DRAG_GATE_THRESHOLD_PX } from "../../constants"; type PointerEvt = ThreeEvent<PointerEvent>; export interface UseDragGateOptions { /** Screen-space threshold in px before we treat it as a drag */ dragThresholdPx...
fe9f6996dcaa0634510ab4930e488ebb37059296cda315dd1f003fd2da0e8705
TypeScript
1,959
60
import { CARD_HEIGHT, CARD_MIN_WIDTH, cardWidth, MULTIMODAL_CARD_HEIGHT, MULTIMODAL_CARD_WIDTH, STRIP_GAP, } from "./theme"; export type TrayItem = { aspectRatio: number | null } | { fold: true }; /** Largest common card height whose wrapped rows fit the available space. */ export function fitCardHeight( ...
df2b1e6b9d7efbccfcad5a97453945dd8c22b8623a5f554194bf13fd78e1dc26
TypeScript
1,960
51
import { useOperatorAvailability, useOperatorExecutor, } from "@fiftyone/operators"; import { useSetAtom } from "jotai"; import { useCallback, useEffect, useRef } from "react"; import { useSchemaManagerModal } from "./SchemaManager/hooks"; import { activeLabelSchemas, activePathsOrder, labelSchemasData, } fro...
4c99cbaca96e8bbe55f5b8fd3d1c9ca39ab89dcfab57c1f5399dab870757fb61
TypeScript
1,964
68
import { describe, expect, it } from "vitest"; import { ClassificationsOverlay } from "../overlays"; import { TemporalDetectionOverlay } from "../overlays/classifications"; import DetectionOverlay from "../overlays/detection"; import HeatmapOverlay from "../overlays/heatmap"; import KeypointOverlay from "../overlays/ke...
838f17c408bb5d31a22ca42046ba6dbb28da89bad02728ad1f7a53286e45697c
TypeScript
1,968
71
/** * Copyright 2017-2026, Voxel51, Inc. */ import { DEFAULT_ZOOM_PAD, dispatchAfterPaintSettle } from "@fiftyone/lighter"; import type { Rect } from "@fiftyone/lighter"; import { useLighter } from "@fiftyone/lighter"; import type { ModalViewportState } from "@fiftyone/state"; import { useEffect, useRef } from "react...
9f59330acd47ed7e7af2eba68c1272d8ad81514ab1b7b5a3f4b78d1f2165bbda
TypeScript
1,969
63
import { useFrameSchema, useModalSample, useModalSampleSchema, } from "@fiftyone/state"; import { registerNonfiniteFields } from "@fiftyone/utilities"; import { useEffect } from "react"; import { useSampleInstance } from "./useSample"; /** * Hydrate the shared {@link Sample} from the Recoil-backed modal sample....
e062d5cf7ff5920fb93f53e76b9aeb78b8505ef3bf3107c438138e98f14ac718
TypeScript
1,973
67
import { Categories, PluginComponentType, registerComponent, } from "@fiftyone/plugins"; import ScatterPlotIcon from "@mui/icons-material/ScatterPlot"; import { BUILT_IN_PANEL_PRIORITY_CONST } from "@fiftyone/utilities"; import { lazy } from "react"; import TabIndicator from "./TabIndicator"; const EmbeddingsV2P...
2082da167cc983c9c549a4e31226956a7e206586aa60da453f254bc05545108f
TypeScript
1,975
73
import { act, renderHook } from "@testing-library/react"; import { useEffect } from "react"; import { beforeEach, describe, expect, it, vi } from "vitest"; const mocks = vi.hoisted(() => ({ available: false, closeSchemaManager: vi.fn(), execute: vi.fn(), result: null, setActive: vi.fn(), setActivePathsOrde...
a41852ec924930720aa7f43d9c1064c7e5c793d3d20369551350a89c25b6e1bf
TypeScript
1,975
95
export type SchemaViewType = { [key: string]: any }; export type BaseSchemaType = { type: string; view: SchemaViewType; default?: unknown; name?: string; read_only?: boolean; }; export type ArraySchemaType = BaseSchemaType & { items: BaseSchemaType; }; export type ObjectSchemaType = BaseSchemaType & { ...
6b6dd7a9589abcd82f069b1f60f13635eae2a889164bc5e3e9e7f8c39aa5c12a
TypeScript
1,977
73
import type { DecodeContext } from "../../../../decoders/index"; import type { DecodedOutput } from "../../../../ir/index"; import { buildNormalizedRawImageOutput } from "../normalized-image"; import { bytesField, integerField, numberField, optionalBoolean, rosHeader, rosHeaderAttributes, rosHeaderFrameId...
f0c0b5849e3f0f45364bdae34a057ace9cf27ef672ee0dceae3dd4b534079fac
TypeScript
1,981
77
import { describe, expect, it } from "vitest"; import { SCENE_SOURCE_METADATA, SCENE_SOURCE_TYPE, type StreamDescriptor, } from "../ir"; import { sceneSourcesFromStreamDescriptors } from "./scene-sources"; describe("sceneSourcesFromStreamDescriptors", () => { it("keeps camera suffixes out of labels without co...
4cf6db96993e2e4b07f41dde7d01ec91bb6faaf3357cabdaf01a3eb7a2a9bc2a
TypeScript
1,984
69
/** * Copyright 2017-2026, Voxel51, Inc. */ import { setDataset, type setDatasetMutation, subscribeBefore, } from "@fiftyone/relay"; import { DEFAULT_SELECTION_STYLE, GRID_SPACES_DEFAULT, ensureColorScheme, stateSubscription, } from "@fiftyone/state"; import { env } from "@fiftyone/utilities"; import {...
bb3bcdd6628157a29b5793bb84678863ae1f55dafd5154f176a157296a9d6e63
TypeScript
1,985
82
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Rect } from "@fiftyone/lighter"; import { UNDEFINED_LIGHTER_SCENE_ID, useLighter, useLighterEventBus, useLighterEventHandler, } from "@fiftyone/lighter"; import { useCallback, useState } from "react"; export const useSceneEventHandler = () => { cons...
152d23b3ddd77120f9eb79966ef70fd3b38427b9de252728123c6c3f2207de18
TypeScript
1,993
61
import { atom, useAtomValue, useSetAtom } from "jotai"; import type { AnnotationRetryController } from "./usePersistenceRetryController"; /** * Health of annotation autosave, mirrored from the persistence retry * controller's tri-state. Drives the {@link SaveStatusIndicator} colour. */ export enum SaveHealth { /*...
b7fa89a1da7981f8d81eb86bde694f623d701b7a6ba55583557ec43c698c3511
TypeScript
1,998
63
import { useTileId } from "@fiftyone/tiling"; import { atom, useAtomValue, useStore } from "jotai"; import { useCallback, useMemo } from "react"; /** Persisted playback presentation settings owned by one 3D tile. */ export interface Scene3dTilePlaybackSettings { readonly smoothTrackedLabels: boolean; } /** Playback...
9a13d4ba6b6d038f3ea8d035526199b984126f79daa1ae4183fad594d35798b5
TypeScript
2,003
60
import type { LabelMask, Overlay } from "../overlays/base"; import DetectionOverlay from "../overlays/detection"; import HeatmapOverlay from "../overlays/heatmap"; import SegmentationOverlay from "../overlays/segmentation"; import type { BaseState, Buffers } from "../state"; export const hasFrame = (buffers: Buffers, ...
940d7e2adb2ff9df5fe843bdf72daa08f2724c9ada54d845740940323590313a
TypeScript
2,008
61
import { describe, expect, it } from "vitest"; import { getSourceFieldFromStages } from "./useSourceFieldToActivate"; const toPatches = (field: string) => ({ _cls: "fiftyone.core.stages.ToPatches", kwargs: [ ["field", field] as [string, unknown], ["_state", { name: `${field}-patches` }] as [string, unknown...
5235b939f756efdfd41d1c54fe692142bd99047db3b2cfbbc3fdf24a7a4ad402
TypeScript
2,013
73
import * as THREE from "three"; import type { GpuCameraProjection } from "../../../../visualization/composition/gpu-camera-projection"; import { sensorToCameraMatrix, sensorToImageProjectionMatrix, type GpuProjectionRotation, type GpuProjectionTranslation, } from "../../../../visualization/composition/gpu-poin...
73baf328461abf788dd91d4d80f32e3514040c0c1bc7b3804638f832c9a6f086
TypeScript
2,013
64
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Point } from "../types"; import type { InteractionHandler, OverlayEvent } from "./InteractionManager"; /** * Configuration for an {@link InteractiveCreationHandler}. */ export interface InteractiveCreationHandlerOptions { /** Stable id for the handler. *...
a06ef31e80f63ba380a7f18f65d3a018d5078638a5144b8dfe3db343d989b01d
TypeScript
2,021
75
import * as fos from "@fiftyone/state"; import type { Controller } from "@react-spring/web"; import type { MutableRefObject } from "react"; import { useCallback } from "react"; import type { InteractiveItems } from "./types"; import type useGetNewOrder from "./useGetNewOrder"; import { Direction, MARGIN, calculateItemL...
88fc5878dc8ffbcb982cd57650a064d29b50b3b9c469d789ac997cfd3c25bab8
TypeScript
2,023
65
import { BufferGeometry, Float32BufferAttribute } from "three"; import { computeMinMaxForScalarBufferAttribute } from "../../utils"; import { DynamicPCDBufferGeometryUserData, PCDAttributes, PCDHeader, } from "./types"; /** * Creates a BufferGeometry from parsed PCD data. * * @param header - The PCD header co...
bbf41eedda8c447eae5aecfaa2f352592ad79ac06ff12dfc843b4d9b0f4ac5e4
TypeScript
2,025
71
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, it, expect, vi } from "vitest"; // utils.ts imports from @fiftyone/utilities at the top level. // That module has Node.js dependencies that fail in jsdom. // This mock allows the module to load, even though limitFiles doesn't use these functions. vi.moc...
2973d867d9dd50866e69e3f94c8bc3292f01976be864b1bf3e54b08ce5ba135a
TypeScript
2,026
63
import { useEffect } from "react"; import type { Material, Mesh, Object3D } from "three"; import { FO_USER_DATA } from "../constants"; import type { useMeshMaterialControls } from "./use-mesh-material-controls"; const setOpacity = ( mtl: Material, newMaterial: ReturnType<typeof useMeshMaterialControls>["material"]...
dbb1b1ca1dc6019fa07004be5620c2f1b2ecd5cb480623756cdd5260223879e8
TypeScript
2,029
82
/** * Generate a URI from the path parts using URL-safe encoding. * * @param parts Path parts */ export const encodeURIPath = (parts: string[]): string => { const encoded = parts.map((part) => encodeURIComponent(part)).join("/"); return `/${encoded}`; }; /** * Serialized datetime format. */ export type DateT...
107cc148983232bca2e77254427a312ffdcf21d04ac741077219c00c30c39cff
TypeScript
2,032
72
import { useSyncExternalStore } from "react"; import type { GridPosterProvider } from "./types"; interface GridPosterProviderState { readonly listeners: Set<() => void>; provider: GridPosterProvider | null; } const REGISTRY_KEY = Symbol.for( "@fiftyone/multimodal:grid-poster-provider-registry", ); const global...
a5279a146dce675483336dad13ab8c23b0a1cd5102a54512d1ea4db684631b20
TypeScript
2,049
73
import type { CameraFrustumPanelLayer, SceneRayPanelLayer, } from "../../../visualization/scene-3d"; import type { DepthHover } from "./depth-sampling"; import type { FrameTransformResolver } from "./frame-transforms/use-frame-transforms"; /** Resolution of a hovered depth sample into one 3D pane's world frame. */...
0d9b8730b79df3ffc4d08e29ac98f288491a89e63e678e1fd0586c47693d6862
TypeScript
2,056
60
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { EventHandlerHook } from "./registerEvent"; import { env } from "@fiftyone/utilities"; import { useCallback } from "react"; import { useSetRecoilState } from "recoil"; import { getDatasetName, getParam, resolveURL } from "../utils"; import { AppReadyState } f...
69c7ad54de0ae2b5362b6a49fd30742cf2c2e6091ffe4d7913fa061dddd33b04
TypeScript
2,056
71
import { useAnnotationEventHandler } from "@fiftyone/annotation"; import { coerceStringBooleans } from "@fiftyone/core/src/components/Modal/Sidebar/Annotate"; import { useCallback } from "react"; import { useSetRecoilState } from "recoil"; import { useUpdateWorkingLabel } from "../annotation/store"; import { hoveredLab...
f36b1b98b2dbc44f0240ebdf837c5f82a2c6a342fa2d7d4dc6f065aaaf2e4cca
TypeScript
2,059
59
import { atom, useAtomValue, useSetAtom } from "jotai"; import type { AnnotationAgentLifecycleStatus } from "../types"; import type { ProviderError } from "../../providers"; /** * Coarse status surfaced to UI for AI-assisted inference. * * Mirrors {@link AnnotationAgentLifecycleStatus} 1:1 today, but kept as a * d...
9079d38d82184a4326115ed43a3ae9f0f789da9e07e1e9c4fb4ef66538521cf9
TypeScript
2,064
58
import { describe, expect, it } from "vitest"; import { toGpuCameraProjection } from "./gpu-camera-projection"; import type { CameraModel } from "./camera-model"; const IDENTITY_ROTATION = { w: 1, x: 0, y: 0, z: 0 } as const; const ZERO_TRANSLATION = { x: 0, y: 0, z: 0 } as const; describe("episode GPU camera-model ...
4308ebf4a2ddb2eac4f49cfaad76407fb1c587687e889fdacbd121b702a7389f
TypeScript
2,066
78
import { deserialize } from "../numpy"; import { RENDER_STATUS_DECODED } from "./shared"; const extractSerializedMask = ( label: object, maskProp: string, ): string | undefined => { if (typeof label?.[maskProp] === "string") { return label[maskProp]; } else if (typeof label?.[maskProp]?.$binary?.base64 ===...
d04fbca50717b756cc9d2d098759de60365b4fb72d132b025fd2aa9224b415c3
TypeScript
2,072
70
/** * Copyright 2017-2026, Voxel51, Inc. */ import { useCallback, useEffect, useState } from "react"; import type { Scene2D } from "../core/Scene2D"; import { UNDEFINED_LIGHTER_SCENE_ID, useLighterEventHandler, } from "./useLighterEventHandler"; /** The minimal scene surface {@link dispatchAfterPaintSettle} need...
0808606597e1e7362954a6ebfe9ee963576833a748ffdac36abd3b534597b93e
TypeScript
2,073
74
/** * Copyright 2017-2026, Voxel51, Inc. */ import type { Undoable } from "@fiftyone/commands"; import type { PolylineOverlay } from "../overlay/PolylineOverlay"; /** * Undoable command for removing a single point from a PolylineOverlay. * * The constructor captures the point's id, relative position, variant, an...
2fc7e78f525d9eb856360158b502ffb66a6921148eadb1e7ad5d705de311fdd1
TypeScript
2,075
67
/** * Copyright 2017-2026, Voxel51, Inc. */ import { afterEach, describe, expect, test, vi } from "vitest"; import { createMaskCanvas } from "./createMaskCanvas"; describe("createMaskCanvas", () => { afterEach(() => { vi.restoreAllMocks(); }); test("returns canvas and 2d context with the requested dimens...
3debbb392efe745df1cae509f3cdc8900063ece4aceb05497227b10e41ab9dee
TypeScript
2,075
68
import { describe, expect, it } from "vitest"; import type { DecodedOutput } from "../ir"; import { decodedOutputSizeBytes } from "./cache-utils"; describe("decodedOutputSizeBytes", () => { it("adds metadata estimates to a declared payload size", () => { expect( decodedOutputSizeBytes({ attributes...
7f990aac67a7c4e88c2e7a8ff14762304b5c20031f808698164d70744f646484
TypeScript
2,077
70
/** * The plot's palette and per-point renderer colors for the current * color-by field. Reading the App's color scheme atoms (rather than * freezing colors when the column is fetched) is what makes the plot * follow pool edits, shuffles, and per-value overrides live — recoloring * never refetches the column, sinc...
5b7b4bb486b75b3cc1fcd2455ca99c77fda15d9f2a025b48f9a98854cde1107e
TypeScript
2,079
61
import type { McapTypes } from "@mcap/core"; import { maxBigInt, minBigInt } from "../../synchronization/policy"; import type { McapIndexedReaderLike } from "../../reader/index"; import type { McapTimelineStrategy } from "../timeline"; import type { McapByteTimelinePoint, McapTimelineRange, } from "../../contracts/...
56d8bb932989a4fd97a4b7bc02fba0f9fed00a5d458167bcb932b4e4cc34b0cb
TypeScript
2,083
70
import { isNullish, Primitive } from "@fiftyone/utilities"; /** * Serialize a date value from the database back to an ISO string * @param value - The value to serialize * @returns The serialized value */ export function serializeDatabaseDateValue( value: Primitive | { datetime: number }, ): Primitive { if (!is...
22b7c6ec43e115ff01f7ba8d1178aeda538623af05d490060d4d9d11e9eb35ea
TypeScript
2,088
57
import { useEffect, useMemo, useState } from "react"; import { fetchMasks } from "./protocol"; /** * The wire indices of an images run's points whose samples own the given * patches. * * A patches view lists patches, so its selections (grid checkboxes, other * panels' ids) are patch ids — which never name a sampl...
077bea7e13cd31b64a3a6d17e7c69c51f91ac5addb8d5d3e6b3a7b8d32246013
TypeScript
2,099
71
import type { EpisodeSelection } from "@fiftyone/state/src/selection"; import { describe, expect, it } from "vitest"; import { capturedGroupSlice } from "./capturedGroupSlice"; const capture = (id: string, slice: string): EpisodeSelection => ({ episodeId: id, members: [{ episodeId: id, kind: "episode" }], node: ...
f80504bf5e6023a50d5b81db8c4d5203d3b752db255fcd21bdd7bd422290cf2d
TypeScript
2,101
69
/** * Copyright 2017-2026, Voxel51, Inc. */ import { act, renderHook } from "@testing-library/react"; import { describe, expect, it } from "vitest"; // Real jotai — the hook is a thin atom getter/setter, and using the real // store gives us a free check that jotai integration still works. import { useInferenceSta...
38c34a71a4d79279deba9e8578bddbff7d642556d269cbf0e28097fbfd449e94
TypeScript
2,103
70
import { describe, expect, it } from "vitest"; import { createSeriesLabelTable, MAX_SERIES_LABEL_LENGTH, MAX_SERIES_LABELS, remapSeriesLabelCodes, SERIES_OVERFLOW_LABEL, } from "./numeric-series-labels"; describe("createSeriesLabelTable", () => { it("assigns stable codes in first-seen order", () => { c...
245b3f1294b1b68c80060742824b30b6dd2efd0644c3079f375e3fb9e14757d0
TypeScript
2,110
87
import { SerializableParam } from "recoil"; import * as recoilRelay from "recoil-relay"; export * from "recoil-relay"; import { Variables } from "relay-runtime"; import { mockValues } from "./recoil"; export function graphQLSelector<TVariables extends Variables, T>( options: Parameters<typeof recoilRelay.graphQLSel...
92eceb22560a9c4371e9ca6378794bea8b5fa5e8f99e08aba06a723a6d29dc82
TypeScript
2,113
72
import { describe, expect, it } from "vitest"; import { localColorMask } from "./colorMask"; import { MISSING_CATEGORY } from "./colors"; import type { ColorMeta, ColorValues } from "./protocol"; const META: ColorMeta = { style: "categorical", exact: true, classes: [ { label: "cat", count: 2 }, { label: ...
945573ded1e8676e6c6543b8c0d779852ed5ca1a8eb7cb78f9c86d6f51c8ce0e
TypeScript
2,116
78
import { type RetryController, useRetryController } from "@fiftyone/state"; import { useCallback, useEffect, useMemo, useState } from "react"; import { v4 } from "uuid"; /** * Maximum number of attempts before triggering fallback behavior. */ const MAX_ATTEMPTS = 3; /** * Fallback duration after attempts exceeded....
5efe34d09cfc871b480f02a121f59f61da5045d0d7d2ce4057adb9901e135235
TypeScript
2,123
80
/** * Copyright 2017-2026, Voxel51, Inc. * * Web worker that decodes + rasterizes a mask into a white+alpha `ImageBitmap` * off the main thread, then transfers the bitmap (zero-copy) back. Moves the * base64/numpy decode, the per-pixel rasterize, and the `ImageBitmap` creation * off the UI thread so dense samples...
f32b9c3c10bb7bb3e87a5f8a805728e05efbb88265184ac262f46c158f677be5
TypeScript
2,126
59
import { useModalSampleSchema, useStableInteraction3dSample, } from "@fiftyone/state"; import { useEffect } from "react"; import { useThreeDSceneSampleId } from "./useGroupAnnotationSample"; import { useSampleInstance } from "./useSample"; /** * Hydrate the pinned 3D scene's {@link Sample} when a grouped modal re...
d591c5c1952150414cd6bd977a8c77615e0a96acb58d836eb75f9265aefff636
TypeScript
2,127
58
/** * Copyright 2017-2026, Voxel51, Inc. * * Pure policy for assigning a positive/negative variant to a SAM2-style * point prompt, based on where the click lands relative to the current * mask and which modifier keys are held. */ import { DetectionOverlay, type Point } from "@fiftyone/lighter"; import type { Ann...
2713a326b8904e43eab3e83fce208f4a12a75ee9377c16e33025dbcf1a29724c
TypeScript
2,129
74
type TaskYieldMessagePort = Pick< MessagePort, "onmessage" | "postMessage" | "start" > & { unref?: () => void; }; interface TaskYieldEnvironment { readonly MessageChannel?: new () => { readonly port1: TaskYieldMessagePort; readonly port2: TaskYieldMessagePort; }; readonly setTimeout: (callback: () ...
a21d308b35a0c621bb1dbd03dbd0cccf054b7d3731103e385ae13bf69649c6b4
TypeScript
2,130
80
import { currentGroupSliceNames, groupMediaTypes } from "@fiftyone/state"; import { is3d, isAnnotationSupported } from "@fiftyone/utilities"; import { useMemo } from "react"; import { useRecoilCallback, useRecoilValue, useRecoilValueLoadable, } from "recoil"; export interface AnnotationSliceInfo { /** Slice na...
07d1719c3d759a32a6173621739d643cc47f650cd68cc18f42055f78d9845420
TypeScript
2,138
81
import { describe, expect, it, vi } from "vitest"; import { createTaskYielder } from "./task-yield"; describe("createTaskYielder", () => { it("resumes concurrent yields in FIFO order through one message channel", async () => { const fallback = vi.fn(); const channels: FakeMessageChannel[] = []; const yie...
06646ef7ba7f49080dc8f002171deae82e2ff739c49b6041a596e79099df90c7
TypeScript
2,146
88
import { beforeEach, describe, expect, it } from "vitest"; import { canPreserveMapViewportBetweenSamples, readMapViewport, resetMapViewportCacheForTests, writeMapViewport, } from "./cache"; describe("mcap map viewport cache", () => { beforeEach(() => { resetMapViewportCacheForTests(); }); it("warms ...
4582a1a467e45d7fbd5ac6a2d72181a681dc46df05b14e05e92a20d4e76a0789
TypeScript
2,147
70
/** * Copyright 2017-2026, Voxel51, Inc. * * Pure mask decode + rasterization — no DOM, runs identically on the main * thread (fallback) and inside `maskDecodeWorker`. Produces a color-INDEPENDENT * white+alpha RGBA buffer (the display color is applied later via GPU tint) * plus the single-channel pixel data used...
c5756d1e57d62538cdea7fa0eab69c1739c4e3dc826f9007b5fb71c549949c87
TypeScript
2,149
69
import { describe, expect, it, vi } from "vitest"; import { cameraOrbitFromPose, cameraPoseFromOrbit, createScene3dViewpointStore, normalizeScene3dCameraProjection, } from "./scene-3d-viewpoint"; describe("episode 3D viewpoint", () => { it("expresses a Z-up camera as understandable orbit angles", () => { ...
7c46a333ea2196eb2b22b949567dccd014f415e8a0c47ff2b19b18bb2b9fc820
TypeScript
2,160
74
import { wrapLongitude } from "../wgs84"; const MAX_VIEWPORT_SCOPES = 16; /** Serializable map camera state retained between nearby modal samples. */ export interface MapViewport { readonly latitude: number; readonly longitude: number; readonly zoom: number; } const viewportByScope = new Map<string, MapViewpor...
20f643275928127fd3272cb934f908097e7007ce01f5d4f25c900e8ee0d6651c
TypeScript
2,164
66
import { useAnnotationEngine } from "@fiftyone/annotation"; import { DetectionOverlay, UNDEFINED_LIGHTER_SCENE_ID, useLighter, useLighterEventHandler, } from "@fiftyone/lighter"; import { useAtomValue } from "jotai"; import { useCallback, useEffect } from "react"; import { effectiveLabelSchemasData, isField...
0ae0d81c31035c79fc7706e0a971cc1e8b22626c89154c8bd3bee4307cf0a6f8
TypeScript
2,169
70
import { describe, expect, it } from "vitest"; import { resolveSelectionClick } from "./resolveSelectionClick"; const click = (over: Partial<Parameters<typeof resolveSelectionClick>[0]>) => resolveSelectionClick({ isSelectableOverlay: true, isSelected: false, isDrawingOver: false, multipleSelection: ...
53dd4ee5ee8b83dccb721a0826169f8a63a075b0ede8d54242db3be97b0e64f0
TypeScript
2,173
54
import { describe, expect, it } from "vitest"; import { unsupportedSourceFormatReason, unsupportedVideoFormatReason, videoCodecFromFormat, videoRenderingUnsupportedReason, } from "./video-format"; describe("video format helpers", () => { it("normalizes exact and prefixed codec identifiers", () => { expe...
2d2d9fcb8f320e54d21fb379c51786da9e2c103f514f100c05c9b89e41748386
TypeScript
2,179
77
import { useCallback, useEffect, useState } from "react"; import { CommandContext } from "../context"; import { useCommandContext } from "./useCommandContext"; import { CommandHookReturn } from "."; export type CommandDescriptor = { id: string; label: string; description: string; }; /** * Gets a previously regi...
c8687202cfe23370c62ae218ce1cdbdb67ef7edc3e2c405d4fb88c756c3c62cc
TypeScript
2,186
95
import type { Texture } from "three"; import { describe, expect, it } from "vitest"; import { applyTextureDimensionsToIntrinsics, getTextureDimensions, } from "./texture-utils"; import type { CameraIntrinsics } from "./types"; describe("getTextureDimensions", () => { it("prefers natural image dimensions when ava...
acfadea83289e9ce23f4711b04cd541de11f75000532b539a70db2fc5e2a82f4
TypeScript
2,189
72
import { getStageKwarg, isPatchesView, view } from "@fiftyone/state"; import { useAtomValue } from "jotai"; import { useRecoilValue } from "recoil"; import { activeLabelSchemas, labelSchemasData } from "./state"; export interface RequiredField { field: string; hasSchema: boolean; } const STAGE_FIELD_EXTRACTORS: {...
3dbe3c046df4b076f4fd84d1d4409c9339df95c40d43b634708e8e9af38fd690
TypeScript
2,192
64
import { describe, expect, it } from "vitest"; import type { SceneSource } from "../../../ir"; import { createSemanticSourceIndex, groupSourcesBySemanticIdentity, semanticSourceKey, semanticSourceKeysForRuntimeIds, resolveSemanticSourceKeys, } from "./semantic-source"; const source = (id: string, type: strin...
6d94e58b45c4bed6487e8005cd5ec80f0c64053794716d7f04b74d0c1e52004b
TypeScript
2,193
69
import { SCENE_SOURCE_METADATA, STREAM_METADATA, type SceneSource, type StreamDescriptor, } from "../ir"; import { streamPrefix } from "./stream-selection"; /** Builds renderer-facing scene sources from adapter-normalized inventory. */ export function sceneSourcesFromStreamDescriptors( streams: readonly Stre...
8a1c4ad26a9b034595247f4b4855b1ac8e2c86e97aa91f50f5e874d94cf84e7f
TypeScript
2,194
93
import { describe, expect, it } from "vitest"; import { GaussianSplatAsset } from "../fo3d/render-types"; import type { FiftyoneSceneRawJson } from "../utils"; import { buildFoScene } from "./use-fo3d-scene-parser"; const DEFAULT_MATERIAL = { _type: "MeshStandardMaterial", color: "#ffffff", emissiveColor: "#0000...