Skip to content
mbostock edited this page Apr 23, 2012 · 10 revisions

WikiAPI ReferenceCube

A source for Cube metrics. To create a source, first create a context. Then, use context.cube to specify the URL of the Cube evaluator. For example:

var context = cubism.context(), // a default context
    cube = context.cube("http://cube.example.com");

# cube.metric(expression)

Creates a new metric for the given Cube expression. For example, if you were using Cube to collect "request" events, you could query the number of request events by saying:

var requests = cube.metric("sum(request)");

For more information on metric expressions, see Cube's documentation.

# cube.toString()

Returns the URL of the Cube server; the first argument to the constructor.

Clone this wiki locally