svg

<script src="./point_src/svg"></script>

As the tin suggests, the 'svg' component makes an SVG. The SVG is editable and made new.

var svg = new PrimaryContext(undefined, '#container')
window.pipes = svg
svg.start()

Target a container or an svg name:

var svg = new PrimaryContext('svd_id')

SVG First, then fallback to the container:

var svg = new PrimaryContext('svd_id', "#svg_pawn_div")

For free we have a rendering layer, iterating objects and discovering a render() function:

svg.addItem({
    render() {
        ...
    }
})
Meta Data
filepath_exists True
path svg
filepath svg.js
clean_files ()

  • VariableDeclaration
    var

    newPath

    =
    function ( svg , name )
    Create a path in SVG's namespace
  • VariableDeclaration
    var

    rand

    =
    function ( )
  • VariableDeclaration
    var

    newSVG

    =
    function ( id , parent )
    let $svg = $("", )
  • ClassDeclaration
    class comments:
    Generate a new SVG using the internal names and append the new svg to the given container. If the svg exists, it's reused else a new one is created.
    • constructor

      constructor

      (
      svgName , containerSelector
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      start

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      createContext

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Generate a new SVG using the internal names and append the new svg to the given container. If the svg exists, it's reused else a new one is created.
    • method

      resetSVGsize

      (
      x , y
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Reset the svg size to 0 0
    • method

      applyWindowHandlers

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      Apply ready and resize handlers to the window and document to call render() upon an event.
    • method

      resize

      (
      width , height
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      render

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      console.log('render pipes')
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ClassDeclaration
    class comments:
    The context acts as a simple manager for many units on an SVG. Provde a svg name - used as an ID and a container selector. If the svgname does not exist as an svg# a new one is created. If the containerSelector is undefined, the newly generated svg is appended to the body. If the svg of name ID exists, it's used rather than creating, but it's still moved into the container (if given) containerSelector = '#my_container' svgName = 'svg1' // note - Not a jquery selector; context = new PrimaryContext(svgName, containerSelector) context.start() context.addItem({ name: 'bob' }) context.render()
    • property

      liveResize

      = false
      from class_name
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos'])
    • constructor

      constructor

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      render

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      super.render()
    • method

      warn

      (
      line
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      renderStack

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      connectAll(this.containerSelector, this.svgSelector)
    • method

      remapNodes

      (
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      adaptDrawLayer

      (
      given = True
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      check if the svg is big enough to draw the path, if not, set heigh/width
    • method

      addItem

      (
      config
      )
      from class_name
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
      { name: 'name' start: Node end: Node }
    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])