Members
dispatch
Attach Event Listeners to Shape
Detect X3DOM events and convert them into D3 dispatch events.
protoFolder
Generate JSON file of compiled X3D Prototypes, encoded as base64 data URLs.
- Source:
Methods
colorParse(color) → {string}
X3D Color Parser
- Source:
Parameters:
Name | Type | Description |
---|---|---|
color |
Rgb
|
Hsl
|
null
|
Returns:
- Type:
-
string
colourNameToHex(colorName) → {boolean|*}
Color Name to Hex
- Source:
Parameters:
Name | Type | Description |
---|---|---|
colorName |
string
|
Returns:
- Type:
-
boolean
|*
colourNameToX3d(colorName) → {string}
Color Name to X3D RGB
- Source:
Parameters:
Name | Type | Description |
---|---|---|
colorName |
string
|
Returns:
- Type:
-
string
componentToHex(c) → {string}
Color Component to Hex
- Source:
Parameters:
Name | Type | Description |
---|---|---|
c |
number
|
Returns:
- Type:
-
string
convert(data) → {Array}
Convert Bubble/Particle Dataset Format
- Source:
Parameters:
Name | Type | Description |
---|---|---|
data |
Array
|
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
- Source:
Parameters:
Name | Type | Description |
---|---|---|
points |
number
|
Number of data points. |
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)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
points |
number
|
Number of data points. |
Returns:
- Type:
-
Array
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.
- Source:
- See:
Parameters:
Name | Type | Description |
---|---|---|
event |
event
|
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
- Source:
Parameters:
Name | Type | Description |
---|---|---|
hex |
string
|
Returns:
- Type:
-
*
hexToX3d(hex) → {string}
Color Hex to X3D RGB
- Source:
Parameters:
Name | Type | Description |
---|---|---|
hex |
string
|
Returns:
- Type:
-
string
rgb2Hex(rgbStr) → {string}
RGB Colour to Hex Converter
- Source:
Parameters:
Name | Type | Description |
---|---|---|
rgbStr |
string
|
RGB colour string (e.g. "rgb(155, 102, 102)"). |
Returns:
- Type:
-
string
- Hex Color (e.g. "#9b6666").
rgbToHex(r, g, b) → {string}
Color RGB to Hex
- Source:
Parameters:
Name | Type | Description |
---|---|---|
r |
number
|
|
g |
number
|
|
b |
number
|
Returns:
- Type:
-
string