Skip to content
Kevin Warne edited this page May 2, 2016 · 5 revisions

# d2b.svg.point()

Constructs a new point generator.

# point(selection)

Apply the point to a selection or transition. The selection must contain an svg or g element. For example:

d3.select('body').append('svg')
    .attr('class', 'point')
    .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([orientation])

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

# 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.

# point.active([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 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. This is used for the legend whenever a legend-item is 'deselected' or 'emptied';

Clone this wiki locally