JUI(Simple UI & Chart Component)

util.svg

Hierarchy

Requires

Files

SVG Utility

Parameters

  • rootElem : Element
  • rootAttr : Object
Defined By

Properties

엘리먼트 관련 메소드 (필터)

엘리먼트 관련 메소드 (필터)

Methods

Defined By

Instance methods

...

Returns

util.svg
view source
( name )
implements svg image file download used by canvas ...

implements svg image file download used by canvas

Parameters

  • name : Object
return a element ...

return a element

Parameters

  • attr : Object
  • callback : Function

Returns

util.svg
view source
( elem, isAuto )
...

Parameters

util.svg
view source
( isAll )
...

Parameters

  • isAll : Object
return custom element ...

return custom element

Parameters

  • name : String
  • attr : Object
  • callback : Function

Returns

return defs element ...

return defs element

Parameters

  • callback : Function

Returns

util.svg
view source
( canvas )
convert svg image to canvas ...

convert svg image to canvas

Parameters

  • canvas : Canvas
return defs element ...

return defs element

Parameters

  • attr : Object
  • callback : Function

Returns

util.svg
view source
( text ) : Object
caculate real pixel size of text element ...

caculate real pixel size of text element

Parameters

  • text : String

    target text

Returns

  • Object
    • width : Integer

      text element's width (px)

    • height : Integer

      text element's height(px)

return line element ...

return line element

Parameters

  • attr : Object
  • callback : Function

Returns

return marker element ...

return marker element

Parameters

  • attr : Object
  • callback : Function

Returns

return rect element ...

return rect element

Parameters

  • attr : Object
  • callback : Function

Returns

util.svg
view source
( isAll )
...

Parameters

  • isAll : Object
util.svg
view source
( isAll )
...

Parameters

  • isAll : Object
util.svg
view source
( ) : Object
if arguments.length is 2, set attribute width, height to root element if arguments.length is zero, return svg size ...

if arguments.length is 2, set attribute width, height to root element if arguments.length is zero, return svg size

Returns

  • Object
return switch element ...

return switch element

Parameters

  • attr : Object
  • callback : Function

Returns

return symbol element ...

return symbol element

Parameters

  • attr : Object
  • callback : Function

Returns

util.svg
view source
( ) : String
convert svg to datauri format ...

convert svg to datauri format

Returns

  • String
util.svg
view source
( ) : String
convert xml string ...

convert xml string

Returns

  • String

    xml

return use element ...

return use element

Parameters

  • attr : Object

Returns

Defined By

Static methods

util.svg
view source
( obj ) : util.svg.elementstatic
create nested elements by json SVG.create({ tag : "pattern", attr : { x : 0, y : 0, width : 20, height : 2...

create nested elements by json

SVG.create({
     tag : "pattern",
     attr : { x : 0, y : 0, width : 20, height : 20  },
     children : [
         { tag : 'rect', attr : {width : 20, height : 20, fill : 'black', stroke : 'blue', 'stroke-width' : 2 } ,
         { tag : 'rect', attr : {width : 20, height : 20, fill : 'black', stroke : 'blue', 'stroke-width' : 2 } ,
         { tag : 'rect', attr : {width : 20, height : 20, fill : 'black', stroke : 'blue', 'stroke-width' : 2 } ,
         { tag : 'rect', attr : {width : 20, height : 20, fill : 'black', stroke : 'blue', 'stroke-width' : 2 }
     ]
 });

is equals to

<pattern x="0" y="0" width="20" height="20">
     <rect width="20" height="20" fill="black" stroke="blue" stroke-width="2" />
     <rect width="20" height="20" fill="black" stroke="blue" stroke-width="2" />
     <rect width="20" height="20" fill="black" stroke="blue" stroke-width="2" />
     <rect width="20" height="20" fill="black" stroke="blue" stroke-width="2" />
 </pattern>

Parameters

  • obj : Object

    json literal

    • type : String

      svg element name

    • attr : Object

      svg element's attributes

    • children : Array (optional)

      svg element's children

      Defaults to: null

Returns