pod-editor-render
v0.3.63
Published
A library that help to render artwork from image/text/psd data
Downloads
48
Readme
POD-render is a javascript library for rendering image from artwork data which can run on both browser and nodejs.
Class
class EditorRender {
/*
@Params artwork object 'artwork info with printAreaWidth, printAreaHeight, Layers data'
@Params containerId string 'id of html element to container Konva editor'
@Params editable boolean 'Konva editor can transform (drag/drop/resize...) or not'
@Params callbackDone function 'return after Konva render succeeded'
*/
constructor(artwork: any, containerId: string, editable: boolean, callbackDone: function)
/*
@Params layers array 'new layers | update layers | delete layers | change position layers
with required field: layer.event = "add" | "update" | "delete"'
@Params callbackDone function 'return after Konva render succeeded'
@Description To render changes of layers in editor
*/
render(layers?: any[], callbackDone: function)
/*
@Description Clear all layers in editor
*/
clearLayers()
/*
@Params percent number scale editor with scale rate = percent / 100
*/
scale(percent: number)
/*
@return Response blob source of canvas drawn by Konva
*/
exportImage()
/*
@Description clear Konva canvas to void leak memory
*/
destroy()
}
class PreviewEditor {
/*
@Params design object 'data preview include artwork json and mockup json'
@Params containerId string 'id of html element to container Konva editor'
@Params callbackDone function 'return after Konva render succeeded'
*/
constructor(design: any, containerId: string, callbackDone: function)
/*
@Description clear Konva canvas to void leak memory
*/
destroy()
}