Namespace: RenderUtil

RenderUtil

A utility namespace containing renderer related functionality.

Methods

staticRenderUtil.getAttributeValue(obj, attribPath){*}

Traverses an object to return a nested attribute
Name Type Description
obj Object The object to traverse.
attribPath String | function Period delimited attribute path or a function that returns one.
Returns:
nested value within the object.

staticRenderUtil.getFontSize(count, totalCount, options){integer}

Returns a font size based on the percentage of tweets relative to the total count
Name Type Description
count integer The local count.
totalCount integer The global count.
options Object The options object to set min and max font size and type (optional).
Returns:
interpolated font size.

staticRenderUtil.getYOffset(numEntries, spacing, offset){integer}

Returns a y offset required to vertical centre a number of entries based on spacing and offset
Name Type Description
numEntries integer The number of entries to render.
spacing integer The spacing between entries in pixels.
offset integer The offset from the top of the tile to centre on in pixels.
Returns:
y pixel offset.

staticRenderUtil.hexBlend(hexA, hexB, aIntoBPercentage){String}

Blends two hex code colors together, defaults to 50/50 blend
Name Type Description
hexA String The hex code color A.
hexB String The hex code color B.
aIntoBPercentage number The percentage to blend hexA into hexB (optional).
Returns:
blended hex code color value.

staticRenderUtil.hexBrightness(hex, factor){String}

Increases the brightness of a hex code color by a percentage factor
Name Type Description
hex String The hex code color.
factor float The percentage factor of increase.
Returns:
adjusted hex code color value.

staticRenderUtil.hexGreyscale(hex){String}

Converts a hex code color to greyscale using a luminosity based model
Name Type Description
hex String The hex code color.
Returns:
greyscale hex code color value.

staticRenderUtil.hexToRgb(hex){Object}

Converts a hex code color to its RGB counter part.
Name Type Description
hex String The hex code color.
Returns:
RGB color values.

staticRenderUtil.rgbToHex(rgb){String}

Converts an RGB color to its hex code counter part.
Name Type Description
rgb Object The RGB color.
Returns:
hex code color value.