From 22e8aa044286c5ae04278191080ad09f381d972f Mon Sep 17 00:00:00 2001 From: noah Date: Wed, 4 Dec 2024 12:45:28 -0800 Subject: [PATCH] fmt --- packages/dzi/package.json | 2 +- packages/dzi/src/renderer.ts | 6 ++--- packages/omezarr/package.json | 2 +- packages/omezarr/src/sliceview/loader.test.ts | 24 +++++++++---------- packages/omezarr/src/sliceview/loader.ts | 4 ++-- .../omezarr/src/sliceview/tile-renderer.ts | 2 +- packages/omezarr/src/zarr-data.ts | 14 +++++------ packages/scatterbrain/package.json | 2 +- packages/scatterbrain/src/abstract/types.ts | 8 +++---- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/dzi/package.json b/packages/dzi/package.json index 44c4785..e7281dd 100644 --- a/packages/dzi/package.json +++ b/packages/dzi/package.json @@ -55,4 +55,4 @@ "lodash": "^4.17.21", "regl": "^2.1.0" } -} \ No newline at end of file +} diff --git a/packages/dzi/src/renderer.ts b/packages/dzi/src/renderer.ts index 88c7d2d..5e0d393 100644 --- a/packages/dzi/src/renderer.ts +++ b/packages/dzi/src/renderer.ts @@ -26,7 +26,7 @@ type GpuProps = { pixels: CachedTexture; }; /** - * + * * @param regl a valid REGL context (https://github.com/regl-project/regl) * @returns an object which can fetch tiles from a DeepZoomImage, determine the visibility of those tiles given a simple camera, and render said tiles * using regl (which uses webGL) @@ -57,7 +57,7 @@ export function buildDziRenderer(regl: REGL.Regl): Renderer { }, // no private resources to destroy + destroy: () => {}, // no private resources to destroy cacheKey: (item, _requestKey, _data, _settings) => `${item.url}`, fetchItemContent: fetchDziTile, getVisibleItems: (dzi, settings) => { @@ -81,7 +81,7 @@ export function buildDziRenderer(regl: REGL.Regl): Renderer { }); describe('sizeInUnits', () => { it('respects scale transformations', () => { - const pyramid = exampleOmeZarr.multiscales[0] - const { axes, datasets } = pyramid + const pyramid = exampleOmeZarr.multiscales[0]; + const { axes, datasets } = pyramid; - const layer9xy = sizeInUnits('xy', axes, datasets[9]) - const layer0xy = sizeInUnits('xy', axes, datasets[0]) + const layer9xy = sizeInUnits('xy', axes, datasets[9]); + const layer0xy = sizeInUnits('xy', axes, datasets[0]); - const layer9yz = sizeInUnits('yz', axes, datasets[9]) - const layer0yz = sizeInUnits('yz', axes, datasets[0]) + const layer9yz = sizeInUnits('yz', axes, datasets[9]); + const layer0yz = sizeInUnits('yz', axes, datasets[0]); // we're looking at the highest resolution and lowest resolution layers. // I think in an ideal world, we'd expect each layer to end up having an exactly equal size, // however I think that isnt happening here for floating-point reasons - so the small differences are acceptable. - expect(layer9xy).toEqual([13.9776, 10.3936]) - expect(layer0xy).toEqual([13.9993, 10.4993]) + expect(layer9xy).toEqual([13.9776, 10.3936]); + expect(layer0xy).toEqual([13.9993, 10.4993]); // note the Y coordinate (last above, first below) is as expected: - expect(layer9yz).toEqual([10.3936, 14.200000000000001]) - expect(layer0yz).toEqual([10.4993, 14.200000000000001]) - }) - }) + expect(layer9yz).toEqual([10.3936, 14.200000000000001]); + expect(layer0yz).toEqual([10.4993, 14.200000000000001]); + }); + }); }); diff --git a/packages/omezarr/src/sliceview/loader.ts b/packages/omezarr/src/sliceview/loader.ts index 34e6e71..1256d71 100644 --- a/packages/omezarr/src/sliceview/loader.ts +++ b/packages/omezarr/src/sliceview/loader.ts @@ -68,8 +68,8 @@ function getVisibleTilesInLayer( return visibleTiles; } /** - * get tiles of the omezarr image which are visible (intersect with @param camera.view). - * @param camera an object describing the current view: the region of the omezarr, and the resolution at which it + * get tiles of the omezarr image which are visible (intersect with @param camera.view). + * @param camera an object describing the current view: the region of the omezarr, and the resolution at which it * will be displayed. * @param plane the plane (eg. 'xy') from which to draw tiles * @param planeIndex the index of the plane along the orthogonal axis (if plane is xy, then the planes are slices along the Z axis) diff --git a/packages/omezarr/src/sliceview/tile-renderer.ts b/packages/omezarr/src/sliceview/tile-renderer.ts index d37e9c1..b12356d 100644 --- a/packages/omezarr/src/sliceview/tile-renderer.ts +++ b/packages/omezarr/src/sliceview/tile-renderer.ts @@ -17,7 +17,7 @@ type Props = { B: REGL.Texture2D; }; /** - * + * * @param regl an active REGL context * @returns a function (regl command) which renders 3 individual channels as the RGB * components of an image. Each channel is mapped to the output RGB space via the given Gamut. diff --git a/packages/omezarr/src/zarr-data.ts b/packages/omezarr/src/zarr-data.ts index da40906..a23680a 100644 --- a/packages/omezarr/src/zarr-data.ts +++ b/packages/omezarr/src/zarr-data.ts @@ -52,7 +52,7 @@ async function mapAsync(arr: ReadonlyArray, fn: (t: T, index: number) = return Promise.all(arr.map((v, i) => fn(v, i))); } /** - * + * * @param url a url which resolves to an omezarr dataset * @returns a structure describing the omezarr dataset. See * https://ngff.openmicroscopy.org/latest/#multiscale-md for the specification. @@ -114,7 +114,7 @@ export type ZarrRequest = Record; * an example relative view of [0,0],[1,1] would suggest we're trying to view the entire slice at the given resolution. * @param displayResolution * @returns an LOD (level-of-detail) layer from the given dataset, that is appropriate for viewing at the given - * displayResolution. + * displayResolution. */ export function pickBestScale( dataset: ZarrDataset, @@ -146,7 +146,7 @@ export function pickBestScale( const choice = datasets.reduce( (bestSoFar, cur) => dstToDesired(vxlPitch(planeSizeInVoxels(plane, axes, bestSoFar)!), pxPitch) > - dstToDesired(vxlPitch(planeSizeInVoxels(plane, axes, cur)!), pxPitch) + dstToDesired(vxlPitch(planeSizeInVoxels(plane, axes, cur)!), pxPitch) ? cur : bestSoFar, datasets[0] @@ -172,9 +172,9 @@ export function sizeInUnits( plane: | AxisAlignedPlane | { - u: OmeDimension; - v: OmeDimension; - }, + u: OmeDimension; + v: OmeDimension; + }, axes: readonly AxisDesc[], dataset: DatasetWithShape ): vec2 | undefined { @@ -211,7 +211,7 @@ export function sizeInVoxels(dim: OmeDimension, axes: readonly AxisDesc[], datas } /** * get the size of a plane of a volume (given a specific layer) in voxels - * see @function sizeInVoxels + * see @function sizeInVoxels * @param plane the plane to measure (eg. 'xy') * @param axes the axes metadata of an omezarr object * @param dataset a layer of the ome-zarr resolution pyramid diff --git a/packages/scatterbrain/package.json b/packages/scatterbrain/package.json index 11cee09..720ff4c 100644 --- a/packages/scatterbrain/package.json +++ b/packages/scatterbrain/package.json @@ -58,4 +58,4 @@ "lodash": "^4.17.21", "regl": "^2.1.0" } -} \ No newline at end of file +} diff --git a/packages/scatterbrain/src/abstract/types.ts b/packages/scatterbrain/src/abstract/types.ts index 0e5742d..6149e08 100644 --- a/packages/scatterbrain/src/abstract/types.ts +++ b/packages/scatterbrain/src/abstract/types.ts @@ -25,7 +25,7 @@ export type Renderer Record Promise>; /** - * + * * @param cacheData the results of fetching all the content for an Item * @returns true if the content matches the expectations of our rendering function */ @@ -65,7 +65,7 @@ export type Renderer string; @@ -73,7 +73,7 @@ export type Renderer void; };