sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
63686395da9a68690c48078d75c7929d976180814f29a42cfda880f693a034e1
TypeScript
3,974
124
import type { SourceSpecification, StyleSpecification } from "maplibre-gl"; import { MAP_BASE_LAYER, OPENFREEMAP_LIBERTY_STYLE_URL, OPENFREEMAP_PROVIDER_NAME, type MapBaseLayer, } from "./rendering/types"; /** Layer used behind trajectories until a remote basemap is installed. */ export const MAP_LOCAL_BACKGRO...
5ef1dd46e811530902fb03d2cc8ef6e4c666aded077c11967c3162602b3732b7
TypeScript
3,985
121
// @vitest-environment node import { IDBFactory } from "fake-indexeddb"; import { afterEach, describe, expect, it, vi } from "vitest"; import { requestResult, transactionDone, } from "../../../runtime/persistence/indexeddb"; import type { GridPosterCacheEntry } from "./grid-poster-cache"; import { createIndexedD...
88d81b30d191ecbf3de473caa42ba2b15e8c26dbfa6c161c9c1ee38ab625cb56
TypeScript
3,990
128
import { isLegacyDomMirror } from "@fiftyone/events"; import * as fos from "@fiftyone/state"; import { useCallback, useEffect, useRef } from "react"; import { useRecoilValue } from "recoil"; import type { Box3, PerspectiveCamera, Vector3 } from "three"; import { SET_EGO_VIEW_EVENT, SET_TOP_VIEW_EVENT } from "../constan...
3641c9eb40510f744fbc344116f617d919bf5172aa5dcd17fcd2f7fafd71bbe5
TypeScript
3,991
155
/** * Copyright 2017-2026, Voxel51, Inc. */ import { type LighterEventGroup, type Scene2D, UNDEFINED_LIGHTER_SCENE_ID, useLighterEventHandler, } from "@fiftyone/lighter"; import { TypeGuards } from "@fiftyone/lighter/src/core/Scene2D"; import * as fos from "@fiftyone/state"; import { useCallback, useEffect }...
fb35689849b9138128cfcdf40c52bc3944c09ca69c241171136a7162c2b13fd9
TypeScript
3,999
126
import { afterEach, describe, expect, it, vi } from "vitest"; import { copyVideoFramePresentation, SharedVideoPresentation, } from "./presentation"; describe("SharedVideoPresentation", () => { afterEach(() => { vi.unstubAllGlobals(); }); it("keeps the copied source until the engine and every renderer r...
1fc2d97878d192ba9fc40a3ffe160ca3a190fb98e876354726c0b2084dcfdb41
TypeScript
4,006
125
/** * Copyright 2017-2026, Voxel51, Inc. */ import { getEventBus } from "@fiftyone/events"; import copy from "copy-to-clipboard"; import { BaseState } from "../../state"; import { BaseElement } from "../base"; import { AppError } from "@fiftyone/utilities"; import errorIcon from "../../icons/error.svg"; import refr...
e8180490d1f5cc1f932c0f09b4d1b0e029b0f1388f6d24cf94657f713dc33972
TypeScript
4,006
144
/** * Copyright 2017-2026, Voxel51, Inc. */ import { Command, getCommandBus } from "@fiftyone/command-bus"; /** * Command to expand a field in the grid sidebar. */ export class ExpandFieldInGridCommand extends Command<void> { constructor(public readonly path: string) { super(); } } /** * Command to expa...
c976524eb3c9fff2344fa920acb22226dab89441ce1c850808b0f80730c3fff8
TypeScript
4,017
134
type MapLibreMap = import("maplibre-gl").Map; /** Stable GeoJSON source ids shared by map installation and updates. */ export const HIT_SOURCE_ID = "episode-location-hit-points"; export const CURRENT_SOURCE_ID = "episode-location-current"; export const HOVER_SOURCE_ID = "episode-location-hover"; export const MEASURE_L...
0e82a160d0ad5ed687f0c9261164c9f98256360088de299d01c08958eaafbccb
TypeScript
4,022
94
import { cssVar } from "@voxel51/voodo"; import type { CSSProperties } from "react"; /** Minimum card geometry, shared by the stylesheet and the resize math. */ export const CARD_WIDTH = 208; export const CARD_PREVIEW_HEIGHT = 106; /** A card is its media plus two 1px borders; nothing is captioned. */ export const CAR...
2f1759b75d454550f82833ed1e07670203451246860dc1d5fc9d2a3ab8c071b5
TypeScript
4,022
126
/** * Copyright 2017-2026, Voxel51, Inc. */ import { useAnnotationEngine, useAnnotationEventBus, usePersistAnnotationDeltas, type LabelRef, } from "@fiftyone/annotation"; import { AnnotationLabel } from "@fiftyone/state"; import { useCallback } from "react"; /** * Hook returning a callback that deletes an ...
220eae6d358b864bb6904e6c26b27833a9e639f55670b8566513b37cc9cdfad1
TypeScript
4,024
198
import Aggregation from "./Aggregation"; export type BoundsParams = { fieldOrExpr?: any; expr?: any; safe?: any; }; export class Bounds extends Aggregation { constructor(params: BoundsParams = null) { super(); this.params = params; this._cls = "fiftyone.core.aggregations.Bounds"; this._nameMap...
26a390bd2d7c31740facfc01f06d43ffa50a67c3f10211ef9eefe89408adef07
TypeScript
4,024
121
import { useEffect, useRef, useState } from "react"; import type { PointCloudCameraPose, PointCloudCameraProjection, } from "../../../../visualization/scene-3d/types"; import type { Scene3dUpAxis } from "../../spatial/view-preferences"; import type { Scene3dCameraNavigationMode, Scene3dViewStateStore, } from "...
add82c28713718b463750cc70660b86db32f382d4ef806d336f0f89d8a47722e
TypeScript
4,032
147
import { describe, expect, it, vi } from "vitest"; import type { Decoder } from "../../decoders"; import { DecoderRegistry } from "../../decoders"; import { VISUALIZATION_KIND } from "../../visualization"; import { createDecodeClient, createMemoryDecodedOutputCache, type DecodeExecutor, } from "./index"; describ...
cd162c8d47593754ee8e93105aba330e2b92d03a03a45b1dac3b870b70c9c356
TypeScript
4,043
122
import type { EpisodeFrameTransformTimeRange } from "../../../../runtime/frame-transform-types"; import { maxBigIntPair, minBigIntPair } from "../../../../utils/bigint"; /** Maximum predecessor history included in a foreground placement window. */ export const DYNAMIC_TRANSFORM_LOOKBACK_NS = 500_000_000n; /** Forward ...
90f916a9c8c0fec40be7fc699ae747d3cd5ca3041d588eeaf1355e622d591f40
TypeScript
4,044
147
import { folder, useControls } from "leva"; import { createElement, useCallback, useEffect, useMemo, useState, } from "react"; import { useSetRecoilState } from "recoil"; import { Vector3, type PerspectiveCamera } from "three"; import { PANEL_ORDER_CAMERAS } from "../../../constants"; import { useFetchSampleS...
c522f89f8de9ef6ebd363616d09adeebc28f552d74b5178b710708e917c08253
TypeScript
4,048
118
import type { Camera } from "three"; /** One embedding point as delivered by the host application */ export interface EmbeddingPoint { id: string; x: number; y: number; /** * Optional third coordinate. Ignored (the data renders flat) unless * the host supplies a zCamera adapter for it. */ z?: number...
30ca2ff7ff814fe4812b70f4a579f38447dd33d530ed2bc228a9700237d2e3c6
TypeScript
4,055
125
import { describe, expect, it } from "vitest"; import { packIntervals, UNPLACED } from "./pack-intervals"; const span = (start: number, end: number) => ({ start, end }); describe("packIntervals", () => { it("keeps disjoint intervals on one level", () => { const { levels, levelCount } = packIntervals( [spa...
c2209b922ea91c86624679b46af471cdb4a8d768f19255c8bf4a99358af8f78c
TypeScript
4,075
117
import { useBrowserStorage } from "@fiftyone/state"; import { useCallback, useMemo, useRef } from "react"; import { getAuthoredVisibilityMap, getVisibilityMapFromFo3dParsed, } from "../fo3d/utils"; import type { FoScene } from "../fo3d/render-types"; export const FO3D_NODE_VISIBILITY_STORAGE_KEY = "fo3d-nodeVisibi...
a631ea76888e7077505702dfc44425b2a0c7859ae6dddcb6c8daa71e96f730ea
TypeScript
4,076
129
const BASEMAP_READINESS_TIMEOUT_MS = 8_000; export const BASEMAP_PROVIDER_ERROR_LIMIT = 3; export const BASEMAP_RETRY_DELAYS_MS = [500, 1_500] as const; interface BasemapEventLike { readonly coord?: unknown; readonly error?: { readonly sourceId?: unknown }; readonly source?: { readonly id?: unknown }; readonly...
405c7d06cc506797bde460ac2460b1decb5108fde6ca23d1ade05955ba2a2aef
TypeScript
4,087
140
import { beforeEach, describe, expect, it, vi } from "vitest"; import { decodeMaskOnDisk } from "./mask-decoder"; // mock the entire canvas-decoder module, // it's hard to test it because it uses offline canvas and createImageBitmap vi.mock("./canvas-decoder", () => { return { decodeWithCanvas: vi.fn().mockResol...
c4e70c3f752e3f9cee4d571dccf919a1891635451503d5ff60d7246dc6a19090
TypeScript
4,087
104
import * as THREE from "three"; import { describe, expect, it } from "vitest"; import { getCuboidOrientationMarkerGeometry, getCuboidOrientationMarkerPropsFromGeometry, getHeadingArrowLengthScale, } from "./cuboid-orientation-geometry"; describe("getCuboidOrientationMarkerGeometry", () => { it("returns null wh...
ae8e7bda430f18cff2364a2d77770547e185a19185ce446491018758e3409e2c
TypeScript
4,099
108
import { act, renderHook, waitFor } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; import type { AgentDescriptor } from "../registry"; import type { InferenceResultProxy } from "../types"; const descriptor = (id: string) => ({ id, label: id, agent: {}, }) ...
23a0c2edb8c4adedc34eef4e59499202a2cef419699b1e5f40b9535cace07d7e
TypeScript
4,101
148
import { useTheme } from "@fiftyone/components"; import { useHelper } from "@react-three/drei"; import { folder, useControls } from "leva"; import { useCallback, useMemo, useState } from "react"; import { DirectionalLightHelper, type Light, PointLightHelper, SpotLightHelper, } from "three"; import { useFo3dCont...
73ae274248797a969503c26070299076e1df60480829b0192e5a0d30dbf9e4fb
TypeScript
4,104
114
import { Quaternion, Vector3 } from "three"; import type { PointCloudCameraPose } from "../../../../visualization/scene-3d/index"; import type { Scene3dCameraTargetPose } from "./scene-3d-camera"; import { DEFAULT_SCENE_3D_UP_AXIS, type Scene3dUpAxis, } from "../../spatial/view-preferences"; import { sceneUpVector ...
1910605521f2f35312d730d98245f256d06bc156cb40c5a80ca32cc42aaeeeb7
TypeScript
4,113
135
import type { VideoIntentPriority } from "./types"; import { VIDEO_INTENT_PRIORITY_WEIGHT, VideoIntentCancelledError, VideoSchedulerClosedError, } from "./types"; interface Waiter { readonly abortListener: () => void; readonly enqueuedAt: number; priority: VideoIntentPriority; readonly reject: (error: Er...
ee86af650ab563a0f46bc91cf5b3b7c316e390c45cbbec0d3d94e5fcbefbac23
TypeScript
4,122
148
import { beforeEach, describe, expect, it, vi } from "vitest"; import type { EpisodeManifest } from "../ir"; import type { EpisodeSource, EpisodeSourceHints } from "../ports"; import { openEpisodePreviewSession, openEpisodeSession, } from "./episode-resources"; const resourceHarness = vi.hoisted(() => ({ byteRe...
63650ce6e210d178b29485a002a9af1a8c52d63093571ab0400875b0596deaf1
TypeScript
4,126
127
/** * Copyright 2017-2026, Voxel51, Inc. */ import { FetchFunctionConfig, FetchFunctionResult, getFetchFunctionExtended, } from "@fiftyone/utilities"; /** Shared request fields — every video-labels read targets one video sample. */ type VideoLabelsRequestBase = { /** Sample id for the parent video document....
fdf061dc679538b72e9d3e4458de68ce874031a4ed8993694f0610d0ed2fba80
TypeScript
4,129
132
import * as fos from "@fiftyone/state"; import { useHelpPanel, useIsMediaType, useJSONPanel } from "@fiftyone/state"; import { MEDIA_TYPE_MULTIMODAL } from "@fiftyone/utilities"; import { useCallback, useContext, useRef } from "react"; import { useRecoilCallback, useRecoilValue } from "recoil"; import { modalContext } ...
c6204be514565839cbefaf0a382c61697846925f4f3f04bed397e9c676763ec6
TypeScript
4,130
124
import { IDBFactory } from "fake-indexeddb"; import { afterEach, describe, expect, it, vi } from "vitest"; import { createIndexedDbConnection, requestResult, transactionDone, } from "./indexeddb"; afterEach(() => vi.unstubAllGlobals()); describe("IndexedDB runtime persistence", () => { it("retries unavailable...
911157a4c524a9616e4420a7bde10267d7970053660066a45caedc5e6d3b61e5
TypeScript
4,133
136
import type { DecodeContext } from "../../../../decoders/index"; import type { DecodedAttributeValue, DecodedOutput, LocationVisualization, } from "../../../../ir/index"; import { VISUALIZATION_KIND } from "../../../../ir/index"; import { finiteNumberArrayField, numberField, recordField, rosHeader, rosH...
fc2f89194aab2098fb4c6b514b32804942bae8e4ea2a5bbbcb7dc0d9b3fc79d3
TypeScript
4,133
143
import { vi, describe, it, expect, beforeEach } from "vitest"; import { renderHook } from "@testing-library/react"; vi.mock("../util", () => ({ doPatchSample: vi.fn(), })); vi.mock("@fiftyone/state", () => ({ generatedDatasetName: null, isGeneratedView: false, useCurrentDatasetId: vi.fn(), useModalSample: v...
2993793281dc89e65aaa0c0aecd78a521f4375c5010387fde1ac960339dd389b
TypeScript
4,139
109
import { AgentTaskType, InferenceResult, InferenceResultProxy, SegmentationInferenceResult, } from "../types"; import { useCallback } from "react"; import { type DetectionLabel, DetectionOverlay, InteractiveDetectionHandler, UNDEFINED_LIGHTER_SCENE_ID, useLighter, useLighterEventBus, } from "@fiftyo...
e8bd24e1add939ddeb631bb37d7a2edb6bde64b3882d29ad28d413a62ec2aeb2
TypeScript
4,143
169
import { describe, it, expect } from "vitest"; import { addWarning, getEmptyValueForType, isSchemaIOSchema, isJSONSchema, type TranslationContext, } from "./utils"; describe("addWarning", () => { it("should add warning to context", () => { const context: TranslationContext = { warnings: [], ...
63d39ade591cb878f514e5c7d9fa931fd717a61c3d6026e1364de1d3e17261b5
TypeScript
4,150
176
/** * @generated SignedSource<<c3864aa64ab70a5ab8ac553837caae81>> * @lightSyntaxTransform * @nogrep */ /* tslint:disable */ /* eslint-disable */ // @ts-nocheck import { ReaderFragment, RefetchableFragment } from 'relay-runtime'; import { FragmentRefs } from "relay-runtime"; export type NavDatasets$data = { read...
192626297276ccdb80cef381fa601cb9bd3557e0ffb710fd96192a8bd18a2eb0
TypeScript
4,156
154
import { describe, expect, it, vi } from "vitest"; import { Quaternion, Vector3 } from "three"; import type { CameraFrustumPanelLayer } from "../../../visualization/scene-3d"; import type { FrameTransformResolver } from "./frame-transforms/use-frame-transforms"; import type { DepthHover } from "./depth-sampling"; impo...
506b3d74a1f86c8e97ef9f8c7bab16a8e79a9d3cf0c21dd49e842473acfaee53
TypeScript
4,159
120
// Stub factories for annotation-edit hook tests. The vi.mock declarations // themselves still live in each test file (vitest hoists them per-file), // but the shapes they return come from here. import { vi } from "vitest"; // ---- annotationContext stub ------------------------------------------------- export interf...
16b6a67a2606450386eaa317bb55c153d021b0c91f85eec6800cbe77939ec98a
TypeScript
4,161
139
import { describe, expect, it } from "vitest"; import type { StreamDescriptor } from "../../../ir"; import { resolveTimelineMode } from "./timeline-mode"; function createStream(metadata: Record<string, string> = {}): StreamDescriptor { return { id: "/topic", kind: "image", metadata, payload: { ...
3193e9db209fd928dc94d3d58113ddf5182df198f2ee74e242cd20e0fbb61597
TypeScript
4,167
96
/** * Lazy-load the label schemas at the dataset level. * * The primary loader is `useLoadSchemas` in `Sidebar.tsx`, which clears + * refetches whenever the user enters the Annotate sidebar inside a sample * modal. That loader doesn't run on the grid, so when the Schema Manager * is opened from the grid (`?schema...
5c23037882c60f77796c10095f3fd318ab36ff31207a5f21b73d02195347c1ca
TypeScript
4,169
140
import { atom, getDefaultStore, type PrimitiveAtom } from "jotai"; import { useCallback, useEffect, useState } from "react"; import type { PointCloudCameraPose } from "../../../visualization/scene-3d"; const GRID_CAMERA_SCOPE_TTL_MS = 30 * 60 * 1000; const MAX_GRID_CAMERA_SCOPES = 32; const cameraPoseAtomsByScope = n...
b6775e4ae9c54ab40a6cea30933be39e83772883f51030561cbf8ba6cfaed6e0
TypeScript
4,169
117
// --------------------------------------------------------------------------- // Per-source audio demand and published state. // // Two separate questions, both keyed by scene-source id: // // demand — does anything actually want this source's samples right now? // state — what did the one reader that owns this s...
313d97a67fc29cd6ca716de71e5a7bcdd38b35350625ac316d8832646208b939
TypeScript
4,171
126
import { crc32 } from "@foxglove/crc"; import type { McapTypes } from "@mcap/core"; import { safeNumber } from "../../../query/bytes/bigint-utils"; import type { McapDecompressedChunkKey, McapDecompressedChunkLoad, } from "./decompressed-chunk-cache"; const MCAP_CHUNK_OPCODE = 0x06; const MCAP_RECORD_HEADER_BYTES ...
e4e4b121519e7ac6e5445ce7b4944f55d9a541dfed18c98fecfb9f8af367dbc8
TypeScript
4,172
153
import * as recoil from "recoil"; export * from "recoil"; export let mockValues = {}; export const mockValuesStore = {}; export let mockDefaults = {}; export function setMockAtoms(newMockValues: { [key: string]: any }) { mockValues = { ...mockValues, ...newMockValues, }; mockDefaults = { ...mockDefaults,...
97b238482522b794007f1f26fe79129823dbf004ab7174674983883bc17bb067
TypeScript
4,175
141
import { resourceHintsForArrayBufferViews, type DecodeContext, } from "../../../../decoders/index"; import type { DecodedAttributeValue, DecodedOutput, } from "../../../../ir/index"; import { VISUALIZATION_KIND } from "../../../../ir/index"; import { buildPointCloudRenderPayload } from "../../../../runtime/poin...
c917b59f0d8da9c886f329b04dde8b7649af190c0536d8d90e7ac8f21db6795c
TypeScript
4,177
118
import { describe, expect, it } from "vitest"; import { createHttpByteClient } from "./http-byte-client"; import type { ByteRangeReadRequest } from "./types"; function request( overrides: Partial<ByteRangeReadRequest> = {}, ): ByteRangeReadRequest { return { range: { length: 8n, offset: 64n }, source: { ...
2c5ce192c25a10772b9f816b51444e8bf6b64b5668cfb56cc2092c1070dcb493
TypeScript
4,182
118
/** * Canonical annotation-entity identity. * * Identity is the full tuple `(sample, instanceId, frame?)`. `instanceId` * alone is a LINKAGE key — `fo.Instance` spans group slices, so it is not * unique across samples. Linkage-class aggregation (cross-slice highlight) * is a separate, derived query; store ops nev...
3e4c73f688b08a34873f4a601b88460d9801db9617f5310ecea467a53b53b40a
TypeScript
4,185
127
import { describe, expect, it } from "vitest"; import { VISUALIZATION_KIND, type EncodedVideoVisualization } from "../ir"; import { isSharedEncodedVideoVisualization, sharedVideoRejectionMessage, VideoDecoderFailureError, VideoDependencyWaitError, VideoIntentCancelledError, VideoSchedulerClosedError, } fro...
4746264912ce1684a801cb180622129188474d0464ff6b1dbf2e3f8e0554ac83
TypeScript
4,194
108
/** * The plot's settings, remembered across page loads per (dataset, run). * * Panel state is Recoil, so it survives view-change remounts and nothing more: * a reload dropped every choice back to its default, and the palette, the * find-similar limit and the link mode all had to be set again. These are * prefere...
86e194cecc6c9c632223a58d89856d11bc9f2ea3dc8816b7918e5278be2f543d
TypeScript
4,199
143
/** * Copyright 2017-2026, Voxel51, Inc. */ import { DYNAMIC_EMBEDDED_DOCUMENT_FIELD, EMBEDDED_DOCUMENT_FIELD, getCls, getFieldInfo, LABEL_LISTS_MAP, Schema, } from "@fiftyone/utilities"; import { LABEL_TAGS_CLASSES } from "../constants"; import { BaseState } from "../state"; import { Overlay } from "./ba...
db0ae2fd0b258e0fb407f6297cb177f372763dfb8da038a2b0597e21cfee7c5a
TypeScript
4,199
110
/** * Copyright 2017-2026, Voxel51, Inc. */ /** * The sidebar filter's paint-time effect: `Scene2D.shouldShowOverlay` (the * looker's `Overlay.isShown` equivalent), driven through the same real * `lighter:scene-options-changed` event `useLighterSetup.ts` dispatches on * every filter/field-visibility change — not...
d89c77122fafa9a7903e149781061bdbbc06a1baba6c63e1b7800831a8ad0de9
TypeScript
4,208
129
// @vitest-environment jsdom import { renderHook, waitFor } from "@testing-library/react"; import { describe, expect, it, vi } from "vitest"; import { fetchGeometry, fetchIds, fetchRunInfo, type Geometry, type RunInfo, type Slice, } from "./protocol"; import { CHUNK, useRunColumns } from "./useRunColumns"; ...
58cb749f4ef4cc18bff60d17798d71259e04afd2d74306cbbe27b8746f78ba27
TypeScript
4,226
133
import { describe, expect, it, vi } from "vitest"; import type { McapIndexedMessageTime, McapIndexedReaderLike, } from "../reader/index"; import { createMcapPredecessorStore } from "./predecessor-store"; import { resolveIndexedPredecessorRound } from "./indexed-predecessor-probe"; describe("indexed predecessor pro...
6b5bcb077126ce843abad389e3119640c5ca69ea9b754d6fccfcdb1c53072d35
TypeScript
4,233
166
import { folder, useControls } from "leva"; import { useMemo, useState } from "react"; import { useRecoilValue } from "recoil"; import { PANEL_ORDER_PCD_CONTROLS } from "../constants"; import { getThreeMaterialFromFo3dMaterial } from "../fo3d/utils"; import { avoidZFightingAtom } from "../state"; import type { FoMeshMa...
57826182854767cdc480494a589b0968d458522d33c66b9766fde40c27255530
TypeScript
4,235
131
import type { MediaReferenceDescriptor } from "@fiftyone/utilities"; import type { ByteSourceDescriptor, EpisodeManifest, EpisodeTimeline, EpisodePreviewReadResult, } from "../ir"; import type { ByteResources, EpisodeSession, ReadPriority } from "./session"; /** One stable asset exposed by an episode resolver...
24893050640cdd4fa8f6263f1e29c5f4cb3c8c8eeaf7db297dc59f92913aa391
TypeScript
4,240
119
import { describe, expect, it } from "vitest"; import type { LocationTrackPoint } from "./location-track"; import { SharedLocationPointStore } from "./shared-location-point-store"; function point( timeNs: bigint, overrides: Partial<LocationTrackPoint> = {}, ): LocationTrackPoint { return { latitude: 37 + Nu...
7e16ce809a0e3a69d6413a2820f9f1697fade8ca5c088fa236e7660c487b15a7
TypeScript
4,243
136
/** Inclusive range in timeline-index coordinates. */ export interface TickIndexRange { readonly endIndex: number; readonly startIndex: number; } /** Sorts and merges inclusive ranges without imposing a timeline boundary. */ export function normalizeTickRanges( ranges: readonly TickIndexRange[], ): TickIndexRang...
24ca76260280815a18ac27b301e72f15ab03a1604e0cecde09d12795cf2c6e08
TypeScript
4,250
137
import { describe, expect, it } from "vitest"; import type { CameraCalibrationVisualization } from "../../../../ir"; import { VISUALIZATION_KIND } from "../../../../ir"; import type { StreamPlaybackFrame } from "../../playback/use-stream-values"; import { buildCameraSourceStatuses, cameraSourceStatusDetails, } from...
402390a6f2e4d5b2efd8fb5205833a3a3d3b2fa6f6110f02af8f7ca2579cd4cc
TypeScript
4,254
135
import { atom, useAtomValue, useStore } from "jotai"; import React, { useEffect } from "react"; import type { SceneEntityVisualization } from "../../../../ir"; /** * Cross-tile object selection for the episode modal. One object at a time, * selected by clicking a 3D scene annotation or a 2D image annotation. * The ...
b290d6437961ac3dce7b771deeb7e47df937fb125351ce878425e23239a70f1b
TypeScript
4,254
119
import { describe, expect, it } from "vitest"; import { VISUALIZATION_KIND } from "../../../../ir/index"; import { decodeJsonRecord } from "./decode"; import { jsonPoseDecoder } from "./pose"; const utf8 = new TextEncoder(); describe("decodeJsonRecord", () => { it("parses UTF-8 JSON objects", () => { expect(de...
316033481d9b68fa3ff54f6121660e3c2b91f666a0735ae6b157a6d9e7f940ec
TypeScript
4,287
144
import type { DecodeContext, Decoder } from "../../../../decoders/index"; import type { CameraCalibrationVisualization, DecodedAttributeValue, DecodedOutput, } from "../../../../ir/index"; import { VISUALIZATION_KIND } from "../../../../ir/index"; import { rosDecodersForPayloads } from "../ros/factory"; import { ...
2b4d9de7b7be6db7437f5b5dda106431619009a25d246892b414c8f6f6114b04
TypeScript
4,290
132
import { beforeEach, describe, expect, it, vi } from "vitest"; import { MAX_SIDEBAR_PREFERENCE_SCOPES, readSidebarPreferences, readSidebarPreferenceScopesForTests, SIDEBAR_PREFERENCES_STORAGE_KEY, updateSidebarPreferences, } from "./sidebar-preferences"; import { semanticSourceKey } from "./semantic-source"; ...
3b85fbcc8f453a01177443e6aea3a83e819d1c6cf485d09e49d6102e02d03477
TypeScript
4,296
134
import { describe, expect, it, vi } from "vitest"; import type { McapDecodedMessage } from "../contracts"; import { DecodedRecordStore } from "./decoded-record-store"; describe("decoded MCAP record store", () => { it("leases exact topic records and preserves canonical object identity", () => { const store = new ...
29e9dd4960f5d23cbdf4019b79f49ca76cdbbc74d305a3d65196af5f0b265d80
TypeScript
4,298
133
import { describe, expect, it, vi } from "vitest"; import { STREAM_KIND } from "../../ir"; import type { ByteResources, EpisodeSource } from "../../ports"; import { collectBatches, defineEpisodeSessionContractTests, } from "../../testing/adapter-contract"; import { createFixtureFormatAdapter } from "./fixture-adapt...
3e58b6abb9f7b25779200654ce3cab246f3d6ba2599dfaacd95cdfc168627d78
TypeScript
4,317
137
import { describe, expect, it } from "vitest"; import { buildColumns, colorsFromLabels, visibleBounds } from "./columns"; import type { EmbeddingPoint } from "./types"; const point = ( x: number, y: number, z?: number, label: string | null = null, ): EmbeddingPoint => ({ id: `${x},${y},${z ?? ""}`, x, y, z, la...
8c537611587b4ee6e87ec5fc61ee561cfb0a5c2145565f647763e68ddac73e31
TypeScript
4,318
120
/** * Copyright 2017-2026, Voxel51, Inc. */ import { renderHook } from "@testing-library/react"; import { atom, getDefaultStore } from "jotai"; import { beforeEach, describe, expect, it, vi } from "vitest"; const mockDeselectOverlay = vi.fn(); const mockExit = vi.fn(); vi.mock("@fiftyone/lighter", () => ({ useLi...
ee78663790da2b37f9921bce701d92b1b4f199eea708d69e0b273a9acdc545c7
TypeScript
4,331
173
/** * Copyright 2017-2026, Voxel51, Inc. */ import { getCls, sizeBytesEstimate } from "@fiftyone/utilities"; import { OverlayMask } from "../numpy"; import type { BaseState, Coordinates, NONFINITE } from "../state"; import { DenseLabelRenderStatus } from "../worker/shared"; import { getLabelColor, shouldShowLabelTag...
04677af78ca019c508fa50c24d79cacac93bd81b102f1b539caf3e765f27bce4
TypeScript
4,336
117
import { Resource } from "@fiftyone/utilities"; import { fetchQuery, Observable, type ConcreteRequest, type Environment, } from "relay-runtime"; import { afterEach, describe, expect, it, vi } from "vitest"; import { createRouter } from "./RouterContext"; vi.mock("react-relay", async (importOriginal) => ({ .....
de4d95ec042e61c9c3a51dd347958be1ba7448da6edfb9d75b3e093d23d15af8
TypeScript
4,349
140
import { beforeEach, describe, expect, test, vi } from "vitest"; import { __test__, getEventBus } from "./registry"; type TestEventGroup = { "test:eventA": { id: string; name: string }; "test:eventB": { value: number }; }; describe("getEventBus", () => { beforeEach(() => { __test__.registry.clear(); }); ...
3d2419a3dd7f18f66b7ba04411c66c68e6d5cdc6b392328e48ae87cda051e387
TypeScript
4,362
128
import { AgentTaskType, isAgentSelectable, useActiveTask, useAgentSelector, useClearPointPrompts, usePointSelection, usePointSelectionSeed, } from "@fiftyone/annotation/src/agents"; import { useCallback, useEffect, useMemo } from "react"; import { atom, getDefaultStore, useAtom, useAtomValue } from "jotai...
7c10b5fac0d76ba0496f40b26d80423b92492ee1709e595796aad89f2ea051a1
TypeScript
4,397
140
/** * Shared helpers for JSON-encoded MCAP message decoding. JSON channels * carry UTF-8 message bytes described by a `jsonschema` schema; unlike * protobuf, the schema bytes are not needed to parse a message, so these * helpers only turn bytes into validated plain records. */ const utf8Decoder = new TextDecoder(...
55de5bf04ae9b4df5762d991fedc051da21e6663ca531b1d48db0905aa618986
TypeScript
4,413
133
/** * Copyright 2017-2026, Voxel51, Inc. * * Pure mapping from a lighter overlay to the {@link LabelProxy} the delta * pipeline expects. * * Owns the mask serialization policy for Detection overlays: * * - When the overlay still has a mask, emit the mask data — preferring a * pending edit over the persiste...
c33fa54e51c324d1c6980ab34fb22fa0e38f229a020e4ddb00db7e70b92ecbb7
TypeScript
4,427
134
import { describe, expect, it, vi, beforeEach } from "vitest"; import type { ByteClient } from "../../query/bytes/index"; import { acquireSharedMcapResourceClient, createMcapResourceClient, } from "./resource-client-factory"; const workerHarness = vi.hoisted(() => { const workerClient = { dispose: vi.fn(), ...
3399f6d05a8c20a616bc822a9193bb244ff229621c1b74e05e27cfb7c7ee4dcb
TypeScript
4,432
176
/** * Copyright 2017-2026, Voxel51, Inc. */ import { Buffer } from "buffer"; import pako from "./pako.js"; export { deserialize }; export const ARRAY_TYPES = { Uint8Array, Uint8ClampedArray, Int8Array, Uint16Array, Int16Array, Uint32Array, Int32Array, Float32Array, Float64Array, }; export type T...
f62d15f7178d9467c304a3a2fb8cac9a775b43d5489ade2a56383f62d0e61788
TypeScript
4,439
123
/** * Generic registry for things that render on top of grid sample tiles. * * A "tile decorator" is anything that wants per-sample DOM/UI on the * grid — status badges, comments-count chips, quality-score halos, * reviewer initials, etc. Decorators are plain React components that * accept a `sample` prop and ret...
875db1d76ebd7ac83c8152b98e45679478322efc88727b233ce9d642afac0680
TypeScript
4,440
152
import { LRUCache } from "lru-cache"; const DEFAULT_MCAP_DECOMPRESSED_CHUNK_CACHE_BYTES = 128 * 1024 * 1024; export interface McapDecompressedChunkKey { readonly compressedLength: bigint; readonly compressedOffset: bigint; readonly compression: string; readonly decompressedSize: bigint; readonly sourceKey: ...
ec47adfa783a5b357f71d4a7a3b9b8e9d1578ca54ae4b00195b2881196c22ff4
TypeScript
4,448
148
/** * Copyright 2017-2026, Voxel51, Inc. * * Mask decode dispatcher. Produces a color-INDEPENDENT white+alpha * `ImageBitmap` (for GPU tinting) plus single-channel hit-test pixels. The * decode + rasterize + `ImageBitmap` creation run in `maskDecodeWorker` * off the main thread when Workers are available, with a ...
dcbcdad193bf42a17ab89835f96f02f92ccdb67b59d5329799a65f9bd5f71d22
TypeScript
4,459
151
import type { McapDecodedMessage, McapNumericSeriesResult, McapNumericSeriesSliceResult, } from "../contracts/index"; import { messagesFromMcapWorkerResult } from "./worker-result-traversal"; /** * Collects transferable buffers from decoded MCAP results before worker posting. */ export function transferablesFo...
c29247fdde15f4dd8ac0113108b2af7d2b8d79e16525585dd577142592be42df
TypeScript
4,465
144
import { HOVER_INTERVAL_MS } from "../constants"; import type { HoverHit } from "../types"; interface HoverCallbacks { /** True while another interaction owns the pointer (e.g. lasso) */ isBlocked: () => boolean; /** Hit-test the pointer position; the chart owns the projection */ pick: (x: number, y: number) =...
9aa263453a51d89288a125d4936d4e647d46833af38d353000cd7468ad78a908
TypeScript
4,467
176
import { coerceDecodedNumber, FOXGLOVE_PROTOBUF_NUMBER_COERCION_POLICY, } from "../../numeric-coercion"; /** * Small runtime coercion helpers for decoded Foxglove protobuf messages. * * Protobufjs returns plain JavaScript objects whose exact field casing depends * on descriptor/runtime behavior, so Foxglove de...
c410142f5523d2c7bdb766d1f360da7c83ed167123f8a0db656984e75e3d476d
TypeScript
4,471
158
import type { LoadingManager } from "three"; import { useEffect, useRef } from "react"; import { useRecoilState, useSetRecoilState } from "recoil"; import { fo3dAssetsParseStatusThisSample, fo3dLoadingStatusThisSample, } from "../state"; import { LoadingStatus } from "../types"; import { useLoadingStatus } from "./...
399396e98cd358474bbd5ab6bd6e3a637bc5f0d010cd2685b81eebcabde2754d
TypeScript
4,479
153
import { IconName } from "@voxel51/voodo"; import { getEpisodeTileExtension, getEpisodeTileExtensions, } from "../../../extensions/tiles/registry"; import type { EpisodeTileAvailability } from "../../../extensions/tiles/types"; import { SCENE_SOURCE_TYPE } from "../../../ir"; import AudioTile from "../audio/AudioTi...
08de555ba9265607e5807361ccbe31961c9da08a8fad1a1018c501af77c3d937
TypeScript
4,486
119
/** * Legend click semantics as pure transforms over the App's sidebar * filter for the color-by field. Which classes are "on" derives from * that filter, not legend state, so sidebar edits and legend clicks can * never disagree. `null` means no filter (every class on). * * soloLabel (double click) writes INCLUSI...
be32436679bec2a9855157b757ccd4b6820bf48f50937cbe124a76efb32cc647
TypeScript
4,493
147
import { Quaternion, Vector3 } from "three"; import { describe, expect, it, vi } from "vitest"; import type { FrameGraphSummarizer, FrameTransformResolver, } from "../spatial/frame-transforms/use-frame-transforms"; import { resolvePointCloudProjectionTransform } from "./use-image-projection-layers"; describe("poi...
566149ba6deff486caa0022ab9c999fc678a3623fe0b1e33a81ef809c74da05a
TypeScript
4,518
127
// --------------------------------------------------------------------------- // Format-neutral audio types. // // Nothing here knows about MCAP, Foxglove, or any container. An audio // source — an MCAP topic, a bare .wav/.mp3 file, a remote stream, a test // fixture — only has to produce `PcmAudioData`; everything do...
e5694c06bdd95f70cc449f5d22f4eee2b488feacfaaa4cf7601ee2f6484d5e3f
TypeScript
4,527
126
/** * Copyright 2017-2026, Voxel51, Inc. */ import { describe, expect, it, vi } from "vitest"; import { KEYPOINT_RADIUS, RIPPLE_CYCLE_MS, RIPPLE_LINE_WIDTH, RIPPLE_MAX_RADIUS, RIPPLE_PEAK_OPACITY, RIPPLE_RING_COUNT, } from "../constants"; import type { Renderer2D } from "../renderer/Renderer2D"; import {...
9c5a120eff9627a558b1ffc5a67ac37c0f84aff8ebca1fa4e7c3d561758e27c2
TypeScript
4,531
156
/** * Copyright 2017-2026, Voxel51, Inc. */ import { afterEach, describe, expect, it, vi } from "vitest"; const response = vi.hoisted(() => ({ savedView: [] as unknown[] })); // The mutation completes at once, as when it lands mid-refresh vi.mock("relay-runtime", () => ({ commitMutation: ( _: unknown, { ...
2757937024423a87a322dc4aa335642384b1db3c502906b9add83f050ce7b55a
TypeScript
4,537
175
import { Quaternion, Vector3 } from "three"; import { areVectorsCoLocated, isFiniteVector3, isNumericTuple, } from "../../../utils"; export type SerializedStaticTransform = { translation: [number, number, number] | number[]; quaternion: [number, number, number, number] | number[]; source_frame?: string; ...
04d3baa330aa8a9271aa18e7b51d29cb7a8d04cc78c2093c861aad89988d7564
TypeScript
4,540
136
import { describe, expect, it } from "vitest"; import { createScene3dViewStateStore, EMPTY_SCENE_3D_VIEW_STATE, scene3dSourceShapeMatches, resolveScene3dSelectionRestore, } from "./scene-3d-view-state"; describe("episode 3D view-state store", () => { it("starts empty and records fields independently", () => ...
c23eb66ab65ff94aefd98b91054c793a633f11ec83aa1b3ba554a958d0b664f3
TypeScript
4,541
152
// @vitest-environment jsdom /** * Copyright 2017-2026, Voxel51, Inc. * * `useExit` closes the sidebar form and releases whatever the form held. The * case that matters here is a DRAFT with drawn content: its overlay was * selected in the scene with side effects suppressed and its ref is never * engine-active, so...
37137f193e9598238b212f1134e15e0fa28eba1306472c9724a393e36650ec63
TypeScript
4,546
152
import type { MapMeasurementPoint, MapMeasurementState } from "../measurement"; import type { LocationTrackState } from "../tracks/location-track"; import { MEASURE_PREVIEW_SOURCE_ID } from "./map-sources"; import { EMPTY_MAP_FEATURE_COLLECTION, setGeoJsonSourceData, type MapGeoJsonFeature, type MapGeoJsonFeatu...
4ce327a110705766d2fedd9f612924b03fe84235daff56736958a7953c3a3ef6
TypeScript
4,559
114
import { useAnnotationEngine } from "@fiftyone/annotation"; import { DetectionOverlay, KeypointOverlay, useLighter, } from "@fiftyone/lighter"; import { TypeGuards } from "@fiftyone/lighter/src/core/Scene2D"; import type { AnnotationLabel } from "@fiftyone/state"; import { DETECTION, hasValidBounds, KEYPOIN...
d9014fde8a3f8e60d252936e05088d31996c0416e2445ecff2c3beb4f4f628c9
TypeScript
4,563
154
import * as fos from "@fiftyone/state"; import { getFetchFunction } from "@fiftyone/utilities"; import { useCallback, useEffect, useMemo, useState } from "react"; import { useRecoilValue } from "recoil"; import { useImageSlicesIfAvailable } from "../../../annotation/useImageSlicesIfAvailable"; import type { CameraInt...
2cece04c16d6737becf9713d8f75393cfa81347438ededff29211b227b08a14b
TypeScript
4,564
163
import { useCallback, useLayoutEffect, useRef, useState } from "react"; import { Box3, Group } from "three"; /** userData key of the placeholder a scene node renders while its asset loads */ export const FO3D_ASSET_LOADING = "fo3dAssetLoading"; const DEFAULT_STABLE_SAMPLES = 3; const DEFAULT_EPSILON = 1e-4; // 10 sec...
84c4e4ec060f85a98160b3267b521480e945dcf5f4bfd450d13ececa2a275a68
TypeScript
4,576
158
/** * Copyright 2017-2025, Voxel51, Inc. */ import { Command } from "../types"; import { KeySequence, KeyParser } from "./KeyParser"; import { CommandRegistry } from "../registry"; export type KeyMatchState = { partial: boolean; full?: Command; }; type KeyBindingEntry = { command: Command; priority: number...
94a62339bee4b3220d600d116e58824462e2ce177d87a6d30b9d58f424d5e89b
TypeScript
4,593
141
import type { McapTypes } from "@mcap/core"; import type { ByteSourceDescriptor } from "../../../query/bytes/index"; import type { DecodeClient } from "../../../query/decoding/index"; import { isEpisodeReadCancelledError } from "../../../ports/index"; import { McapTopicDecodeError } from "../normalization/errors"; impo...
9d0669e50eca53717b7bd7daeba941dd233e48d08e4a6277b8d39060d15f8507
TypeScript
4,602
197
import { get, merge } from "lodash"; import * as components from "../components"; import { UnsupportedView } from "../components"; import { ArraySchemaType, CustomComponentsType, SchemaType, ViewPropsType, } from "./types"; import { getLayoutProps } from "./layout"; import { isNullish } from "@fiftyone/utilitie...
436bb8d4a517d68acbbf0d458548d93924e98855905e3e94a1469628fa9c4b56
TypeScript
4,608
171
import { Box3, MathUtils, Vector3 } from "three"; import { MAIN_PANEL_ORBIT_ZOOM_SPEED, ORBIT_CONTROLS_WHEEL_ZOOM_BASE, } from "./side-panel-camera-sync"; export const MAIN_PANEL_ORBIT_PAN_SPEED = 1.15; export const MAIN_PANEL_CLOSE_NAVIGATION_DISTANCE_RATIO = 0.03; export const MAIN_PANEL_CLOSE_NAVIGATION_MIN_DIS...
c8f90790d4f4e215afdc3945bbd9906ab521e812f2d71269534c4907a2029fd9
TypeScript
4,611
148
import { useCallback, useEffect, useMemo, useRef } from "react"; import { atom, useAtom } from "jotai"; import { useRecoilValue } from "recoil"; import { useLighter } from "@fiftyone/lighter"; import { DETECTION } from "@fiftyone/utilities"; import useExit from "./useExit"; import { isPatchesView } from "@fiftyone/s...
b6a30663fde41c7516dda9180479f5f89c6cb4f7a23ef36be065b33e61a8cd84
TypeScript
4,615
161
import { Quaternion, Vector3 } from "three"; import { describe, expect, it } from "vitest"; import { cameraPoseFromTrackingAnchor, cameraTargetPoseFromFrameTransform, cameraTrackingAnchorFromPose, type Scene3dCameraTargetPose, type Scene3dFollowTrackingMode, } from "./scene-3d-camera"; import type { PointClou...
9d4664245ceecbd4dd80c1ae8e3c2e61957b52addeef02aa81727b915d74058b
TypeScript
4,621
132
/** * Runtime video-decode capability, asked of the client rather than assumed. A * fixed allowlist is wrong in both directions: it refuses HEVC the client * decodes natively, and accepts codecs it cannot decode at all - whose refusal * then surfaces as a read that never completes. */ /** Decoder families a conta...
f347a88592e92388482182aa0bc2612db82215beb76d9b318e8ef8f0c2b2c2d4
TypeScript
4,624
142
/** * looker-3d label-kind adapters: per-kind translation between committed labels * and the 3D annotation working store. The working store is this surface's * retained "scene" (cf. Scene2D for Lighter): a {@link Looker3dHandle} is a * store-bound view of one entry, since working entries are immutable store * valu...