Home Reference Source Test
public class | source

FZPView

FZPView class is used by the fzp breadboard, pcb and schematics view.

Example:

const {FZPView} = require('fzp-js')

let view = new FZPView()

Constructor Summary

Public Constructor
public

constructor(image: String, ids: Array, flipH: Boolean, flipV: Boolean, svg: String)

FZPView constructor

Member Summary

Public Members
public

FZPView flip horizontal

public

FZPView flip vertical

public

The FZPView image

public

The FZPView layer id's

public

The FZPView svg data

Method Summary

Public Methods
public

Check if a layer id exist at the FZPView layerIds array

public

loadSVG(baseurl: String): Promise

load the svg of the image path from the fritzing-parts api

public

Set the FZPView image source

public

Add a layer id to the FZPView

public

Set the svg data

public

Get the total number of FZPView layer id's

Public Constructors

public constructor(image: String, ids: Array, flipH: Boolean, flipV: Boolean, svg: String) source

FZPView constructor

Params:

NameTypeAttributeDescription
image String
ids Array
flipH Boolean
flipV Boolean
svg String

The raw svg string

Public Members

public flipHorizontal: Boolean source

FZPView flip horizontal

public flipVertical: Boolean source

FZPView flip vertical

public image: String source

The FZPView image

public layerIds: Array source

The FZPView layer id's

public svg: String source

The FZPView svg data

Public Methods

public existLayerId(id: String): Boolean source

Check if a layer id exist at the FZPView layerIds array

Params:

NameTypeAttributeDescription
id String

Return:

Boolean

public loadSVG(baseurl: String): Promise source

load the svg of the image path from the fritzing-parts api

Params:

NameTypeAttributeDescription
baseurl String

the url to the fritzing-parts/core directory

Return:

Promise

public setImage(src: String): FZPView source

Set the FZPView image source

Params:

NameTypeAttributeDescription
src String

The image source

Return:

FZPView

public setLayerId(name: String): FZPView source

Add a layer id to the FZPView

Params:

NameTypeAttributeDescription
name String

The layer name

Return:

FZPView

public setSVG(data: String): FZPView source

Set the svg data

Params:

NameTypeAttributeDescription
data String

The SVG data

Return:

FZPView

public totalLayerId(): Number source

Get the total number of FZPView layer id's

Return:

Number