FZP
The FZP class is the main fzp data entry. Here you can access the main data properties/objects and some utility functions can be used to load svgs as string, count the total number of connections or set a connector.
Example:
const {FZP} = require('fzp-js')
let fzp = new FZP({moduleId: 'sample'})
fzp.version = '1.0.0'
fzp.setTag('demo')
fzp.setProperty('p', 'hello', true)
fzp.setView()
fzp.setConnector()
fzp.setBus()
Constructor Summary
Public Constructor | ||
public |
constructor(opt: Object) FZP constructor has an opt argument object that can be used to setup data at the initialization. |
Member Summary
Public Members | ||
public |
The FZP author |
|
public |
The FZP buses is a map with instances of the Bus class. |
|
public |
The FZP connectors |
|
public |
The FZP date |
|
public |
The FZP description |
|
public |
The FZP family |
|
public |
The FZP fritzing version |
|
public |
The FZP label |
|
public |
The FZP language |
|
public |
The FZP module id |
|
public |
The FZP properties |
|
public |
The FZP tags |
|
public |
The FZP taxonomy |
|
public |
The FZP title |
|
public |
The FZP url |
|
public |
The FZP variant |
|
public |
The FZP version |
|
public |
The FZP views (icon, breadboard, schematic, pcb) |
Method Summary
Public Methods | ||
public |
getProperty(key: String): FZPProperty Get a FZP property by the given key. |
|
public |
Load all SVG sources. |
|
public |
setBus |
|
public |
setConnector(name: String, connector: FZPConnector): FZP setConnector |
|
public |
setProperty(key: String, value: String, showInLabel: Boolean): FZP Create or update a FZPProperty instance to the FZP. |
|
public |
Set a tag |
|
public |
Set a view |
|
public |
totalBuses(): Number Get the total number of buses. |
|
public |
Get the total number of connector. |
|
public |
Get the total number of properties. |
|
public |
Get the total number of tags. |
Public Constructors
Public Members
Public Methods
public getProperty(key: String): FZPProperty source
Get a FZP property by the given key.
Params:
Name | Type | Attribute | Description |
key | String |
public loadSVGs(baseurl: String): FZP source
Load all SVG sources.
Params:
Name | Type | Attribute | Description |
baseurl | String |
public setConnector(name: String, connector: FZPConnector): FZP source
setConnector
Params:
Name | Type | Attribute | Description |
name | String | ||
connector | FZPConnector |
public setProperty(key: String, value: String, showInLabel: Boolean): FZP source
Create or update a FZPProperty instance to the FZP.