new Legend(dependencies)
Creates a Legend from the axes of a canvas
Parameters:
Name | Type | Description |
---|---|---|
dependencies |
Object | : legend data |
Classes
Members
(static, constant) exports.computeItemSpaces
(static, constant) exports.createAxis
Creates an axis cell with a linear axis for computing space and
creating gradient legend
(static, constant) exports.createItemSkeleton
Creates legend item based on alignment and text orientation
(static, constant) exports.getLegendIcon
Returns the icon of the legend item
(static, constant) exports.renderAxis
Renders the axis for the gradient
(static, constant) exports.renderDiscreteItem
Renders the items in the legend i.e, icon and text
(static, constant) exports.renderStepItem
Renders the items in the legend i.e, icon and text
Methods
(static) create(dependencies) → {Instance}
Initializes an instance of the class
Parameters:
Name | Type | Description |
---|---|---|
dependencies |
Object | Set of dependencies required by the legend |
Returns:
returns a new instance of Legend
- Type
- Instance
(static) create(dependencies) → {Instance}
Initializes an instance of the class
Parameters:
Name | Type | Description |
---|---|---|
dependencies |
Object | Set of dependencies required by the legend |
Returns:
returns a new instance of Legend
- Type
- Instance
(static) create(dependencies) → {Instance}
Initializes an instance of the class
Parameters:
Name | Type | Description |
---|---|---|
dependencies |
Object | Set of dependencies required by the legend |
Returns:
returns a new instance of Legend
- Type
- Instance
(static) create(dependencies) → {Instance}
Initializes an instance of the class
Parameters:
Name | Type | Description |
---|---|---|
dependencies |
Object | Set of dependencies required by the legend |
Returns:
returns a new instance of Legend
- Type
- Instance
(static) elemType()
(static) elemType()
(static) getLabelSpaces(effPadding, align)
Parameters:
Name | Type | Description |
---|---|---|
effPadding |
* | |
align |
* |
(static) getLabelSpaces(effPadding, align)
Parameters:
Name | Type | Description |
---|---|---|
effPadding |
* | |
align |
* |
(static) getLabelSpaces(effPadding, align)
Parameters:
Name | Type | Description |
---|---|---|
effPadding |
* | |
align |
* |
(static) getTitleSpace() → {Object}
Returns the space occupied by the legend title
Returns:
Space occupied by title
- Type
- Object
(static) mount()
(static) render(mountPoint) → {Instance}
Render the legend with its title
Parameters:
Name | Type | Description |
---|---|---|
mountPoint |
DOM | Point where the legend and title are to be appended |
Returns:
Current instance of legend
- Type
- Instance
(static) render(mountPoint) → {Instance}
Render the legend with its title
Parameters:
Name | Type | Description |
---|---|---|
mountPoint |
DOM | Point where the legend and title are to be appended |
Returns:
Current instance of legend
- Type
- Instance
(static) render(mountPoint) → {Instance}
Render the legend with its title
Parameters:
Name | Type | Description |
---|---|---|
mountPoint |
DOM | Point where the legend and title are to be appended |
Returns:
Current instance of legend
- Type
- Instance
(static) render(mountPoint) → {Instance}
Render the legend with its title
Parameters:
Name | Type | Description |
---|---|---|
mountPoint |
DOM | Point where the legend and title are to be appended |
Returns:
Current instance of legend
- Type
- Instance
(static) renderTitle(container) → {Selection}
Creates the title for the legend
Parameters:
Name | Type | Description |
---|---|---|
container |
DOM | Container made for the title |
Returns:
Title and it's node
- Type
- Selection
(static) setLegendMeasures() → {Instance}
Sets the height and width of a legend based on provided max
height and width and based on its contents
Returns:
Current instance
- Type
- Instance