Base models¶
_Model¶
-
class
nvd3._Model(name)¶ This class represent a model in NVS3. A model in NVD3 is an object with some settable options. These options are callables, to be more correct, they are setters. In python they are setters too: if you normally write
chart.showLabels(true)in JavaScript, this becomechart.showLabels(True)in Python.-
name¶ The name of the object. It is in the form
myobjfor the main objects and in the formmyobj.attrfor the attributes.
-
_option_names¶ Tuple of options that the model supports.
-
_raw_options¶ Tuple of raw options that should not be trasformed in some kind of javascript object.
-
js_options()¶ Returns the JavaScript representation of this model. This representation does not instantiate the object but is a collection of function calls to set the properties of the object.
-
NVD3 base models¶
-
class
nvd3.Line(name)¶ Represents a
nv.models.line()in NVD3. Available properties:-
width¶ Is raw: no. Type: int.
-
height¶ Is raw: no. Type: int.
-
defined¶ Allows a line to be not continuous when it is not defined.
Is raw: yes.
-
interpolate¶ Set the interpolation mode. The possible values are listed in the d3’s line.interpolate() documentation. Default:
'linear'.Is raw: no. Note
As now
interpolateaccepts onlystr.
-
clipEdge¶ If
True, masks lines within x and y scale.Is raw: no.
-
margin¶ Valid keys are:
top,right,bottomandleft, values must beints.Is raw: no. Type: dict.
-
duration¶ Is raw: no.
-
isArea¶ Decides if a line is an area or just a line.
Is raw: yes.
-
x¶ Accessor to get the x value from a data point.
Is raw: yes.
-
y¶ Accessor to get the y value from a data point.
Is raw: yes.
-
color¶ A function that returns a color.
Is raw: yes.
-
-
class
nvd3.Axis(name)¶ Represents a
nv.models.axis()in NVD3. Available properties:-
axisLabelDistance¶ Is raw: no. Type: int.
-
staggerLabels¶ Is raw: no. Type: bool.
-
rotateLabels¶ Is raw: no. Type: int.
-
rotateYLabel¶ Is raw: no. Type: bool.
-
showMaxMin¶ Is raw: no. Type: bool.
-
axisLabel¶ Is raw: no. Type: str.
-
height¶ Only used for tickLabel currently.
Is raw: no. Type: int.
-
ticks¶ Control how ticks are generated for the axis.
Is raw: no. Type: int.
-
width¶ Only used for tickLabel currently.
Is raw: no. Type: int.
-
fontSize¶ Is raw: no. Type: str.
-
margin¶ See
nvd3.Line.marginfor a valid format.Is raw: no.
-
duration¶
-
scale¶
-
dispatch¶
-
isOrdinal¶
-
orient¶
-
tickValues¶
-
tickSubdivide¶
-
tickSize¶
-
tickPadding¶
-
tickFormat¶
-
domain¶
-
range¶
-
rangeBand¶
-
rangeBands¶
-
-
class
nvd3.Legend(name)¶ Represents a
nv.models.legend()in NVD3. Available properties:widthheightkeykeyFormatteralignmaxKeyLengthrightAlignpaddingradioButtonModeexpandedversmargincolorupdateState
-
class
nvd3.Tooltip(name)¶ Represents a
nv.models.tooltip()in NVD3. Available properties:durationgravitydistancesnapDistanceclassesenabledhideDelaycontentGeneratorvalueFormatterheaderFormatterkeyFormatterheaderEnabledposition
-
class
nvd3.Focus(name)¶ Represents a
nv.models.focus()in NVD3. Available properties:widthheightshowXAxisshowYAxisbrushExtentmargindurationcolorinterpolatexTickFormatyTickFormatxyrightAlignYAxis
-
class
nvd3.Pie(name)¶ Represents a
nv.models.pie()in NVD3. Available properties:arcsRadiuswidthheightshowLabelstitletitleOffsetlabelThresholdvalueFormatxidendAnglestartAnglepadAnglecornerRadiusdonutRatiolabelsOutsidelabelSunbeamLayoutdonutgrowOnHovermarginycolorlabelType