@wawjs/ngx-fabric
v21.3.2
Published
`ngx-fabric` is the extracted Fabric canvas package for this workspace. It wraps Fabric.js in Angular-friendly component and directive APIs, plus a small provider for shared defaults.
Maintainers
Readme
ngx-fabric
ngx-fabric is the extracted Fabric canvas package for this workspace. It wraps Fabric.js in Angular-friendly component and directive APIs, plus a small provider for shared defaults.
Install
npm i --save ngx-fabricBootstrap
import { provideNgxFabric } from '@wawjs/ngx-fabric';
export const appConfig = {
providers: [
provideNgxFabric({
selectionColor: 'rgba(37, 99, 235, 0.16)',
renderOnAddRemove: true,
preserveObjectStacking: true,
}),
],
};What It Includes
FabricComponentfor template-level canvas usage with JSON loading supportFabricDirectivefor direct canvas instance controlprovideNgxFabric()for app-wide Fabric defaultsFABRIC_CONFIG,FabricConfigInterface,FabricConfig, andFabricEvents
Notes
disabledswaps the liveCanvasforStaticCanvas.loadFromJSON()is available through the directive reference and is also used by the componentdatainput.- Width and height fall back to the container size through
ResizeObserver. - Event outputs follow camelCase Angular bindings, for example
objectAddedfor Fabric'sobject:added.
