fabric-layers-core
Version:
A fabric.js coordinate-plane (grid) & layers library
105 lines (77 loc) ⢠2.24 kB
Markdown
# Fabric Layers Core
An interactive coordinate-plane, grid, and layer management library for [fabric.js](https://fabricjs.com/) canvases.
`fabric-layers-core` is based on the excellent original work of [IndoorJS](https://github.com/mudin/indoorjs) by
## Publishing
To publish a new version, run:
```bash
yarn test
```
```bash
yarn build
```
if no errors, run:
```bash
yarn release
```
```bash
git push --follow-tags origin main && npm publish
```
You will be prompted to enter a One-Time-Password (OTP) from your GitHub account.
## š Running the Grid Demo
To explore the grid functionality, follow these steps:
1. **Install Dependencies**
```bash
yarn install
```
2. **Build the Library**
```bash
yarn build
```
3. **Open the Demo**
- Open `grid-demo.html` directly in your browser
- The demo includes:
- Interactive grid with zoom/pan functionality
- Coordinate display
- Zoom level controls
- Reset view button
4. **Development Workflow**
- cd ../fabric-layers-core && npm run build:watch
- Make changes to the source code
- Refresh the browser to see changes
---
## ⨠Classes
```
Base (EventEmitter2)
āāā Map (+ ModesMixin)
ā āāā Grid
ā āāā Point
ā āāā Measurement
āāā Layer
ā āāā Vector Layers (Line, Circle, Rect, Polyline)
ā āāā Marker System
ā ā āāā Marker
ā ā āāā MarkerGroup
ā ā āāā Icon
ā āāā Group
ā āāā Connector
ā āāā Tooltip
āāā Paint System
ā āāā Canvas
ā āāā Arrow
ā āāā ArrowHead
ā āāā PaintManager
āāā Measurement System
āāā Measurement
āāā Measurer
```
## š¤ Contributing
PRs and issues are welcome!
1. Fork & `git clone`
2. `yarn install`
3. `yarn dev` ā watch/build
4. Add tests in `test/` and run `yarn test`
Please follow the [Conventional Commits](https://www.conventionalcommits.org/) spec; CI will lint commit messages.
---
## š Licenses
MIT Ā© 2025 [Allen Joslin](https://github.com/ajoslin103) (current author of fabric-layers-core)
MIT Ā© 2022 [Mudin](https://github.com/mudin) (original author of IndoorJS)