Instance Settings
A separate Relationships instance is created for each targetted division and has its own settings:
$(selector).relationships({...});
description | links | onSelect | opacity | set1 | set2
Name | Type | Default | Comments |
---|---|---|---|
opacity | number | 20 | The percentage (0 to 100) to which icons are faded when they are not selected. For comparison: 0% , 10% , 20% , 50% , 100% . |
set1 | object | {} | Details about the contents of the first set of items. See set settings below. |
set2 | object | {} | Details about the contents of the second set of items. See set settings below. |
links | int[][2] | null | The relationships between items in the first and second sets.
This is an array of arrays of two digits, being the indexes of
related items from set one and two. Indexes start at zero. For example, [[0, 0], [1, 0]] connects the first two
items from the first set with the first item in the second set. |
description | string | '' | The description for this relationship - displayed as a title. |
onSelect | function | null | A callback triggered when an icon is selected. The function receives
the set number (1 or 2), the item index within that set, and the label for the icon
as parameters. this refers to the relationships container.
|
Set Settings
Name | Type | Default | Comments |
---|---|---|---|
images | string | null | The location of the image file that depicts the items in this set. The image is a horizontal composite of all the item images with each item being associated with the matching position (by default). For example, this image is used for the integers example: . |
imageSize | int[2] | null | The size (width and height) of each item image within the images above.
For example, the value for the image above is [25, 29] . |
items | string[] or object[] | null | The item descriptions for display. If using a String[] that
just contains the descriptions, then the images for these items
are assumed to match their position in this array. Alternately, use an
Object[] to specify the description and
imageIndex for each item.
|