sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d291f2bcfdbe7ed1264d0e21f5a177e8854ed7bde7375e1da266f4c19f2c9c0e | TypeScript | 6,631 | 238 | import { types } from "@fiftyone/operators";
const inputComponentsByType = {
Object: "ObjectView",
Boolean: "CheckboxView",
String: "FieldView",
Number: "FieldView",
List: "ListView",
OneOf: "OneOfView",
Tuple: "TupleView",
Map: "MapView",
File: "FileExplorerView",
UploadedFile: "FileView",
Resol... |
75466d9280df35e3773da568f5c6d70bc49c0842494eb1c70ee9839f8c0f9055 | TypeScript | 6,652 | 230 | import { atom, getDefaultStore, useAtomValue, useSetAtom } from "jotai";
import { useCallback, useEffect, useMemo } from "react";
/**
* Stored value that preserves the existing first-image-stream preview behavior.
*/
export const GRID_STREAM_AUTO = "auto" as const;
const EMPTY_STREAMS: readonly string[] = Object.fr... |
2fdf4a28336c5267177b5ffe731938a05c63c3cbd9c23b32a99ca8924bc3eda0 | TypeScript | 6,675 | 205 | import { useCallback, useSyncExternalStore } from "react";
import type { SampleRendererLoadingProps } from "@fiftyone/plugins";
const MAX_SNAPSHOTS = 32;
const MAX_SNAPSHOT_BYTES = 8 * 1024 * 1024;
const MAX_CANVAS_DIMENSION = 512;
const MAX_POSTER_KEYS = 512;
const MAX_POSTER_URLS = 16;
type Thumbnail =
| { readon... |
06dc73b6d9c54939b8c1b8c30ba84ff1d5717b56abd242146b547f074aab1789 | TypeScript | 6,676 | 192 | import { beforeAll, describe, expect, it, vi } from "vitest";
import { AudioRingBuffer } from "./ring-buffer";
// `AudioWorkletProcessor` and `registerProcessor` exist only in
// `AudioWorkletGlobalScope`. Stub them before importing the worklet so the
// real-time `process()` logic can be driven directly — otherwise t... |
075a851551b488b350b1e60e9bd02b2674f4bf32c2b2aad558fb6dc255b24475 | TypeScript | 6,679 | 240 | import { ModalSample, getNormalizedUrls, getSampleSrc } from "@fiftyone/state";
import {
BufferManager,
DETECTION,
DETECTIONS,
HEATMAP,
SEGMENTATION,
sizeBytesEstimate,
} from "@fiftyone/utilities";
import { LRUCache } from "lru-cache";
import { getSampleWithResettedMasks } from ".";
import {
MAX_FRAME_ST... |
af82572721e6f54ceee97ca87c514b000e82dbbec5c42da358709ffc69e0fd8c | TypeScript | 6,690 | 233 | import type { Decoder } from "../../../../decoders/index";
import { decodeRosCameraInfoRecord } from "../ros/camera-info";
import { decodeRosCompressedImageRecord } from "../ros/compressed-image";
import { decodeRosImageRecord } from "../ros/image";
import { decodeRosLaserScanRecord } from "../ros/laser-scan";
import {... |
f3f11bceb8d8ac22253bfd0747838f980a8be9afc026396903d3a463646f19d9 | TypeScript | 6,693 | 231 | import { Lookers } from "@fiftyone/state";
import {
jotaiStore,
numConcurrentRenderingLabels,
} from "@fiftyone/state/src/jotai";
import { v4 as uuid } from "uuid";
import { ProcessSample } from ".";
import { Coloring, Sample } from "..";
import { LookerUtils } from "../lookers/shared";
import { retrieveTransferabl... |
75867a8dbcc4a2924c94bb96a07c81ab33170bb31cc44ee4af8af65c0b6ac5a6 | TypeScript | 6,698 | 241 | import { describe, expect, it } from "vitest";
import {
STREAM_SYNC_MODE,
type DecodedFrame,
type StreamSyncPolicy,
} from "../../../ir";
import type { EpisodeSession } from "../../../ports";
import { readSynchronizedPlaybackBatchFallback } from "../../../runtime/read-policy";
import { PlaybackSyncMode } from ".... |
9677fa7adc193d51f1669964538606cf1aa96dda30690e007ce4ceb91cf90736 | TypeScript | 6,724 | 195 | import * as THREE from "three";
import { describe, expect, it } from "vitest";
import {
fitCuboidHeightToPoints,
type ScenePointCloud,
} from "./fit-cuboid-to-points";
import type { CuboidTransformData } from "./types";
const IDENTITY_QUAT: [number, number, number, number] = [0, 0, 0, 1];
const makeCloud = (
po... |
c9c1cc0bc23c53b94f21e84ea2d03cf6f3953e6a46fd483125ab62fa306a202c | TypeScript | 6,724 | 204 | import type { McapTypes } from "@mcap/core";
import { safeNumber } from "../../../query/bytes/bigint-utils";
import { throwIfAborted } from "../../../utils/cancellation";
import { yieldToTask } from "../../../utils/task-yield";
import { ByteClientReadable } from "./byte-readable";
import {
decompressMcapChunkRecord,
... |
6992979bfef60f2b17cfe19350778fb4a409bd2b987730d3fbc23835a940eb08 | TypeScript | 6,727 | 57 | import xml from "@xmldom/xmldom";
const domParser: DOMParser =
typeof window !== "undefined" ? new DOMParser() : new xml.DOMParser();
function HTMLToDom(html: string) {
const node = domParser.parseFromString(html, "text/xml").childNodes[0];
return node;
}
export const clipboard = HTMLToDom(
'<svg xmlns="http:... |
2af412872a2c34f25c80abc6b54425d236e2d41c8c70ceb749630aec95349433 | TypeScript | 6,729 | 205 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { getFieldSchema, useDeleteAnnotation } from "@fiftyone/annotation";
import {
type Scene2D,
UNDEFINED_LIGHTER_SCENE_ID,
useLighterEventHandler,
} from "@fiftyone/lighter";
import * as fos from "@fiftyone/state";
import { useCallback, useEffect } from "react";
... |
6c953d3f53e629775354ebda5c56c26c4e044e98195791f91b28ed2418a610f8 | TypeScript | 6,739 | 211 | /**
* Row model for the Schema Manager overview: which fields appear, in
* which section, with which display metadata. Pure derivation from the
* dataset schema, the selected doc and the search filter.
*/
import * as fos from "@fiftyone/state";
import type { StrictField } from "@fiftyone/utilities";
import { atom,... |
a2503a4161096457472d8493b8e85ea3197e4d577fecf0b2440afabd4fa4267c | TypeScript | 6,760 | 239 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { getEventBus } from "@fiftyone/events";
import type { COLOR_BY } from "@fiftyone/utilities";
import { isEqual } from "lodash";
import type {
BaseState,
CustomizeColor,
LabelTagColor,
Sample,
} from "../../state";
import { BaseElement } from "../base";
import... |
bf2910fa73fd5ee7247f6422f4c0ff2695664a1c71e82c14eedecb5305c6f231 | TypeScript | 6,761 | 237 | import type {
ByteRange,
ByteSourceDescriptor,
ByteSourceReadProfile,
} from "../../ir";
export type {
ByteRange,
ByteSourceDescriptor,
ByteSourceReadProfile,
} from "../../ir";
/**
* Request for reading one source byte range.
*/
export interface ByteRangeReadRequest {
/**
* Per-read cache behavior... |
2be03aeaf33e5530c67273b8e9924ee7ce0f5cea3bce368d672b9878540b8e82 | TypeScript | 6,764 | 233 | import { DETECTIONS, getCls, Schema } from "@fiftyone/utilities";
import ch from "monotone-convex-hull-2d";
import { POINTCLOUD_OVERLAY_PADDING } from "../constants";
import { DetectionLabel } from "../overlays/detection";
import { OrthogrpahicProjectionMetadata, Sample } from "../state";
import {
BoundingBox3D,
ge... |
862fe2c6172b8e0dc0bf583f1adfac6d3e646a9b86cbb9222f4ca01e3aa4d10a | TypeScript | 6,780 | 237 | import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
import { Analytics } from "./usingAnalytics";
import { AnalyticsBrowser } from "@segment/analytics-next";
// Mock the AnalyticsBrowser object
vi.mock("@segment/analytics-next", () => ({
AnalyticsBrowser: {
load: vi.fn(),
},
}));
const S... |
8bdfae27bfaeeee50782a3ed7a26a43138292991827709342949fc5864f2f440 | TypeScript | 6,781 | 221 | import * as fos from "@fiftyone/state";
import { useCallback, useEffect, useMemo, useRef } from "react";
import { useRecoilValue } from "recoil";
import type { Box3, PerspectiveCamera } from "three";
import { Vector3 } from "three";
import { DEFAULT_CAMERA_POSITION } from "../constants";
import { resolveCameraConfig } ... |
98bb862fb90dbf6b860a989ad00a3e78a0e8e081a8b7a63274a1846a81befe9f | TypeScript | 6,791 | 244 | /**
* Copyright 2017-2025, Voxel51, Inc.
*/
import { isUndoable } from "../utils";
import type { Action } from "./Action";
import type { Undoable } from "./Undoable";
export type UndoStateListener = (
undoEnabled: boolean,
redoEnabled: boolean,
) => void;
export type ActionListener = (actionId: string, isUndo:... |
3a5192c37857cea236dd957bd72a34fa2ab3666fb899f918552c085a0caf3148 | TypeScript | 6,798 | 222 | import { describe, expect, it } from "vitest";
import { getEventBus } from "@fiftyone/events";
import type { LighterEventGroup } from "../events";
import { SelectionManager } from "./SelectionManager";
class Selectable {
public id = "id";
private selected = false;
getSelectionPriority = () => 0;
isSelected = ... |
6ab01d42d0f8e715bb2cf6fd9754513886655cba355dabe009d0a66398f93205 | TypeScript | 6,811 | 279 | /**
* Lightweight facts extracted from one Annex-B H.264 access unit.
*/
export interface H264AnnexBAccessUnitInfo {
readonly codecString?: string;
readonly hasBFrames: boolean;
readonly hasFrame: boolean;
readonly hasStartCodes: boolean;
readonly keyframe: boolean;
readonly nalUnitTypes: readonly number[... |
0fe0a41c8b5f785071e6589199a08e5e19d15a1ab2371607513bb9b58b4f0e9f | TypeScript | 6,824 | 235 | import { beforeEach, describe, expect, it, vi } from "vitest";
import { VISUALIZATION_KIND } from "../../../../ir/index";
import type { RawImageVisualization } from "../../../../ir/index";
import { decodeProtobufMessage } from "./protobuf/index";
import {
foxgloveRawImageCdrDecoders,
foxgloveRawImageDecoder,
} fro... |
2dcb15b727f9637acf0edc61a9ebc14e81ae658638570f64cdc303b74fe97940 | TypeScript | 6,826 | 208 | // @vitest-environment jsdom
import { beforeEach, describe, expect, it, type Mock, vi } from "vitest";
import { LASSO_MIN_EXTENT_PX } from "../constants";
import type { Polygon } from "../types";
import { LassoOverlay } from "./LassoOverlay";
const fire = (
target: HTMLElement,
type: string,
props: Record<string... |
3c4b3acb689261b9984062d04371c2c1334ca26052ec4313b569deb0c06dac03 | TypeScript | 6,844 | 227 | import { parse as parseRosMessageDefinition } from "@foxglove/rosmsg";
import { parseRos2idl } from "@foxglove/ros2idl-parser";
import { MessageReader as Ros1MessageReader } from "@foxglove/rosmsg-serialization";
import { MessageReader as Ros2MessageReader } from "@foxglove/rosmsg2-serialization";
import type { McapTyp... |
3cb015081491d065b44b18bb4be8b51a4b0b0de031b41a076fd79f8c5aa159b1 | TypeScript | 6,853 | 225 | import { MathUtils, Vector3 } from "three";
import { DEFAULT_POINT_CLOUD_CAMERA_PROJECTION } from "../../../../visualization/scene-3d/camera-fit-bounds";
import type {
PointCloudCameraPose,
PointCloudCameraProjection,
} from "../../../../visualization/scene-3d/types";
import type { Scene3dUpAxis } from "../../spati... |
3857662ef107cc382a8e50367bed6be57d2d844de6578c70dffc148ec2a87d43 | TypeScript | 6,855 | 201 | import { Archetype3d, Looker3dOverlayLabel } from "@fiftyone/looker-3d";
import { AnnotationLabel } from "@fiftyone/state";
import type {
AnnotationAgentDownloadProgress,
AnnotationAgentLifecycleStatus,
} from "./agents";
import type { LabelRef } from "./engine/identity/ref";
import type { ProviderError } from "./p... |
ff23f1e8c2e5cd3c63572dae4fde1baa4f6ae1ce440ac152e5c6c1c23669652b | TypeScript | 6,855 | 221 | import { afterEach, describe, expect, it, vi } from "vitest";
import type { DecodedFrame } from "../../../ir";
import {
EpisodeReadCancelledError,
type EpisodeSession,
type ReadRequest,
} from "../../../ports";
import { monotonicNowMs } from "../../../utils/monotonic-time";
import { readStreamFramesWithinBudget ... |
650d6ff76d797545b7f67c66feed696589139d7e3aea44662ac1261b7e479e6f | TypeScript | 6,856 | 233 | import { describe, expect, it } from "vitest";
import {
intervalPinnedTrackIds,
intervalTimelineSections,
intervalTrackId,
intervalsToTracks,
} from "./intervals-to-tracks";
import type {
EpisodeInterval,
EpisodeIntervalSource,
ResolvedEpisodeIntervals,
} from "./types";
const NS = 1_000_000_000;
const ... |
6dd37960cb0da65fe3fc59019327b9357e60290855938c5ecb7492b5aeb52e8e | TypeScript | 6,886 | 212 | import {
type AnnotationContextManager,
type EnterResult,
InitializationStatus,
useSetEntranceLabel,
} from "@fiftyone/annotation";
import {
type ContextManager,
DefaultContextManager,
useActiveModalFields,
useModalSample,
useQueryPerformanceSampleLimit,
useUnboundStateRef,
} from "@fiftyone/state";... |
7eaea22771728f82033f35623160cf23372f2c4fda90a15ce91c5cb67a756e9b | TypeScript | 6,886 | 296 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { getColor, sizeBytesEstimate } from "@fiftyone/utilities";
import { ARRAY_TYPES, TypedArray } from "../numpy";
import { BaseState, Coordinates, MaskTargets } from "../state";
import {
BaseLabel,
CONTAINS,
LabelMask,
Overlay,
PointInfo,
SelectData,
isS... |
783c188206ed863f7966cb6349505fd6ca8b015226df1d6a3d9ee559932f1408 | TypeScript | 6,891 | 200 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { getFrameNumber, getTime, type VideoLooker } from "@fiftyone/looker";
import {
bumpStreamRangesVersion,
useIsPlaying,
usePlayback,
usePlaybackStore,
useSeekEvent,
useSpeed,
} from "@fiftyone/playback";
import * as fos from "@fiftyone/state";
import { us... |
24781d414fa539d295e1ef5d9284504f0cc5c0c0bf84958c34d58a122e2b6a17 | TypeScript | 6,899 | 242 | /**
* The declarative-surface contract: equality-checked
* selector hooks over `useSyncExternalStore` against read-only projections —
* the type system enforces "subscribers are sinks" — plus the shared
* ref-addressed write-half. No bridge, no handles, no exported atoms.
*
* Dependencies are injected: the bindin... |
ecf0f054ba20838d3a4dbcd1171c88ff67a42095f0ec6fe935a6eea7c392e0c0 | TypeScript | 6,906 | 226 | import fs from "node:fs";
import path from "node:path";
import react from "@vitejs/plugin-react";
import nodePolyfills from "rollup-plugin-polyfill-node";
import { defineConfig, normalizePath, type Plugin } from "vite";
import relay from "vite-plugin-relay";
import svgr from "vite-plugin-svgr";
import wasm from "vite-p... |
17b12391622953bf90ce3563ee0ed8e25c5dad3acadc2403e9e96fe14282674a | TypeScript | 6,923 | 181 | import { useEffect, useMemo, useState } from "react";
import type {
PoseVisualization,
SceneUpdateVisualization,
} from "../../../../ir/index";
import type { Scene3dViewStateStore } from "../camera/scene-3d-view-state";
import { useScene3dViewStateStore } from "../camera/scene-3d-view-state-context";
import { usePo... |
733138526373e3bdfb72f4af8024146604adadc81877cd116266245fb1d63af0 | TypeScript | 6,927 | 256 | /**
* Pure helpers for rendering ego-pose streams: trajectory decimation, the
* synthetic SceneUpdate payloads that reuse the existing 3D annotation
* pipeline (line rendering + frame-locked transform resolution), and the
* frame heuristics/telemetry formatting around them.
*/
import type {
LocationVisualization... |
d4c1d27005e47330fce5867c6fdb536ac75cb8c81790daa085b32f38c528bed7 | TypeScript | 6,932 | 235 | import { act, renderHook } from "@testing-library/react";
import type { RefObject } from "react";
import { MOUSE, Vector3 } from "three";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { useFo3dCameraControlsConfig } from "../../hooks/use-fo3d-camera-controls-config";
import type { Fo3dCameraCont... |
0b16c4e47a6d109d6a8a636abbb709d9be0fc2033cff841d125320e078fa0db6 | TypeScript | 6,950 | 186 | import { describe, expect, it } from "vitest";
import {
decimateMinMax,
NUMERIC_SERIES_BUCKET_GAP,
} from "./numeric-series-decimate";
describe("decimateMinMax", () => {
it("passes through inputs at or under budget", () => {
const times = Float64Array.from([0, 1, 2, 3]);
const values = Float64Array.from(... |
b5c6c452c4e1b044c5c1602c91849103452be98113014442cdf9212b6318ed81 | TypeScript | 6,970 | 244 | /**
* The temporal {@link TemporalView}: presence is the pool subset whose
* occurrence coordinate matches the playhead's current frame. Sample-level refs
* (`frame == null`) are present too, EXCEPT temporal detections, which are gated
* by their `support` span — a TD shows only while the playhead sits inside
* `[... |
2d71aeea35a8dbaff9adca28ff988ee86eabb0f063cb3f4e4ae179cf66ac2211 | TypeScript | 6,971 | 237 | import type { McapDecodedMessage } from "../contracts";
import { decodedOutputSizeBytes } from "../../../query/cache-utils";
import type { McapRetainedDecodedMessageReference } from "./playback-worker-types";
const DEFAULT_DECODED_RECORD_STORE_MAX_BYTES = 128 * 1024 * 1024;
const DEFAULT_DECODED_RECORD_STORE_MAX_ENTRI... |
9adfd612dcd3d9659e50e1f993c9862ab08a8ad9212c266c852f3a3481957b8c | TypeScript | 6,982 | 197 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { describe, expect, it } from "vitest";
import {
imagePixelsToCanvasPixels,
relativeToImagePixels,
} from "./coordinateConversion";
describe("relativeToImagePixels", () => {
it("converts normalized coords to image pixel coords", () => {
const result = rel... |
ff444b0f94a4e2366cc70655f11972f710c20e12131d7d146740c03b4d760d68 | TypeScript | 7,003 | 268 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type {
DrawStyle,
Point,
Rect,
TextOptions,
ViewportState,
} from "../types";
/**
* Types of image sources that can be rendered.
*/
export type ImageSourceType =
| "html-image"
| "canvas"
| "texture"
| "image-data"
| "bitmap"
| "custom";
/*... |
2f5a6166e8c0994bcff319eeb4ba7feffb5029b9aae648729cfa3b56a4d0288c | TypeScript | 7,009 | 186 | import type {
RawRecordCursor,
RawRecordIndexWindow,
RawRecordIndexWindowRequest,
} from "../ir";
/**
* Declared identity of one state/action feature vector. Dimension order and
* names come verbatim from source metadata; consumers must not reorder them
* or invent semantic names for unnamed dimensions.
*/
e... |
35316d4e7159963c2aad8c642e11093eb7452a252f001269c4b54a02de8d6e82 | TypeScript | 7,011 | 247 | import { executeOperator } from "@fiftyone/operators";
import * as fos from "@fiftyone/state";
import { useCallback, useMemo, useState } from "react";
import { useRecoilCallback, useRecoilValue } from "recoil";
import {
PANEL_NAME,
QUERY_TYPE_IMAGE,
QUERY_TYPE_TEXT,
SEARCH_OPERATOR_URI,
} from "./constants";
im... |
ec51eeeaa59b23067a4ea13fa8b9e7eb8a18dd9c6c6af91545418437eb937eaa | TypeScript | 7,035 | 185 | import {
refKey,
useAnnotationEngine,
useInteraction,
type LabelRef,
} from "@fiftyone/annotation";
import { useLighter } from "@fiftyone/lighter";
import type { AnnotationLabel, AnnotationLabelData } from "@fiftyone/state";
import { atom, getDefaultStore, type PrimitiveAtom, useAtomValue } from "jotai";
import... |
4c4959708737093d20068af97e544f6d4e894d20b2d6bde8acc85e5de2168055 | TypeScript | 7,036 | 188 | // ---------------------------------------------------------------------------
// Min/max peak pyramid for waveform rendering. Raw PCM samples are far
// denser than any display can show, so the GPU renderer never touches
// them directly — it samples a mipmap-style pyramid of min/max pairs
// instead, computed once at... |
40333622d72f1419fe1760cde53981510975dc4c9dbdb71facf932dda31b556a | TypeScript | 7,043 | 239 | import { Quaternion, Vector3 } from "three";
import type {
PointCloudCameraPose,
PointCloudFrameTransform,
} from "../../../../visualization/scene-3d/index";
import {
DEFAULT_SCENE_3D_UP_AXIS,
type Scene3dUpAxis,
type Scene3dFollowTrackingMode,
type Scene3dTrackingMode,
} from "../../spatial/view-preference... |
3c31311e83a7215d47d8e76852b793fd3956f823761d5e1f7beae4284dcecb4e | TypeScript | 7,057 | 204 | import { serializeCacheKey } from "../cache-utils";
import { byteSourceCacheKey } from "./cache";
import type {
ByteFillLockManager,
ByteRangeReadRequest,
ByteSourceDescriptor,
} from "./types";
/**
* Cross-context single-flight for network block fills.
*
* Every worker lane owns a private in-memory cache and... |
5c6fae23e0f346f4345954626e473f6477746ad4467b6b3e06b94c656a9a71f2 | TypeScript | 7,059 | 240 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { SCALE_FACTOR } from "../../constants";
import { BaseState, Coordinates } from "../../state";
import { clampScale, getDPR } from "../../util";
import { BaseElement, Events } from "../base";
import { dispatchTooltipEvent } from "./util";
import { invisible, lookerC... |
e0050b78bd44272eb26753b6fa83054d7cbf7c1418a239819182725b7a58f9c4 | TypeScript | 7,088 | 269 | /**
* Copyright 2017-2026, Voxel51, Inc.
*
* Off-main-thread `mask_path` decode. URL resolution stays on the main thread
* (so we can reuse `getSampleSrc` without porting state plumbing into the
* worker), and a small pool of workers handles fetch + decode.
*/
import type { OverlayMask } from "@fiftyone/looker/s... |
890be19f1b72cb022e4790905e913ce6e39ed05f88795b61f1a0a4fa84a318c9 | TypeScript | 7,101 | 213 | import type { MosaicNode } from "react-mosaic-component";
import {
sanitizeModalLayout,
type PersistedCameraPreferences,
type PersistedModalLayout,
} from "./layout-persistence";
import {
normalizeSidebarPreferences,
type SidebarPreferences,
} from "../settings/sidebar-preferences";
/** Payload limit for por... |
5f769aed429c3b720c93064f049157c2c980bdcceab474ab4dd962bce4dfd926 | TypeScript | 7,113 | 205 | /**
* Live registry of grid tiles that are currently visible — populated
* by `useRenderer.showItem` and consumed by `TileDecoratorPortals`,
* which renders one React portal per entry into the tile's reserved
* overlay div.
*
* Decoupling tile DOM management (in `useRenderer`) from React
* rendering (in `TileDec... |
376df8b1222a3b267129efa318d151a5297a24d09c12a825e357be5edb99dffa | TypeScript | 7,123 | 231 | import {
getSubset,
selectionDomainId,
useGridSelectionDataset,
useSelectionBoundary,
viewConversion,
type SelectionBoundary,
} from "@fiftyone/state/src/selection";
import { useEffect, useRef } from "react";
import {
useUrlSearch,
writeUrlSearch,
} from "../../../url/useUrlSearchSubscription";
import {... |
b479cfcde29f025f008fce2c7ab5bd464917c0aca5b45473275a3ef30b55e094 | TypeScript | 7,138 | 253 | import { useEffect, useState } from "react";
import { useOperatorExecutor } from "@fiftyone/operators";
import { resolveParent, joinPaths } from "@fiftyone/utilities";
import {
getNameFromPath,
computeFileObject,
limitFiles,
getFileSystemsFromList,
} from "./utils";
const LIST_FILES = "list_files";
const DEFAU... |
ee2b69ce125c7ea1677fc34bf0bbdbcd3a56c70f6d273790485cf645e61a5403 | TypeScript | 7,147 | 258 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { describe, expect, it, vi } from "vitest";
import { CONTAINS } from "./base";
import DetectionOverlay, {
DetectionLabel,
getDetectionPoints,
} from "./detection";
describe("a 3D detection has no 2D box to hit-test", () => {
const overlay = new DetectionOver... |
27d3c8e3b2b656dbee8211ea0f0a4100fa4bcb57029e5d26768b9d48609ce14b | TypeScript | 7,157 | 262 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import {
KEYPOINT_OUTLINE_WIDTH,
KEYPOINT_RADIUS,
KEYPOINT_SELECTED_OUTLINE_WIDTH,
KEYPOINT_SELECTED_RADIUS,
PREVIEW_LINE_OPACITY,
STROKE_WIDTH,
} from "../constants";
import type { Renderer2D } from "../renderer/Renderer2D";
import type { CoordinateSystem, Dra... |
925d3ab8d84d0e16914e6fecf20e515410c6454fccbc01f4524ea117bd3980ca | TypeScript | 7,158 | 227 | import { act, renderHook } from "@testing-library/react";
import { afterEach, describe, expect, it, vi } from "vitest";
// `hooks.ts` pulls in a heavy dependency chain (`@fiftyone/annotation`,
// `@fiftyone/state`, `@fiftyone/looker`, `@react-three/drei`) that isn't
// safely importable in isolation under vitest (a ci... |
e6888e36fc1768ed1d44f967f4f66a24c8aebe18190b74026287b53f76f762f4 | TypeScript | 7,167 | 228 | import * as THREE from "three";
import { describe, expect, it } from "vitest";
import {
computeCuboidFaceResizeDelta,
getCuboidResizeDimensionMagnitudes,
getCuboidFaceResizeDragPlaneNormal,
getCuboidResizeFaceFromNormal,
getCuboidResizeFaceWorldNormal,
getCuboidResizeQuaternion,
isValidCuboidResizeDimensi... |
8f58de0ac914ca1c2685cfaa90ce96a783b56c659e88e002050beab74a74f608 | TypeScript | 7,168 | 250 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { EventDispatcher, getEventBus } from "@fiftyone/events";
import type { LighterEventGroup } from "../events";
import type { Selectable } from "./Selectable";
/**
* Options for selection operations.
*/
export interface SelectionOptions {
/**
* An optional poi... |
2d4ac215052ec69bdf0c68244fbece7375053b821c58b5bb45c1966e57d66472 | TypeScript | 7,204 | 211 | import { useEffect, useMemo, useState } from "react";
import {
useGridPosterProvider,
type GridPosterProvider,
type GridPosterProviderDescriptor,
} from "../../../extensions/grid-posters";
import type { PointCloudCameraPose } from "../../../visualization/scene-3d";
import {
getGridPosterCache,
recordGridPost... |
7a2b56bd15cd7c01e63dfb8ae1d7533194c5888f86417dd5a56e3e9ed7f521b8 | TypeScript | 7,210 | 247 | import type { ImageGeometry } from "./math";
const DB_NAME = "fiftyone-embeddings";
const STORE_NAME = "embeddings";
const META_STORE = "metadata";
export const MAX_CACHE_ENTRIES = 5;
interface StoredTensor {
data: Float32Array;
dims: number[];
}
export interface CachedEmbedding {
imageEmbed: StoredTensor;
h... |
f4c6dc377939ac2bb40f92b112122d400453a86160b61623632f3a60f8e698c5 | TypeScript | 7,232 | 263 | import * as THREE from "three";
import { describe, expect, it, vi } from "vitest";
import type {
SceneCubePrimitive,
SceneEntityVisualization,
SceneUpdateVisualization,
} from "../../../ir";
import { VISUALIZATION_KIND } from "../../../visualization";
import { prepareImageAnnotations } from "../../../visualizati... |
288335558c9dc99e382299423926001e74f8d5daaefc737066927dbd741c5900 | TypeScript | 7,233 | 215 | import { describe, expect, it } from "vitest";
import {
DEFAULT_SIDEBAR_PREFERENCES,
type SidebarPreferences,
} from "../settings/sidebar-preferences";
import {
parsePortableLayout,
portableLayoutChangeKey,
serializePortableLayout,
} from "./portable-layout";
const capture = () =>
serializePortableLayout(
... |
8597d12ef92f8a190dba981e8d66278291f1b3549c0ebf5c24c0595b566cd249 | TypeScript | 7,236 | 237 | import type { McapTypes } from "@mcap/core";
import { compareBigInt } from "../../../ir";
import { DEFAULT_MAX_PREDECESSOR_CHUNK_PROBES } from "./latest-before";
import {
channelIdsForTopics,
readChunkIndexedTimeBounds,
} from "./message-index";
import type {
McapIndexedReaderLike,
McapReadTopicIndexedTimeBound... |
9b394b385b248f9ab9c7f035f77ce84ae56cb2253973c5a6d82f954723e46a1d | TypeScript | 7,260 | 335 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type {
DrawStyle,
Point,
Rect,
TextOptions,
ViewportState,
} from "../types";
import type { ImageOptions, ImageSource, Renderer2D } from "./Renderer2D";
/**
* Mock implementation of Renderer2D for lightweight testing and development.
* This mock provide... |
0e03d05e928a9a04550fdc1ec0e12f68ac5281058eb264dbfcc5e8596c267a3a | TypeScript | 7,263 | 271 | import { describe, expect, it } from "vitest";
import type {
SceneCubePrimitive,
SceneEntityVisualization,
SceneUpdateVisualization,
} from "../../../../ir/index";
import {
hasInterpolatableSceneEntityPair,
interpolateSceneEntity,
interpolateSceneUpdate,
} from "./interpolate-scene-entities";
const IDENTI... |
b787de8b968cacae00df3aad63b40ad6437a36dcce9b8021735041b21dcba1a3 | TypeScript | 7,263 | 286 | /**
* Engine-owned ephemeral interaction state: the active
* (selection) set with its engine-owned anchor, and the hover set. NOT a
* LabelStore — never persisted, never dirty, never patched. Singleton per
* session; keyed on full identity. GC'd against the semantic change
* stream (engine bookkeeping); presence `... |
fabc5e972c408ac171f4e5bec35e7c6a36af38257eaabce8a37e899dff63155e | TypeScript | 7,272 | 286 | import type { ModalSample } from "@fiftyone/state";
import {
GAUSSIAN_SPLAT_EXTENSIONS,
getSamplePathExtension,
isWrappableDirect3dSamplePath,
} from "@fiftyone/utilities";
import type { FiftyoneSceneRawJson, FoSceneRawNode } from "../utils";
import type { DirectPcdWorldTransforms } from "./direct-pcd-world-align... |
058168e45be809d5d12f82d250a3d9fec140e694e21486466589a95679c50a5a | TypeScript | 7,288 | 255 | import { getFetchFunctionExtended } from "@fiftyone/utilities";
const PLY_HEADER_RANGE_BYTES = 64 * 1024;
const MAX_PLY_HEADER_BYTES = 1024 * 1024;
const MAX_CACHED_PLY_CLASSIFICATIONS = 256;
const PLY_HEADER_DECODER = new TextDecoder("utf-8");
const PLY_SPLAT_DETECTION_CACHE = new Map<string, Promise<boolean>>();
con... |
36795d694b96488993d799ab98f57cae8c599377269c6daa388e03fd4c3f112b | TypeScript | 7,321 | 261 | import { describe, expect, it, vi } from "vitest";
import { VideoLooker } from "../lookers/video";
import { presentsSeekTarget } from "./util";
import { VideoElement } from "./video";
import type { VideoState } from "../state";
const FPS = 5;
vi.mock("./util", async (importOriginal) => {
const actual = await import... |
487f44847df156dfc5883f3713159d3b80ee8a65da37c13b1a99b65afc740dc7 | TypeScript | 7,333 | 256 | import { type PackedSplats, type SplatMesh } from "@sparkjsdev/spark";
import { Color, Quaternion, Vector3 } from "three";
import { describe, expect, it, vi } from "vitest";
import {
applySplatMeshAppearance,
computeSplatBounds,
computeSplatBoundsIncrementally,
getSplatBounds,
getSplatFileTypeHint,
requires... |
8b5e21403924e8dc1bb7ef1c588bd4bcfa0af2ad11d958777e4396f7f7e04122 | TypeScript | 7,347 | 230 | import { describe, expect, it, vi } from "vitest";
import { createInlineMcapResourceClient } from "./inline-client";
import { MCAP_ACTIVE_TIMELINE } from "../contracts/index";
import { isEpisodeReadCancelledError } from "../../../ports";
import {
collect,
createChannel,
createMcapSourceDescriptor,
createMessage... |
6338118a6041f9930824a36b2ee08f0084337ee4a00b5ff89d61e4cb72eb5685 | TypeScript | 7,349 | 249 | import { getFetchParameters, mergeHeaders } from "@fiftyone/utilities";
import type {
AnnotationProvider,
BitmapEncodeRequest,
BitmapInferenceRequest,
DownloadProgressCallback,
ErrorCallback,
InferenceRequest,
InferenceResult,
ProviderError,
StatusCallback,
WarningCallback,
WorkerMessageType,
Wo... |
b199e82d7d96855ecde5ccf6e414ee0a577945e4faac5f91e43d185866da1e48 | TypeScript | 7,412 | 185 | import type { AnnotationEngine, LabelRef } from "@fiftyone/annotation";
import type { AnnotationLabel } from "@fiftyone/state";
import {
CLASSIFICATION,
DETECTION,
KEYPOINT,
POLYLINE,
} from "@fiftyone/utilities";
import type { BaseOverlay, OverlayFactory, Scene2D } from "@fiftyone/lighter";
import type { Keypo... |
ad863ce9c485d7075999b933a7c70131427af6ba519f01b9d767bda097a70211 | TypeScript | 7,435 | 326 | import { isValidColor } from "@fiftyone/looker/src/overlays/util";
import {
ColorSchemeInput,
ColorscaleListInput,
MaskColorInput,
} from "@fiftyone/relay";
import colorString from "color-string";
import { isEmpty, xor } from "lodash";
export enum ACTIVE_FIELD {
JSON = "JSON editor",
GLOBAL = "Global setting... |
f854af545385b36a125d5e2bb91a0c45fe543ba6146bfae5237bc7d736a445b5 | TypeScript | 7,441 | 210 | import {
isGeneratedView,
nullableModalSampleId,
useCurrentDatasetId,
useModalSample,
useRefreshSample,
useStableInteraction3dSample,
} from "@fiftyone/state";
import { useCallback } from "react";
import { useRecoilValue } from "recoil";
import { enqueuePersist } from "./persistQueue";
import { useAnnotatio... |
c77c6f7c6aaaa1c297cbcd965fa75b465390f7d5f5cc0e47f3c74dc1109f4fc6 | TypeScript | 7,457 | 266 | /**
* Canvas-rendered position "pucks" for the map tile. MapLibre circle
* layers cannot render gradients, so the dimensional look — dome shading,
* specular highlight, white rim, baked drop shadow — is pre-drawn once per
* track color and registered as a symbol icon, the technique behind
* Google/Uber-style navig... |
f826463449357871135825fae28b89f655825d8a32fa1d39964798bf323e0197 | TypeScript | 7,466 | 253 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import * as PIXI from "pixi.js";
import { Assets } from "pixi.js";
import type { LoadOptions, ResourceLoader } from "./ResourceLoader";
// todo: make this more robust and idiomatic
PIXI.loadTextures.test = (_url, resolvedAsset) => {
resolvedAsset!.loadParser = "loadText... |
844ed71cdb1bee4f85959285ba34740c12bbe61733e2c665e287ca94cdecbd61 | TypeScript | 7,508 | 273 | import {
Box3,
BufferGeometry,
Float32BufferAttribute,
type Intersection,
Group,
Mesh,
OrthographicCamera,
PerspectiveCamera,
Points,
Vector3,
} from "three";
import { describe, expect, it } from "vitest";
import type { ReconciledDetection3D } from "../annotation/types";
import {
createPointCloudC... |
88af83e1ebc04c0f27d2b9706c58676a598e8e9a2802096c8c278133e84316aa | TypeScript | 7,508 | 289 | import { useCallback, useEffect, useRef } from "react";
import { atom, useRecoilValue, useSetRecoilState } from "recoil";
import type {
LabelId,
TransientCuboidState,
TransientPolylineState,
TransientStore,
} from "./types";
/**
* Fallback delay in milliseconds.
* After a window pointer-up, if a drag is stil... |
81a3d6c720f693e2eb58d2864d8ff2915c8f939c54fd1ea8f3eef15cf8d2a8cf | TypeScript | 7,546 | 266 | import { describe, expect, it } from "vitest";
import { VISUALIZATION_KIND } from "../../../ir/index";
import {
rosDetection2DArrayDecoders,
rosDetection3DArrayDecoders,
rosMarkerArrayDecoders,
} from "./ros/index";
import {
ROS2_DETECTION_2D_ARRAY_SCHEMA,
ROS2_DETECTION_3D_ARRAY_SCHEMA,
ROS2_MARKER_ARRAY_S... |
3f86bfe80621424fa087a8adaaec3cffefc28d2de53a8e52d78672ca0b817b25 | TypeScript | 7,567 | 221 | import type { CameraCalibrationVisualization } from "../../../ir";
import type {
CameraModelResolution,
ImageDimensionCompatibility,
ImageDimensions,
ImageDisplayMode,
ImageGeometryMode,
} from "../spatial/camera-geometry/camera-model";
import type { RectifiedImageDisplay } from "../spatial/camera-geometry/im... |
02b1219bd86a063ed9f1d05eebec8608b3e11a035d551ee2ee27d0d26c74a329 | TypeScript | 7,584 | 269 | import type { UiSchema } from "@rjsf/utils";
import { SmartFormComponents } from "../../types";
import { addWarning, type TranslationContext } from "./utils";
/**
* Translates SchemaIO view to UI Schema
*
* Note: Uses `any` for schemaIO parameter due to recursive processing of
* dynamic schema structures with vary... |
4486de42605da7aa7392ece7ca42d5d779273485792a75d6d60b180bbbda8d59 | TypeScript | 7,590 | 233 | import { afterEach, describe, expect, it, vi } from "vitest";
import {
getGridPosterCache,
resetGridPosterCacheForTests,
} from "./grid-poster-cache";
import { createGridPosterEncoder } from "./grid-poster-codec";
import {
resetGridPosterPersistenceForTests,
type GridPosterPersistence,
} from "./grid-poster-pe... |
8794596ed03e39347a934846cfe8bd894d2f48dcd629d5aa43565d0ea8518ec3 | TypeScript | 7,598 | 206 | // @vitest-environment jsdom
import { renderHook, waitFor } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import type { ColorColumnSource } from "./extensions";
import {
fetchColor,
fetchColorByChoices,
type ColorResponse,
type VisualizationRun,
} from "./protocol";
import { ... |
0bb1b49eab46c9501737bd47aafa8f85b3db329d6b39048f7b8b32e69bcd764f | TypeScript | 7,615 | 294 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import type {
BaseState,
FrameState,
ImaVidState,
ImageState,
StateUpdate,
ThreeDState,
VideoState,
} from "../state";
import type { BaseElement } from "./base";
import * as common from "./common";
import * as frame from "./frame";
import * as image from "./im... |
fa76840889628e81d97563e98c96e7a94c03333be6fd9df430d94c08968d4e9a | TypeScript | 7,648 | 200 | /**
* Copyright 2017-2026, Voxel51, Inc.
*
* Tests for polyline mode's activate / deactivate contract. The behaviour that
* matters here is that leaving the mode also closes any open polyline edit —
* right-click off a track's extent reaches the mode quit and nothing else, so a
* deactivate that only flips the fl... |
d5281b02233e7d2b64eff3bd16fb6613a765836eefab760c54d161e7106e6984 | TypeScript | 7,652 | 229 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { expect, test, describe } from "vitest";
import {
clipPolygonToRect,
distance,
dot2d,
project2d,
distanceFromLineSegment,
} from "./geometry";
import type { Point } from "../types";
describe("geometry", () => {
describe("distance", () => {
test("sh... |
78b7ec6b1acb3f1c4375e62602bf30f1c7c14908fac47ac22153abea25cba174 | TypeScript | 7,688 | 237 | import type { LabelRef } from "@fiftyone/annotation";
import type { LabelData, LabelType } from "@fiftyone/utilities";
import { describe, expect, it } from "vitest";
import {
buildForwardFill,
buildTrackFanOut,
splitTrackEdit,
} from "./trackFanOut";
const DETECTIONS = "Detections" as LabelType;
/** A stub eng... |
06c95d784cf743b191868be9ea4e41f44139c5673c18796726464ee3d07b5e84 | TypeScript | 7,691 | 244 | import type {
ByteSourceDescriptor,
EpisodeManifest,
EpisodeTimeline,
TimeWindow,
} from "../ir";
/** Current source-facts storage schema. Incompatible changes invalidate V1. */
export const SOURCE_FACTS_SCHEMA_VERSION = 1 as const;
/** OSS origin-local namespace. Authenticated compositions must supply anothe... |
ffebffef53b88d206a2e83473abad15a0799fa9bf072a563d9acb3b0c31c074c | TypeScript | 7,693 | 219 | import { describe, expect, it } from "vitest";
import { createIncrementalPeaks } from "./incremental-peaks";
import { buildChannelPeakPyramids } from "./peak-pyramid";
const SAMPLE_RATE = 8000;
/** Deterministic waveform; no Math.random so failures reproduce. */
function signal(frames: number, channels: number): Floa... |
450d72a53b2e22dbafec08507ed151932293fea913655d9dee7654d5ce206c18 | TypeScript | 7,705 | 258 | import type { DecodeContext, Decoder } from "../../../../decoders/index";
import type {
DecodedAttributeValue,
DecodedOutput,
} from "../../../../ir/index";
import { resourceHintsForArrayBufferViews } from "../../../../decoders/index";
import { VISUALIZATION_KIND } from "../../../../ir/index";
import { buildPointCl... |
41227843b4a61036e05bb055717c16de0e912fafb83eaf672b2089613ca81dd7 | TypeScript | 7,717 | 253 | import { McapWriter, type McapTypes } from "@mcap/core";
import { Root } from "protobufjs";
import descriptor from "protobufjs/ext/descriptor";
import { describe, expect, it } from "vitest";
import { rawNodeToJson } from "../../../ir/index";
import type { ByteClient } from "../../../query/bytes/index";
import { createD... |
35868c11182c72002f7f5024ac842bc14548cd7d884f6f71376875a1a14d1e7a | TypeScript | 7,724 | 213 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
// ── Mocks ────────────────────────────────────────────────────────────────────
//
// Provide real classes for DetectionOverlay (so `instanceof` matches) a... |
bb126aacf229fbff8e6ae8aed54324ebfa70bca9f2a1bb8ed8a7f1be70d3d8d0 | TypeScript | 7,740 | 229 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { CommandContextManager } from "@fiftyone/commands";
import type { Undoable } from "@fiftyone/commands";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { AddMaskKeypointCommand } from "../commands/AddMaskKeypointCommand";
import type { Detecti... |
f32296dacf69302bcb392978e925f48c91ccdf8c772c0d0847fa1a50eeff3030 | TypeScript | 7,765 | 295 | import { describe, expect, it } from "vitest";
import type { ReconciledDetection3D, ReconciledPolyline3D } from "../types";
import {
PRECISION,
round,
roundDetection,
roundPolyline,
roundTuple,
} from "./rounding-utils";
// =============================================================================
// TEST... |
7050033bad1e0fb888deb30eb65c97a5e9c0048d9e70d963da96c66f536b0d79 | TypeScript | 7,785 | 288 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { Selectable } from "../selection/Selectable";
import { BaseOverlay } from "./BaseOverlay";
import type { Renderer2D } from "../renderer/Renderer2D";
import type { Point, RawLookerLabel, Rect, RenderMeta } from "../types";
import {
LABEL_ARCHETYPE_PRIORITY,
TA... |
e7548317c72fb539d510bdaacced03de4edda0a0b1fbda2b8f4dba49112b685f | TypeScript | 7,818 | 270 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { Sample } from "@fiftyone/looker";
import {
FetchFunctionConfig,
FetchFunctionResult,
getFetchFunctionExtended,
MalformedRequestError,
NotFoundError,
} from "@fiftyone/utilities";
import * as jsonpatch from "fast-json-patch";
import { patchPathFieldContex... |
4f2629245175d2f00829f6817556f530f6da98da8423ac6082dee3e2f0bf9169 | TypeScript | 7,871 | 314 | import type { Schema } from "@fiftyone/utilities";
import {
CLASSIFICATIONS,
DETECTIONS,
DYNAMIC_EMBEDDED_DOCUMENT_PATH,
EMBEDDED_DOCUMENT_FIELD,
LABELS_PATH,
LIST_FIELD,
STRING_FIELD,
TEMPORAL_DETECTIONS,
withPath,
} from "@fiftyone/utilities";
import { describe, expect, it } from "vitest";
import { ... |
0dfc549ccf805c74f107452d7b720206dc9284d6a960698f52bc72729ff2d579 | TypeScript | 7,874 | 231 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { setImmediate } from "node:timers/promises";
import { Resource } from "@fiftyone/utilities";
import type { Session } from "@fiftyone/state";
import type { ConcreteRequest, Environment } from "relay-runtime";
import { afterEach, beforeEach, describe, expect, it, vi ... |
5a05c62d7b1b762f0f1c48a9367ae8323905e92db84424642f37854eea1a10ed | TypeScript | 7,913 | 249 | /**
* Copyright 2017-2026, Voxel51, Inc.
*/
import { cloneDeep } from "lodash";
import { isObject, NONFINITE_FIELDS } from "@fiftyone/utilities";
/**
* DataTransformer implementations offer conversion from one record type to another.
*/
export type DataTransformer = {
transform: (data: Record<string, unknown>) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.