Card

Card

The Card React element

Constructor

new Card()

Source:

Methods

calculateYPosition(layers, layer) → {integer}

Calculates the Y position of an element based on any attachments etc.
Parameters:
Name Type Description
layers object The object of all layers
layer object The layer to calculate the Y position for
Source:
Returns:
The Y position
Type
integer

computeFonts(fonts) → {array}

Compute the fonts needed for the card
Parameters:
Name Type Description
fonts object The fonts to use when rendering this card
Source:
Returns:
An array of React elements to render in the element of the SVG
Type
array

computeGradients(layers) → {array}

Compute the gradient elements to render to the element
Parameters:
Name Type Description
layers object The configuration object representing the layers that may require gradients
Source:
Returns:
An array of React elements to render to the element
Type
array

computeLayers(layers) → {array}

Compute the layers to render on the Card
Parameters:
Name Type Description
layers object The configuration object representing the layers to render
Source:
Returns:
An array of React elements to render on the card
Type
array

getLayerValue(layers, layer, key) → {mixed}

Returns the value for a given layer property
Parameters:
Name Type Description
layers object The object of all layers
layer object The layer to get the value for
key object The key of the value to get from the layer
Source:
Returns:
The value of the property on the layer
Type
mixed

render() → {object}

Renders the card
Source:
Returns:
JSX for the React Component
Type
object