sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
dc0c06003e1bb4fc6ed6c240c8309b8c35edd9c12857976786a980d0d3d63250 | TypeScript | 2,197 | 72 | /** Aggregate counters exposed by the episode performance-stats panel. */
export interface MapPerformanceStats {
readonly followCommands: number;
readonly playbackPaints: number;
readonly reactCommits: {
readonly surface: number;
readonly tile: number;
};
readonly sourceUpdates: Readonly<Record<string... |
c991709fd381565c2ad219f59e69a4fb30413d5d572f162a5a92fca73a2824d2 | TypeScript | 2,200 | 68 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import {
isFrameScopedPath,
useActiveSampleId,
useAnnotationEngine,
useFrameValue,
useTemporal,
} from "@fiftyone/annotation";
import {
useDynamicGroupGroupBy,
useDynamicGroupOrderBy,
useIsImageDynamicGroupVideo,
} from "@fiftyone/state";
import type { Prim... |
08778e3029693ba3b5beb30eeb3945e37169c9fac81157e31e8de33c1786f0cc | TypeScript | 2,201 | 71 | import { useSelectionSubsetDisabledReason } from "@fiftyone/state";
import {
deleteSubset,
useInvalidateSelectionScope,
type SavedSubset,
} from "@fiftyone/state/src/selection";
import { getEventBus } from "@fiftyone/events";
import { useEffect, useState } from "react";
import {
rememberSubsetConfirmation,
sk... |
9fc25a04c74263f33218b831c703d3f57e7dd0485e220a591056864fecfe3ec5 | TypeScript | 2,207 | 55 | import type { LabelRef } from "@fiftyone/annotation";
import type { AnnotationLabel } from "@fiftyone/state";
import { atom, type PrimitiveAtom } from "jotai";
import type { LabelType } from "./types";
export const savedLabel = atom<AnnotationLabel["data"] | null>(
null,
) as PrimitiveAtom<AnnotationLabel["data"] | ... |
bb8bf240222f1c1a0eefa12fcd9e894eeb3d117fca7fd40e6c4a0c514a2aa977 | TypeScript | 2,210 | 72 | import type { EpisodeFrameTransformTimeRange } from "./frame-transform-types";
/** Whether canonical transform coverage contains a timestamp. */
export function isFrameTransformTimeIndexed(
ranges: readonly EpisodeFrameTransformTimeRange[],
timeNs: bigint,
): boolean {
return ranges.some(
(range) => range.st... |
f0bf6f9b7c9571db5de497d626d6d99764e86c244d47a3cd566b564db977b07a | TypeScript | 2,228 | 70 | import { describe, expect, it } from "vitest";
import { partitionCuboidsByEditedLabel } from "./partition-cuboids";
function overlay(id: string) {
return { data: { _id: id } };
}
describe("partitionCuboidsByEditedLabel", () => {
it("puts everything in instancedDetections when nothing is being edited", () => {
... |
35d8126d36f0103d98dceeb8ed7be62fc300c45262b009352a40db324fd8c50f | TypeScript | 2,231 | 76 | import { Vector3 } from "three";
import { describe, expect, it } from "vitest";
import {
buildCameraControlOptionsFromTransforms,
resolveCameraSelectorTarget,
} from "./utils";
describe("buildCameraControlOptionsFromTransforms", () => {
it("includes quaternion values in camera options", () => {
const options... |
81e7c4e32353ef7e9ab004268c52b0d181bb4a9f6488124ebbb6cdcdfbde05e6 | TypeScript | 2,232 | 76 | import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { CommandContext } from "../context";
import { CommandFunction } from "../types";
import { resolveContext } from "./utils";
import { CommandHookReturn } from ".";
/**
* Hook to create and register a command in a given context.
* The co... |
d04e0917f2b8ae0722dc360ae9e410f3764cd13e1ebb349d6c6cd74d5d87dfa5 | TypeScript | 2,233 | 75 | import type { McapDecodedMessage } from "../contracts/index";
import { messagesFromMcapWorkerResult } from "./worker-result-traversal";
/** Maximum plain decoded records delivered in one worker message. */
export const MCAP_STREAM_BATCH_MAX_ITEMS = 64;
/** Maximum estimated structured-clone bytes delivered in one wor... |
b9fd1fc3ac6cc3f0cb790c1baa9cb8c48492a5c35fb6f4eb55ec40c0192ee21d | TypeScript | 2,237 | 83 | import type { PaginateSamplesNode } from "@fiftyone/relay";
import type {
GridCursor,
GridLocation,
SelectionRequest,
} from "@fiftyone/state/src/selection";
import BoundedMap from "./BoundedMap";
type SeekPage = Extract<GridLocation, { kind: "seek" }>;
/** Relative page coordinates for one identity-anchored gr... |
f90f36a24736734a8f00358b8beeb1b1645048a7c9b12d93835668b893d565c5 | TypeScript | 2,242 | 68 | import { describe, expect, it } from "vitest";
import {
DEFAULT_OBSERVATION_STALE_THRESHOLD_NS,
DEFAULT_TRANSFORM_INTERPOLATION_GAP_NS,
EpisodeCadenceTracker,
observationStaleThresholdNs,
recentMedianCadenceNs,
transformInterpolationGapLimitNs,
} from "./temporal-policy";
const MS = 1_000_000n;
const SECO... |
ddd03131122c50834083ba227dc67cfbfca2539a77e856696e243a652569ec14 | TypeScript | 2,243 | 91 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { matchPath } from "./routing";
export const getDatasetName = (pathname?: string) => {
const result = matchPath(
pathname || window.location.pathname,
{
path: "/datasets/:name",
},
window.location.search,
{},
);
if (result) {
re... |
5ad19b6b384cfde9fb47968d21935191bed971d08cae40aaa44915932a1ecdcc | TypeScript | 2,247 | 75 | const SELECT_DATASET_CODE = `import fiftyone as fo
# Name of an existing dataset
name = "quickstart"
dataset = fo.load_dataset(name)
# Launch a new App session
session = fo.launch_app(dataset)
# If you already have an active App session
# session.dataset = dataset`;
const ADD_SAMPLE_CODE = `import fiftyone as fo
... |
07bdaf28ee93ff9ef579baf68cf9e332f206c5a016f5558183f4768fa49b7ddc | TypeScript | 2,253 | 65 | import { atom, getDefaultStore } from "jotai";
import { useCallback } from "react";
/**
* When `true`, the next point-selection inference seeds a brand-new label
* instead of refining the currently-selected one.
*
* Point-selection resolves its inference target from the sidebar selection
* (`selected ?? new uuid`... |
02d1383af77c823cb592f99f05b0214dad27c81c5fa881c7cc8ca96039605d32 | TypeScript | 2,256 | 79 | import { afterEach, describe, expect, it, vi } from "vitest";
import {
startBulkStreamLifecycle,
type BulkStreamControl,
} from "./bulk-stream-lifecycle";
describe("startBulkStreamLifecycle", () => {
afterEach(() => {
vi.useRealTimers();
});
it("waits for a stood-down read to settle before retrying its... |
b536dc9dd79463bebc58ba63a65857899fbf5d2c150ca18e413f77427b37eb70 | TypeScript | 2,261 | 69 | import { throttle } from "lodash";
const ADAPT_THROTTLE = 100;
export const SHOW_MORE_ACTIONS_BUTTON_WIDTH = 48;
export const ADAPTIVE_MENU_GAP = 8;
export const hideOverflowingNodes = throttle(
(container: HTMLDivElement, onHide: HideOverflowingNodesCallback) => {
if (!container) return;
const containerWi... |
8da7c4799774a10beba5226da27acd4c15507b0302af4c1a22d53f0b42d74f8b | TypeScript | 2,262 | 77 | import { useEffect, useState } from "react";
import {
getGridPosterCache,
shouldReplaceGridPoster,
type GridPosterCacheEntry,
type GridPosterCacheKey,
} from "./grid-poster-cache";
import { getGridPosterPersistence } from "./grid-poster-persistence";
export type GridPosterCacheLookupStatus = "idle" | "loading... |
6fb25eb1f5f1c56cce9fda012d9f095169bcde88a1bacf2a4c1cc1c9d72ce7e5 | TypeScript | 2,265 | 60 | import type { IconName } from "@voxel51/voodo";
import type React from "react";
import type {
ByteSourceDescriptor,
EpisodeRecordingFacts,
StreamDescriptor,
TimeWindow,
TransformTopology,
} from "../../ir";
import type { RawRecordCapability } from "../../ports";
/** Namespaced identity for an action contribu... |
913e82cac4b3a4925b39d5dc4d10a6949553856b37b1b3569748b7db2c1e5fc9 | TypeScript | 2,265 | 75 | import { useTileId } from "@fiftyone/tiling";
import { atom, createStore, useAtomValue, useStore } from "jotai";
import { useCallback, useEffect, useMemo } from "react";
type PointCloudCountsByTile = Readonly<
Record<string, ReadonlyMap<string, number>>
>;
/** Live decoded point counts keyed by 3D tile and point-cl... |
48b2699a6130f24ec6bd1bd9d9efff48ceb93a6baafe2673271bd64f36edf364 | TypeScript | 2,267 | 83 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
/**
* A press on the canvas ends text editing in a sidebar input. The pointer
* handlers call preventDefault, which would otherwise keep the input focused
* and route Delete/Backspace to it instead of the label shortcuts.
*/
import { beforeEach, describe, expect, it, v... |
fb9976a941cbf125882abdb16f6feb92f777eb6a1fbe5eeb2ce2e1d98c7d224f | TypeScript | 2,267 | 82 | import type { Archetype3d } from "../types";
import { isDetection3dDocument, isPolyline3dDocument } from "../types";
import type { SelectedPoint, TransformMode } from "./types";
type GetSelectedTransformArchetypeOptions = {
currentArchetypeSelectedForTransform: Archetype3d | null;
isAnnotationPlaneEnabled?: boolea... |
3ec9837087b38fd1d0e2a96456ebfe73a7dee809a35a88189b5d2fc76eb88f3a | TypeScript | 2,268 | 71 | import { act, renderHook } from "@testing-library/react";
import type { ThreeEvent } from "@react-three/fiber";
import { describe, expect, it } from "vitest";
import { useDragGate } from "./useDragGate";
function pointerEvent(clientX: number, clientY: number) {
return { nativeEvent: { clientX, clientY } } as ThreeEv... |
08ac8e15a6a51fd57fd0268f052c77a6eded30d8b5824b695c66868dbc6c7d76 | TypeScript | 2,269 | 76 | import { describe, expect, it } from "vitest";
import { VISUALIZATION_KIND } from "../../../ir/index";
import {
foxgloveRawImageCdrDecoders,
foxgloveRawImageDecoder,
} from "./foxglove/index";
import {
RAW_IMAGE_SCHEMA_DATA,
ROS2_RAW_IMAGE_SCHEMA,
decoderForSchemaEncoding,
rawImageWireMessage,
ros2Message... |
5409583f34487e9e0589570c0f5d55d6d0211a1f00f39f580efe71276f6bfebb | TypeScript | 2,275 | 92 | import type { Texture } from "three";
import type { CameraIntrinsics } from "./types";
/**
* Pixel dimensions resolved from a loaded texture image.
*/
export interface TextureDimensions {
width: number;
height: number;
}
type DimensionBearingImage = {
naturalWidth?: number;
naturalHeight?: number;
videoWi... |
4da631ca221fe97374a2bd4ddaffb75a58f611b5b98b674842b607169a7eaa5b | TypeScript | 2,282 | 60 | import type { TimelineMode } from "@fiftyone/playback";
import type { StreamDescriptor } from "../../../ir";
// Placeholder metadata convention written by
// datasets/timing_mode_test/tools/rewrite-timing-mode.mjs — not a finalized
// ingestion contract. Keeping this compatibility at the episode presentation
// bounda... |
79e21c34c51d55016ebbf3f10427b3232e39d605644b787a4408e2053c183166 | TypeScript | 2,284 | 80 | import { beforeEach, describe, expect, it, vi } from "vitest";
vi.mock("recoil");
vi.mock("recoil-relay");
import {
setMockAtoms,
TestSelectorFamily,
} from "../../../../../../__mocks__/recoil";
import * as state from "./state";
// Tracks every ``nonfiniteData`` read so tests can assert whether the
// prefetch ac... |
383b21829064d2b9beb91e00f117a7c3b76e85263b20ad867cb21d262716053d | TypeScript | 2,292 | 83 | import { ImaVidState } from "../../state";
import { BaseElement, Events } from "../base";
import { lookerSeekBar } from "../video.module.css";
// controls element: not shown in grid (thumbnail = off)
export class SeekBarElement extends BaseElement<ImaVidState, HTMLInputElement> {
getEvents(): Events<ImaVidState> {
... |
33d5978becf26ede831af29c2b2830adfbd9e09173385f92ac823d5b3dd07bc2 | TypeScript | 2,294 | 77 | // @vitest-environment jsdom
import { renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
const refs = vi.hoisted(() => ({
annotationContext: { selected: null, createNew: vi.fn() } as unknown,
fields: [] as string[],
isVideo: false,
}));
vi.mock("recoil", a... |
7068214c7315eb23fed0d2f1b471b84b9981fb2a4183c90c1a688cf6291cd9b4 | TypeScript | 2,295 | 75 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { useEffect, useRef } from "react";
import { getCommandBus } from "../dispatch";
import { Command, CommandCtor, CommandHandler } from "../types";
/**
* Hook that registers a command handler in a useEffect.
* The handler is registered on mount and remains register... |
97d1a094b0bd1a5cfcd56a2e80fb351836e663f1b2213cb91660fee1a520048c | TypeScript | 2,295 | 64 | import { describe, expect, it } from "vitest";
import { counterLabel } from "./plotCounter";
const RUN = { loaded: 313696, total: 313696, selected: null, inView: null };
describe("counterLabel", () => {
it("reports the run's size when nothing is selected", () => {
expect(counterLabel(RUN)).toBe("313,696 points"... |
b96c741bb3f9c51ed7f198be64e7f55cc40153bb3e8e4897a1834928fe68650c | TypeScript | 2,299 | 78 | import { describe, expect, it } from "vitest";
import {
PAUSED_TRANSFORM_PLACEMENT_LOOKAHEAD_NS,
dynamicPlacementRangeForTime,
dynamicRunwayCoverageRangeForTime,
dynamicRunwayExtensionRangeForTime,
frameTransformRangeKey,
isRangeInRanges,
isTimeInRanges,
transformCoverageEndForTime,
} from "./frame-tran... |
415125fe8c543df65b8c730fbe236067e153b92f245f8f4e9f0ce5fd03aff624 | TypeScript | 2,302 | 86 | import type { ByteClient, ByteSourceDescriptor } from "../../../query/bytes";
import { byteSourceAccessKey } from "../../../query/bytes";
import {
ByteClientReadable,
type McapChunkReadDebugLog,
} from "./byte-readable";
import type { McapIndexedReaderLike, McapReaderFactory } from "./types";
/**
* Lazy cache for... |
9972f32b61a9eb0340e8181aabd5fb9dd1f7c2d0a3efa5e48edfc21afb7d490b | TypeScript | 2,304 | 69 | import { createKeyedExternalStore } from "./keyed-external-store";
/** One request to move a tile's preview to an instant, in absolute ns. */
export interface EpisodeSeekRequest {
readonly timestampNs: bigint;
/**
* Distinguishes two requests for the same instant.
*
* A seek is a command, not a position: ... |
44708ffe01a8b081cf22f742788343acfce78af209d0a6340b7b57544b721bed | TypeScript | 2,308 | 60 | import {
savedViewsFragment,
savedViewsFragment$data,
savedViewsFragment$key,
savedViewsFragmentQuery,
} from "@fiftyone/relay";
import { datasetQueryContext } from "@fiftyone/state";
import { startTransition, useContext } from "react";
import { RefetchFnDynamic, useRefetchableFragment } from "react-relay";
//... |
4c0a0bcb5594bc019e323b189c233f72c5a8cea263fc30a82e96898ae5318fb2 | TypeScript | 2,311 | 88 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { Action } from "../actions";
export type CommandFunction = () =>
| Action
| void
| undefined
| Promise<Action | void | undefined>;
/**
* Class to handle command style invocation. It delegates
* execution, undo, and enablement to lambdas vs a subclass
... |
5e7595d898e7a964b3f5e7bda4284c2e54acdd276b6c651e9bebe6fef890dec0 | TypeScript | 2,316 | 60 | /**
* The looker-3d wiring hook: registers the bridge (the engine derives the
* whole read-half — mount/update/unmount into the working store) and returns
* the surface controller for the write-half (gesture finalize → commit, wired
* by the caller's operations once the legacy ad-hoc path retires).
*
* The workin... |
d4104863a4bf184c81622f9ad6480e01de8353421eb46cc8f1dc5c21240afd9e | TypeScript | 2,319 | 82 | import { getEventBus } from "@fiftyone/events";
import type { ImaVidFramesController } from "@fiftyone/looker/src/lookers/imavid/controller";
import {
IMAVID_FETCHED_EVENT,
type ImaVidEvents,
} from "@fiftyone/looker/src/lookers/imavid/events";
import type { PlayheadState } from "@fiftyone/playback";
import {
PLA... |
6c33e8f144e61c99e2bcd848eee1a7365f750a9c9d9fbad083d1fe180aadf17d | TypeScript | 2,326 | 65 | /** Media semantics retained with a poster supplied by a product extension. */
export type GridPosterMediaKind = "image" | "video" | "point-cloud";
/** Minimal camera pose exposed without coupling extensions to a renderer. */
export interface GridPosterCameraPose {
readonly position: readonly [number, number, number... |
6fc25586f5d6e92c231ffcf9c3ae34256a4f80e77145c314d92f2a64462857f5 | TypeScript | 2,330 | 85 | import { describe, expect, it } from "vitest";
import type { McapDecodedMessage } from "../contracts/index";
import {
estimateMcapStreamItemBytes,
isMcapStreamBatchFull,
MCAP_STREAM_BATCH_MAX_ESTIMATED_BYTES,
MCAP_STREAM_BATCH_MAX_ITEMS,
wouldOverflowMcapStreamBatch,
} from "./playback-worker-stream-batch";
... |
9267196a2aa4d1e578873cbd69ba4b2efa74345c97a1a88a6c979cc1b49ddb40 | TypeScript | 2,342 | 88 | import { Quaternion, Vector3 } from "three";
import { describe, expect, it } from "vitest";
import { FO3D_CAMERA_LIFECYCLE, isFo3dSceneReady } from "../camera-lifecycle";
import type { FoScene } from "../render-types";
const makeScene = (): FoScene => ({
position: new Vector3(0, 0, 0),
quaternion: new Quaternion()... |
c172bd569b4548205f3f1771ace2ca154b5b2cdbea5424f861967cae3e59b733 | TypeScript | 2,345 | 59 | import { describe, expect, it } from "vitest";
import { patchRect, type Bounds } from "./patchCrop";
const MEDIA_W = 600;
const MEDIA_H = 400;
const rect = (bounds: Bounds, width = MEDIA_W, height = MEDIA_H) => {
const result = patchRect(bounds, width, height);
if (!result) throw new Error("expected a rect");
r... |
c0a428645b55fe712e699d11644d0b5ef135bbd4fd17f4c21e95b586c2a339a5 | TypeScript | 2,347 | 101 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { DetectionOverlay } from "../overlay/DetectionOverlay";
import type { Point } from "../types";
import type { InteractionHandler, OverlayEvent } from "./InteractionManager";
const INTERACTIVE_DETECTION_HANDLER_ID = "interactive-detection-handler";
const MIN_PIXELS... |
10f3d6e8e3096b507e1d8faefafbfd4d3eeb990a50d637d79433875d0ba7f141 | TypeScript | 2,357 | 66 | /**
* Decompresses LZF-compressed data. This is only relevant for "binary_compressed" mode.
* This implements the simple LZF algorithm.
*
* Reference: https://gitlab.com/taketwo/three-pcd-loader/blob/master/decompress-lzf.js
*
* - Literal runs: when ctrl < 32, we copy (ctrl + 1) bytes directly.
* - Back‑referenc... |
aa67999da06469492d41b7605184520a3b4faa12b716a368277829d816b8a66f | TypeScript | 2,361 | 73 | import { beforeEach, describe, expect, it, vi } from "vitest";
import { VISUALIZATION_KIND } from "../../../../ir/index";
import { foxglovePoseInFrameDecoder } from "./pose-in-frame";
import { decodeProtobufMessage } from "./protobuf/index";
vi.mock("./protobuf/index", () => ({
decodeProtobufMessage: vi.fn(),
}));
... |
00aff9f95548f2d194048d81394cba9fe575073d4755256e0d1b8f47d0c74a2e | TypeScript | 2,370 | 75 | // @vitest-environment jsdom
import { beforeEach, describe, expect, it, type Mock, vi } from "vitest";
import { ClickDetector } from "./ClickDetector";
const fire = (
target: HTMLElement,
type: string,
props: Record<string, unknown> = {},
) => {
const event = new Event(type, { bubbles: true, cancelable: true }... |
fff63f3b8728511916597c6182d91f0c54b7acd5a7fd2086a949378036cf6c0c | TypeScript | 2,375 | 84 | import { getTime } from "@fiftyone/looker";
import { renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { useLookerFrameSync } from "./useLookerFrameSync";
const seek = vi.fn();
vi.mock("@fiftyone/playback", () => ({ usePlayback: () => ({ seek }) }));
con... |
d2c811d816e9ad8fa60a1d82624d8bec7a68f1087f3dc29776679b9effa3f3df | TypeScript | 2,376 | 63 | import { describe, expect, it } from "vitest";
import { fitCardHeight, type TrayItem } from "./cardSizing";
import { CARD_HEIGHT, cardWidth, MULTIMODAL_CARD_HEIGHT } from "./theme";
const square: TrayItem = { aspectRatio: 1 };
describe("selection card sizing", () => {
it("fills the height with widths following land... |
64cabcc8c14720f9b328890fc5e2f6a9c6dc5c4692a74df4215440efd0f7a546 | TypeScript | 2,382 | 92 | import { PCDFileFormat, PCDHeader } from "./types";
/**
* Parses the header of a PCD file.
*
* @param bin - The binary data of the PCD file.
* @returns The header of the PCD file.
*/
export const parseHeader = (bin: ArrayBuffer): PCDHeader => {
const text = new Uint8Array(bin);
let header = "",
line = "",... |
e80f1f4c0b1daf4fdcb6b32ab4b5f8750f76e62fa1b9ed8e796be84e54b7353e | TypeScript | 2,390 | 67 | import type { Decoder } from "../../../../decoders/index";
import { rosCameraInfoDecoders } from "./camera-info";
import { rosCompressedImageDecoders } from "./compressed-image";
import { rosCompressedPointCloud2Decoders } from "./compressed-point-cloud2";
import { rosImageDecoders } from "./image";
import { rosLaserSc... |
ce7281164780ba2a844bb0a2b1205690e18b79f4ca9f6ec8ef69f44672a131eb | TypeScript | 2,393 | 79 | import type { Controller } from "@react-spring/web";
import { describe, expect, it, vi } from "vitest";
import type { InteractiveItems } from "./types";
import { disposeInteractiveItems, pruneInteractiveItems } from "./utils";
const fakeController = () => ({ stop: vi.fn() }) as unknown as Controller;
const fakeItems ... |
0365536576679e11a0d9a21b88f10bc9ca79ce7654afbb93a1272a5b86be19f5 | TypeScript | 2,395 | 89 | import { subscribe } from "@fiftyone/relay";
import { activeLabelFields } from "@fiftyone/state";
import { useCallback, useEffect } from "react";
import { useRecoilValue } from "recoil";
import { syncAndGetNewLabels } from "./syncAndGetNewLabels";
export type LookerId = string;
export type CachedLabels = Set<string>;
... |
3c7c787428a67ba74385216ed6864b23cd611dff3d110ddc7687313343599813 | TypeScript | 2,398 | 80 | import {
combineSelectionCaptures,
memberCounts,
viewConversion,
type SelectionScope,
} from "@fiftyone/state/src/selection";
import { useEffect, useRef, useState } from "react";
/** Resolve sibling expansion once, then reuse the frozen targets for every action. */
export function useGroupActionScope(
datase... |
978394f33c2011c53d40b1b1ced6e0c9b57c5f328fd9881012004c9f72ca6c39 | TypeScript | 2,401 | 79 | import { describe, expect, it, vi } from "vitest";
import type { LocationTrackState } from "../tracks/location-track";
import {
activeRouteGradient,
cometSourceId,
createIndexedMapTrack,
MAP_ROUTE_PAINT,
reconcileTrackLayers,
routeLayerId,
} from "./route-layers";
describe("map route layers", () => {
it... |
f9630a13680c0d985419b77bf100af39260fa72fbc5ce887cab716ad689cd3ab | TypeScript | 2,402 | 82 | import type { PointCloudVisualization } from "../../../../ir";
import { decodePointCloudChannelValue } from "../../../../runtime/point-cloud-channel-encoding";
import type { Scene3dHoveredPoint } from "./use-hover-tooltip";
const POINT_COMPONENT_COUNT = 3;
/** Builds the hovered-point payload for a picked decoded ind... |
5efcc8eefced0113b76f0e6189b3975a2cb2d7288a30fc300e3fed9aadc1a59e | TypeScript | 2,407 | 78 | import {
BYTE_SOURCE_READ_PROFILE,
type ByteSourceReadProfile,
} from "../../../ir";
/** Lowest supported episode timeline sampling rate. */
export const MIN_TIMELINE_SAMPLING_RATE_HZ = 1;
/** Highest supported episode timeline sampling rate. */
export const MAX_TIMELINE_SAMPLING_RATE_HZ = 120;
/** Named sampling... |
16af4a168dc5b07afef2ed05f8fadb868f01460704ebe680923baf1b0c317b00 | TypeScript | 2,412 | 61 | /**
* Compressed audio codecs `foxglove.CompressedAudio` may carry, limited to
* what the browser's WebCodecs `AudioDecoder` can actually decode. Anything
* outside this table is treated as unsupported at the decoder layer, the
* same policy `video-format.ts` applies beyond H.264.
*
* `webCodec` is the RFC 6381-s... |
65d148971113648f805631eb12bcffd709f422bad881595a3bfda899943521f8 | TypeScript | 2,415 | 75 | import { EventDispatcher } from "./dispatcher";
/**
* What a {@link LocalEventTarget} listener receives for a non-DOM payload; an
* `Error` payload is on `error` too, where an `ErrorEvent` carries it
*/
export type LocalEvent<T = unknown> = {
readonly type: string;
readonly detail: T;
readonly error?: T exten... |
3d23217dc84a2bdd94cf6fe3233ec86d21de8f088ca931a44c907da425deda7d | TypeScript | 2,419 | 96 | const VIDEO_FORMATS = Object.freeze({
av1: {
exact: ["av1"],
label: "AV1",
prefixes: ["av01"],
},
h264: {
exact: ["h264", "h.264", "avc"],
label: "H.264",
prefixes: ["avc"],
},
h265: {
exact: ["h265", "h.265", "hevc"],
label: "H.265",
prefixes: ["hev", "hvc"],
},
vp9: {... |
8b3ed3a73aed7223927dc885042e66c4309278c899302f0b078b690325037766 | TypeScript | 2,420 | 92 | import { act, renderHook } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { useImageNaturalSize } from "./useImageNaturalSize";
class FakeImage {
onload: (() => void) | null = null;
onerror: (() => void) | null = null;
complete = false;
naturalWi... |
2b9d3dfb97877effbac3b82f08dd9ff556c38f16d20b305d7d4782a41541c7b6 | TypeScript | 2,421 | 92 | import { describe, expect, it } from "vitest";
import type { ReadWorkBudget, ReadWorkUsage } from "../../../ports";
import { createSourceReadBudgetLedger } from "./source-read-budget";
const allowance: ReadWorkBudget = {
maxMessages: 20,
maxSourceBytes: 2_000,
maxUncompressedBytes: 8_000,
maxWallTimeMs: 1_000,... |
aa684d478b3351aef7ffc985380aefb27e13071c1d3962ca321dd901117be6d7 | TypeScript | 2,422 | 87 | import React from "react";
import Aggregation from "./Aggregation";
import { getFetchFunction } from "@fiftyone/utilities";
const AGGREGATE_ROUTE = "/aggregate";
type AggregationParams = {
view?: any;
filters?: any;
dataset?: any;
sample_ids?: any;
};
/**
* A hook for aggregating data from the **FiftyOne** ... |
8060dee2a2c4201a86f5fe036eefa1a148a9f417ad0dd5e30b520abf234cbd49 | TypeScript | 2,423 | 97 | import { resourceHintsForArrayBufferViews } from "../../../decoders/index";
import type {
DecodedAttributeValue,
DecodedOutput,
DecodedTiming,
} from "../../../ir/index";
import { VISUALIZATION_KIND } from "../../../ir/index";
import { decodeImageRgba } from "./image-encodings";
const EMPTY_RGBA = new Uint8Array... |
d2af707922947b1e3fb47e49ee62d6b6a189b12b6905fae452a2200a06413c05 | TypeScript | 2,427 | 68 | /**
* Shift-click range selection over a voodo ``RichList``'s checkboxes.
*
* The list only reports the selection after a checkbox toggles, so the
* hook watches ``mousedown`` (capture) on the list's wrapper to learn
* which row was clicked and whether Shift was held, remembers the last
* clicked row as the ancho... |
b6f586aa1f8a9045ae671a260b221aee5f34d2c27576c36dda0684c376226b22 | TypeScript | 2,433 | 79 | import type {
McapPlaybackWorkerPriority,
McapPlaybackWorkerRequestPayloadByType,
McapPlaybackWorkerRpcType,
} from "./playback-worker-types";
import { MCAP_PLAYBACK_WORKER_PRIORITY } from "./playback-worker-types";
const SUPERSESSION_KEY_SEPARATOR = "\0";
/**
* Returns keys for request families where a newer ... |
dd19f6ab7169adea224882c4313b963b549bc26c3d2ad9f46e8e89076977a377 | TypeScript | 2,433 | 90 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type { ImageState } from "../state";
import type { Events } from "./base";
import { BaseElement } from "./base";
const MAX_IMAGE_LOAD_RETRIES = 10;
export class ImageElement extends BaseElement<ImageState, HTMLImageElement> {
private src = "";
protected imageS... |
4b22da1d90eab2c036dfdc54c2e60c8403d8247198ffad6d641a73c81f405933 | TypeScript | 2,434 | 74 | // Deep imports on purpose: the playback package root barrel pulls view
// components whose relay fragments cannot evaluate under vitest.
import { usePlaybackStore } from "@fiftyone/playback/runtime";
import type { PlaybackStore } from "@fiftyone/playback/runtime";
import { atom, useAtomValue, type PrimitiveAtom } from... |
461346f5a251f2751015c9b8d1031966d864ea784c24872fa47b38ff1c48a0ac | TypeScript | 2,437 | 84 | import { describe, expect, it } from "vitest";
import { createNetworkTransportMeter } from "./network-meter";
import type { ByteReadDebugLog } from "./types";
describe("network transport meter", () => {
it("counts fetched bytes and clips overlapping busy intervals", () => {
let now = 100;
const meter = creat... |
c11228a28774d2ed9a870b387b9140c6230be2e862ff4909ed40d4f719f20a45 | TypeScript | 2,437 | 89 | import * as fos from "@fiftyone/state";
import { getFetchFunction } from "@fiftyone/utilities";
import { useCallback, useEffect, useRef, useState } from "react";
import { useRecoilValue } from "recoil";
import type { StaticTransform } from "../frustum/types";
type StaticTransformsListResponse = {
transforms: StaticT... |
177f9cafc6fc7fbad7e84dbfd82e8e80bb4e54a504035e1daabe0cec78cd1e3b | TypeScript | 2,441 | 86 | import * as fos from "@fiftyone/state";
import { move } from "@fiftyone/utilities";
import type { MutableRefObject } from "react";
import { useCallback } from "react";
import type { InteractiveItems } from "./types";
import type { Direction } from "./utils";
import { getAfterKey } from "./utils";
export default functi... |
7de5af5cdf2c88e5e9359dcf7a7603ee1dc1c603dff823bb50cbaca36abb7077 | TypeScript | 2,454 | 94 | import {
extendedSelection,
getBrowserStorageEffectForKey,
sampleFields,
theme,
} from "@fiftyone/state";
import { atom, selector } from "recoil";
import { SELECTION_SCOPE } from "./constants";
export interface Settings {
clustering?: boolean;
clusterMaxZoom?: number;
clusters?: {
textPaint: mapboxgl... |
726e20b642b137a3ba712ae5230e842899699b4f2f02e7745941210ab7017dac | TypeScript | 2,459 | 73 | import { DetectionLabel } from "@fiftyone/looker";
import { describe, expect, it } from "vitest";
import { deriveTransformState } from "./deriveTransformState";
const baseLabel: DetectionLabel = {
_id: "label-1",
_cls: "Detection",
location: [1, 2, 3],
dimensions: [4, 5, 6],
};
describe("deriveTransformState"... |
b7607a886393093688394c8ebbc8b9b919136783c878bb950f075f271b5c631e | TypeScript | 2,459 | 84 | import { useAnnotationEventHandler } from "@fiftyone/annotation";
import {
UNDEFINED_LIGHTER_SCENE_ID,
useLighter,
useLighterEventHandler,
} from "@fiftyone/lighter";
import { atom, useAtomValue, getDefaultStore } from "jotai";
import { atomFamily } from "jotai/utils";
import { useCallback } from "react";
const ... |
804c4950b9df18c96708ab0d6101222d32dd81f386d5bd594919ef697714814b | TypeScript | 2,469 | 81 | /**
* Protobuf descriptor lookup and decode helpers for Foxglove MCAP payloads.
*
* MCAP schemas provide binary FileDescriptorSet data per channel. This module
* turns that schema data into cached protobufjs message types and decodes
* message bytes into plain records for the concrete Foxglove decoders.
*/
import... |
618657e17deb47cdd5b41d3cb3368cbd42a4ce58c314c913ba7d76ba9ca0e87d | TypeScript | 2,473 | 71 | /**
* A tiny keyed external store: many independent values, each addressed by a
* key, each with its own subscriber set.
*
* The grid's footer chrome is a sibling of the tile that owns the data it
* draws — the presented frame, the episode's extent — so the two cannot pass
* it through React. These stores are tha... |
ed1e33ea9b2e7772a965fbd0d01c822f38e8dd57ecbd7127013fea70555388ad | TypeScript | 2,477 | 64 | /**
* Client-side evaluation of the color-by field's sidebar filter against
* the color column already in memory — the mask that makes legend
* clicks instant instead of a masks-endpoint round trip (a full
* server-side aggregation, seconds at scale).
*
* Fidelity rule: the server's match mask is the truth (it ap... |
f7b639840d3a6facd265edcf8b44f600c502e767bbfc20322b68fee43e408fee | TypeScript | 2,496 | 92 | import type { OwnedVideoPresentation, VideoPresentationLease } from "./types";
interface ClosableCanvasSource {
readonly height: number;
readonly width: number;
close?: () => void;
}
/**
* Copies a decoder-backed frame into a renderer-owned bitmap/canvas and closes
* the decoder surface as soon as the copy co... |
3c4e1633022644179da46a365f0d01cd2a10fe55140cfdb6d23a05c24f4a049e | TypeScript | 2,498 | 100 | import type { ID } from "@fiftyone/spotlight";
import { useMemo } from "react";
import {
atom,
useRecoilCallback,
useRecoilTransaction_UNSTABLE,
useRecoilValue,
} from "recoil";
import { gridAt, gridOffset, gridPage } from "./recoil";
const gridJump = atom({
key: "gridJump",
default: 0,
});
/** Signals th... |
f6765efbb3e4fea12b3a8cb8127a59c87beb4c8cd9e6042c93e39927aaef6c51 | TypeScript | 2,514 | 75 | import { describe, expect, it, vi } from "vitest";
import type { TestSelectorFamily } from "../../../../../../__mocks__/recoil";
import { setMockAtoms } from "../../../../../../__mocks__/recoil";
import * as state from "./state";
vi.mock("recoil");
vi.mock("recoil-relay");
describe("Resolves tag counts", () => {
it... |
28ed1aef5456d8b024d2901f065c2328be20c4bfdb922041eb3d30d09edce1d9 | TypeScript | 2,517 | 83 | import { Euler, Vector3 } from "three";
export type Vec3 = [number, number, number];
export type Vec2 = [number, number];
export interface BoundingBox3D {
dimensions: Vec3;
location: Vec3;
rotation: Vec3; // rotation angles in radians
}
export interface BoundingBox2D {
tlx: number; // top-left corner of the ... |
7b2c5f89a394f2ed7a1f9be94e777b0915e3bcb279a28970b200528895ffa035 | TypeScript | 2,517 | 76 | import { Coloring } from "..";
import { decodeWithCanvas } from "./canvas-decoder";
import { customDecode16BitPng } from "./custom-16-bit-png-decoder";
const PNG_SIGNATURE = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];
/**
* Reads the PNG's image header chunk to get bit depth & color type.
* Returns undefined ... |
a14f185c2377a681e5188d34f0448f17e5b3268c06d135085f9d1f80780747e3 | TypeScript | 2,522 | 91 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type { CoordinateSystem, Rect, TransformMatrix } from "../types";
/**
* 2D coordinate system implementation for transforming between relative [0,1] and absolute pixel coordinates.
* Handles aspect ratio preservation and centering of canonical media.
*/
export cl... |
4f36e530c29fc81ef2f7976784378acdc626b44678bb89856f2e7f48815ad2b6 | TypeScript | 2,531 | 92 | import type { DecodeClient } from "../../../../query/decoding/index";
import { isWithinRange } from "../../synchronization/policy";
import { decodeMcapMessage } from "../message-decoder";
import type { McapIndexedReaderLike } from "../../reader/index";
import type { McapTimelineStrategy } from "../timeline";
import typ... |
586b80f28ea3598d5547b093acdb6f5890d6703e42a9a52f3ad19f8a7e2eb0f4 | TypeScript | 2,531 | 80 | import { RJSFValidationError, UiSchema } from "@rjsf/utils";
/**
* Filter out empty arrays that weren't in the original data
* i.e. don't add `tags: []` if `tags` does not already exist on props.data
*/
export function filterEmptyArrays(
formData: Record<string, unknown>,
originalData: Record<string, unknown>,
... |
f6951f38b6cf83034010fa1c3b9869174cf981ac5fdac4468fe058d1cbfe4c53 | TypeScript | 2,531 | 81 | import type { DecodeContext, Decoder } from "../../../../decoders/index";
import type {
DecodedAttributeValue,
DecodedOutput,
PoseVisualization,
} from "../../../../ir/index";
import { VISUALIZATION_KIND } from "../../../../ir/index";
import { rosDecodersForPayloads } from "../ros/factory";
import { decodeProtobu... |
ea36a1f2631b817ff4c1d91f49ce5718619991e8ce5bceef94aeaccb1844a027 | TypeScript | 2,533 | 90 | import { describe, expect, it } from "vitest";
import {
analyzeH264AnnexBAccessUnit,
h264AccessUnitWithParameterSets,
} from "./h264-annexb";
describe("H.264 Annex-B access unit inspection", () => {
it("extracts keyframe, codec string, and parameter sets", () => {
const info = analyzeH264AnnexBAccessUnit(
... |
da9fa06850466d1ff72d6d64436b46a43ecaeae90329d66c7c4212b96f5c6d97 | TypeScript | 2,534 | 81 | // @vitest-environment jsdom
import { renderHook } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { useVisualizationRuns } from "./useVisualizationRuns";
const dataset = vi.hoisted(() => ({ current: null as unknown }));
vi.mock("@fiftyone/state", () => ({ dataset: "datasetAto... |
31486d604a2fc4e48f67e0906666250cf239d04a370153f5317b14ec9737d8e5 | TypeScript | 2,538 | 74 | import { useSyncExternalStore, type ComponentType } from "react";
import type { IntervalTileContext } from "../host/tile-context";
/**
* Grid-tile overlay components an edition contributes (e.g. an
* embedding-match time-lane). Mirrors the timeline-extension registry: the
* OSS-synced grid renders whatever is regis... |
05f00a0675716edbf867d9d8c2260a745dec644f01a05a46f85da4fd9daf5c09 | TypeScript | 2,552 | 90 | import { describe, expect, it } from "vitest";
import {
INDEXED_RECORD_ID_OPTION_PART_COUNT,
mintIndexedRecordIdentity,
parseIndexedRecordIdentity,
selectSettlementTopics,
} from "./read-synchronized-message-batch";
describe("indexed record identity", () => {
it("round-trips physical and decoder-option iden... |
a53b91d7300167164f0a07245c945c271b5ac63008a5e03e83efa419464fd6e3 | TypeScript | 2,561 | 91 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
/**
* Singleton canvas manager that creates and maintains a persistent canvas element.
* This, together with the SharedPixiApplication, allows us to keep the WebGL context alive and to a single instance.
*/
class SingletonCanvas {
private static instance: SingletonCan... |
6095fba6a878d9476b680481c6319ae442180b5aef38f1c275aa4fac0be18618 | TypeScript | 2,575 | 87 | import type { FoScene } from "./render-types";
/**
* Canonical lifecycle states for the FO3D camera bootstrap flow.
*/
export const FO3D_CAMERA_LIFECYCLE = {
WAITING_FOR_SCENE: "waiting_for_scene",
WAITING_FOR_BOUNDS: "waiting_for_bounds",
RESTORING_CAMERA: "restoring_camera",
READY: "ready",
} as const;
/*... |
edcdaa5ab3cc833b5855b38006efa490a15453e9077359cd073f3adc6b0235b9 | TypeScript | 2,577 | 103 | import { getFrameElements } from "../elements";
import { COMMON_SHORTCUTS } from "../elements/common";
import { Overlay } from "../overlays/base";
import { DEFAULT_FRAME_OPTIONS, FrameState } from "../state";
import { AbstractLooker } from "./abstract";
import { LookerUtils } from "./shared";
import { zoomToContent } ... |
33b7af9dc400607e8e119c8fbae260101d5ff7ce75250009244dfdd3b2d7eea1 | TypeScript | 2,584 | 81 | import { PluginComponentRegistration } from "@fiftyone/plugins";
import { SpaceNodeJSON, usePanels } from "@fiftyone/spaces";
import { panelsCompareFn } from "@fiftyone/spaces/src/utils/sort";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
const MODAL_PLUGINS_REGISRATION_TIMEOUT_MS = 200;
... |
47bc28853b81e16cae579e260d36422290792aa4720c7e8ccc9edf9980560905 | TypeScript | 2,584 | 65 | /**
* Temporal contracts: the pool/presence split. The pool is every
* entity in the stores, frame-agnostic; presence is the subset present at the
* current time, derived from (pool × clock). Presence events never dirty
* anything and never enter a patch — the change stream stays purely semantic.
*/
import type {... |
aca23752aff4f405f3fe537142533142b6e8ad34b587e79840865f0d233cc3aa | TypeScript | 2,584 | 67 | // Deep imports on purpose: the playback package root barrel pulls view
// components whose relay fragments cannot evaluate under vitest.
import {
getIsBuffering,
getIsPlayPending,
getStreamValue,
setStreamValue,
} from "@fiftyone/playback/runtime";
import type { PlaybackStore } from "@fiftyone/playback/runtime... |
5484a9fc015de812326833dfcb4e48ea4b7ca20ea955862c6a00312912b89b1d | TypeScript | 2,586 | 85 | import { useEffect, useRef } from "react";
import { useCommandContext } from "./useCommandContext";
import { CommandFunction } from "../types";
export type KeyBinding = {
/** Unique command id registered in the target command context. */
commandId: string;
/** Key sequence, or sequences, that invoke the command.... |
af4721b757b6949bb2b4f4a69a48c92fa84fdbefe7dcff5da3a7c815a8143dc2 | TypeScript | 2,588 | 85 | import { useAnnotationEventHandler } from "./useAnnotationEventHandler";
import { INDEFINITE_TOAST_TIMEOUT, useActivityToast } from "@fiftyone/state";
import { useCallback, useEffect } from "react";
import { IconName, Variant } from "@voxel51/voodo";
import {
deriveSaveHealth,
usePersistenceEventHandler,
usePersi... |
acbf0fc3b2a0eda9c50ace421fd21c97c380e2a06c328a7c36396de2a3e6f0ee | TypeScript | 2,603 | 99 | import { describe, expect, it } from "vitest";
import { PLOT_SERIES_PALETTE } from "../../../visualization/plot/series-palette";
import { addPlotSeriesToTile, nextPlotSeriesColor } from "./plot-tile-state";
describe("nextPlotSeriesColor", () => {
it("assigns the first palette slot to the first series", () => {
e... |
74ac4b0df6bd303d6490f062ef22b8d8a3fb4dd430e370470843964a578f02e9 | TypeScript | 2,619 | 93 | import {
generatedDatasetName as generatedDatasetNameAtom,
isGeneratedView,
useActiveModalSample,
useCurrentDatasetId,
useRefreshSample,
} from "@fiftyone/state";
import { useCallback } from "react";
import { useRecoilValue } from "recoil";
import { JSONDeltas } from "@fiftyone/core/src/client";
import { useG... |
ab243a59ffcd15e8e3ebbd6c1bd80454e2a2db086a1c657d72d97c4ce3046940 | TypeScript | 2,631 | 72 | /**
* Label-schema document and stage-policy types shared by the Annotate
* sidebar, the Schema Manager and (in FiftyOne Teams) the workflow
* task workspace. Workflow-neutral: the documents are authored in the
* Schema Manager; a workflow stage only references one by id.
*/
/** Summary row for a schema selector ... |
c822852cc72b8f3ec76f5e688a0f2ebbbf41daa78b83a1ca3068d6f55b7c802a | TypeScript | 2,642 | 77 | /**
* Copyright 2017-2026, Voxel51, Inc.
*
* Generates a CSS cursor data-URL for the segmentation brush tool.
*/
import {
SegmentationTool,
SegmentationToolMode,
SegmentationToolShape,
type SegmentationToolState,
} from "@fiftyone/core/src/components/Modal/Sidebar/Annotate/Edit/useSegmentationMode";
/**
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.