
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.
schematic-map
Advanced tools
The IndoorJs Grid as a FabricJS library, facilitates working above coordinate planes
A fabric.js library, for working with fabric objects above a coordinate plane.
schematic-map is based on the excellent original work of IndoorJS by Mudin.
/ -> Grid (draws lines/axes/labels)
/
Your Application -> The Schematic -> The Map
\ -> Fabric.js canvas
Schematic is the main entry point recommended for applications. It wraps a Map instance, exposing the underlying Fabric.js canvas via schematic.fabricCanvas, and forwards convenient methods and events for zooming, panning, and grid control.
It creates and owns the Fabric.js canvas through the Map, provides event helpers (e.g. on, off, once, emit), and high-level controls like setZoom(), setZoomLimits(min,max), resetView(), setOriginPin(pin, margin), and setShowGrid(true/false).
Interactions supported by default:
resetView() to re-center and reset zoom.The schematic instance also exposes mapInstance for lower-level access when needed.
Map creates and manages the Fabric.js canvas element and coordinates grid rendering relative to Fabric’s viewport transform. It keeps the grid aligned to the viewport center so grid lines remain consistent while you pan and zoom.
It listens to Fabric canvas events (via Schematic) and updates the grid state when the viewport changes. It also ensures grid rendering happens in Fabric’s before:render phase so the grid draws beneath objects.
Map exposes helpers:
setZoom(zoom) and setZoomLimits(min,max) (via Schematic).reset() to restore initial zoom/origin.onResize(width, height) to resize the canvas and grid.The Grid class uses the canvas 2D context (from Fabric’s canvas) to paint grid lines, axes, ticks, and labels. It displays a visible coordinate reference for Fabric objects without affecting those objects in any way.
The grid is stateless with respect to Fabric objects. Each time the viewport changes, the Map updates the grid’s center and zoom (using pure calculations) and triggers a draw; the effect is responsive without the grid owning any Fabric state.
The Fabric.js canvas does what it does — see their docs for details. The Fabric instance is available as schematic.fabricCanvas so your application can add and manipulate Fabric objects directly. Note: grid coordinates invert the Y axis for display, while Fabric’s world coordinates remain standard.
fabric@^6dist/)npm install schematic-map fabric
# or
yarn add schematic-map fabric
The package exports both the Schematic class (recommended) and the lower-level Map class, along with all supporting utilities.
// JavaScript
import { Schematic } from 'schematic-map';
const container = document.getElementById('canvas-container');
const schematic = new Schematic(container, {
setShowGrid: true,
zoomDebounceDelay: 200
});
// Access Fabric.js instance
const fabricCanvas = schematic.fabric;
// Controls
schematic.setZoomLimits(0.05, 20);
schematic.setZoom(1);
schematic.setOriginPin('CENTER', 0); // or 'TOP_LEFT'|'TOP_RIGHT'|'BOTTOM_LEFT'|'BOTTOM_RIGHT'|'NONE'
// Add Fabric objects normally
const circle = new fabric.Circle({ left: 0, top: 0, radius: 50, fill: '#eee' });
fabricCanvas.add(circle);
import { Schematic } from 'schematic-map';
import { Circle } from 'fabric';
const container = document.getElementById('canvas-container');
if (!container) throw new Error('Container not found');
const schematic = new Schematic(container, {
setShowGrid: true,
zoomDebounceDelay: 200
});
// Controls
schematic.setZoomLimits(0.05, 20);
schematic.setZoom(1);
// Add Fabric objects with type safety
const circle = new Circle({
left: 0,
top: 0,
radius: 50,
fill: '#eee',
stroke: '#999',
strokeWidth: 1
});
schematic.fabric.add(circle);
import { Map } from 'schematic-map';
const container = document.getElementById('canvas-container');
const map = new Map(container, { setShowGrid: true });
// Access Fabric.js instance
const fabricCanvas = map.fabricCanvas;
// Controls
map.setZoom(1);
map.onResize(container.clientWidth, container.clientHeight);
// Add Fabric objects normally
const circle = new fabric.Circle({ left: 0, top: 0, radius: 50, fill: '#eee' });
fabricCanvas.add(circle);
Schematic(container, options): creates a map + grid.
fabricCanvas, mapInstance.zoom, zoom:change, zoom:completed, pan:move, pan:completed, grid:change, view:reset.setZoom(zoom)setZoomLimits(min, max)resetView()setOriginPin(pin, margin) and setOriginScreen(x, y)setShowGrid(visible)addObject(obj), removeObject(obj) (delegate to Map)Map (lower-level): manages Fabric canvas and grid sync.
setZoom(zoom), reset(), onResize(w,h), update()npm run dev (serves demo/grid-demo.html with live-reload)npm run build (outputs dist/schematic.*.js via Rollup)src/map/Map.js; public wrappers: src/core/Schematic.jsbefore:render and never mutates Fabric objects.FAQs
The IndoorJs Grid as a FabricJS library, facilitates working above coordinate planes
We found that schematic-map 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.