Class pvc.visual.Context
Constructor Attributes | Constructor Name and Description |
---|---|
The Context class exposes the CCC Visual API to extension point functions.
|
Field Attributes | Field Name and Description |
---|---|
Interactivity and Delegation | |
Gets the associated DOM event.
|
|
Scene | |
Gets the index of #scene in relation to its sibling scenes.
|
|
Gets the associated scene, if there is one, or null if not.
|
|
Visual Components | |
Gets the immediate chart instance.
|
|
Gets the immediate panel instance.
|
|
Gets the Protovis mark instance, if there is one, or null, if not.
|
|
Gets the sign that wraps #pvMark, if there is one, or null, if not.
|
Method Attributes | Method Name and Description |
---|---|
delegate(defaultValue)
Calls the underlying implementation of the extension point property currently being evaluated.
|
|
Interactivity and Delegation | |
finished(value)
Informs CCC that the value returned by the extension point function
currently being evaluated should be taken as final.
|
|
Visual Data | |
Gets the value of the category scene variable.
|
|
Gets the label of the category scene variable.
|
|
getColor()
Gets the value of the color scene variable.
|
|
Gets the label of the color scene variable.
|
|
Gets the value of the series scene variable.
|
|
Gets the label of the series scene variable.
|
|
getSize()
Gets the value of the size scene variable.
|
|
Gets the label of the size scene variable.
|
|
getTick()
Gets the value of the tick scene variable.
|
|
Gets the label of the tick scene variable.
|
|
getValue()
Gets the value of the value scene variable.
|
|
Gets the label of the value scene variable.
|
|
getX()
Gets the value of the x scene variable.
|
|
Gets the label of the x scene variable.
|
|
getY()
Gets the value of the y scene variable.
|
|
Gets the label of the y scene variable.
|
It is passed as the JavaScript this context object to extension functions, such as extension point functions and action handlers.
When the context is used in the context of click or double-click action handlers, gets the corresponding DOM event. In IE, gets a "fixed" version of the DOM event. Otherwise, gets the value null.
This index is 0-based.
When there is a scene, it gets the value of its Scene#childIndex method. Otherwise, when there is no scene, or when it is a root scene, gets the value null.
This property can be used to change the value of extension point properties depending on the index being, for example, even or odd. It should not be used for much else, like for obtaining data from an external array.
- See:
- #sign
- See:
- #pvMark
This method allows you to only handle certain cases, in an extension point function, and to delegate the remaining cases to the default implementation, as in the following example:
function(scene) {
switch(scene.getCategory()) {
case "cars": return "red";
case "plains": return "green";
case "boats": return "blue";
}
return this.delegate("orange");
}
- Arguments:
- {any} defaultValue
- The default value to return when the default implementation would evaluate to undefined.
- Returns:
- {any} The evaluated value.
For convenience, CCC applies certain effects automatically to the values returned by extension point functions. For example, it might decide to use a brighter version of a returned color when the corresponding mark is being hovered-over.
This method conveniently returns the passed-in value untouched, so that the following coding pattern is possible:
function() {
var color = this.index % 2 ? "blue" : "red";
return this.finished(color);
}
- Arguments:
- {any} value
- - The value of the extension point property.
- Returns:
- {any} The passed in value argument.
This method is sugar for this.scene.vars.category.value.
- Returns:
- {any} The variable's value.
This method is sugar for this.scene.vars.category.label.
- Returns:
- {any} The variable's label.
This method is sugar for this.scene.vars.color.value.
- Returns:
- {any} The variable's value.
This method is sugar for this.scene.vars.color.label.
- Returns:
- {any} The variable's label.
This method is sugar for this.scene.vars.series.value.
- Returns:
- {any} The variable's value.
This method is sugar for this.scene.vars.series.label.
- Returns:
- {any} The variable's label.
This method is sugar for this.scene.vars.size.value.
- Returns:
- {any} The variable's value.
This method is sugar for this.scene.vars.size.label.
- Returns:
- {any} The variable's label.
This method is sugar for this.scene.vars.tick.value.
- Returns:
- {any} The variable's value.
This method is sugar for this.scene.vars.tick.label.
- Returns:
- {any} The variable's label.
This method is sugar for this.scene.vars.value.value.
- Returns:
- {any} The variable's value.
This method is sugar for this.scene.vars.value.label.
- Returns:
- {any} The variable's label.
This method is sugar for this.scene.vars.x.value.
- Returns:
- {any} The variable's value.
This method is sugar for this.scene.vars.x.label.
- Returns:
- {any} The variable's label.
This method is sugar for this.scene.vars.y.value.
- Returns:
- {any} The variable's value.
This method is sugar for this.scene.vars.y.label.
- Returns:
- {any} The variable's label.