# geometry-interfaces

> The W3C Geometry Interfaces implemented in JavaScript and polyfilled.

Latest version **2.0.0** (published 2024-12-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install geometry-interfaces
pnpm add geometry-interfaces
yarn add geometry-interfaces
bun add geometry-interfaces
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2024-12-28 |
| First published | 2016-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 115.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Maintainers | trusktr |
| Keywords | DOMMatrix, DOMMatrixReadOnly, DOMPoint, DOMPointReadOnly, DOMRect, DOMRectReadOnly, GeometryUtils, geometry, Geometry Interfaces, 3D, affine transforms, transformation matrices |

## Links

- npm: https://www.npmjs.com/package/geometry-interfaces
- Repository: https://github.com/trusktr/geometry-interfaces
- Issues: https://github.com/trusktr/geometry-interfaces/issues
- npm.io page: https://npm.io/package/geometry-interfaces

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2024-12-28
- 1.1.4 — 2017-08-29
- 1.1.3 — 2017-08-29
- 1.1.2 — 2017-06-15
- 1.1.1 — 2017-05-13
- 1.1.0 — 2017-05-13
- 1.0.7 — 2017-05-13
- 1.0.6 — 2017-05-13
- 1.0.5 — 2017-04-23
- 1.0.4 — 2016-02-05
- 1.0.3 — 2016-01-21
- 1.0.2 — 2016-01-09
- 1.0.1 — 2016-01-03
- 1.0.0 — 2016-01-03
- 0.0.4 — 2016-01-02

## README

# Geometry Interfaces

Let's do some dommetry!

The W3C [Geometry](http://www.w3.org/TR/cssom-view/#geometry)
[Interfaces](http://www.w3.org/TR/geometry-1/) implemented in JavaScript and
polyfilled.

<h4><code><strong>npm install geometry-interfaces</strong></code></h4>

## In the box so far

- [DOMMatrixReadOnly](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly) \*
- [DOMMatrix](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix) \*
- [DOMPointReadOnly](https://developer.mozilla.org/en-US/docs/Web/API/DOMPointReadOnly) \*
- [DOMPoint](https://developer.mozilla.org/en-US/docs/Web/API/DOMPoint) \*
- [DOMQuad](https://developer.mozilla.org/en-US/docs/Web/API/DOMQuad) \*
- [DOMRectReadOnly](https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly)
- [DOMRect](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect)

\* Some methods are not implemented yet.

## Usage

Just import the library after installing it [from
NPM](https://www.npmjs.com/package/geometry-interfaces) and it will polyfill the
global APIs:

```js
import 'geometry-interfaces' // ES Modules
```

If you're not using a build tool, just plain JS in a browser, you can set up an
[importmap](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#importing_modules_using_import_maps):

```html
<script type="importmap">
	{
		"imports": {
			"geometry-interfaces": "/node_modules/geometry-interfaces/dist/index.js"
		}
	}
</script>

<script type="module">
	import 'geometry-interfaces'

	// ... use APIs ...
</script>
```

If you don't want to polyfill the APIs globally, you can import what you need
directly:

```js
import {DOMMatrix} from 'geometry-interfaces/dist/DOMMatrix.js'
import {DOMPoint} from 'geometry-interfaces/dist/DOMPoint.js'
```

## TypeScript

Make sure you have `lib: ["dom"]` in `tsconfig` or DOM types will be missing and
there may be type errors.

## Contributing

To develop the project, run `npm clean-install` after cloning the repo, then
`npm run dev` will build the TS to JS in watch mode, and `npm run build` will
build it without watch mode.

Any help would be greatly appreciated, as this is a purely free time unpaid
project. If you'd like to contribute, a pull request to add missing features,
APIs, tests, or performance improvements would be awesome. :]

## Miscellaneous

The word "dommetry" is a play on the words "geometry" and "DOMMatrix" put
together. :D

---
_Source: https://npm.io/package/geometry-interfaces · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
