setStyle(< object >style) - ( TargetRenderer )style should an object containing some (or all) of the style keywords
described above

setScale(< number >scale) - ( TargetRenderer )

Subclassing notes
Subclasses should override the following methods:

drawTarget() - ( void )
Draws the target into context, into a width x height-sized rectangle with center in
(0, 0). Target should be scaled according to scale, for instance, if
scale = 2 the target should fit exactly into the rectangle with size
2*width x 2*height.

TriangleRenderer

Handles rendering of upper-right hand triangles, used for non-marking series.
Inherits all properties and methods of Renderer.

var renderer =newTriangleRenderer();

renderer.setContext(ctx)

.setStyle({

color:'rgb(150, 150, 150)',

borderColor:'rgb(50, 50, 50)',

size:.2

})

.setRect({

x:100,

y:150,

width:400,

height:300

})

.render();

Public properties

< object >style

< string >color, the color of the triangle

< string >borderColor, the color of the border (facing the target) of
the triangle

< number >size, the size of the triangle relative to the width of the
rect

Setters
Return pointer to the renderer for convenience.

setStyle(< object >style) - ( TriangleRenderer )style should an object containing some (or all) of the style keywords
described above

ShotRenderer

Handles rendering of shots. Inherits all properties and methods of Renderer.

var renderer =newShotRenderer();

renderer.setContext(ctx)

.setStyle({

gaugeSize:.1,

gaugeColor:'rgb(255, 0, 0)',

markerColor:'rgb(0, 0, 255)',

lastMarkerColor:'rgb(0, 255, 0)'

})

.setScale(2)

.setRect({

x:100,

y:150,

width:400,

height:300

})

.setShots(shots)

.render();

Public properties

< object >style

< number >gaugeSize
default value is .015

< string >gaugeColor
default value is 'rgb(0, 0, 0)'

< string >markerColor
default value is 'rgb(0, 255, 0)'

< string >lastMarkerColor
default value is 'rgb(255, 0, 0)'

< object >shots, should be object created by ShotListBuilder

< number >scale, the scale (zoom) at which to render
default value is 1

Setters
Return pointer to the renderer for convenience.

setStyle(< object >style) - ( ShotRenderer )style should an object containing some (or all) of the style keywords
described above

setShots(< object >shots) - ( ShotRenderer )

setScale(< number >scale) - ( ShotRenderer )

Components for ring targets

RingTargetRenderer

Super class for various implementations of ring-target renderers. Inherits all
properties and methods of TargetRenderer.

var renderer =newRingTargetRenderer();

renderer.setContext(ctx)

.setStyle({backColor:'rgb(255, 0, 0)', frontColor:'rgb(0, 0, 255)'})

.setScale(2)

.setRect({

x:100,

y:150,

width:400,

height:300

})

.setTarget(target)

.render();

Public properties

< object >style
Extended from TargetRenderer

< boolean >drawFullTarget, true if the entire target should be
drawn, even if it extends outside the drawing rectangle. false if only
rings that fully fit inside the rectangle should be drawn.

< number >ringLineWidth, the rendered line width of the rings
default value is 1

< object >target, should be object created by RingTargetBuilder

Setters
Return pointer to the renderer for convenience.

setTarget(< object >target) - ( RingTargetRenderer )target should be object created by RingTargetBuilder

RingTargetScaler

Super class for various implementations of ring-target scalers. Inherits all
propterties and methods of Scaler.

var scale =newRingTargetScaler()

.setTarget(target)

.setShots(shots)

.getScale();

Public properties

< object >target, should be object created by RingTargetBuilder

Public methods

setTarget(< object >target) - ( RingTargetScaler )target should be object created by RingTargetBuilder

(static method) RingTargetBuilder.createBlankTarget() - ( object )
Creates and returns a new empty target, with all fields present, but set to
empty placeholder values.

reset() - ( RingTargetBuilder )
Resets the current target. Returns pointer to the builder for convenience.

getTarget() - ( object )
Returns pointer to the current target

setRingSizes(< array >ringSizes) - ( RingTargetBuilder )ringSizes should be a stricly decreasing positive sequence of
numbers. Each number represents the radius of a ring on the target. The
largest should ring always have size 1.

setFrontSize(< number >frontSize) - ( RingTargetBuilder )frontSize is the size of the black disc with repect to the target size.
For instance, a target with radius 300mm and a black disc with radius
120mm, frontSize should be 120mm / 300mm = .4.

setNumbersFrom(< number >numbersFrom) - ( RingTargetBuilder )

setNumbersTo(< number >numbersFrom) - ( RingTargetBuilder )

List of implemented targets

All of the following targets are accesible through the targets object on the
root object of the package. You can either access the directly using their
targetID as a key:

When targets are needed to setup scalers and renderers, the convenience methods
getRenderer and getScaler should be used. These will create new instances
of Renderer and Scaler (or the appropriate subclass of these), and set them
up with the correct target:

var LiveShot =require('liveshot-core');

var targetID ='NO_DFS_100M';

var renderer =LiveShot.targets.getRenderer(targetID);

var scaler LiveShot.targets.getScaler(targetID);

DFS range targets

All DFS range targets are ring targets and should be rendered with
RingTargetRenderer and scaled with RingTargetScaler.