Extension JS API endpoints
JavaScript module returns an object that may implement one of the endpoints: version(), supported(), settings(), disableDraw(), beforeDraw(), afterDraw(), and afterDataRequest().
version()
This must exist, and reports on the version of the API that this object implements.
Currently supported version strings is "1"
. This must be a string, not a
number.
supported()
If this member exists, it is expected to be an object that contains a member called
visualType
. This member must point to a string with the type of visual
supported, or an array of strings that contain the types of visuals supported.
For example,
supported: {
visualType: "trellis-bars"
},
Visual Type | Object Name |
---|---|
Table | table |
Cross Tabulation | crosstab |
Bars | trellis-bars |
Lines | trellis-lines |
Combo | combo |
Areas | trellis-areas |
Grouped Bars | trellis-groupedbars |
KPI | kpi |
Packed Bubbles | packed-bubbles |
Scatter | scatter |
Flow | flow |
Funnel | funnel |
Pie | pie |
Radial | radial |
Chord | chord |
Correlation Heatmap | correlation |
Correlation Flow | correlation-flow |
Calendar Heatmap | calendar-heatmap |
Map | map |
Interactive Map | leaflet |
Sparklines | sparklines |
External Link | link |
Histogram | histogram |
Extension | extension |
Field Statistics | column-stats |
Queries | rawtable |
Rich Text | html |
Network | network |
Dendrogram | dendrogram |
Treemap | treemap |
Bullet | bullet |
Gauge | gauge |
Word Cloud | wordcloud |
Box Plot | boxplot |
Timeline | timeline |
settings()
If a member with this name exists, it is expected to be a function that returns an array. Each array element is then expected to be an object with the following members:
settings: function() {
return [
{
id: "Column Name"
},
{
id: "Max bar width",
defaultValue: "50"
},
{
id: "Color",
defaultValue: "steelblue"
}
];
},
Member | Name | Description | Default Value | Mandatory |
---|---|---|---|---|
id |
Column Name | The ID of this setting. | None | Yes |
displayName |
Column Name | Name used to display this setting. | Same as ID | No |
type |
String | The data type of the variable. Supported types include String ,
and boolean . |
String |
No |
defaultValue |
"" | The default value for this setting. | null |
No |
disableDraw()
If a member with this name exists, and it is a function that returns a
boolean
variable set to true
, we disable the drawing of
the visual.
beforeDraw()
If a member with this name exists, it must be a function that executes after receiving data but before the draw event on the visual.
afterDraw()
If a member with this name exists, it must be a function that executes after the draw event on the underlying visual.
afterDataRequest()
If a member with this name exists, it must be a function that executes after creating the request object, but before the data request call. This function accepts the current request object in the arguments, adds your modifications, and returns an updated valid request object. If the function does not return a valid request object, the request is not sent, and the system returns an error.