d2bSVG Point

# d2b.point()

Constructs a new point generator with the default settings.

When using the d2b-point generator you can draw a point onto each element in the selection.

# point(context)

Render the point(s) to the given context, which may be either a d3-selection of SVG containers (either SVG or G elements) or a corresponding d3-transition.

Before applying the d2b-point generator, you should join the data to the selected element(s) using selection.data or selection.datum. Here is the default data format.

var point = d2b.point();

point.size(function (d) {return d.size;});

d3.select('body').append('svg')
    .datum({ size: 120 })
    .call(point);

# point.size([size])

If size is specified, sets the size-accessor to the specified function or value in pixels. If size is not specified, returns the current size-accessor. The points are sized by a pixel area value.

# point.type([type])

If type is specified, sets the type-accessor to the specified function or string. If type is not specified, returns the current type-accessor. Refer to symbol types for the complete list of supported types.

# point.fill([fill])

If fill is specified, sets the fill-accessor to the specified function or constant color. If fill is not specified, returns the current fill-accessor, which defaults to () => 'steelblue'.

# point.stroke([stroke])

If stroke is specified, sets the stroke-accessor to the specified function or constant color. If stroke is not specified, returns the current stroke-accessor. The stroke by default will be a slightly darker shade of the fill.

# point.strokeWidth([strokeWidth])

If strokeWidth is specified, sets the strokeWidth-accessor to the specified function or constant in pixels. If strokeWidth is not specified, returns the current strokeWidth-accessor, which defaults to () => '1px'

# point.active([boolean])

If boolean is specified, sets the active-accessor to the specified function or bool. If boolean is not specified, returns the current boolean-accessor, which defaults to false. The active state will decide whether the point will transition with mouseover/mouseout activity.

# point.empty([boolean])

If boolean is specified, sets the boolean-accessor to the specified function or bool. If boolean is not specified, returns the current boolean-accessor. The empty state will decide whether the point is drawn without a fill and carries a variant of the mouse event transition.

results matching ""

    No results matching ""