Members
colorNames :Array
Definition of CSS color names
Type:
- Array
- Source:
countries :Array
List of Countries
Type:
- Array
- Source:
dispatch :d3.dispatch
Custom Dispatch Events
Type:
- d3.dispatch
fruit :Array
List of Fruit
Type:
- Array
- Source:
protoFolder
Generate JSON file of compiled X3D Prototypes, encoded as base64 data URLs.
- Source:
Methods
assignCoordinateScales(state, data) → {Array}
Build linear x, y, z, and size scales from coordinate extents when missing.
Parameters:
| Name | Type | Description |
|---|---|---|
state |
Object | |
data |
Array |
- Source:
Returns:
Row keys
- Type
- Array
assignSeriesScales(state, data, scales) → {Object}
Build x, y, and z scales from a summary when they are missing.
Pass overwrite: true to replace scales on every call.
Parameters:
| Name | Type | Description |
|---|---|---|
state |
Object | |
data |
Array | |
scales |
Object |
- Source:
Returns:
dataTransform summary
- Type
- Object
attachEventListners(el)
Attach Event Listeners to Shape
Detect X3DOM events and convert them into D3 dispatch events.
Parameters:
| Name | Type | Description |
|---|---|---|
el |
colorParse(color) → {string}
X3D Color Parser
Parameters:
| Name | Type | Description |
|---|---|---|
color |
Rgb | Hsl | null |
- Source:
Returns:
- Type
- string
colourNameToHex(colorName) → {boolean|*}
Color Name to Hex
Parameters:
| Name | Type | Description |
|---|---|---|
colorName |
string |
- Source:
Returns:
- Type
- boolean | *
colourNameToX3d(colorName) → {string}
Color Name to X3D RGB
Parameters:
| Name | Type | Description |
|---|---|---|
colorName |
string |
- Source:
Returns:
- Type
- string
componentToHex(c) → {string}
Color Component to Hex
Parameters:
| Name | Type | Description |
|---|---|---|
c |
number |
- Source:
Returns:
- Type
- string
convert(data) → {Array}
Convert Bubble/Particle Dataset Format
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array |
- Source:
Returns:
- Type
- Array
coordinateSeriesData(data) → {Array}
Reshape { value, x, y, z } points into mapped { key, value } pairs.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array |
- Source:
Returns:
- Type
- Array
dataset1() → {Array}
Random Dataset - Single Series
- Source:
Returns:
- Type
- Array
dataset2() → {Array}
Random Dataset - Multi Series
- Source:
Returns:
- Type
- Array
dataset3(points) → {Array}
Random Dataset - Single Series Scatter Plot
Parameters:
| Name | Type | Description |
|---|---|---|
points |
number | Number of data points. |
- Source:
Returns:
- Type
- Array
dataset4() → {Array}
Random Dataset - Surface Plot 1
- Source:
Returns:
- Type
- Array
dataset5() → {Array}
Random Dataset - Surface Plot 2
- Source:
Returns:
- Type
- Array
dataset6(points) → {Array}
Random Dataset - Single Series Scatter Plot (with size and color values)
Parameters:
| Name | Type | Description |
|---|---|---|
points |
number | Number of data points. |
- Source:
Returns:
- Type
- Array
drawIndexedFaceStrip(element, state, options)
Draw a strip of quads as an IndexedFaceSet.
X3DOM rejects an empty IndexedFaceSet, so the node is injected with .html().
Parameters:
| Name | Type | Description |
|---|---|---|
element |
d3.selection | |
state |
Object | Component scales, color, dimensions, and curve. |
options |
Object |
- Source:
drawSeriesGroups(element, state, options)
Place one translated group per series and draw the inner component into it.
Parameters:
| Name | Type | Description |
|---|---|---|
element |
d3.selection | |
state |
Object | |
options |
Object |
- Source:
forwardEvent(event)
Forward X3DOM Event to D3
In X3DOM, it is the canvas which captures onclick events, therefore defining a D3 event handler on an single X3DOM element does not work. A workaround is to define an onclick handler which then forwards the call to the D3 "click" event handler with the event. Note: X3DOM and D3 event members slightly differ, so d3.mouse() function does not work.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
event |
- Source:
- See:
getEventCoordinates(event) → {Object}
Show Alert With Event Coordinate
Parameters:
| Name | Type | Description |
|---|---|---|
event |
event |
Returns:
- Type
- Object
getEventPagePoint(event) → {Object}
Inverse of coordinate transform defined by function mousePosition(evt) in x3dom.js
Parameters:
| Name | Type | Description |
|---|---|---|
event |
event |
Returns:
- Type
- Object
getX3domHolder(event) → {*}
Return the x3d Parent Holder
Find clicked element, walk up DOM until we find the parent x3d. Then return the x3d's parent.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Returns:
- Type
- *
hexToRgb(hex) → {*}
Color Hex to RGB
Parameters:
| Name | Type | Description |
|---|---|---|
hex |
string |
- Source:
Returns:
- Type
- *
hexToX3d(hex) → {string}
Color Hex to X3D RGB
Parameters:
| Name | Type | Description |
|---|---|---|
hex |
string |
- Source:
Returns:
- Type
- string
initColumnPointScales(data, state)
Column point scales shared by the area and ribbon charts. Scales are replaced on every call.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array | |
state |
Object |
- Source:
initCoordinateScales(data, state)
Linear coordinate scales shared by the bubble chart and spot plot. Scales are replaced on every call.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array | |
state |
Object |
- Source:
orientSeriesViewpoint(viewpoint)
Viewpoint orientation shared by the area and ribbon charts.
Parameters:
| Name | Type | Description |
|---|---|---|
viewpoint |
function |
- Source:
randomNum() → {number}
Random Number Generator between 1 and 10
- Source:
Returns:
- Type
- number
rgb2Hex(rgbStr) → {string}
RGB Colour to Hex Converter
Parameters:
| Name | Type | Description |
|---|---|---|
rgbStr |
string | RGB colour string (e.g. "rgb(155, 102, 102)"). |
- Source:
Returns:
- Hex Color (e.g. "#9b6666").
- Type
- string
rgbToHex(r, g, b) → {string}
Color RGB to Hex
Parameters:
| Name | Type | Description |
|---|---|---|
r |
number | |
g |
number | |
b |
number |
- Source:
Returns:
- Type
- string
sceneChart(spec) → {function}
Build a chart that creates a scene, viewpoint, axis, mark, and optional light.
init assigns scales on every call. draw covers marks that are not a single layer call.
Parameters:
| Name | Type | Description |
|---|---|---|
spec |
Object |
- Source:
Returns:
- Type
- function