Class Index | File Index

Classes


Class pv.Rule


Extends pv.Mark.
Represents a horizontal or vertical rule. Rules are frequently used for axes and grid lines. For example, specifying only the bottom property draws horizontal rules, while specifying only the left draws vertical rules. Rules can also be used as thin bars. The visual style is controlled in the same manner as lines.

Rules are positioned exclusively the standard box model properties. The following combinations of properties are supported:

PropertiesOrientation
leftvertical
rightvertical
left, bottom, topvertical
right, bottom, topvertical
tophorizontal
bottomhorizontal
top, left, righthorizontal
bottom, left, righthorizontal
left, top, heightvertical
left, bottom, heightvertical
right, top, heightvertical
right, bottom, heightvertical
left, top, widthhorizontal
left, bottom, widthhorizontal
right, top, widthhorizontal
right, bottom, widthhorizontal

Small rules can be used as tick marks; alternatively, a Dot with the "tick" shape can be used.

See also the Rule guide.
Defined in: Rule.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Constructs a new rule with default properties.
Field Summary
Field Attributes Field Name and Description
 
Constructs a new rule anchor with default properties.
 
Default properties for rules.
 
The height of the rule, in pixels.
 
The width of stroked lines, in pixels; used in conjunction with strokeStyle to stroke the rule.
 
The style of stroked lines; used in conjunction with lineWidth to stroke the rule.
 
The width of the rule, in pixels.
Fields borrowed from class pv.Mark:
bottom, childIndex, cursor, data, events, index, left, parent, proto, reverse, right, root, scale, title, top, type, visible
Methods borrowed from class pv.Mark:
add, anchorTarget, def, event, extend, margin, mouse, render
Class Detail
pv.Rule()
Constructs a new rule with default properties. Rules are not typically constructed directly, but by adding to a panel or an existing mark via pv.Mark#add.
See:
pv.Line
Field Detail
{pv.Anchor} anchor
Constructs a new rule anchor with default properties. Rules support five different anchors:In addition to positioning properties (left, right, top bottom), the anchors support text rendering properties (text-align, text-baseline). Text is rendered to appear outside the rule. Note that this behavior is different from other mark anchors, which default to rendering text inside the mark.

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.


{pv.Rule} defaults
Default properties for rules. By default, a single-pixel black line is stroked.

{number} height
The height of the rule, in pixels. If the bottom position is specified, the rule extends upward from the bottom edge; if the top position is specified, the rule extends downward from the top edge.

{number} lineWidth
The width of stroked lines, in pixels; used in conjunction with strokeStyle to stroke the rule. The default value is 1 pixel.

{string} strokeStyle
The style of stroked lines; used in conjunction with lineWidth to stroke the rule. The default value of this property is black.
See:
pv.color

{number} width
The width of the rule, in pixels. If the left position is specified, the rule extends rightward from the left edge; if the right position is specified, the rule extends leftward from the right edge.

Documentation generated by JsDoc Toolkit 2.3.2 on Sun May 30 2010 18:10:25 GMT-0700 (PDT)