stroke

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

Meta Data
filepath_exists True
path stroke
filepath stroke.js
clean_files ()

  • VariableDeclaration
    const

    UNSET

    =
    ObjectExpression
  • VariableDeclaration
    const

    quickStroke

    =
    function ( color =green , lineWidth =UNSET , f )
  • VariableDeclaration
    const

    quickStrokeWithCtx

    =
    function ( ctx , color =green , lineWidth =UNSET , f )
  • ClassDeclaration
    class comments:

    ctx properties of which don't need map adapting,

    • method

      getOpts

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

      ctx properties of which don't need map adapting,

    • method

      march

      (
      delta = 1
      )
      from Stroke
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      Performing a dashoffset (if applied)

          This is simply a more specific _step_ function
      
    • method

      step

      (
      delta = 1
      )
      from Stroke
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      marchKeyPrepare

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

      return this.marchKeyApply.apply(this, arguments)

    • method

      marchKeyStep

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

      marchKeyApply

      (
      ctx , key , newValue
      )
      from Stroke
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      The given key should be the "march" param, and the value applied within the setup. Apply marching ants by applying the internal stepper value as the lineDashOffset.

    • method

      lineDashKeyApply

      (
      ctx , key , newValue , k
      )
      from Stroke
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])
    • method

      lineDashKeyRemove

      (
      ctx , key , cachedValue
      )
      from Stroke
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      To remove the line dash we call setLineDash with the inverse of the previously applied value cachedValue.

    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ClassDeclaration
    class comments:
     Create and and manage Strokes, using a name.
    
        const fooStroke = stage.strokes.create('foo',{
                        dash: [3,3]
                        , color: 'grey'
                        , width: 2
                    })
    
    Call set to apply, unset to unapply:
    
        fooStroke.set(ctx)
        fooStroke.set()
    
        fooStroke.set(ctx)
        fooStroke.unset()
    
    Fetch the same stroker:
    
        let fooStroke = stage.strokes.get('fooStroke')
    
    Or call the stroke object directly:
    
        stage.strokes.fooStroke.set()
        stage.strokes.fooStroke.unset()
    
    Call 'set' on the stroke object to perform the same as above:
    
        stage.strokes.set('line')
        stage.line.render(ctx)
        stage.strokes.unset('line')
    
    Run in place, immediately enabling the stroke styles:
    
        let off = stage.strokes.line()
        stage.line.render(ctx)
        off()
    
    Or for less code, provide a function to the immediate caller, to run inline:
    
        // set 'line'
        // run the given function
        // unset 'line'
        stage.strokes.line(()=>stage.line.render(ctx))
    
    • constructor

      constructor

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

      get

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

      has

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

      create

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

      set

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

      unset

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

      remove

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

      delete

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

      propHook

      (
      prop
      )
      from StageStrokeMap
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos'])

      Given a name (and potentially options), return a handler of which can be a function. The handler returns a off function for disabling this same stroke.

    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • VariableDeclaration
    const

    example

    =
    function ( )

    ctx identical