sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
a3ea920f334d697223bba8be96be0b82d7bf568ce7e33f81def913b58d19dc74 | TypeScript | 3,075 | 75 | import { useEffect, useRef, useState } from "react";
import { buildIdIndex, fetchIds } from "./protocol";
/**
* Sample id -> the wire indices of that sample's points, for a patches run.
*
* A patches run's points are labels, so a sample-level selection (grid
* checkboxes in a samples view, another panel's selectio... |
ec07731fac3de2b3bb08fa67d082b07747eae005992005a5731f842ebd4cd00e | TypeScript | 3,076 | 103 | import type { Matrix4 } from "three";
/**
* Static transform (pose) data from the API.
* Represents a rigid 3D transformation (translation + rotation).
*/
export interface StaticTransform {
/** Translation vector [tx, ty, tz] */
translation: [number, number, number];
/** Quaternion [qx, qy, qz, qw] in scalar-... |
0eb4fe5a414fad8eb10a9fb23f38063c9e7d65980467a484624d0794e50ada2f | TypeScript | 3,077 | 98 | import { beforeEach, describe, expect, it, vi } from "vitest";
import { VISUALIZATION_KIND } from "../../../../ir/index";
import { foxgloveLocationFixDecoder } from "./location-fix";
import { decodeProtobufMessage } from "./protobuf/index";
vi.mock("./protobuf/index", () => ({
decodeProtobufMessage: vi.fn(),
}));
... |
958db7d6a178e26fab6f7f3a555810fae85bd5362c9b9a132ef8529a2daab3c0 | TypeScript | 3,080 | 122 | import { afterEach, describe, expect, it, vi } from "vitest";
import {
ensurePuckImages,
hexColorWithAlpha,
puckImageId,
PUCK_VARIANT,
voxel51PrimaryColor,
} from "./puck";
afterEach(() => {
vi.restoreAllMocks();
});
describe("mcap map puck", () => {
it("produces stable per-variant, per-color sprite ids... |
a0661e532ddfe45457e007c0f6ad664603eeab4d1f95862a99f7aee6cb7fbf75 | TypeScript | 3,081 | 90 | import type { Track } from "@fiftyone/playback";
import type { EpisodeIntervalSource, ResolvedEpisodeIntervals } from "./types";
const NS_PER_SEC = 1_000_000_000;
/**
* Timeline track id for one row of one source. Namespacing by source id keeps
* two sources that happen to use the same row key on separate rows, whi... |
20e95e9d19b051d11f21ef4eed0325d500272bff7c13ddb5ffb4296b94c5b535 | TypeScript | 3,083 | 100 | import type { SampleRendererProps } from "@fiftyone/plugins";
import type { Track } from "@fiftyone/playback";
import {
buildTemporalTagTracks,
temporalTagNanoseconds,
temporalTagTrackId,
} from "@fiftyone/playback";
import type {
TemporalTagCreatePayload,
TemporalTagUpdatePayload,
} from "@fiftyone/playback"... |
f8380e1b4aa8c9b16bae9cb7dcbec640c9be1c19d3551a34e148c64e00131e1e | TypeScript | 3,083 | 83 | import { atom, useAtomValue } from "jotai";
import { useMemo } from "react";
/**
* Where each 2D-media tile draws its stream, and the episode's media
* commands — published by the view layer, read by features hosted outside
* this package that overlay a tile's media or send the episode back to a
* stream and a mom... |
9e27a8d42a51b2e34fd7310ca7ac2ab1dd854d03f69ae045e020131fbe3474af | TypeScript | 3,088 | 100 | import {
createSampleRendererRenderContext,
getComponent,
getMatchingSampleRenderer,
hasSampleRendererSource,
isSampleRendererModalPersistent,
PluginComponentType,
SampleRendererProps,
useActivePlugins,
} from "@fiftyone/plugins";
import * as fos from "@fiftyone/state";
import { useMemo, useRef } from "... |
4cccbdbbea80433965e60e1dcd75f9fb4755f18e9c3d3e4c33412a0e6c52cdee | TypeScript | 3,090 | 102 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { CommandContextManager } from "@fiftyone/commands";
import { AddMaskKeypointCommand } from "../commands/AddMaskKeypointCommand";
import type { DetectionOverlay } from "../overlay/DetectionOverlay";
import type { Point } from "../types";
import type { InteractionHan... |
2be41f9dada54a47048f844af2bebabed931ea50780798c7006ae5c1e88c224f | TypeScript | 3,094 | 104 | import { getFetchFunction } from "@fiftyone/utilities";
import { renderHook, waitFor } from "@testing-library/react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { useFrustumTextureUrl } from "./use-frustum-texture-url";
vi.mock("@fiftyone/utilities", () => ({
getFetchFunction: v... |
f115d57e50f7120edc47af0eb9af3c42b18ad9f91d3c2d7d8ae1be2f964d51b7 | TypeScript | 3,095 | 94 | import {
createSampleRendererMediaContext,
type SampleRendererProps,
type SampleRendererSampleLike,
} from "@fiftyone/plugins";
import { getSampleSrc } from "@fiftyone/state";
import {
withMediaAssetSrcs,
type SampleMediaDescriptor,
} from "@fiftyone/utilities";
import {
BYTE_SOURCE_READ_PROFILE,
type By... |
c56f4613b4ed27483b70845f27c41086852a33fbfa5194ea808121a73907e7af | TypeScript | 3,103 | 82 | import type { RenderSettings } from "./types";
// FiftyOne embeddings style: the Voxel51 orange (the app's default marker
// color) leads, so uncolored data renders solid orange. Hosts override
// per-point colors entirely via setColors().
export const PALETTE = ["#ffa500", "#19a7ce", "#9b5de5", "#02c39a", "#ef476f"];... |
890aa84eaf9d71af80bf622d20f312494733c4bd3d256d91bab7b193d1be848e | TypeScript | 3,112 | 106 | import { renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { useFo3dSceneBounds } from "./use-fo3d-scene-bounds";
const useFo3dBoundsMock = vi.hoisted(() => vi.fn());
vi.mock("./use-bounds", () => ({
useFo3dBounds: (...args: unknown[]) => useFo3dBounds... |
c0ae43c0c4df9713b539864951b8b94486f2cf9abbd2423503c1c7345dc29882 | TypeScript | 3,113 | 107 | /**
* Timing helpers for Foxglove protobuf decoders.
*
* MCAP records provide transport timestamps, while Foxglove payloads can carry
* message-level timestamps. This module merges both sources into the generic
* decoded timing shape consumed by synchronized playback.
*/
import type { DecodeContext } from "../../... |
3a7490003a49b6cdc40b52113ce30867408db83813124847ec5c77adb3aa6c73 | TypeScript | 3,114 | 103 | import {
useActiveAnnotationSampleId,
useAnnotationEngine,
useSampleSelector,
} from "@fiftyone/annotation";
import {
UNDEFINED_LIGHTER_SCENE_ID,
useLighter,
useLighterEventHandler,
} from "@fiftyone/lighter";
import { useAtomValue, useSetAtom } from "jotai";
import { useCallback, useEffect, useRef } from "... |
281dcf31de42830dd8642e577841c8a60b17386e3d20d6e5720b90e05660f989 | TypeScript | 3,115 | 101 | import type { McapTypes } from "@mcap/core";
import type {
McapDecompressedChunkCache,
McapDecompressedChunkKey,
} from "./decompressed-chunk-cache";
export interface CachedMcapDecompressHandlersOptions {
/** The caller owns this cache and must dispose it with the reader. */
readonly cache: McapDecompressedChu... |
f11bbc7e8204c8dd9947aa5dae79a4e1999e8044d2aa5216b87e83a75e8f84a8 | TypeScript | 3,124 | 108 | import {
canAnnotate,
isGeneratedView,
isPatchesView,
mediaType,
readOnly,
useGroupSlices,
useIsDynamicGroup,
useIsGroupDataset,
useIsNestedDynamicGroup,
useIsQueryPerformantDynamicGroup,
useParentMediaType,
} from "@fiftyone/state";
import { isAnnotationSupported, isMultimodal } from "@fiftyone/u... |
3987bcd458d8534854727e4b2f1f0c3a3d180519314d8a8d0db00cafda7da108 | TypeScript | 3,127 | 97 | import { describe, expect, it } from "vitest";
import {
ABORT_ERROR_NAME,
createAbortError,
DEFAULT_ABORT_ERROR_MESSAGE,
linkAbortSignals,
throwIfAborted,
} from "./cancellation";
describe("cancellation identity", () => {
it("creates a fresh Error with stable name, message, and creation stack", () => {
... |
3828577e40efe99b8dd7c4fd8f8d2f5ebd22d4b968ee84542106f6fb9a750c7f | TypeScript | 3,130 | 85 | import { describe, expect, it } from "vitest";
import { createTree } from "./schemaHelpers";
describe("createTree", () => {
describe("single-select (multiSelect: false)", () => {
it("returns a string-typed schema", () => {
const result = createTree("species", "animals", false);
expect(result.type).to... |
7ec7114351c03b8138412489e952c5d42c9f24879c567715a232b57e72a3bcd5 | TypeScript | 3,139 | 106 | import { afterEach, describe, expect, it, vi } from "vitest";
import { createTimestampLruScopedStore } from "./scoped-store";
interface Value {
readonly name: string;
}
afterEach(() => vi.restoreAllMocks());
describe("timestamp-LRU scoped store", () => {
it("layers fallback and scoped values while evicting the o... |
04661ef3e3eb538ef4bc2c976d8349330ebca55783d05ddd31e08cf98ed7b4f7 | TypeScript | 3,142 | 107 | import type { DecodeContext, Decoder } from "../../../../decoders/index";
import type { DecodedOutput } from "../../../../ir/index";
import { buildNormalizedRawImageOutput } from "../normalized-image";
import {
bytesField,
integerField,
recordField,
rosTimestampNs,
stringField,
} from "../ros/common";
import ... |
3055f7b9d50a7e976b2a303ef8ea994dbc4a523b8ab86d572f4bf562d4316b8e | TypeScript | 3,144 | 99 | import { describe, expect, it, vi } from "vitest";
import { encodeEntityId } from "../identity/entityId";
import { makeDet, makeEngine, ref } from "../testing/fixtures";
const key = (instanceId: string) =>
encodeEntityId("dataset", ref("ground_truth", instanceId));
describe("signal pipe", () => {
it("routes by t... |
37eaf3b9cd1be776ab1d9119993c629c6f9ca0f466a62f1809263afb19a675d8 | TypeScript | 3,144 | 112 | import {
createByteBoundedCache,
type MemoryCacheOptions,
serializeCacheKey,
setByteBoundedEntry,
} from "../cache-utils";
import { safeNumber } from "./bigint-utils";
import type {
ByteRangeCache,
ByteRangeReadRequest,
ByteRangeReadResult,
ByteSourceDescriptor,
} from "./types";
/**
* Creates a stabl... |
4794b46e8b2ba0fa835939b180d91098e4aa6f6ac7222a1f4dd3b60f7880b982 | TypeScript | 3,153 | 113 | import { describe, expect, it } from "vitest";
import { EMBEDDED_DOCUMENT_FIELD, type Schema } from "@fiftyone/utilities";
import { zoomAspectRatio } from "../zoom";
import { RegularLabel } from "./base";
import DetectionOverlay from "./detection";
import * as index from "./index";
import { getHashLabelColorByInstance... |
ca06eb2d0d2c80edb45c4598176506f579a98c7b8d8255ac8f6dabfbdc235458 | TypeScript | 3,163 | 76 | import type { TemporalTagTimelineProps, Track } from "@fiftyone/playback";
import type { SampleRendererProps } from "@fiftyone/plugins";
import type React from "react";
import type { TimeWindow } from "../../ir";
import type { EpisodeSession } from "../../ports";
/** Row-level behavior contributed by an episode timeli... |
e4840803066b9b0c6f033185868190c83d1d583b897786635b1d965c51ae62e4 | TypeScript | 3,169 | 81 | import { useIsImageDynamicGroupVideo, useModalSample } from "@fiftyone/state";
import { atom, useAtomValue } from "jotai";
import { useEffect, useMemo } from "react";
import { AnnotationEngine } from "../engine/core/engine";
import { SampleLabelStore } from "../engine/store/sampleLabelStore";
import { useThreeDSceneSam... |
12ceccbea1bc8fc9e0c2768244973cbadbdb5a7724398cfaaa0c736342182b68 | TypeScript | 3,177 | 81 | /** Public source-agnostic load state. */
export type { LoadStatus } from "./load-status";
/** Public source-agnostic transport metering. */
export {
createNetworkTransportMeter,
type LaneTransportSnapshot,
type NetworkTransportMeter,
type NetworkTransportSnapshot,
type TransportLane,
} from "../query/bytes/n... |
251a92429c3c9f9fed6ebd45154ee9d71629107827a65d7f0c3021242379e3eb | TypeScript | 3,180 | 100 | import type {
AdapterDescriptor,
EpisodeOpenOptions,
FormatAdapter,
SampleDescriptor,
} from "../ports";
import { createAbortError, throwIfAborted } from "../utils/cancellation";
const descriptors = new Map<string, AdapterDescriptor>();
const adapterLoads = new Map<AdapterDescriptor, Promise<FormatAdapter>>();... |
6afd65f4cf25f7ee15e096fd96b1eee6871145586f9d23b6346dd8f4568baca7 | TypeScript | 3,183 | 107 | import { FlashlightConfig, Response } from "@fiftyone/flashlight";
import { zoomAspectRatio } from "@fiftyone/looker";
import * as foq from "@fiftyone/relay";
import * as fos from "@fiftyone/state";
import { Schema } from "@fiftyone/utilities";
import { useCallback, useMemo, useRef, useState } from "react";
import { us... |
ac55e24fc2b288c0371ecbc54373aa5703efa43185f9dbea5444b895c9ab2c35 | TypeScript | 3,193 | 115 | import type { McapTypes } from "@mcap/core";
import type {
McapIndexedMessageTime,
McapReadIndexedMessageTimesRequest,
} from "../reader/index";
import {
MCAP_ACTIVE_TIMELINE,
type McapActiveTimeline,
} from "../contracts/index";
/**
* MCAP timeline strategy that owns how adapter playback time maps to MCAP da... |
a982b6433baf7554cb896db36f6687bd88a39c3b1353849abb3a703c51c93cd9 | TypeScript | 3,197 | 112 | import {
AnnotationEventGroup,
useAnnotationEventHandler,
} from "@fiftyone/annotation";
import {
coerceStringBooleans,
useLabelsContext,
} from "@fiftyone/core/src/components/Modal/Sidebar/Annotate";
import { useCallback } from "react";
import { useRecoilCallback, useSetRecoilState } from "recoil";
import {
... |
0b739ea580c3168d11eada1e590236d4fe1b347177af776c59d1a6281e1a1b99 | TypeScript | 3,201 | 112 | /**
* Copyright 2017-2026, Voxel51, Inc.
*
* Web worker that fetches a `mask_path` URL and decodes the response into an
* {@link OverlayMask}. Runs as a sibling to the main thread so dense samples
* with many large masks don't block the UI on decode.
*
* Pairs with `maskPathDecoding.ts` (the pool manager).
*/
... |
a9ec29c6b07680d90af69e2ecfe0cb1b43c272bba8c1216920360a8fad8b04d6 | TypeScript | 3,202 | 105 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { parseTimestamp } from "@fiftyone/core/src/client/util";
import type { Sample } from "@fiftyone/looker";
import { getSampleVersionToken } from "./getSampleVersionToken";
/**
* A version the server has confirmed for a sample: the opaque `ETag` it
* returned, plus... |
4a6fbd7fc6b79715b3fe25409011c593827e277046118e47406518fba187dddb | TypeScript | 3,205 | 111 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { beforeEach, describe, expect, it, vi } from "vitest";
vi.mock("@fiftyone/core/src/client", () => {
class VersionMismatchError extends Error {
constructor(
message?: string,
readonly responseBody?: Record<string, unknown>,
readonly versionT... |
54d3037c444bddad804791e776a432f7283a8003326abcb67dcbb289e62395dc | TypeScript | 3,209 | 111 | import type { GridSelectionActionContext } from "@fiftyone/multimodal/extensions/grid-selection";
import {
normalizeSelectionMembers,
capturedScopeSources,
type SelectionScope,
} from "@fiftyone/state/src/selection";
import { useEffect, useMemo, useRef, useState } from "react";
/** Metadata and complete membersh... |
c69169d43afb63e0b2a38089055743b6adf3c1ae7a6b6a4cdb9b16ed96a9148b | TypeScript | 3,219 | 121 | import { useFrame } from "@react-three/fiber";
import { folder, useControls } from "leva";
import { useEffect, useMemo, useRef, useState } from "react";
import type { AnimationClip, AnimationMixer } from "three";
import { PANEL_ORDER_ANIMATIONS } from "../constants";
export const useAnimationSelect = (
assetLabel: s... |
14ccb115e3af7802aa8750a5a262aac8f33bdc3b0c54d4eb3c4287666f9e9c17 | TypeScript | 3,222 | 102 | import { describe, expect, it } from "vitest";
import { VISUALIZATION_KIND } from "../../../ir/index";
import {
foxglovePoseInFrameDecoder,
foxgloveSceneUpdateCdrDecoders,
} from "./foxglove/index";
import { POSE_IN_FRAME_FIXTURE } from "./foxglove.test-fixtures";
import {
ROS2_SCENE_UPDATE_SCHEMA,
concatProtob... |
96e07d0dd34ca959b7893c7716ed250503fce542976ce0505a254d821f180771 | TypeScript | 3,223 | 92 | /**
* Router-agnostic URL search-string read + write primitive.
*
* Monkey-patches `window.history.pushState` / `replaceState` once to
* dispatch a `fo:url-changed` bus event, so subscribers (via `useUrlSearch`)
* pick up SPA navigations made through any router. Prefer
* `writeUrlSearch(...)` over calling `replac... |
f3f0cb041a8dc4b886e25db8139f47ba0d564c9d60a3c0680dfccfdf846751b2 | TypeScript | 3,224 | 72 | import { KnownContexts, useKeyBindings } from "@fiftyone/commands";
import { useLighter } from "@fiftyone/lighter";
import * as fos from "@fiftyone/state";
import { useClearSelectedLabels } from "../Actions/Selected/hooks";
/**
* Zoom and clear-selection keybindings for the video Explore surface.
*
* Space / `.` / ... |
1aafb838c6d9be56519c49b60a33bfc4a37d211e0f00d82d605aa28a5eb7f06b | TypeScript | 3,237 | 129 | import { describe, expect, it } from "vitest";
import { parseHeader } from "./parse-header";
const makeBuffer = (str: string): ArrayBuffer => {
return new TextEncoder().encode(str).buffer as ArrayBuffer;
};
describe("parseHeader()", () => {
it("parses a minimal ASCII header with explicit COUNT & POINTS", () => {
... |
420823bebc08a82eb5b50e379c86254b9e7ff998ad9c2ae56142ae10826d2f28 | TypeScript | 3,237 | 105 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type { Undoable } from "@fiftyone/commands";
import { getEventBus } from "@fiftyone/events";
import type { Scene2D } from "../core/Scene2D";
import type { LighterEventGroup } from "../events";
import type { InteractionHandler } from "../interaction/InteractionManage... |
14efed6d981100e624570ca9bc0449d90df944dfab71f08e0bf7a29f8072e81b | TypeScript | 3,239 | 133 | import { describe, expect, it } from "vitest";
import type { RawImageVisualization } from "../../../ir";
import { VISUALIZATION_KIND } from "../../../visualization";
import type { CameraModel } from "./camera-geometry/camera-model";
import { depthSampleAtDisplayPixel } from "./depth-sampling";
describe("mcap depth ho... |
ab2ccbfe1cde6bbc9fb57c377fcd47ecdae9c6dc444809f5a125b8b5d519d107 | TypeScript | 3,243 | 105 | import { isLegacyDomMirror } from "@fiftyone/events";
import * as fos from "@fiftyone/state";
import { useEffect, useRef } from "react";
import { useRecoilCallback, useRecoilValue } from "recoil";
import type { Vector3 } from "three";
import { SET_ZOOM_TO_SELECTED_EVENT } from "../constants";
import {
isFo3dCameraLif... |
32c2ddbd0931113c18237e464c2a64ab831484784516d902efe0e68ccfa18baa | TypeScript | 3,247 | 104 | import { describe, expect, it } from "vitest";
import { createExtensionRegistry } from "./registry";
interface Probe {
readonly id: string;
readonly order: number;
readonly tag?: string;
}
/** A fresh global slot per case, so registries can't leak into each other. */
let slotSeq = 0;
const freshRegistry = (
o... |
5ae4039732f965f509e9543b7f65c597247f9081700faaf25850a3ad65f01506 | TypeScript | 3,252 | 118 | import { byteSourceAccessKey } from "../../../query/bytes";
import { toError } from "../../../utils/errors";
import type {
McapGridPreviewRequestPayload,
McapGridPreviewResult,
McapGridPreviewWorkerResponse,
McapGridPreviewWorkerRpcRequest,
} from "./grid-preview-worker-types";
import {
MCAP_PLAYBACK_WORKER_P... |
5b2b9b8dc49303ce3a2fa0bd4a98b65cd99ae3665b6fd876024cf4e490d26a4d | TypeScript | 3,252 | 129 | // Auto generate SchemaIO compatible schema based on a value
import { isNullish, isPrimitiveType } from "@fiftyone/utilities";
// todo: add support for OneOfView, TupleView, and MapView
export function generateSchema(value: any, options?: GenerateSchemaOptions) {
const type = getType(value);
const { label, readOn... |
750d528668fba0b6b3ff78794cbc3e784f88ee25349e7dea5ec58d70f73638cc | TypeScript | 3,260 | 104 | // @vitest-environment jsdom
import { act, renderHook, waitFor } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { fetchMasks, type Masks } from "./protocol";
import { useSelectedPatchOwners } from "./useSelectedPatchOwners";
vi.mock("@fiftyone/utilities", () => ({
... |
c32ec3f060623e358bd9be694e97118ae02a9f45a8b3815bd5704efe887c82f5 | TypeScript | 3,266 | 99 | import {
compareFrameIds,
uniqueSortedFrameIds,
} from "../../../../utils/frame-ids";
import type { EpisodeFrameTransformStore } from "../../../../runtime/frame-transforms";
/** Frame sources that one placement consumer resolves into a target frame. */
export interface FramePlacementScope {
readonly frameIds: re... |
e72deac85d7c73391c32ae713b3f4dd0a97899cdb244d80e8b1e9be6c8d94501 | TypeScript | 3,269 | 130 | import styled from "styled-components";
import { Box as MuiBox } from "@mui/material";
export const Box = styled.div`
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
`;
export const TextContainer = styled.div`
display: flex;
align-items: flex-start;
width: 100%;... |
2af55b26e0eee5bebda98e7808310ad54616626a2b9e840eccf634ada372549e | TypeScript | 3,271 | 97 | /** Maximum presentation rate shared by lightweight episode grid previews. */
export const EPISODE_PREVIEW_MAX_FPS = 12;
const NANOSECONDS_PER_MILLISECOND = 1_000_000;
const MIN_FRAME_DELAY_MS = 1_000 / EPISODE_PREVIEW_MAX_FPS;
const SCHEDULER_EPSILON_MS = 1e-6;
/**
* Stateful 1x timeline scheduler for a pull-based ... |
35984fc5bf92cb847744e445620ed790f514227410fa98793e5ae7c3ed1a59bf | TypeScript | 3,279 | 119 | import { atom, useAtomValue, useSetAtom } from "jotai";
import type { RawImageVisualization } from "../../../ir";
import {
projectCameraPoint,
unprojectCameraPixel,
type CameraModel,
} from "./camera-geometry/camera-model";
const MINIMUM_RAY_Z = 1e-9;
/** One valid depth-image sample expressed in its camera fr... |
51b54d00707b3388b0dccc7f19b9fa4d2770e5b932184bea95df2aa9f8e41d9c | TypeScript | 3,280 | 111 | import { useTileId } from "@fiftyone/tiling";
import { atom, useAtomValue, useStore } from "jotai";
import { useCallback, useMemo } from "react";
import { MAP_BASE_LAYER, type MapBaseLayer } from "../rendering/types";
export { MAP_BASE_LAYER, type MapBaseLayer } from "../rendering/types";
export interface MapTileSett... |
6f5dfbf298ea7130dac626e866d248209cb6b000b867c8e394a8aa45def94364 | TypeScript | 3,280 | 72 | import {
groupMediaIsMain2DViewerVisible,
useStableInteraction3dSample,
} from "@fiftyone/state";
import { useRecoilValue } from "recoil";
import { useActiveSampleId } from "./useSample";
/**
* The annotated 3D sample's id — the pinned (representative) 3D slice's
* document, stable across 2D-slice selection; `un... |
a22535c90409802bc61c3a366ef6f1ef4b55d3aef85c3afdcf5f769cdcebf401 | TypeScript | 3,289 | 128 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type { Overlay } from "./overlays/base";
import { CONTAINS } from "./overlays/base";
import { ClassificationsOverlay } from "./overlays/classifications";
import HeatmapOverlay from "./overlays/heatmap";
import SegmentationOverlay from "./overlays/segmentation";
impo... |
65f65190d364e5e693f3a5975491bfd0d92aa5710891c8cb645dae5e513687ae | TypeScript | 3,298 | 105 | /** Default opacity multiplier for splat assets without an authored value. */
export const DEFAULT_SPLAT_OPACITY = 1;
/** Default color multiplier for splat assets without an authored value. */
export const DEFAULT_SPLAT_TINT = "#ffffff";
/** User-facing splat LoD presets. */
export type SplatDetail = "low" | "standa... |
765942f1a4a61fd4bef95d31db8e078ba89df1963783efc01c0bb2495a8b334b | TypeScript | 3,305 | 116 | import {
resourceHintsForArrayBufferViews,
type Decoder,
} from "../../../../decoders/index";
import type {
DecodedAttributeValue,
DecodedOutput,
} from "../../../../ir/index";
import { VISUALIZATION_KIND } from "../../../../ir/visualization-kinds";
import {
audioCodecFromFormat,
unsupportedAudioFormatReaso... |
cdb35a26e11883544bf96be387b9032cb56091e45b32dad90226b0949f222e6d | TypeScript | 3,306 | 89 | // =============================================================================
// GEOMETRY CONSTANTS
// =============================================================================
/** Static frustum depth (distance from camera to far plane) */
export const FRUSTUM_DEPTH = 2;
/** Minimum frustum depth to ensure vi... |
a7ed7be38183275cde88620a7d64f1f53634f849cff1174ab11f089f0ae230c7 | TypeScript | 3,312 | 130 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
const dummyLooker = {
state: {
options: {
coloring: "blue",
customizeColorSetting: {},
colorscale: [],
labelTagColors: {},
selectedLabelTags: [],
activePaths: [],
},
config: {
sources: [],
... |
b3f9e243f1733d0d45b64466b65b0e889731eadec417402a94a8809f1b5324d1 | TypeScript | 3,313 | 96 | import {
ToolsContext,
useToolsContext,
useToolsState,
} from "./useToolsContext";
import { useCallback, useEffect } from "react";
import { v4 as uuidv4 } from "uuid";
import { useLighter } from "@fiftyone/lighter";
import { useAnnotationAgent } from "./useAnnotationAgent";
import { useAgentSelector } from "./use... |
34b382ce988a4ae3cf7b236493bd3fd362b821cfbfbfddadf9b6703b473abb3a | TypeScript | 3,316 | 98 | import type { McapIndexedMessageTime } from "../../reader";
import type { McapMessageCursor } from "../../contracts";
import { fnv1aFingerprint } from "../../../../utils/fnv1a";
import {
byteSourceAccessKey,
type ByteSourceDescriptor,
} from "../../../../query/bytes";
const CURSOR_PREFIX = "mcap-message:v1:";
int... |
2e8ec18a53115b0d52f98b370abca52f2b9dc343780cb9a2de7d5a6b88cabc08 | TypeScript | 3,323 | 116 | import { HEATMAP, SEGMENTATION } from "@fiftyone/utilities";
import { Coloring } from "..";
import { OverlayMask } from "../numpy";
import { isRgbMaskTargets } from "../overlays/util";
const canvasAndCtx = (() => {
if (typeof OffscreenCanvas !== "undefined") {
const offScreenCanvas = new OffscreenCanvas(1, 1);
... |
ae967b9287a3fc22fd7dc3b985217f7a8b8127ffa04d4915a4ac8de0b77f882c | TypeScript | 3,324 | 110 | import type { DecodeContext, Decoder } from "../../../../decoders/index";
import type {
DecodedAttributeValue,
DecodedOutput,
LocationVisualization,
} from "../../../../ir/index";
import { VISUALIZATION_KIND } from "../../../../ir/index";
import { rosDecodersForPayloads } from "../ros/factory";
import { decodePro... |
4d9a3f89cc679182958c380e83d0d124a7db887571da5c94fb4bd8adfdde664f | TypeScript | 3,326 | 67 | export { default as AdaptiveMenu } from "./AdaptiveMenu";
export { default as Arrow } from "./Arrow";
export { default as Bar } from "./Bar";
export { default as Button } from "./Button";
export { default as CenteredStack } from "./CenteredStack";
export { default as Code } from "./Code";
export { default as CodeBlock ... |
6e4c218555472601edfdd38888968bfd5a0104764553089f5209e828f967b92d | TypeScript | 3,326 | 107 | import { renderHook } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { useOverviewRows } from "./overviewRows";
import type { SchemaDoc } from "./useSchemaDocs";
import { PROTECTED_PATHS } from "./schemaDocTypes";
const DATASET_SCHEMAS = {
gt: { type: "detections", label_schema:... |
a7aed40047f61a36bdf9d4117010fa895b424cbfa766d2cc8bf6b3425d68f63a | TypeScript | 3,327 | 111 | import {
RIPPLE_VISIBLE_MS,
UNDEFINED_LIGHTER_SCENE_ID,
useLighter,
useLighterEventHandler,
} from "@fiftyone/lighter";
import { useToolsState } from "./useToolsContext";
import {
NEGATIVE_POINT_VARIANT,
usePointSelection,
useSyncPointSelectionWithScene,
} from "./usePointSelection";
import { useCallback ... |
9923d9f849fb4246ce38a332358b584e4652714a6cbcec0402929599553bf574 | TypeScript | 3,329 | 105 | import { useMemo } from "react";
import type { SceneUpdateVisualization } from "../../../ir";
import type { ImageAnnotationSetInput } from "../../../visualization/media-2d/gpu-image-annotation-preparation";
import type { CameraModel } from "../spatial/camera-geometry/camera-model";
import { useFrameTransformsContext }... |
15b125294edacab086cab152fb0819d63514fcec987c3c3a354deafacee62419 | TypeScript | 3,332 | 117 | import { atom, useAtom, useSetAtom } from "jotai";
import { useCallback, useEffect } from "react";
import { useCurrentDatasetId } from "@fiftyone/state";
import {
ListValidAnnotationFieldsRequest,
ListValidAnnotationFieldsResponse,
useSchemaManager,
} from "./useSchemaManager";
/**
* Atom containing a mapping o... |
ef10b6a45f2adf633121680b64607fa9dfb651db1fcd3cf0cf396abfe5a2e4c3 | TypeScript | 3,332 | 98 | import { useMemo, useRef } from "react";
import type { PointCloudVisualization } from "../../../../ir/index";
import type { StreamContentFrame } from "../../playback/use-stream-values";
/**
* Color channels a point-cloud stream has been observed to carry: the
* decoded scalar field names (decoder order preserved) a... |
4e5faf1df6a8db9222c345fec007c74a6068bb0d5dc34cdc18b1e9c80a54fa27 | TypeScript | 3,340 | 103 | /** Lazy, best-effort connection to one IndexedDB database. */
export interface IndexedDbConnection {
open(): Promise<IDBDatabase | null>;
}
/** Domain-owned database definition consumed by the shared lifecycle layer. */
export interface IndexedDbConnectionOptions {
readonly name: string;
/** Resolved for every ... |
e1c8a8a20ee9cc2aaaec727edac0e0e6fe29bc2d4347559d9bd40a704721a518 | TypeScript | 3,345 | 112 | import styles from "./Grid.module.css";
import { getEventBus } from "@fiftyone/events";
import { freeVideos } from "@fiftyone/looker";
import type Spotlight from "@fiftyone/spotlight";
import type { Rejected } from "@fiftyone/spotlight";
import * as fos from "@fiftyone/state";
import { useLayoutEffect } from "react";
... |
89d67c1bf74f4dccf2df2591e5974cb2e4c76f3634e48fd894cee9df5d56c7c0 | TypeScript | 3,346 | 123 | import type {
CuboidTransformData,
PolylinePointTransformData,
ReconciledDetection3D,
ReconciledPolyline3D,
} from "../annotation/types";
import { isValidPolylineSegment } from "../utils";
import type { OverlayLabel } from "./loader";
/**
* Reconciles a raw detection overlay with staged transform data.
* Sta... |
00fd7252d28a70ef05d666cdadb5c48084056ec4d38b2062b32ccbad9db6d337 | TypeScript | 3,348 | 118 | /** Placement state relevant to retaining the last valid 3D scene. */
export type Scene3dSnapshotReadiness =
| "ready"
| "pending"
| "definitiveMissing";
/** A scene snapshot retained across asynchronous placement transitions. */
export interface HeldScene3dSnapshot<Snapshot> {
readonly definitiveMissingSinceM... |
a66c7a03912b82097905bd124c9adb975aa81706c82dec01c8f7e2699fb2a448 | TypeScript | 3,348 | 91 | /**
* Crops the hover card's image to a patch's bounding box.
*
* A patches run's points are labels, not samples, so the card must show
* the patch rather than its parent image. The card is a fixed-size frame,
* so the patch is FIT inside it at its true aspect ratio (letterboxed
* against the card's surface) rath... |
f24ba9310d5988fbc6548b55a30c13b35ed1200919b014a4a8b38847fee89064 | TypeScript | 3,352 | 92 | import { describe, it, expect } from "vitest";
import { getDataView } from "./get-data-view";
import { PCDFileFormat } from "./types";
const makeDataView = (buffer: ArrayBuffer) => {
return new DataView(buffer);
};
describe("getDataView", () => {
describe("type F (float)", () => {
it("reads 4-byte float (Floa... |
8f1a5484332d95acc91d5b7945b36a7489ff641598cbe357103d05d1302ab96b | TypeScript | 3,360 | 111 | import { useMemo } from "react";
import type {
CameraCalibrationVisualization,
GridVisualization,
PointCloudVisualization,
SceneUpdateVisualization,
} from "../../../../ir";
import type {
StreamContentFrame,
StreamPlaybackFrame,
} from "../../playback/use-stream-values";
import type { FrameTransformsState ... |
5c8570cf6689ca8595117e45f6a2d43608ee07352e001109a93f68de4cc3c365 | TypeScript | 3,369 | 93 | import { describe, expect, it, vi } from "vitest";
import type { BrowserAnnotationProvider } from "./BrowserAnnotationProvider";
import { PointLabel, type InferenceResult } from "./types";
import { pointsFromBox, propagate } from "./videoPropagation";
/** A 2×2 all-on mask at a fixed bbox — enough for centroid samplin... |
797908b34299bc9894b19cc9c843735d2b2c2bcc5663c0c78cf49902a88d36e9 | TypeScript | 3,370 | 112 | import { useEffect, useMemo, useState } from "react";
import type { EpisodeSession } from "../../../ports";
import { createEpisodePlaybackRuntime } from "../../../runtime/read-policy";
import {
logConsoleRowsFromDecodedMessage,
type EpisodeLogConsoleRow,
} from "../../../visualization/logs/log-console-rows";
expor... |
a13363ffe3324ec812640df1957a8f4ee6e06f4984658f309253badf9cf54f2e | TypeScript | 3,373 | 116 | import { beforeEach, describe, expect, it, vi } from "vitest";
import { fetchWithLinearBackoff } from "./decorated-fetch";
describe("fetchWithLinearBackoff", () => {
beforeEach(() => {
vi.clearAllMocks();
vi.useRealTimers();
});
it("should return response when fetch succeeds on first try", async () => {... |
1177b7658ce838a593e1a2cefb93b2604f1d272ea54850a3f8cc4ec384be544a | TypeScript | 3,380 | 105 | import {
BufferAttribute,
BufferGeometry,
HalfFloatType,
Mesh,
NearestFilter,
OrthographicCamera,
RawShaderMaterial,
Scene,
Sphere,
Vector3,
WebGLRenderTarget,
type Camera,
type WebGLRenderer,
} from "three";
import { DEFAULT_SETTINGS } from "./constants";
import { SCREEN_FRAGMENT, SCREEN_VERT... |
07dd993b78b54ea1a15a71875261c6c7b5d1576d06dc3732c7db00ce8ce888fb | TypeScript | 3,381 | 107 | import { Box3, Vector3 } from "three";
import { describe, expect, it } from "vitest";
import {
getMainPanelCloseNavigationDistance,
getMainPanelOrbitPanSpeed,
getMainPanelOrbitZoomSpeed,
MAIN_PANEL_CAMERA_TARGET_EPSILON,
MAIN_PANEL_CLOSE_PAN_MAX_SPEED,
MAIN_PANEL_CLOSE_ZOOM_MAX_SPEED,
MAIN_PANEL_ORBIT_PAN... |
13d7349385db09a1820e044af20f792e2dd2e343c8fc5c5eca73c136e3813ee0 | TypeScript | 3,389 | 123 | import { useControls } from "leva";
import { useEffect, useState } from "react";
import { PANEL_ORDER_PCD_CONTROLS } from "../constants";
import {
MAX_SPLAT_SHARPNESS,
MIN_SPLAT_SHARPNESS,
SPLAT_DETAIL_OPTIONS,
SPLAT_SH_OPTIONS,
SPLAT_SORTING_OPTIONS,
type SplatDetail,
type SplatShDegree,
type SplatSort... |
163726d500630323a9f9667ed58dd11fc36d6055a0d3ad58168b107453e555ca | TypeScript | 3,394 | 111 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
const state = vi.hoisted(() => ({
readOnly: false,
canAnnotate: true,
mediaType: "image",
parentMediaType: "image",
isGeneratedView: false,
isPa... |
2c6a5bd82fe2a62a63ab37e39f34da810c36390d00d9b0ba7cd02ee2c3eaa176 | TypeScript | 3,398 | 96 | import type { DecodedFrame, PointCloudRenderChannelPayload } from "../ir";
import type { TimelineIndex } from "./timeline-index";
/** Minimum identity required for a source-scoped runtime data stream. */
export interface SourceScopedDataStream {
readonly sourceKey: string;
}
/** Presentation preferences that affect... |
32e81efbe1be193935b108d3d16b351340fb6ee12298b93a3d3d5ab5f6cc21b8 | TypeScript | 3,402 | 103 | import { act, renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { FoScene, FoSceneNode } from "../fo3d/render-types";
import { useFo3dVisibilityPreferences } from "./use-fo3d-visibility-preferences";
const storageState = vi.hoisted(() => ({
visibil... |
d15d4d26dc32bf9da1542a42465960b8d56f0d94138a68e10e03af9e221ec9ae | TypeScript | 3,403 | 108 | import { beforeEach, describe, expect, it } from "vitest";
import type { Sample } from "@fiftyone/looker";
import {
clearSampleVersions,
recordSampleVersion,
resolveSampleVersionToken,
} from "./sampleVersionTokens";
const ID = "66e4b1c2f0a1b2c3d4e5f601";
const T0 = new Date("2026-09-14T22:19:00.000Z");
const T1... |
170a23b0a7ab0bbe31069640de8279de4dae82031e70bb84b771e5aa7da0dd83 | TypeScript | 3,404 | 124 | import type { McapTypes } from "@mcap/core";
import { describe, expect, it, vi } from "vitest";
import type { DecodeClient } from "../../../../query/decoding";
import {
isMcapBoundedReadCancelledError,
type McapIndexedReaderLike,
} from "../../reader";
import { resolveMcapTimelineStrategy } from "../timeline";
impo... |
d6f6c5689c1e1ea482b035cf43a67f95be6c594ec6eecaa254aa1c18aa0adb88 | TypeScript | 3,404 | 126 | import { describe, expect, it } from "vitest";
import {
clampTickRanges,
intersectAllTickRanges,
intersectTickRanges,
normalizeTickRanges,
subtractTickRanges,
unionAllTickRanges,
} from "./tick-ranges";
describe("tick range algebra", () => {
it("normalizes only discrete non-negative safe indexes", () => ... |
a8200abf1381d828dc921622919d5778a167da68bdbdf85029317500bdb03df3 | TypeScript | 3,411 | 104 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
// Pen-tool lifecycle: installs an InteractivePenHandler on the selected
// detection while the pen tool is active, and tears it down on tool/mode/
// selection change. Modeled on `usePolylineMode`'s install/exit shape.
import { useEffect, useRef } from "react";
import t... |
7869e2d81e08eef3e617ff772378197105ef4fd6b062bef3c0678b38981c2b86 | TypeScript | 3,419 | 112 | import { describe, expect, it } from "vitest";
import {
transformPoint,
computeMaskBbox,
postprocessMask,
SAM2_INPUT_SIZE,
SAM2_OUTPUT_SIZE,
type ProcessedImage,
} from "./math";
const SZ = SAM2_INPUT_SIZE;
function makeImg(width: number, height: number): ProcessedImage {
return {
tensor: new Float3... |
f4edb628f751dd820985cc89f00ff2a15d9b3efb68f44847bc7cd666f28fbc80 | TypeScript | 3,419 | 133 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { describe, expect, it } from "vitest";
import { CoordinateSystem2D } from "../core/CoordinateSystem2D";
// Through the package entry: importing an overlay module first trips a
// pre-existing import cycle (PolylineOverlay extends KeypointOverlay).
import { Polyline... |
0a9d1faccae58e23c8cc2e2195c55e64a77522f31a31c045b4767d23859d284c | TypeScript | 3,420 | 114 | import { describe, expect, it } from "vitest";
import { createAdaptiveByteCacheBlockSize } from "./adaptive-block-size";
import {
BYTE_SOURCE_READ_PROFILE,
DEFAULT_LOCAL_BYTE_CACHE_BLOCK_SIZE_BYTES,
DEFAULT_REMOTE_BYTE_CACHE_BLOCK_SIZE_BYTES,
} from "./constants";
import type { ByteRangeReadRequest, ByteReadDebug... |
1c5b87420431ba231a07b98424802aed6987d816cb7781786a353d6798c3247e | TypeScript | 3,420 | 126 | import { getImageElements } from "../elements";
import { COMMON_SHORTCUTS } from "../elements/common";
import type { Overlay } from "../overlays/base";
import type { Coordinates, ImageState } from "../state";
import { DEFAULT_IMAGE_OPTIONS } from "../state";
import { AbstractLooker } from "./abstract";
import { LookerU... |
f3cdd8b4bf4f93a504d9f3c53f255de29f9172fa6316abe55b4056b6c3efb375 | TypeScript | 3,425 | 128 | /** Bounds browser-native video decoders retained by episode grid cells. */
export const GRID_NATIVE_VIDEO_CAP = 2;
type GridNativeVideoPriority = "playing" | "poster";
/** Handle for one pending or active native-video decoder lease. */
export interface GridNativeVideoLeaseRequest {
release(): void;
}
interface Le... |
28986789db2c2363794a5d8f4abe5e511c5973cf485c37bc400361c6499a6700 | TypeScript | 3,427 | 117 | import { copyVideoFramePresentation } from "./presentation";
import { VideoSeekAdmissionScheduler } from "./admission-scheduler";
import { VideoStreamEngine } from "./stream-engine";
import type {
VideoAccessUnitReader,
VideoEngineDependencies,
VideoPlaybackIntent,
VideoStreamSnapshot,
} from "./types";
import ... |
2d664fbf431bffb512b610e650b33b72daf4218f9e94cdf1ffa04c55f3f8e9c7 | TypeScript | 3,427 | 114 | import {
useActiveAnnotationSampleId,
useAnnotationEngine,
useTemporal,
} from "@fiftyone/annotation";
import { LabelType } from "@fiftyone/utilities";
import { useAtomValue } from "jotai";
import { visibleLabelSchemas } from "./state";
import { useAnnotationLabelsReady } from "./useLabels";
export type LabelRow... |
164746b7cdf55b1ca8fd408f057d03b9c36912de9c50fc6fd3354b4c30b5cc43 | TypeScript | 3,430 | 113 | import { labelSchemaData } from "@fiftyone/core/src/components/Modal/Sidebar/Annotate/state";
import { getDefaultStore } from "jotai";
import { afterEach, describe, expect, it } from "vitest";
import type { ReconciledDetection3D } from "../types";
import {
clearLastCreatedLabels,
getDefaultLabel,
recordLastCreate... |
7e3ebb777b96f688132cd44944c41f245d89ede3c24b4eeb34e508713203b94a | TypeScript | 3,433 | 122 | import { describe, expect, it } from "vitest";
import { getFrameNumber } from "../elements/util";
import { VideoLooker } from "./video";
const FPS = 10;
const DURATION = 2;
const LAST = getFrameNumber(DURATION, DURATION, FPS);
type Update = Record<string, unknown>;
/** Run a transport method against `state` and retu... |
618c6081c1ada02a533f1a2992834b272609359a0691ae3aea6805b41deaf4bd | TypeScript | 3,442 | 105 | import { BaseConfig, BaseState, DispatchEvent, Sample } from "../../state";
import { BaseElement } from "../base";
import { getFileName, getFileSize, getIcon } from "./util";
export class MetadataThumbnailElement extends BaseElement<BaseState> {
// Used to scale content as size of looker changes.
// These values h... |
4348f69007608b088afbb0b4aca2beba2ec7d60ad0c9016db0233d3fb7e134cd | TypeScript | 3,443 | 128 | import { describe, expect, it, vi } from "vitest";
import type {
BudgetedReadRequest,
BudgetedReadResult,
SourceReadBudgetAccount,
} from "../ports";
import { createScheduledSourceReadBudgetAccount } from "./scheduled-read-budget-account";
describe("createScheduledSourceReadBudgetAccount", () => {
it("round-r... |
8ddd048c372065c898c3811ef123bb9f978125680a3a12c6b665a08fc12970d4 | TypeScript | 3,450 | 123 | import type { Overlay3DDocument, OverlayLabel } from "../labels/loader";
export type {
ToolbarActionItem,
ToolbarActionGroup,
} from "@fiftyone/components";
export interface AnnotationToolbarProps {
className?: string;
}
// Hover state for specific polyline points/segments
export interface HoveredPolylineInfo ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.