Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Allen Institute Visualization TypeScript Libraries

This repository contains a collection of TypeScript libraries to help software engineers building scalable visualization tools at the Allen Institute. It houses the `vis-[package name]` packages on the Allen Institute GitHub organization's NPM package registry.
This repository contains a collection of TypeScript libraries to help software engineers building scalable visualization tools at the Allen Institute. It houses the `vis-[package name]` packages, which are published publicly to [npm](https://www.npmjs.com/org/alleninstitute) under the `@alleninstitute` scope.

**The published packages are in alpha or beta states. They may fundamentally change as we continue building out functionality.** They are used in a production environment so they are relatively stable, but the APIs are not yet finalized.

Expand All @@ -12,20 +12,21 @@ The following is the list of packages and their descriptions:
- `vis-geometry`: A collection of vector functions for 2D and 3D geometry
- `vis-omezarr`: A renderer for [OME-Zarr](https://ngff.openmicroscopy.org/latest/) datasets
- `vis-core`: A collection of useful utilities used to build our big-data, scalable, data visualization tools, including the DZI viewer, OME-Zarr viewer, and our scatterplot tool "Scatterbrain" for the [ABC Atlas](https://knowledge.brain-map.org/abcatlas) in the Brain Knowledge Platform web application
- `vis-scatterbrain`: A scatterplot viewer optimized for visualizing large datasets, such as those in the [ABC Atlas](https://knowledge.brain-map.org/abcatlas)

We use [Semantic Versioning](https://semver.org/) for our packages. As of November 2024, all of them are in the `0.0.x` range, indicating that they are in early development.
We use [Semantic Versioning](https://semver.org/) for our packages. All of them are still pre-`1.0`, indicating that they are in early development. While in `0.x`, a minor version bump (e.g. `0.1.x` to `0.2.0`) signals a breaking change.

## Level Of Support

We are planning on occasional updating this tool with no fixed schedule. Community involvement is encouraged through both issues and pull requests.

## Examples

A deployed version our our examples are located at [https://alleninstitute.github.io/vis](https://alleninstitute.github.io/vis).
A deployed version of our examples is located at [https://alleninstitute.github.io/vis](https://alleninstitute.github.io/vis).

See the `examples` directory for example projects using the packages. Over time, these examples will become more fully featured as the base tooling becomes more mature.
The examples live in `site/src/examples`, alongside the documentation site in `site`. Over time, these examples will become more fully featured as the base tooling becomes more mature.

For details on running or adding new examples, see the `docs/examples.md` file.
For details on running the documentation and example site, see the [development docs](https://alleninstitute.github.io/vis/developers/development/).

## Contributing

Expand All @@ -41,4 +42,4 @@ Volta has experimental support for pnpm, so [follow the steps on their docs](htt

## Using the Libraries

See the `docs/using-packages.md` file for information on how to use the packages in your own projects.
See the [using packages docs](https://alleninstitute.github.io/vis/getting-started/using-packages/) for information on how to use the packages in your own projects, including which peer dependencies to install.
4 changes: 4 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ filter_commits = false
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"

[bump]
# while pre-1.0, breaking changes bump the minor version instead of jumping to 1.0.0
breaking_always_bump_major = false
16 changes: 10 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,20 @@
"registry": "https://registry.npmjs.org",
"access": "public"
},
"devDependencies": {
"@types/lodash-es": "4.17.12",
"@webgpu/types": "0.1.74"
},
"dependencies": {
"@alleninstitute/vis-geometry": "workspace:*",
"lodash-es": "4.18.1",
"regl": "2.1.1",
"uuid": "14.0.2",
"webgpu-utils": "2.1.1",
"zod": "4.4.3"
},
"peerDependencies": {
"@alleninstitute/vis-geometry": "workspace:^",
"regl": "^2.1.0"
},
"devDependencies": {
"@alleninstitute/vis-geometry": "workspace:*",
"@types/lodash-es": "4.17.12",
"@webgpu/types": "0.1.74",
"regl": "2.1.1"
}
}
9 changes: 7 additions & 2 deletions packages/dzi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,14 @@
"registry": "https://registry.npmjs.org",
"access": "public"
},
"dependencies": {
"@alleninstitute/vis-geometry": "workspace:*",
"peerDependencies": {
"@alleninstitute/vis-core": "workspace:^",
"@alleninstitute/vis-geometry": "workspace:^",
"regl": "^2.1.0"
},
"devDependencies": {
"@alleninstitute/vis-core": "workspace:*",
"@alleninstitute/vis-geometry": "workspace:*",
"regl": "2.1.1"
}
}
13 changes: 10 additions & 3 deletions packages/omezarr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,17 @@
"access": "public"
},
"dependencies": {
"@alleninstitute/vis-core": "workspace:*",
"@alleninstitute/vis-geometry": "workspace:*",
"regl": "2.1.1",
"zarrita": "0.6.1",
"zod": "4.4.3"
},
"peerDependencies": {
"@alleninstitute/vis-core": "workspace:^",
"@alleninstitute/vis-geometry": "workspace:^",
"regl": "^2.1.0"
},
"devDependencies": {
"@alleninstitute/vis-core": "workspace:*",
"@alleninstitute/vis-geometry": "workspace:*",
"regl": "2.1.1"
}
}
19 changes: 12 additions & 7 deletions packages/scatterbrain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,24 @@
"type": "git",
"url": "https://github.com/AllenInstitute/vis.git"
},
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
},
"dependencies": {
"@alleninstitute/vis-core": "workspace:*",
"@alleninstitute/vis-geometry": "workspace:*",
"lodash-es": "4.18.1",
"regl": "2.1.0",
"ts-pattern": "5.9.0",
"zod": "4.4.3"
},
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
"peerDependencies": {
"@alleninstitute/vis-core": "workspace:^",
"@alleninstitute/vis-geometry": "workspace:^",
"regl": "^2.1.0"
},
"devDependencies": {
"@types/lodash-es": "4.17.12"
"@alleninstitute/vis-core": "workspace:*",
"@alleninstitute/vis-geometry": "workspace:*",
"@types/lodash-es": "4.17.12",
"regl": "2.1.1"
}
}
50 changes: 23 additions & 27 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ allowBuilds:
msgpackr-extract: false
sharp: false

saveExact: true

minimumReleaseAge: 10080
minimumReleaseAgeExclude:
- '@alleninstitute/*'
23 changes: 22 additions & 1 deletion site/src/content/docs/developers/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,31 @@ description: A reference page describing how dependencies are managed in the vis

## Locked Dependencies

All dependencies in this project are locked to specific versions using the `.npmrc` file at the root of the project.
All dependencies in this project are locked to specific versions using the `saveExact` setting in `pnpm-workspace.yaml` at the root of the project.

This is to ensure that the project is built and tested with the same versions of dependencies across different environments, and reduces the threat of security vulnerabilities from a more permissive versioning strategy.

## Peer Dependencies

Dependencies whose types or instances cross package boundaries are declared as `peerDependencies` so that consumers end up with a single shared copy. Today that's `@alleninstitute/vis-core`, `@alleninstitute/vis-geometry`, and `regl`. Dependencies that are only used internally (e.g. `zarrita`, `lodash-es`) stay in `dependencies`.

Each peer dependency is also listed in `devDependencies` so the workspace can build and test against it:

```json
"peerDependencies": {
"@alleninstitute/vis-core": "workspace:^",
"regl": "^2.1.0"
},
"devDependencies": {
"@alleninstitute/vis-core": "workspace:*",
"regl": "2.1.1"
}
```

On publish, `workspace:^` is replaced with a caret range of the current version (e.g. `^0.1.5`). Since we treat `0.x` minor releases as breaking, that range accepts patch releases only. If a package is verified to work with a newer minor release of a peer, replace `workspace:^` with an explicit range (e.g. `^0.1.5 || ^0.2.0`) when releasing it.

When adding a new dependency, make it a peer dependency if consumers will pass its objects into, or receive them from, a `vis` package.

## Dependabot

We run a monthly Dependabot to automatically open PRs to update our dependencies. These are controlled in the `.github/dependabot.yml` file. Because we have multiple packages within this monorepo, that file is somewhat verbose.
Expand Down
4 changes: 2 additions & 2 deletions site/src/content/docs/developers/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ sidebar:
order: 0
---

This document covers the tools, processes, and standards that we follow went developing within the `vis` repository.
This document covers the tools, processes, and standards that we follow when developing within the `vis` repository.

## Development Servers

To get started developing in the `vis` repsitory, you can use the following command to watch for changes in all packages and the documentation site:
To get started developing in the `vis` repository, you can use the following command to watch for changes in all packages and the documentation site:

```sh
pnpm run dev
Expand Down
42 changes: 0 additions & 42 deletions site/src/content/docs/getting-started/authenticating.md

This file was deleted.

12 changes: 10 additions & 2 deletions site/src/content/docs/getting-started/using-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ sidebar:
order: 2
---

The `vis` project contains multiple packages, each of which is published to the Allen Institute NPM organization package registry.
The `vis` project contains multiple packages, each of which is published publicly to [npm](https://www.npmjs.com/org/alleninstitute) under the `@alleninstitute` scope. No authentication is required to install them.

1. Run `npm install @alleninstitute/<package-name>` to install the package.
1. Run `npm install @alleninstitute/<package-name>` to install the package, along with any of its peer dependencies (see below).

## Peer Dependencies

The higher-level packages (`vis-core`, `vis-dzi`, `vis-omezarr`, and `vis-scatterbrain`) list `@alleninstitute/vis-core`, `@alleninstitute/vis-geometry`, and `regl` as **peer dependencies** rather than bundling their own copies. Your project installs them directly, and every `vis` package shares that single copy.

This matters because objects created by one copy of a package aren't always compatible with another copy, even when the versions are nearly identical. For example, a cache created with your project's `vis-core` must be the same `vis-core` that `vis-omezarr` uses, and a `regl` context you create must match the `regl` types the renderers expect.

Each package's page lists the exact install command. If your package manager reports a peer dependency conflict, upgrade the conflicting `vis` packages together so they agree on a compatible version range.
Loading
Loading