Global

Members

(constant) colorNames :Array

Definition of CSS color names

Source:
Type:
  • Array

(constant) countries :Array

List of Countries

Source:
Type:
  • Array

(constant) dispatch :d3.dispatch

Custom Dispatch Events

Source:
Type:
  • d3.dispatch

(constant) fruit :Array

List of Fruit

Source:
Type:
  • Array

Methods

attachEventListners(el)

Attach Event Listeners to Shape

Detect X3DOM events and convert them into D3 dispatch events.

Source:
Parameters:
Name Type Description
el

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

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

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

Source:
Parameters:
Name Type Description
event event
Returns:
Type:
Object

getEventPagePoint(event) → {Object}

Inverse of coordinate transform defined by function mousePosition(evt) in x3dom.js

Source:
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.

Source:
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

randomNum() → {number}

Random Number Generator between 1 and 10

Source:
Returns:
Type:
number

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