-
Notifications
You must be signed in to change notification settings - Fork 525
API Reference
mbostock edited this page Apr 2, 2012
·
29 revisions
Everything in Cubism is scoped under the cubism
namespace. Cubism uses semantic versioning. You can find the current version as cubism.version
, which is a string of the form "X.Y.Z", where X is the major version number, Y is the minor version number, and Z is the patch version number.
- cubism.context - create a new context.
- cubism.version - determine the current semantic version number.
- context.step - get or set the context step in milliseconds.
- context.size - get or set the context size in number of values.
- context.serverDelay - get or set the context server-side delay in milliseconds.
- context.clientDelay - get or set the context client-side delay in milliseconds.
- context.on - add, get or remove a listener for "beforechange" or "change" events.
- context.graphite - create a source for Graphite metrics.
- context.cube - create a source for Cube metrics.
- context.constant - create a constant-value metric.
- context.horizon - create a horizon chart.
- context.comparison - create a comparison chart.
- graphite.metric - create a Graphite metric.
- graphite.toString - get the Graphite host URL.
- cube.metric - create a Cube metric.
- cube.toString - get the Cube host URL.
- metric.valueAt - get the value of the metric at the given index.
- metric.extent - get the minimum and maximum metric value.
- metric.add - add another metric or constant to this metric.
- metric.subtract - subtract another metric or constant from this metric.
- metric.multiply - multiply this metric by another metric or constant.
- metric.divide - divide this metric by another metric or constant.
- metric.shift - time-shift this metric.
- metric.on - add, get or remove a listener for "change" events.
- metric.context - get the metric's parent context.
- metric.toString - get the metric's associated expression, if any.
- horizon - apply the horizon chart to a D3 selection.
- horizon.mode - get or set the horizon mode ("offset" or "mirror").
- horizon.height - get or set the chart height in pixels.
- horizon.metric - get or set the chart metric.
- horizon.extent - get or set the chart extent (if not automatic).
- horizon.title - get or set the chart title.
- horizon.format - get or set the chart's value format function.
- horizon.colors - get or set the horizon layer colors.
- comparison - apply the comparison chart to a D3 selection.
- comparison.height - get or set the chart height in pixels.
- comparison.primary - get or set the primary metric.
- comparison.secondary - get or set the comparison metric.
- comparison.extent - get or set the chart extent (if not automatic).
- comparison.title - get or set the chart title.
- comparison.formatPrimary - get or set the primary value format function.
- comparison.formatChange - get or set the percentage change format function.
- comparison.colors - get or set the comparison colors (positive and negative).
- comparison.stroke - get or set the primary metric's stroke color.
- comparison.strokeWidth - get or set the primary metric's stroke width.
- comparison.fill - get or set the primary metric's fill color.