pod-editor-render

0.3.63 • Public • Published

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()

}

Readme

Keywords

Package Sidebar

Install

npm i pod-editor-render

Weekly Downloads

210

Version

0.3.63

License

MIT

Unpacked Size

98.9 kB

Total Files

16

Last publish

Collaborators

  • duandz
  • kratosvn
  • trungnguyenbeeketing
  • hieuvu
  • vuvanquy