sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
1d6a738144f28cfa17f7666082e617cb165ed3dde46a7d8efb9d88b32371f1a5 | TypeScript | 9,590 | 343 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import {
FiftyoneSceneRawJson,
getFiftyoneSceneSummary,
} from "@fiftyone/looker-3d/src/utils";
import { getFetchFunction } from "@fiftyone/utilities";
import { DispatchEvent, ThreeDState } from "../state";
import { BaseElement, Events } from "./base";
const DEFAULT_F... |
a96dce98d1b0162a32d2bae647672f8a1c84cae035ff4e040a908a285acd974d | TypeScript | 9,596 | 367 | import { describe, expect, it } from "vitest";
import { createCacheApiByteRangeCache } from "./cache-api-byte-cache";
import type {
ByteRangeReadRequest,
ByteRangeReadResult,
ByteSourceDescriptor,
} from "./types";
describe("createCacheApiByteRangeCache", () => {
it("returns undefined when the runtime has no C... |
fa0ed89089f9b4905981324fb1ba30f5fe8f6923bcbdc7396c410d227ae90a55 | TypeScript | 9,617 | 312 | import { beforeEach, describe, expect, it, vi } from "vitest";
import { VISUALIZATION_KIND } from "../../../../ir/index";
import { foxgloveGridDecoder } from "./grid";
import { decodeProtobufMessage } from "./protobuf/index";
vi.mock("./protobuf/index", () => ({
decodeProtobufMessage: vi.fn(),
}));
const EMPTY_BYT... |
8ea4b8c1579d46518f82bc6364985bc6e398bb0dcc71eeeb12ffb1fc3d851129 | TypeScript | 9,625 | 317 | // @vitest-environment jsdom
/**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { act, renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
/**
* The selection, as this surface sees it: whatever the `@fiftyone/state`
* accessors hand back. Those are Recoil-ba... |
ca1c977756bf0845336c9e351ffa4acdbf0dc1999899bbbd2a810b1386869506 | TypeScript | 9,657 | 314 | // Pure geometry — no three.js, no DOM. Everything here is directly
// unit-testable: the planar camera's viewport algebra, the lasso's
// point-in-polygon test, and the projected hit-tests shared by both
// camera modes.
import type { Columns } from "./columns";
import type { Bounds, HoverHit, Polygon } from "./types"... |
772a797986442a98115aa32a174f1c7f554f63fdb3cb19772a504e44249325ec | TypeScript | 9,665 | 290 | import { act, cleanup, renderHook, waitFor } from "@testing-library/react";
import { afterEach, describe, expect, it, vi } from "vitest";
import type {
PointCloudRenderChannelPayload,
PointCloudVisualization,
} from "../../../ir";
import {
POINT_CLOUD_RGB_ENCODING,
pointCloudNativeIntegerScalarEncoding,
} from... |
153d190b013402f593bc93d0dd13e677d6b8309934172d5787f836126f679aa8 | TypeScript | 9,672 | 266 | import {
EPISODE_UNIT,
selectionScopeLabel,
type EpisodeSelection,
type SavedSubset,
type SelectionCounts,
type SelectionMember,
type SelectionRange,
type SelectionUnit,
} from "@fiftyone/state/src/selection";
export type SegmentMember = Extract<SelectionMember, { kind: "segment" }>;
/** "1 segment", ... |
2e7161203eac0f419a97ea8693ecaa16857d64935a742549e46676d5dcaad26d | TypeScript | 9,676 | 316 | import {
STREAM_SYNC_MODE,
type DecodedFrame,
type EpisodeManifest,
type ResolvedStreamSyncPolicy,
type StreamDescriptor,
type StreamSyncMode,
type StreamSyncPolicies,
type StreamSyncPolicy,
type SynchronizedFrameWindow,
} from "../ir";
/** Default symmetric tolerance for nearest-frame presentation. ... |
bac2db8378aa7ee46643f24c1278c155ef687d64e8ebb67c2c90366f2d52736f | TypeScript | 9,704 | 282 | import { useMemo } from "react";
import type { CameraVisualization, SceneSource } from "../../../../ir";
import {
isSharedEncodedVideoVisualization,
sharedVideoRejectionMessage,
} from "../../../../video/types";
import { imageTextureCacheKey } from "../../../../visualization/media-2d/image-texture-cache";
import {... |
47466b90e0337f9f9c0d965b6fafec77a529b2db3387f2e5298ef8bc3e68898f | TypeScript | 9,733 | 313 | import { renderHook, act } from "@testing-library/react";
import { describe, expect, it, vi, beforeEach } from "vitest";
import type { ListSchemasResponse } from "./useSchemaManager";
const mockListSchemas = vi.fn();
const mockInitializeSchema = vi.fn();
const mockActivateSchemas = vi.fn();
const mockSetLabelSchema = ... |
63eebe26ceeb477e01e62a4caabb420754b128fdac9829e6d78be9eb4229b295 | TypeScript | 9,735 | 95 | /**
* Minimal compressed-image descriptor/message fixture.
*
* The schema bytes are a FileDescriptorSet built from the canonical Foxglove
* `foxglove/CompressedImage.proto` schema plus google.protobuf.Timestamp:
* https://github.com/foxglove/schemas/blob/main/schemas/proto/foxglove/CompressedImage.proto
* The mes... |
4e211ff2e4f1f251a5c5af89b97effb3550a7122b24211bae71ad0de0af52068 | TypeScript | 9,745 | 273 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type { BaseState, StateUpdate } from "../state";
import type { BaseElement, Events } from "./base";
export const FRAME_ZERO_OFFSET = 1;
export const ICONS = Object.freeze({
arrowLeft:
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' h... |
0a2584b82f305e15fbe6b7008b1b1c19ff88ad41f69b49e1939d1e1d53728ff4 | TypeScript | 9,763 | 338 | /**
* Hook for attribute form logic.
* Separates business logic from rendering.
*/
import { IconName } from "@voxel51/voodo";
import { useCallback, useMemo } from "react";
import {
COMPONENT_OPTIONS,
LIST_TYPES,
NO_DEFAULT_TYPES,
NUMERIC_TYPES,
POINT_SCOPE_TYPES,
componentNeedsRange,
componentNeedsVal... |
252e39e18934781f268f45e03041f8be43d487f2bd6e995ca6b1543ed14184fb | TypeScript | 9,767 | 281 | /**
* The Lighter surface bridge: kind-agnostic plumbing between the
* engine's read-half loop and a `Scene2D`. Methods close over the scene; the
* engine never holds a scene reference.
*
* Async-sourced mounts are gated: a descriptor
* carrying `pendingMaskPath` defers its insert until the mask decodes — no
* m... |
8498a3585677b716c4162ef50576d61d7a0697f5ae9befc29a58fc2457db8500 | TypeScript | 9,774 | 345 | import { describe, expect, it } from "vitest";
import type { LaneTransportSnapshot } from "../../../runtime";
import {
createNetworkHealthEstimator,
shouldDeferIdleWork,
shouldPublishNetworkHealth,
} from "./network-health-estimator";
describe("episode network health estimator", () => {
it("enters limited only... |
1bb3743ad325daa4027ea8552f58a5688f5bafb467fadd1f6ae33df6c6d086ab | TypeScript | 9,792 | 331 | import { usePlayback } from "@fiftyone/playback/runtime";
import { usePlaybackStore } from "@fiftyone/playback/runtime";
import {
bumpStreamRangesVersion,
getBufferingDetail,
getIsPlaying,
getPlayhead,
setBufferingDetail,
} from "@fiftyone/playback/runtime";
import type {
BufferReadiness,
PlaybackStore,
... |
6286e8f326e253329e0d6353e454a8aef325b135ed0566a2c8be5a30b9bbc641 | TypeScript | 9,905 | 286 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { describe, expect, it, vi } from "vitest";
import { CoordinateSystem2D } from "../core/CoordinateSystem2D";
import { CONTAINS } from "../core/Scene2D";
import { MockRenderer2D } from "../renderer/MockRenderer2D";
import { DetectionOverlay } from "./DetectionOverlay... |
036180569195168563b5dbaa38d3a831c66555e19eb498020b9617528499a3b9 | TypeScript | 9,906 | 316 | // @vitest-environment jsdom
import { act, renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, test, vi } from "vitest";
import useViewport from "./useViewport";
// Hoisted so vi.mock factories can reference these before module-level code runs
const {
mockBus,
mockSetViewportState,
... |
45dd32075f5b2017a684fd7c7ffa14a3f4a6e595724ed547a296722d6ee7e138 | TypeScript | 9,906 | 311 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { LABEL_ARCHETYPE_PRIORITY } from "../constants";
import type { DrawStyle, RenderMeta } from "../types";
import { TemporalOverlay, type TemporalLabel } from "./TemporalOverlay";
const makeLab... |
f51c4d4c22586d02bffedd3108acd00b6536c19693280a7d51b5aeb15bb3f791 | TypeScript | 9,912 | 413 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import {
REGRESSION,
TEMPORAL_DETECTION,
TEMPORAL_DETECTIONS,
getCls,
sizeBytesEstimate,
} from "@fiftyone/utilities";
import { INFO_COLOR, MOMENT_CLASSIFICATIONS } from "../constants";
import {
BaseState,
BoundingBox,
Coordinates,
NONFINITE,
VideoStat... |
62b3024cc7742e691f758821581c4da60d4b2509475ffb240a8b84f4234e7d07 | TypeScript | 9,994 | 396 | import type { Controller } from "@react-spring/web";
import * as fos from "@fiftyone/state";
import type { InteractiveItems } from "./types";
export const MARGIN = 3;
/** Stops the root and every per-entry controller so they detach from react-spring's frameloop (call on unmount). */
export const disposeInteractiveIte... |
086fec307b13a124c6edf42ddc219ec0a62452689b5acebc7a417cf98a5ed7fa | TypeScript | 10,157 | 304 | import type {
ClassificationOptions,
ClassificationOverlay,
DetectionLabel,
DetectionOverlayOptions,
DetectionOverlay,
KeypointLabel,
KeypointOptions,
KeypointOverlay,
PolylineLabel,
PolylineOptions,
PolylineOverlay,
} from "@fiftyone/lighter";
import { InteractiveDetectionHandler } from "@fiftyon... |
128c93f57fe1b1c3bb3073a78f3f84a4a397ab82910bf53fd6abf13340ee3ef5 | TypeScript | 10,208 | 379 | import { describe, expect, it } from "vitest";
import type {
ByteSourceDescriptor,
EpisodeManifest,
EpisodeTimeline,
} from "../ir";
import {
decodeStoredSourceFacts,
encodeStoredSourceFacts,
} from "./source-facts-codec";
import {
canonicalSourceFactsLocator,
SOURCE_FACTS_SCHEMA_VERSION,
sourceFactsIde... |
7c2648b70a14b5d52c0f3f25f80f8285916829ec28f87f53771f8eda8f3cc62c | TypeScript | 10,229 | 339 | import type { McapTypes } from "@mcap/core";
import { describe, expect, it, vi } from "vitest";
import { createInlineMcapResourceClient } from "./inline-client";
import { MCAP_ACTIVE_TIMELINE } from "../contracts/index";
import type { McapIndexedReaderLike } from "../reader/index";
import {
collect,
createChannel,
... |
fc76228499422231a49337a97dee8670d519528b13cbdf0950ef33f931dcb10e | TypeScript | 10,245 | 305 | // @vitest-environment jsdom
import { describe, expect, it, vi } from "vitest";
import { DEFAULT_ZOOM, MARGIN } from "../constants";
import { fitRect } from "../math";
import { PlanarCamera } from "./PlanarCamera";
const BOUNDS = {
xMin: 0,
xMax: 10,
yMin: 0,
yMax: 10,
zMin: 0,
zMax: 0,
};
describe("Plana... |
e8d5c2e3cf71b2857ec89ee9f03bc7706f225b4b0a23bdfb45d785e12ce6cba1 | TypeScript | 10,256 | 259 | import { useCallback, useEffect, useRef, useState } from "react";
import type { HoverContent } from "./HoverCard";
import { fetchSampleInfo, type SampleInfo } from "./protocol";
import type { HoverHit } from "./renderer";
/**
* A hit must survive this long before the card commits to it. The ring
* (hoverHit) tracks ... |
e52ad82dc428e9673d3bdec87d9d2bbb1898df3146ece7f99aae264e4d25ebd5 | TypeScript | 10,298 | 292 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { act, renderHook } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
// ── Mocks ────────────────────────────────────────────────────────────────────
const hoisted = vi.hoisted(() => ({
AgentTaskType: {
... |
39c14ac4be9508707e4b9293c8022dc69ed066dae17713e1009d4461abf50e31 | TypeScript | 10,305 | 327 | import type { LaneTransportSnapshot } from "../../../runtime";
/**
* Network-health verdict for the active episode source, shown in modal chrome so
* buffering is attributed honestly.
*
* "Limited" means playback has been buffering for a sustained moment while
* transport was busy moving bytes nearly the whole ti... |
e352fb79ae9d6ea3ae13b72bd92b4b0356e96f24bd11c360ed399660042406ae | TypeScript | 10,327 | 314 | import { type SetStateAction, useCallback, useEffect, useMemo } from "react";
import { type PrimitiveAtom, useStore } from "jotai";
import type { SceneSource } from "../../../../ir";
import { useKeyedIdentityMap } from "../../../../visualization/panel-ui/use-keyed-identity-map";
import type {
PointCloudPanelLayer,
... |
d00ebb1fda7c68719046c1aace5e979a99b16c9afa6741dbb2c625f737ee0e91 | TypeScript | 10,351 | 315 | /**
* Pure functions for frustum geometry calculation.
*/
import { Box3, Matrix4, Quaternion, Vector3 } from "three";
import {
FRUSTUM_DEFAULT_ASPECT_RATIO,
FRUSTUM_DEFAULT_FOV_DEGREES,
FRUSTUM_DEPTH,
FRUSTUM_MAX_DEPTH,
FRUSTUM_MIN_DEPTH,
FRUSTUM_NEAR_PLANE_DISTANCE,
} from "./constants";
import type {
... |
65d162efe165d70b0b5d558e4104d7b4cc8d5edd495da2736574a1967d78bf36 | TypeScript | 10,366 | 321 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { useCallback, useEffect, useMemo, useRef } from "react";
import { atom, useAtom } from "jotai";
import { useRecoilValue } from "recoil";
import { usePointSelectionSeed } from "@fiftyone/annotation/src/agents";
import { BaseOverlay, DetectionOverlay, useLighter } f... |
e3d894cf01f120cd8b3cc55bdb6237dd17a3e5ed07aaf0976feee722ce47b025 | TypeScript | 10,392 | 300 | import {
getFetchFunctionExtended,
type FetchFunctionConfig,
type FetchFunctionResult,
} from "@fiftyone/utilities/src/fetch";
import { createAbortError } from "../../utils/cancellation";
import { safeNumber } from "./bigint-utils";
import { parseByteSize } from "./byte-size";
import type { ByteClient } from "./t... |
ecf88ef2de5ad152ef51627e4e49b9409c8abe024caef1c90186e62023c2033b | TypeScript | 10,398 | 259 | // ---------------------------------------------------------------------------
// Waveform peaks for audio that is never fully in memory.
//
// `buildChannelPeakPyramids` needs the whole track at once, which is exactly
// what streaming exists to avoid. Peaks are a min/max fold, though, so they
// can be accumulated wi... |
4dfca37d12d5723248b1b16c4af969a4158631356d92c5bd8888f153aa470585 | TypeScript | 10,405 | 386 | import type { CameraCalibrationVisualization } from "../../../ir";
import type { PointCloudColorWriter } from "../../../visualization/scene-3d";
/**
* Pure math for the pointcloud→camera projection overlay: transforms
* decoded sensor-frame points into the camera frame, projects through
* a pinhole projection matri... |
85f11f2c8e00c944b9106433638cd731540a858131b6963c5772b00094821118 | TypeScript | 10,407 | 339 | import { describe, expect, it } from "vitest";
import { buildColumns } from "./columns";
import {
clampToHome,
fitRect,
nearestPoint,
projectPoint,
panRect,
pointInPolygon,
pxToData,
selectInPolygon,
worldRect,
zoomOf,
zoomRect,
type Rect,
} from "./math";
import type { EmbeddingPoint, Polygon }... |
74eb97253189f8413d9b708604102cb82f0583b0b6c7ef9899d6e556694853f3 | TypeScript | 10,520 | 340 | import { renderHook } from "@testing-library/react";
import type { RefObject } from "react";
import type { PerspectiveCamera, Vector3Tuple } from "three";
import { Vector3 } from "three";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { useFo3dCameraInitialization } from "../../hooks/use-fo3d-cam... |
f764d790933f26da3a9a6604f5d14b9a36c44505c8440e96e172302f3d524c59 | TypeScript | 10,521 | 301 | import type { McapFrameTransformSetWire } from "../transforms/types";
import type { McapTransportSnapshot } from "./transport-meter";
import type {
McapDecodedMessage,
McapEnumerateNumericFieldsRequest,
McapNumericSeriesResult,
McapNumericSeriesSliceResult,
McapMessageIndexWindowResult,
McapPointCloudChanne... |
49eeccdf1778ff30def4b1fbdc2373390f73419ea40382abd4ff1323f16f24c1 | TypeScript | 10,566 | 288 | // ---------------------------------------------------------------------------
// Main-thread half of streaming audio playback.
//
// Owns the transport only: the `AudioContext`, the worklet node, and the
// ring the render thread drains. It knows nothing about MCAP, Foxglove, or
// where samples come from — a caller p... |
c4d9d0a5cc63f3e147ff64ed8c59dd500328654a5f50e8e7aad215a40d5ca5e5 | TypeScript | 10,582 | 341 | import { Box3, Vector3 } from "three";
import { describe, expect, it } from "vitest";
import { DEFAULT_CAMERA_POSITION } from "../../constants";
import {
type CameraConfigSources,
type ViewConfigSources,
resolveCameraConfig,
resolveConfiguredUpVector,
resolveUpVector,
resolveViewConfig,
} from "../camera-in... |
a8ec0a343b9de61bd7af173a9789a3747c50a63f75e60c42a696df0e7772db2f | TypeScript | 10,583 | 415 | import { POINT_CLOUD_CROP_BOUNDS_EPSILON } from "../../../constants";
const PointCloudCropVertexDeclarations = /* glsl */ `
uniform bool pointCloudCropEnabled;
uniform mat4 pointCloudCropWorldToBox;
uniform vec3 pointCloudCropHalfSize;
out float vPointCloudCropVisible;
bool isInsidePointCloudCrop(vec3 loca... |
d18575cf5b2b3e7a7eb01d9310340de4a508954c9263fc4231835e74171d053b | TypeScript | 10,599 | 342 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { LRUCache } from "lru-cache";
import type { OverlayMask } from "@fiftyone/looker/src/numpy";
import { decodeMask, type DecodedMask } from "./maskDecoding";
/** A mask's raw source — the same value {@link decodeMask} consumes. */
export type MaskSource = string | ... |
46e4771e732ec7ab352c5a957c6b969162b32c3525bd2c9894f4996c004479c5 | TypeScript | 10,602 | 339 | import {
createLocationTrackCursor,
indexedLocationTrailCoordinates,
resolveIndexedLocationAtTime,
type IndexedLocationTrack,
type InterpolatedLocation,
type LocationTrackCursor,
type ResolvedLocationTrackPosition,
} from "../tracks/location-track";
import { mapRouteProgressFilters } from "../tracks/route... |
9683461da312b09d6dd4ef25742ad8bc72c951c6e254b6309b73d77ff0153092 | TypeScript | 10,607 | 387 | import * as fos from "@fiftyone/state";
import {
getSamplePathExtension,
isFo3dSamplePath,
isWrappableDirect3dSamplePath,
} from "@fiftyone/utilities";
import { useEffect, useMemo, useState } from "react";
import { useRecoilValue } from "recoil";
import type { FoScene } from "../fo3d/render-types";
import type { ... |
ed5c53e69ea2b51a027ca2399e78fe0b7564a3f8f50a1f350c0c665007550480 | TypeScript | 10,617 | 329 | import {
MCAP_PLAYBACK_WORKER_PRIORITY,
type McapPlaybackWorkerPriority,
type McapPlaybackWorkerRpcRequest,
type McapPlaybackWorkerResultByType,
type McapPlaybackWorkerRpcType,
type McapPlaybackWorkerStreamItemByType,
type McapPlaybackWorkerStreamType,
type McapPlaybackWorkerUnaryType,
} from "./playbac... |
56bb480b234b20f9073a39993f80f781e1429faef8b71ff020a4ad350fda3fd9 | TypeScript | 10,637 | 286 | import { useLighter } from "@fiftyone/lighter";
import type { Lookers } from "@fiftyone/looker";
import { useCurrentPublishedFrame } from "@fiftyone/playback";
import type { State } from "@fiftyone/state";
import * as fos from "@fiftyone/state";
import type { MutableRefObject } from "react";
import { useCallback } from... |
d5f45c34b5e03da10f3be8cd0723793f8683c187c0ea8c24abb37fe4a61b921e | TypeScript | 10,642 | 287 | /**
* Copyright 2017-2025, Voxel51, Inc.
*/
import { describe, it, expect } from "vitest";
import { KeyParser } from "./KeyParser";
describe("KeyParser", () => {
it("can parse simple valid single sequence bindings", () => {
let result = KeyParser.parseBinding("ctrl+s");
expect(result.length).toEqual(1);
... |
0a607d5127a89c6c1f7d11708c0ecf5eb7a80766f1f846d19ab700a7cb743986 | TypeScript | 10,657 | 318 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { beforeEach, describe, expect, it, vi } from "vitest";
// ── Mocks ────────────────────────────────────────────────────────────────────
//
// We provide real classes for the lighter overlay types so the SUT's
// `instanceof DetectionOverlay` checks match instances... |
6e7f336da9e394feb40c62d03f0f27f306697adf9549d218366ec0adf2010254 | TypeScript | 10,672 | 300 | import * as THREE from "three";
import {
CUBOID_RESIZE_FACES,
getCuboidResizeFaceAxis,
type CuboidResizeFace,
} from "../../annotation/cuboid-face-resize";
import {
ORIENTATION_MARKER_EXTENSION_RATIO,
ORIENTATION_MARKER_HEAD_LENGTH_RATIO,
ORIENTATION_MARKER_HEAD_WIDTH_RATIO,
ORIENTATION_MARKER_MIN_HEAD_LE... |
fb5e0ca5aba38ecc368f96d8c88d6a871a2d28bb1d18315a7798f51c924b1f2d | TypeScript | 10,674 | 365 | import { describe, expect, it, vi } from "vitest";
import { rawNodeToJson } from "../../../ir/index";
import type {
McapRawArrayNode,
McapRawObjectNode,
McapRawValueNode,
} from "../contracts/index";
import {
DEFAULT_RAW_PRUNE_BUDGETS,
pruneRawRecord,
rawRecordToJsonText,
} from "./raw-record-prune";
descr... |
b3153b2973e5ab761ccbc9596e79678a072b23dbbf7deca6897bb0f232b78da9 | TypeScript | 10,679 | 336 | import { afterEach, describe, expect, it, vi, type Mock } from "vitest";
import {
MCAP_PLAYBACK_WORKER_PRIORITY,
type McapPlaybackWorkerRequest,
} from "./playback-worker-types";
type WorkerClientMock = {
readonly dispose: Mock;
readonly readSynchronizedMessages: Mock;
readonly readTopics: Mock;
};
const wo... |
b46293e6aedecb456c944ebfe9b9626b2f5112bc08f14a6af2c681e1b8520867 | TypeScript | 10,697 | 408 | import type { ModalSample } from "@fiftyone/state";
import { PathType, determinePathType } from "@fiftyone/utilities";
import { folder } from "leva";
import {
DoubleSide,
MeshBasicMaterial,
MeshDepthMaterial,
MeshLambertMaterial,
MeshPhongMaterial,
MeshStandardMaterial,
PointsMaterial,
Vector3,
type V... |
97e949e50880ce4bd908194abf7480e4e4cbaa411071dc4b4a14cf876a17afc7 | TypeScript | 10,771 | 310 | import { describe, it, vi, expect, beforeEach } from "vitest";
import { CommandContextManager, KnownContexts } from "./CommandContextManager";
import { DelegatingUndoable } from "../actions";
describe("CommandContextManager", () => {
beforeEach(() => {
CommandContextManager.instance().reset();
});
// TODO: ... |
39d7d5dde2d541e82d8d1d74c7b42b1868831161aa7afc6367c45fdf838d5c47 | TypeScript | 10,784 | 377 | import type {
DecodeContext,
PointCloudChannelProjectionRequest,
} from "../../../../decoders/index";
import type {
DecodedAttributeValue,
DecodedOutput,
PointCloudField,
PointCloudRenderChannelPayload,
} from "../../../../ir/index";
import { resourceHintsForArrayBufferViews } from "../../../../decoders/ind... |
6e3c5076ebf405b36ea14d213ab6da510bf7484dd478e4f4041c2e09ecbe5d73 | TypeScript | 10,938 | 372 | import { describe, expect, it } from "vitest";
import {
addCoveredRange,
completeNumericSeriesPrefix,
contiguousNumericSeriesPrefix,
coveredNumericSeriesSeconds,
flattenSeriesSegments,
FULL_NUMERIC_SERIES_COVERAGE,
insertSeriesSegment,
nearestNumericSeriesRange,
numericSeriesKey,
numericSeriesRangeD... |
6898be3ef60e28a7d860a599ac21e3c63c79a6cd585a1560de863b0b2ffe3786 | TypeScript | 10,941 | 418 | import type { DecodeContext } from "../../../../decoders/index";
import type {
DecodedAttributeValue,
PayloadDescriptor,
SceneArrowPrimitive,
SceneCubePrimitive,
SceneCylinderPrimitive,
SceneEntityVisualization,
SceneLinePrimitive,
SceneModelPrimitive,
SceneSpherePrimitive,
SceneTextPrimitive,
Sce... |
f1c55e250df9f68c61bae5f9c0bb51d2b5277255e6f98fe5d1f3fc7cb5729b54 | TypeScript | 10,968 | 323 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { describe, expect, it } from "vitest";
import { PolylinePropagationBrowserAgent } from "./PolylinePropagationBrowserAgent";
import type { PropagationContext } from "./types";
import { AgentTaskType } from "./types";
type Ring = [number, number][];
const SQUARE: R... |
cbab97a21bb5952d5e2c1c782efdf68b4e6c73abab58e96e0365375e570bc521 | TypeScript | 10,970 | 392 | import { describe, expect, it } from "vitest";
import { SCENE_SOURCE_TYPE } from "../../../ir/index";
import {
PlaybackSyncMode,
type StreamInventory,
} from "../../../schemas/v1/index";
import { mcapSceneSources, mcapStreamPolicies } from "./scene-sources";
describe("mcapSceneSources", () => {
it("classifies su... |
5fa70578af32d4683a5e8d0371619bcabcead30519f852569bed93234b296ed3 | TypeScript | 10,997 | 296 | // ---------------------------------------------------------------------------
// Lock-free SPSC ring buffer for streaming PCM into an AudioWorklet.
//
// One producer (the main thread, filling from paged MCAP reads) and one
// consumer (the audio render thread) share one `SharedArrayBuffer`. No
// locks: the render th... |
533ba5b398a17d644d42efe565441a7be362bd98b767b54dd158a3bda47af153 | TypeScript | 11,010 | 328 | import type { PayloadDescriptor } from "../../../ir/index";
import type { StreamInventory } from "../../../schemas/v1/index";
import {
JSON_FOXGLOVE_COMPRESSED_AUDIO_PAYLOAD,
JSON_FOXGLOVE_RAW_AUDIO_PAYLOAD,
JSON_POSE_PAYLOAD,
JSON_ROS_CAMERA_INFO_PAYLOADS,
JSON_ROS_COMPRESSED_IMAGE_PAYLOADS,
JSON_ROS_DETEC... |
7caf0a29ad3c59234d739424ebf7c48ed1838aaaf5ffa51f431644055a64f086 | TypeScript | 11,017 | 410 | import {
indexLocationTrack,
type IndexedLocationTrack,
type LocationTrackState,
} from "../tracks/location-track";
import { hexColorWithAlpha } from "./puck";
import { noteMapSourceUpdate } from "./performance";
import { ACCURACY_LAYER_ID, PULSE_LAYER_ID } from "./map-sources";
type MapLibreMap = import("maplib... |
2a26ddcf837a0604fe44c799f93b2bab0b66ba55605a7fcfeac709dbddf09c3c | TypeScript | 11,070 | 330 | import type { PointCloudCameraPose } from "../../../../visualization/scene-3d/index";
import type { MutableVectorHandle } from "../../../../visualization/scene-3d/mutable-vector-handle";
import {
cameraPoseFromTrackingAnchor,
cameraTrackingAnchorFromPose,
isFollowTrackingMode,
trackingAnchorMatches,
type Came... |
21c63233641f3a48c29bd8bb16483dbad31be616f94d63c284039616b401ae92 | TypeScript | 11,080 | 372 | import { useCallback, useMemo } from "react";
import {
DEFAULT_IMAGE_PROJECTION,
normalizeImageProjection,
normalizePinholeCamera,
normalizePointCloudColor,
normalizePointCloudPointSize,
normalizeReferenceGrid,
normalizeSceneBackground,
type ImageProjectionSettings,
type PinholeCameraSettings,
type... |
7ad897b92b8e1fb8cfcfd3cb4219f9f232acc8df82e23326e4aa51923f8b3c82 | TypeScript | 11,112 | 390 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
/**
* @vitest-environment jsdom
*/
import { renderHook, act } from "@testing-library/react";
import { describe, it, expect, vi, beforeEach } from "vitest";
import { useDependencyHash } from "./useDependencyHash";
import { useLoadTrigger, type LoaderState } from "./useLoa... |
3fde26abcb2bb032227183525e89755fd90c4d63bbb9defb558ae61e4984f598 | TypeScript | 11,121 | 383 | import { act, renderHook } from "@testing-library/react";
import { Box3, type Group } from "three";
import { type Mock, afterEach, describe, expect, it, vi } from "vitest";
import { FO3D_ASSET_LOADING, useFo3dBounds } from "./use-bounds";
vi.useFakeTimers();
vi.mock("three", () => {
return {
Box3: vi.fn(),
... |
a12a9215f3c8d992c5cea7a9aa139ce2b4accd4d1b67f8ab1e793d136cc08d4a | TypeScript | 11,127 | 371 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { isHoveringParticularLabelWithInstanceConfig } from "@fiftyone/state/src/jotai";
import { INFO_COLOR, TOLERANCE } from "../constants";
import { BaseState, Coordinates } from "../state";
import { distanceFromLineSegment } from "../util";
import { CONTAINS, Coordinat... |
290db5600dfe55c4a2c79de6e225d62bcefcf968be511f076484bbe4cf5b6f61 | TypeScript | 11,222 | 403 | import type { DecodeContext, Decoder } from "../../../../decoders/index";
import type {
DecodedAttributeValue,
DecodedOutput,
GridField,
GridVisualization,
} from "../../../../ir/index";
import { resourceHintsForArrayBufferViews } from "../../../../decoders/index";
import { VISUALIZATION_KIND } from "../../../.... |
2ed94ff5eb9caf1fbefe0f70275b98bd14d7e88ddaa7e9e94290d2ee833a5566 | TypeScript | 11,292 | 440 | import type { DecodeContext } from "../../../../decoders/index";
import type {
DecodedAttributeValue,
DecodedOutput,
ImageAnnotationPoints,
ImageAnnotationText,
RgbaColor,
SceneCubePrimitive,
SceneEntityDeletionVisualization,
SceneEntityVisualization,
ScenePose3d,
SceneTextPrimitive,
} from "../../.... |
4c9f3ba37055845a8d23dfdae504e2fb1898e15f699d870020381d3f98b1b7a1 | TypeScript | 11,320 | 350 | import { useEffect, useMemo, useRef } from "react";
import type { ImageAnnotationsVisualization } from "../../../ir";
import type { ImageAnnotationRenderMetadata } from "../../../visualization/media-2d/image-annotation-render-metadata";
import type { TimelineIndex } from "../../../runtime";
import {
prepareImageAnno... |
55f2a04f951ff38cf6c291ccca68dfdb226c3a97e2877a233187bab3f803c302 | TypeScript | 11,323 | 363 | import { atom } from "jotai";
import { beforeEach, describe, expect, it, vi } from "vitest";
/**
* Per-field schema map. The mocked `labelSchemaData(field)` reads from here.
* Tests mutate it via `setSchema(field, ...)`.
*/
const schemaMap: Record<string, unknown> = {};
vi.mock("../../state", () => ({
labelSchem... |
a4e3b03b8a27789d215815dd00714508dd5149d74960956d19f2cc80aea4aabe | TypeScript | 11,368 | 334 | import { describe, expect, it } from "vitest";
import { VISUALIZATION_KIND } from "../../../ir/index";
import { rosLaserScanDecoders, rosPointCloud2Decoders } from "./ros/index";
import {
ROS1_POINT_CLOUD2_SCHEMA,
ROS2_LASER_SCAN_SCHEMA,
decoderForSchemaEncoding,
expectArrayCloseTo,
pointCloud2Data,
pointFi... |
a29ef9e9ab7dc1d6453d1a5512f7cac8345cfbfb00fb3b71ade82ba1e4952026 | TypeScript | 11,369 | 335 | import * as THREE from "three";
import { describe, expect, it } from "vitest";
import { CUBOID_RESIZE_FACES } from "../../annotation/cuboid-face-resize";
import {
getBoxSurfaceDistanceAlong,
getHeadingFaceAnchor,
getHeadingFaceDotRadius,
getHeadingFaceDots,
getHeadingGhostArrowGeometry,
pickNearestHeadingFa... |
857464ee9263e5550ff101dec0308e99be4ca4a488f812bf837791d374e4bc9e | TypeScript | 11,409 | 321 | import { zoomAspectRatio } from "@fiftyone/looker";
import * as foq from "@fiftyone/relay";
import type { ID, Response } from "@fiftyone/spotlight";
import * as fos from "@fiftyone/state";
import {
resolveGridLocation,
type SelectionRequest,
useGridSelectionBoundary,
useGridSelectionDataset,
useGridSelectionP... |
6aaee670c9c3808c1672a468299ee2f7f172a442c1eee5143aa9adef5e4ca69d | TypeScript | 11,451 | 364 | import type { EncodedVideoAccessUnit } from "./types";
export const VIDEO_ENCODED_ACCESS_UNIT_BYTE_CAP = 128 * 1024 * 1024;
const VIDEO_GOP_INDEX_KEYFRAME_CAP = 8_192;
interface KeyframeEntry {
readonly configSignature: string;
readonly epoch: number;
readonly timeNs: bigint;
}
interface TimeRange {
readonly... |
d2c2b837de124fd06d702e8fde90c915a0f07673d22de6548e4d9c950d9f57fe | TypeScript | 11,527 | 321 | import * as THREE from "three";
import { describe, expect, it } from "vitest";
import type { ReconciledDetection3D } from "../annotation/types";
import { LineSegmentsGeometry } from "three/examples/jsm/lines/LineSegmentsGeometry";
import {
computeArrowheadMatrix,
computeBodyMatrix,
computeBoxEdgePositions,
EDGE... |
8a06ff4f09e914027fe3154949422b7766df05a27d2394d478594a1d98b9459f | TypeScript | 11,610 | 382 | import { describe, expect, it } from "vitest";
import type {
ByteSourceDescriptor,
EpisodeManifest,
EpisodePosterFrame,
TimeWindow,
} from "../ir";
import { getEpisodeTimeRange } from "./episode-time-range-registry";
import {
getSourceBootstrap,
getSourceSessionHints,
peekSourceBootstrap,
publishCurrent... |
090b6152a1869c64376df09cd1c7e3729b53e6bd523ddec0349e96488f9c7c0f | TypeScript | 11,612 | 383 | import { describe, expect, it } from "vitest";
import type { NsRange } from "../ir";
import {
createNumericSeriesTileCache,
type NumericSeriesTile,
} from "./numeric-series-tile-cache";
const SECOND = 1_000_000_000n;
describe("numeric-series tile cache", () => {
it("copies immutable inputs and assembles only vi... |
18b6fd4c8c21af8cb5b30a01fd99c6eccbc7d59412adf7478840a3d7e8fc97c9 | TypeScript | 11,637 | 362 | import { useThree, type ThreeEvent } from "@react-three/fiber";
import {
useCallback,
useEffect,
useRef,
useState,
type MutableRefObject,
type RefObject,
} from "react";
import * as THREE from "three";
import type { CuboidResizeFace } from "../../annotation/cuboid-face-resize";
import { computeCuboidHeading... |
69d2ab54892668c5e524cb5f96abe016c8d5cf835c98267ed2203584310ddc62 | TypeScript | 11,639 | 377 | import { beforeEach, describe, expect, it, vi } from "vitest";
vi.mock("@fiftyone/utilities", () => ({
getFetchParameters: vi.fn(),
mergeHeaders: vi.fn(),
}));
import { getFetchParameters, mergeHeaders } from "@fiftyone/utilities";
import { BrowserAnnotationProvider } from "./BrowserAnnotationProvider";
// Mock ... |
216e7b92ccf6d1c6bf8b0b33165ea0824e31f9248fbd3cdadd57a6499d5931e5 | TypeScript | 11,654 | 446 | /**
* @generated SignedSource<<c40a30869c367669a40e1e3f60ad11c5>>
* @lightSyntaxTransform
* @nogrep
*/
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
import { ConcreteRequest, Query } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type ColorBy = "field" | "instance" | "value"... |
55a54ac210e9b413b472530ee855d25a56ab7117df90c2e4a810c18a120c5efb | TypeScript | 11,681 | 401 | import type { McapTypes } from "@mcap/core";
import { describe, expect, it, vi } from "vitest";
import { createInlineMcapResourceClient } from "./inline-client";
import {
createChannel,
createChunkIndex,
createMcapSourceDescriptor,
createMessage,
createReader,
createSchema,
createStatistics,
createTestD... |
4ed7b1a6e175f10dcb5b151058c31aef1712a0fc09842815a03f32bed134b525 | TypeScript | 11,697 | 366 | import { Matrix4, Quaternion, Vector3 } from "three";
import { describe, expect, it } from "vitest";
import {
buildFrustumGeometry,
computeFrustumCorners,
getCameraPosition,
isValidStaticTransform,
staticTransformToMatrix4,
} from "./builders";
import type { CameraIntrinsics, StaticTransform } from "./types";... |
45c8626f50331df5e9601c9a7460827785161789bf8193f4f3343c9f9bd65276 | TypeScript | 11,721 | 357 | import { createStore } from "jotai";
import {
isPlayPendingAtom,
isPlayingAtom,
playheadAtom,
seekEventAtom,
} from "@fiftyone/playback/runtime";
import { act, cleanup, renderHook } from "@testing-library/react";
import { afterEach, describe, expect, it, vi } from "vitest";
import { createTimelineIndex } from "... |
55fd2c2208486aa2d7494ddbbf6dc59314540ff1d4d507f211583b97afd8c5a5 | TypeScript | 11,729 | 400 | import { act, renderHook } from "@testing-library/react";
import type { ModalSample } from "@fiftyone/state";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { FiftyoneSceneRawJson } from "../utils";
import { useFo3d } from "./use-fo3d";
const mockAtoms = vi.hoisted(() => ({
sel... |
0637b8e6c1e036ee53c05f40e2dd2a41d869758821ef2297ef124eb12147c844 | TypeScript | 11,810 | 385 | import { beforeEach, describe, expect, it, vi } from "vitest";
import { VISUALIZATION_KIND } from "../../../../ir/index";
import { foxgloveImageAnnotationsDecoder } from "./image-annotations";
import { decodeProtobufMessage } from "./protobuf/index";
vi.mock("./protobuf/index", () => ({
decodeProtobufMessage: vi.fn... |
fab568916f51b0d7987082e2e21499464b90d750da210508e62b47fef28e2d80 | TypeScript | 11,869 | 413 | /**
* Copyright 2017-2025, Voxel51, Inc.
*/
import { Action, Undoable } from "../actions";
import {
ActionListener,
ActionManager,
UndoStateListener,
} from "../actions/ActionManager";
import { KeyManager, KeyMatchState } from "../keys";
import { CommandRegistry } from "../registry/CommandRegistry";
import { C... |
34964e54a066566f94ac300612832cba2587b9e21167e9abf1f26051c20d228d | TypeScript | 11,920 | 406 | /**
* Client for the `/embeddings/v2` column protocol.
*
* Binary responses share a 16-byte little-endian header
* (`u32 magic "FOE1" | u16 version | u8 dtype | u8 width | u32 n |
* u32 flags`) followed by `width` contiguous columns of `n` values in
* wire order — the brain run's row order, which is the join key ... |
5fc601ebcfbe2e9ed6c82702b3f59b2acb8641fb7126d19974f10c0c2081e78e | TypeScript | 12,019 | 428 | import { describe, it, expect } from "vitest";
import { translateToUISchema } from "./ui";
import type { TranslationContext } from "./utils";
describe("translateToUISchema", () => {
const baseContext: TranslationContext = {
warnings: [],
path: [],
strictMode: false,
};
describe("no view", () => {
... |
4bd063fa41932d6012cfe65c11decc0dbd50709439442d3d82cd1c3d14a29aa1 | TypeScript | 12,034 | 384 | import {
decodeStoredSourceFacts,
encodeStoredSourceFacts,
} from "./source-facts-codec";
import type { StoredSourceFactsV1 } from "./source-facts";
import {
createIndexedDbConnection,
requestResult,
transactionDone,
} from "./persistence/indexeddb";
import { getEventBus } from "@fiftyone/events";
/** e2e sp... |
fac055fa7621fdf66c39da6b294e116f202e86acf07b4479b1a6e617d60eb733 | TypeScript | 12,100 | 441 | import { PlaybackSyncMode } from "../../../schemas/v1/index";
import { maxBigInt, minBigInt } from "../../../utils/bigint";
import type {
McapDecodedMessage,
McapResolvedStreamSyncPolicy,
McapStreamSyncPolicies,
McapStreamSyncPolicy,
McapSynchronizedMessageWindow,
McapActiveTimeline,
} from "../contracts/in... |
68581a0f02bd1241c8fe03b69a891ae98bae595158ca1bb3330cc031d43db54f | TypeScript | 12,165 | 360 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { MAX_FRAME_STREAM_SIZE } from "../constants";
// Simplified dummy worker -- only postMessage and terminate are used
// by frame-reader.ts; no EventTarget or listener overrides needed.
const { DummyWorker } = vi.hoisted(() => {
return {... |
68d8a14adc60bbe399d452f23c300aa0a672dbb9745216ee95713df9548eb01b | TypeScript | 12,214 | 399 | import {
getIsPlayPending,
getIsPlaying,
getLoopEnd,
getLoopStart,
getPlayhead,
type PlaybackStore,
} from "@fiftyone/playback";
import {
BYTE_SOURCE_READ_PROFILE,
type ByteSourceReadProfile,
type ByteTimelinePoint,
} from "../../../ir";
import { type EpisodeStreamCache, type TimelineIndex } from "..... |
4310117b3f3b226ab8a770d44e316ae3ede69dc68576474638d50a177cfbfeb9 | TypeScript | 12,240 | 456 | import * as THREE from "three";
import type {
ImageAnnotationPoints,
RgbaColor,
SceneCubePrimitive,
ScenePoint3d,
SceneUpdateVisualization,
} from "../../../ir";
import { VISUALIZATION_KIND } from "../../../visualization";
import type { ImageAnnotationSetInput } from "../../../visualization/media-2d/gpu-imag... |
1ba95c76be47cd67c8ab0476c0c67305ddb1247d02ce9bafbe6d0a18a0c9e1e0 | TypeScript | 12,290 | 425 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
// note: inspired by https://github.com/davidfig/pixi-dashed-line/blob/main/lib/index.ts
import * as PIXI from "pixi.js";
/** Define the dash: [dash length, gap size, dash size, gap size, ...] */
export type Dashes = number[];
export interface DashLineOptions {
dash?:... |
de67db59073328e6141533cdab96c3fa4ef96610af18684f6c68a3a4a6701e95 | TypeScript | 12,309 | 369 | import type {
ByteSourceDescriptor,
EpisodeManifest,
EpisodePosterFrame,
EpisodePreviewReadResult,
EpisodeTimeline,
TimeWindow,
} from "../ir";
import { byteSourceAccessKey } from "../query/bytes";
import {
normalizeSourceFactsPayload,
SOURCE_FACTS_MCAP_ADAPTER_ID,
type SourceFactsPayload,
type Sour... |
14c8af35c722b23a37e6448b6f3d4f4df644129ad9ad05cceabd37f9a43c8c9e | TypeScript | 12,333 | 410 | import { beforeEach, describe, expect, it, vi } from "vitest";
import { loadModelWeights, MAX_RETRIES } from "./modelCache";
// Minimal in-memory IndexedDB mock
function createMockIDB(options?: { failOn?: "get" | "put" }) {
const { failOn } = options ?? {};
const store = new Map<string, ArrayBuffer>();
const clo... |
55284311603a3002e21cc5a0ce0f1c7ce494de1164db42b98d62837912907b67 | TypeScript | 12,437 | 373 | import {
getIsPlayPending,
getIsPlaying,
getPlayhead,
seekEventAtom,
subscribePlayhead,
type PlaybackStore,
} from "@fiftyone/playback/headless";
import { monotonicNowMs } from "../utils/monotonic-time";
import type { TimelineIndex } from "./timeline-index";
/** Minimal mutable reference contract shared wi... |
2734eaa9d917068205647538da8963914a4e95287903b6b7fe61de42fa103585 | TypeScript | 12,479 | 418 | import {
type LabelRef,
useActiveAnnotationSampleId,
useAnnotationEngine,
} from "@fiftyone/annotation";
import { useLighter } from "@fiftyone/lighter";
import { useGetKeypointSkeleton, type AnnotationLabel } from "@fiftyone/state";
import { atom, type PrimitiveAtom, useAtomValue, useSetAtom } from "jotai";
impor... |
dffbc1977774cf597fa1544458ea5270a95f641acdbc1ea26880afc7b9ce94cc | TypeScript | 12,480 | 454 | import { describe, expect, it, vi } from "vitest";
import type { DecodedFrame, SynchronizedFrameWindow } from "../../../ir";
import { createTimelineIndex, EpisodeStreamCache } from "../../../runtime";
import {
bufferedRangesEqual,
boundSpeculativeTicksByByteTimeline,
decodeFailuresByStream,
DEFAULT_PLAYBACK_POL... |
6f7cbf9f1a28b4dcf96c437987770e8a365926d15fc2611c065aceda4d802c3e | TypeScript | 12,532 | 439 | // @vitest-environment jsdom
/**
* Tests for useUnselectVisible.
*/
import { act, renderHook } from "@testing-library/react";
import React from "react";
import {
DefaultValue,
RecoilRoot,
useRecoilValue,
type MutableSnapshot,
} from "recoil";
import { beforeEach, describe, expect, it, vi } from "vitest";
c... |
98729db46dee751c99680f9e630f354bf246f68333aaeef0af1f3d1f73546586 | TypeScript | 12,599 | 369 | /**
* Named label-schema DOC access for the Schema Manager (the converged
* design's one-editing-surface). Wraps the `@voxel51/label-schemas`
* schema-doc operators with the same `operatorAsPromise` pattern the
* dataset-level schema manager uses, and holds the manager's doc-mode
* state: which doc is selected (nu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.