Class pv.Dot
Extends pv.Mark.
Represents a dot; a dot is simply a sized glyph centered at a given point that can also be stroked and filled. The size property is proportional to the area of the rendered glyph to encourage meaningful visual encodings. Dots can visually encode up to eight dimensions of data, though this may be unwise due to integrality. See pv.Mark for details on the prioritization of redundant positioning properties.
See also the Dot guide.
Defined in: Dot.js.
Constructor Attributes | Constructor Name and Description |
---|---|
pv.Dot()
Constructs a new dot mark with default properties.
|
Field Attributes | Field Name and Description |
---|---|
The rotation angle, in radians.
|
|
Default properties for dots.
|
|
The fill style; if non-null, the interior of the dot is filled with the
specified color.
|
|
The width of stroked lines, in pixels; used in conjunction with
strokeStyle to stroke the dot's shape.
|
|
The shape name.
|
|
The size of the dot, in square pixels.
|
|
The style of stroked lines; used in conjunction with lineWidth to
stroke the dot's shape.
|
- Fields borrowed from class pv.Mark:
- bottom, childIndex, cursor, data, index, left, parent, proto, reverse, right, root, scene, title, top, type, visible
Method Attributes | Method Name and Description |
---|---|
anchor(name)
Constructs a new dot anchor with default properties.
|
|
radius()
Returns the radius of the dot, which is defined to be the square root of the
#size property.
|
- Methods borrowed from class pv.Mark:
- add, anchorTarget, cousin, def, event, extend, first, last, mouse, render, sibling
Constructs a new dot mark with default properties. Dots are not typically constructed directly, but by adding to a panel or an existing mark via pv.Mark#add.
The rotation angle, in radians. Used to rotate shapes, such as to turn a cross into a plus.
Default properties for dots. By default, there is no fill and the stroke style is a categorical color. The default shape is "circle" with size 20.
The fill style; if non-null, the interior of the dot is filled with the specified color. The default value of this property is null, meaning dots are not filled by default.
- See:
- pv.color
The width of stroked lines, in pixels; used in conjunction with strokeStyle to stroke the dot's shape.
The shape name. Several shapes are supported:
- cross
- triangle
- diamond
- square
- tick
- circle
Note: it may be more natural to use the pv.Rule mark for horizontal and vertical ticks. The tick shape is only necessary if angled ticks are needed.
The size of the dot, in square pixels. Square pixels are used such that the area of the dot is linearly proportional to the value of the size property, facilitating representative encodings.
- See:
- #radius
The style of stroked lines; used in conjunction with lineWidth to stroke the dot's shape. The default value of this property is a categorical color.
- See:
- pv.color
Constructs a new dot anchor with default properties. Dots support five different anchors:
- top
- left
- center
- bottom
- right
For consistency with the other mark types, the anchor positions are defined in terms of their opposite edge. For example, the top anchor defines the bottom property, such that a bar added to the top anchor grows upward.
- Parameters:
- {string} name
- the anchor name; either a string or a property function.
- Returns:
- {pv.Anchor}
Returns the radius of the dot, which is defined to be the square root of the #size property.
- Returns:
- {number} the radius.