
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@ajoslin103/schematic
Advanced tools
A FabricJS library, facilitating working above coordinate planes
A lightweight Fabric.js library for working with canvas objects on an interactive coordinate grid.
Schematic or low-level Map APIYour App → Schematic → Map → Fabric Canvas
↓
Grid (renders behind objects)
Schematic – Main entry point with event system and interaction controls
Map – Manages Fabric canvas lifecycle and grid synchronization
Grid – Renders coordinate grid, axes, and labels beneath Fabric objects
Base – Shared configuration foundation for all components
npm install @ajoslin103/schematic fabric
# or
yarn add @ajoslin103/schematic fabric
Requirements:
^6.7.1 (peer dependency)Package exports:
dist/schematic.esm.jsdist/schematic.cjs.jsdist/schematic.umd.jsdist/types/index.d.tsimport { Schematic } from '@ajoslin103/schematic';
import * as fabric from 'fabric';
const container = document.getElementById('canvas-container');
const schematic = new Schematic(container, {
gridEnabled: true,
units: 'points',
zoomDebounceDelay: 200
});
// Access the Fabric canvas
const canvas = schematic.fabricCanvas;
// Configure zoom behavior
schematic.setZoomLimits(0.1, 10);
schematic.setZoom(1);
// Add Fabric objects
const rect = new fabric.Rect({
left: 100,
top: 100,
width: 200,
height: 150,
fill: '#4CAF50'
});
canvas.add(rect);
import { Schematic, SchematicOptions } from '@ajoslin103/schematic';
import { Rect } from 'fabric';
const container = document.getElementById('canvas-container');
if (!container) throw new Error('Container not found');
const options: SchematicOptions = {
gridEnabled: true,
units: 'imperial',
mouseWheelZoom: true,
zoomOnCenter: false
};
const schematic = new Schematic(container, options);
// Configure
schematic.setZoomLimits(0.1, 10);
schematic.setShowGrid(true);
schematic.setUnits('metric');
// Add objects with type safety
const rect = new Rect({
left: 50,
top: 50,
width: 100,
height: 100,
fill: 'rgba(255, 99, 71, 0.8)'
});
schematic.fabricCanvas.add(rect);
// Listen to zoom events
schematic.on('zoom:change', (data) => {
console.log('Zoom changed:', data.zoom);
});
schematic.on('zoom:completed', (data) => {
console.log('Zoom completed:', data.zoom);
});
// Listen to pan events
schematic.on('pan:completed', (data) => {
console.log('Pan completed:', data);
});
// Grid visibility changes
schematic.on('grid:change', (data) => {
console.log('Grid visibility:', data.enabled);
});
// Pin origin to corner (locks grid to viewport)
schematic.setOriginPin('TOP_LEFT', 15);
// Options: 'TOP_LEFT', 'TOP_RIGHT', 'BOTTOM_LEFT', 'BOTTOM_RIGHT', 'CENTER', 'NONE'
// Reset view to initial state
schematic.resetView();
// Toggle grid visibility
schematic.setShowGrid(false);
// Change units dynamically
schematic.setUnits('metric'); // 'points' | 'imperial' | 'metric'
// Control zoom behavior
schematic.setZoomOnCenter(true); // Zoom around center vs mouse position
Constructor:
new Schematic(container: HTMLElement, options?: SchematicOptions)
Properties:
fabricCanvas – Fabric.js Canvas instancemapInstance – Underlying Map instancegridEnabled – Grid visibility statezoomOnCenter – Zoom around center vs mouseunits – Current unit systemMethods:
setZoom(zoom: number) – Set zoom levelsetZoomLimits(min: number, max: number) – Clamp zoom rangesetShowGrid(enabled: boolean) – Toggle grid visibilitysetOriginPin(pin: string, margin: number) – Pin origin to cornersetUnits(units: 'points' | 'imperial' | 'metric') – Change unitssetZoomOnCenter(enabled: boolean) – Control zoom anchorresetView() – Reset to initial viewon(event: string, callback: Function) – Subscribe to eventoff(event: string, callback?: Function) – Unsubscribeemit(event: string, data: any) – Emit custom eventEvents:
zoom – Zoom in progresszoom:change – Zoom changedzoom:completed – Zoom finishedpan:move – Pan in progresspan:completed – Pan finishedgrid:change – Grid visibility changedview:reset – View reset triggeredConstructor:
new Map(container: HTMLElement, options?: BaseOptions)
Methods:
setZoom(zoom: number) – Set zoomonResize(width: number, height: number) – Handle resizeupdate() – Force grid syncreset() – Reset viewportProperties:
visible – Grid visibilityunits – Unit systemstep – Grid step sizescale – Grid scaleMethods:
setUnits(units: string) – Change unitsshow(visible?: boolean) – Show/hide gridrender() – Force redrawThe library includes a centralized debug system that allows you to control console output by category. By default, all debug logging is disabled for production use.
const schematic = new Schematic(container, {
debug: true // Enable all debug categories
});
const schematic = new Schematic(container, {
debug: {
schematic: true, // Schematic-level operations
events: true, // Mouse/interaction events
grid: false, // Grid rendering
map: false, // Map updates
units: false, // Unit conversions
calibration: false // Calibration tools
}
});
// Enable a category at runtime
schematic.debug.enable('events');
// Disable a category
schematic.debug.disable('grid');
// Enable all
schematic.debug.enable('all');
// Check if enabled
if (schematic.debug.isEnabled('units')) {
console.log('Units debug enabled');
}
Mouse:
Programmatic:
setZoom(), setZoomLimits() – Control zoomsetOriginPin() – Lock origin to viewport cornerresetView() – Return to initial stateSetup:
git clone https://github.com/ajoslin103/schematic.git
cd schematic
npm install
Scripts:
npm run dev – Start dev server with live reloadnpm run build – Build all bundles (CJS, ESM, UMD) + typesnpm run watch – Watch mode for developmentnpm run serve – Serve demo filesProject Structure:
src/
├── core/ # Schematic, Base, Debug, Constants
├── map/ # Map class
├── grid/ # Grid rendering
├── geometry/ # Point utilities
├── components/ # Calibration tools
└── lib/ # Helper functions
before:render phase and never mutates Fabric objectsBuilt on the foundation of IndoorJS by Mudin.
MIT © Allen Joslin
FAQs
A FabricJS library, facilitating working above coordinate planes
We found that @ajoslin103/schematic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.