Members
(constant) ANGLE
Field referring to object storing the transforms
(constant) animateGroup
(constant) applyItemStyle
(constant) ARC
Field referring to object storing the transforms
(constant) arrangeComponents
(constant) attachDragEvent
Adds dragging action to the target element.
(constant) AXIS
Field referring to object storing the transforms
(constant) BAR
Field referring to object storing the transforms
(constant) BEFORE_UPDATE
Field referring to object storing the transforms
(constant) BORDER
The border for the grid
- Source:
(constant) BOTH
Field referring to object storing the transforms
(constant) BOTTOM
Field referring to object storing the transforms
(constant) BOTTOM_DIV_ID
The id attribute of the bottom div.
- Source:
(constant) BOTTOM_MATRIX_HEIGHT
Field to store the height of the bottom matrix.
- Source:
(constant) BOTTOM_TABLE_ID
The id attribute of the bottom table.
- Source:
(constant) BREAK_PAGE
Field that indicates spacing property for border
- Source:
(constant) breakMatrix
Breaks the matrix into two part
- Source:
(constant) calculateBandSpace
Calculates the logical space of the axis
(constant) calculateContinousSpace
Calculates the logical space of the axis
(constant) CARTESIAN
Field referring to object storing the transforms
(constant) CATEGORICAL
Field referring to object storing the transforms
(constant) CELL
Field referring to object storing the transforms
(constant) CENTER_DIV_ID
The id attribute of the center div.
- Source:
(constant) CENTER_TABLE_ID
The id attribute of the center table.
- Source:
(constant) COL
Field referring to object storing set of columns
(constant) COLLAPSE
Field that indicates collpase property for border
- Source:
(constant) COLOR
Field that indicates the color configuration
- Source:
(constant) COLOR
Field referring to object storing color field
(constant) COLUMN
Field referring to object storing set of columns
(constant) COLUMN_MATRIX_HEIGHT
Field that indicates the height of row matrix
- Source:
(constant) COLUMN_POINTER
The index of the first visible column in the view matrix.
- Source:
(constant) COLUMN_SIZE_IS_EQUAL
Flag to specify whether column sizes are equal.
- Source:
(constant) COLUMN_WIDTHS
Field to store an array an of the widths of visible columns.
- Source:
(constant) COLUMNS
Field referring to object storing set of columns
(constant) computeLayoutMeasurements
Computes the measurements of space for all matrices in the
layout
(constant) computeLogicalSpace
Computes the logical spcae taken by the matrix tree
- Source:
(constant) CONFIG
Field referring to object storing configuration properties.
(constant) createHeaders
- Source:
(constant) createLegend
- Source:
(constant) createMatrixEachLevel
Creates different level matrices
- Source:
(constant) createMatrixInstances
Creates matrix instancess
- Source:
(constant) createRetinalAxis
(constant) createSelection
Creates a selection set from a data set with corresponding attributes
(constant) createTree
Creates a hirachical tree from the context
- Source:
(constant) createValueCells
(constant) DATA_UPDATE_COUNTER
This file exports variables that are used as defaults for the crosstab group.
- Source:
(constant) dataTypeScaleMap
Map of DataModel types to associated field types.
(constant) dataTypeScaleMap
Map of DataModel types to associated field types.
(constant) DEFAULT_CONFIG
Default Configuration for the cells
- Source:
(constant) DEFAULT_CONFIGURATION
Default configuration of the layout
- Source:
(constant) DEFAULT_MEASUREMENTS
Default measurements for the layout
(constant) defaultConfig
(constant) defaultConfig
(constant) defaultConfig
Returns the default configuration of the visual unit
- Source:
(constant) DETAIL
Field referring to object storing detail field
(constant) DIMENSION
Field to store the array of dimensions to facet by.
(constant) DIMENSIONS
Field to store the array of dimensions to facet by.
(constant) DISTRIBUTION
Field that indicates spacing property for border
- Source:
(constant) drawLine
Draws a line from the points
Generates a svg path string
(constant) ENTRY_CELLS
Field referring to object storing the transforms
(constant) EXIT_CELLS
Field referring to object storing the transforms
(constant) extraCellsRemover
- Source:
(constant) extractUnitConfig
(constant) FACET
Field referring to object storing the transforms
(constant) FACET_HEADERS
Field referring to object storing the transforms
(constant) fadeUnfadeSelection
- Source:
(constant) findInGroup
(constant) focusUnfocusSelection
- Source:
(constant) FORMAT
Flag to specify format
(constant) generateAxisFromMap
(constant) generateMatrices
Generates matrices
(constant) getAxesScales
- Source:
(constant) getAxisKey
(constant) getAxisType
(constant) getCellKey
(constant) getDefaultMark
return a default mark based on predefined set of rules of type and subtype of the fields
(constant) getDistributedHeight
Distributeed heights returned
- Source:
(constant) getDistributedWidth
Distributed width returned
- Source:
(constant) getDomainBounds
(constant) getEncoder
(constant) getEncodingFieldInf
(constant) getGradientDomain
(constant) getHeaderAxisFrom
(constant) getHorizontalAxisSpace
(constant) getIndex
(constant) getInterpolatedData
(constant) getItemContainers
(constant) getItemMeasures
(constant) getLegendSpace
- Source:
(constant) getLogicalSpace
Get the logical space from the tree
- Source:
(constant) getMatrixModel
Gets Matrixes for corresponding datamodel, facets and projections
(constant) getMaxMeasures
(constant) getMinMeasures
Gives the min measues
- Source:
(constant) getRenderDetails
- Source:
(constant) getScaleInfo
(constant) getTranslatedPoints
Generates an array of objects containing x, y, width and height of the bars from the data
(constant) getValidTransform
(constant) getVerticalAxisSpace
(constant) getViewMatrices
Gets view matrices based on current pointers for row and column
(constant) getViewMeasurements
Returns measurements of the cells of the current matrix
(constant) GRID_BANDS
Field referring to object storing the transforms
(constant) GRID_HEIGHT
The height of the grid supplied by the user.
- Source:
(constant) GRID_LINES
Field referring to object storing the transforms
(constant) GRID_WIDTH
The width of the grid suppied by the user.
- Source:
(constant) GUTTERSPACE
Field that indicates spacing property for border
- Source:
(constant) HAS_DATA_UPDATED
Data update flag
(constant) HAVE_COLUMNS_CHANGED
Field that indicates if the column configuration has changed
- Source:
(constant) HAVE_ROWS_CHANGED
Field that indicates if the row configuration has changed
- Source:
(constant) HAVE_VALUES_CHANGED
Field that indicates if the values configuration for the center matrix has changed
- Source:
(constant) HEADER
Field referring to object storing the transforms
(constant) headerCreator
(constant) HEIGHT
Height of the crosstab.
(constant) ICON_MAP
Creates a map of pre defined icons
id
Returns the id of the axis.
(constant) initCanvas
Instantiate high level components. Canvas knows what all high level component it has.
- Source:
(constant) initializeCacheMaps
(constant) INITIALIZED
Field referring to object storing the transforms
(constant) INTERACTION
Field referring to object storing the transforms
(constant) isDistributionEqual
(constant) LAYERS
Field referring to object storing set of layers
(constant) LEFT
Field referring to object storing the transforms
(constant) LEFT_MATRIX_WIDTH
Field to store the width of the left matrix.
- Source:
(constant) LEFT_TABLE_ID
The id attribute of the left table element.
- Source:
(constant) legendCreator
- Source:
(constant) legendInitializer
- Source:
(constant) LINE
Field referring to object storing the transforms
(constant) LINEAR
Field referring to object storing the transforms
(constant) longtouch
Adds mouse interactions to target element.
(constant) makeLinearGradient
(constant) MARGIN
Flag to specify whether direction is vertical.
- Source:
(constant) MEASURE
Field to store array of measures to use as x axis.
(constant) MEASUREMENT
Field referring to object storing measurement configuration.
(constant) MEASURES
Field to store array of measures to use as x axis.
(constant) MIN_UNIT_HEIGHT
Height of visual unit.
(constant) MIN_UNIT_WIDTH
Width of visual unit in crosstab.
(constant) MOUNT
Mount point where the variable will be hosted
(constant) MOUNT_POINT
The dom element to render the layout inside.
- Source:
(constant) ORDINAL
Field referring to object storing the transforms
(constant) palette
Set of default colors
(constant) PIVOT
Flag to specify if model should be pivoted.
(constant) placeArrow
Places the arrow in the specified arrow position. It also applies appropriate arrow
class name to the arrow element.
- Source:
(constant) POINT
Field referring to object storing the transforms
(constant) POLAR
Field referring to object storing the transforms
(constant) prepareLayout
- Source:
(constant) PRIMARY
Field referring to object storing the transforms
(constant) RADIUS
Field referring to object storing the transforms
(constant) renderComponents
- Source:
(constant) renderIcon
(constant) reqAnimFrame
Returns the browser window object
- Source:
(constant) RETINAL
Field referring to object storing the transforms
(constant) retriveDomainFromData
(constant) RIGHT
Field referring to object storing the transforms
(constant) RIGHT_MATRIX_WIDTH
Field to store the width of the right matrix.
- Source:
(constant) RIGHT_TABLE_ID
The id attribute of the right table element.
- Source:
(constant) ROW
Field referring to object storing set of rows
(constant) ROW_HEIGHTS
Field to store an array of heights of visible rows.
- Source:
(constant) ROW_MATRIX_WIDTH
Field that indicates the width of row matrix
- Source:
(constant) ROW_POINTER
The index of the first visible row in view matrix.
- Source:
(constant) ROW_SIZE_IS_EQUAL
Flag to specify whether row sizes should be equal.
- Source:
(constant) ROWS
Contants to be used as attr
- Source:
(constant) ROWS
Field referring to object storing set of rows
(constant) SECONDARY
Field referring to object storing the transforms
(constant) setupChangeListener
- Source:
(constant) setupChangeListeners
(constant) SHAPE
Field referring to object storing shape field
(constant) shapeGenerator
- Source:
(constant) SHOW_COL_BORDERS
Field that indicates spacing property for border
- Source:
(constant) SHOW_ROW_BORDERS
Field that indicates spacing property for border
- Source:
(constant) SHOW_VALUE_BORDERS
Field that indicates spacing property for border
- Source:
(constant) SIZE
Field referring to object storing size field
(constant) spaceTakenByColumn
Gives the space taken by a column
- Source:
(constant) spaceTakenByRow
Gives the space taken by a row
- Source:
(constant) SPACING
Field that indicates spacing property for border
- Source:
(constant) strategies
(constant) strategy
This contains the strategy methods for showing tooltip in the chart.
- Source:
(constant) strategyGetter
(constant) strategyGetter
(constant) STYLE
Field that indicates the style object
- Source:
(constant) TEMPORAL
Field referring to object storing the transforms
(constant) titleCreator
(constant) TOP
Field referring to object storing the transforms
(constant) TOP_DIV_ID
The id attribute of the top div.
- Source:
(constant) TOP_MATRIX_HEIGHT
Field to store the height of the top matrix.
- Source:
(constant) TOP_TABLE_ID
The id attribute of the top table.
- Source:
(constant) touchdrag
Adds dragging action to the target element.
(constant) TRANSFORM
Field referring to object storing the transforms
(constant) transformData
(constant) transformFields
(constant) UNIT
Field referring to object storing the transforms
(constant) UNIT_HEIGHT
Field that indicates the unit height of layout
- Source:
(constant) UNIT_WIDTH
Field that indicates the unit width of layout
- Source:
(constant) UPDATED
Field referring to object storing the transforms
(constant) updateStyle
(constant) VALUE_MATRIX
Field referring to object storing the transforms
(constant) VIEW_INDEX
The index of top, bottom and center in the matrix
- Source:
(constant) WIDTH
Field that indicates width
- Source:
(constant) WIDTH
Width of the crosstab.
(constant) X
Width of the crosstab.
(constant) X_AXES
Field referring to object storing the transforms
(constant) Y
Width of the crosstab.
(constant) Y_AXES
Field referring to object storing the transforms
Methods
_calculateDomainFromData(data) → {Array}
Calculates the domain from the data.
It checks the type of field and calculates the domain based on that. For example, if it
is a quantitative or temporal field, then it calculates the min and max from the data or
if it is a nominal field then it gets all the values from the data of that field.
Parameters:
Name | Type | Description |
---|---|---|
data |
Array | DataArray |
Returns:
Domain values array.
- Type
- Array
addClass(className) → {Tooltip}
Sets the class name of tooltip
Parameters:
Name | Type | Description |
---|---|---|
className |
string | tooltip class name |
- Source:
Returns:
Instance of tooltip.
- Type
- Tooltip
addClass(element, className, selector, filterFn)
Adds a css class to elements which passes the filter function.If filter function is not given,
then all elements will be applied the class.
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | SVGElement | element |
className |
string | css class |
selector |
string | css selector |
filterFn |
function | filter method. |
- Source:
addLayer(layerDef) → {Array}
Adds a new layer to the visual unit. It takes a layer definition and creates layer instances from them. It does
not render the layers. It returns the layer instances in an array. If the layer definition is a composite layer,
then multiple layer instances will be returned in the array.
To add a layer in the unit,
```
unit.addLayer({
name: 'bullet',
mark: 'bar',
encoding: {
x: 'Year',
y: 'Acceleration',
color: 'Origin'
}
});
```
Parameters:
Name | Type | Description |
---|---|---|
layerDef |
Object | Definition of new layer. |
- Source:
Returns:
Array of layer instances.
- Type
- Array
angleToRadian(angle)
Parameters:
Name | Type | Description |
---|---|---|
angle |
* |
- Source:
appendElement(element1, element2)
This function appends a dom element in another element.
Parameters:
Name | Type | Description |
---|---|---|
element1 |
HTMLElement | SVGElement | The element in which to append the second element |
element2 |
HTMLElement | SVGElement | The element which will be appended. |
- Source:
applyBorders(cells, border, type, index)
Applies borders to the cells in a matrix
Parameters:
Name | Type | Description |
---|---|---|
cells |
Selection | Set of cells made from the matrix |
border |
Object | Border info for layout |
type |
string | Type of matrix(top/center/bottom) |
index |
number | Column index of matrix in the row |
applyInteractionStyle(set, config, config[0, interactionType, apply) → {SurrogateSideEffect}
Applies or removes interaction styles from plot elements. An array of row ids needs to be passed
which identifies the plot elements and applies styles to them.
To apply the interaction style,
```
const entryRowIds = entrySet[0].uids;
const interactionStyle = [{
type: 'fill',
intensity: [0, 0, 15, 0] // hsla configuration
}];
this.applyInteractionStyle(entryRowIds, interactionStyle, 'brighten', true);
```
Parameters:
Name | Type | Description |
---|---|---|
set |
Array | Array of row ids. |
config |
Array | Style configuration. |
config[0 |
Object | fill or stroke configuration. |
config[0].type |
string | Type of style - fill or stroke. |
config[0].intensity |
Array | hsla configuration. |
interactionType |
string | Type of interaction. This is needed for storing the styles for each type of interaction in the plot elements. |
apply |
boolean | Whether to apply or remove the interaction style. |
Returns:
Instance of surrogate side effect.
- Type
- SurrogateSideEffect
applyStyle(elem, styleObj) → {Element}
This function applies styles to an element
Parameters:
Name | Type | Description |
---|---|---|
elem |
Object | Element Selection |
styleObj |
Object | Style Object to be applied |
- Source:
Returns:
Newly Created Element
- Type
- Element
arraysEqual(arr1, arr2)
Parameters:
Name | Type | Description |
---|---|---|
arr1 |
* | |
arr2 |
* |
- Source:
axes() → {Object}
Returns the axes attached with the layer.
Returns:
Axes instances of the layer.
```
{
// x and y axis is only returned for cartesian layers
x: // X Axis Instance.
y: // Y Axis Instance.
color: // Color Axis instance
shape: // Shape Axis instance.
size: // Size Axis instance.
}
```
- Type
- Object
axes() → {Object}
Returns the axis instances attached to this visual unit.
Returns:
Axis instances.
```
{
x: [PrimaryAxis, SecondaryAxis], // First element in array is primary x axis and the second element
is the secondary x axis.
y: [PrimaryAxis, SecondaryAxis], // First element in array is primary y axis and the second element
is the secondary y axis.
color: [ColorAxis],
shape: [ShapeAxis],
size: [SizeAxis]
}
```
- Type
- Object
axisPlaceholderGn(context, selectionObj, cells)
Parameters:
Name | Type | Description |
---|---|---|
context |
* | |
selectionObj |
* | |
cells |
* |
barEnterFn(elem, d)
Parameters:
Name | Type | Description |
---|---|---|
elem |
* | |
d |
* |
calcColSpan(colData, colIdx, matrix, rIdx) → {number}
This callback is used to calculate the rowspan
by checking for repeating entries in subsequent rows
at the specified column.
Parameters:
Name | Type | Description |
---|---|---|
colData |
Placeholder | Instance of placeholder. |
colIdx |
number | The index of the placeholder in the array. |
matrix |
Array | The 2d array for which filtering is to be done |
rIdx |
number | The index of the row of the placeholder in array. |
Returns:
The row span.
- Type
- number
calcRowSpan(colData, colIdx, matrix, rIdx) → {number}
This callback is used to calculate the rowspan
by checking for repeating entries in subsequent rows
at the specified column.
Parameters:
Name | Type | Description |
---|---|---|
colData |
Placeholder | Instance of placeholder. |
colIdx |
number | The index of the placeholder in the array. |
matrix |
Array | The 2d array for which filtering is to be done |
rIdx |
number | The index of the row of the placeholder in array. |
Returns:
The row span.
- Type
- number
canvas() → {Canvas}
Creates an instance of Canvas
- Source:
Returns:
Instance of canvas
- Type
- Canvas
capitalizeFirst(text) → {string}
Capitalizes the first letter of the word
Parameters:
Name | Type | Description |
---|---|---|
text |
string | word |
- Source:
Returns:
Capitalized word
- Type
- string
cellRegistry(override) → {Env|object}
Components of Muze are loaded from registry. User can override the default component by overriding the registry
with new component definition.
Muze creates multiple cells to house the visualization components. Those are called Cells.
`cellRegistry` is the registry for those cells.
- SimpleCell
- TextCell
- AxisCell
- GeomCell
- BlankCell
This funciton acts as getter and setter.
When acts as a getter this returns the list of registries you can extend.
When acts as a setter this allows user to register a component for a existing key. During the process of setting
a new component in registry, it is not allowed to create a new key.
```
const GeomCell = env.cellRegistry().GeomCell;
env.cellRegistry({
GeomCell: class NewGeomCell extends GeomCell {
render () {
// override the render
}
}
});
```
When called as a setter
Parameters:
Name | Type | Description |
---|---|---|
override |
Object | Key value pair where keys are the name of the cells user with to override. Allowed keys are - `SimpleCell` - `TextCell` - `AxisCell` - `GeomCell` - `BlankCell` And value being the overridden class definition. |
- Source:
Returns:
-
Instance of current environment When called as a getter
- Type
- Env
-
Object containing the registration key and class definition ``` { SimpleCell: SimpleCell, TextCell: TextCell, AxisCell: AxisCell, GeomCell: GeomCell, BlankCell: BlankCell } ```
- Type
- object
cellRegistry() → {Object}
Creates a registry for the cells, which can be used for
setting a new cell or getting the registered cells
- Source:
Returns:
Setters and getters for registered cells
- Type
- Object
cellSpanMaker(matrix, type, index) → {Object}
This function is used to set the col and row spans
for the matrices based on repeated/hierarchichal data
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Array | The 2d array for which filtering is to be done |
type |
string | Type of array (center, top, bottom) |
index |
number | Index of array in the row |
Returns:
containing the view matrix and their spans
- Type
- Object
centerMatrix(matrix) → {Layout|Object}
Sets/Gets the matrix for value
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Object | matrices for the layout |
Returns:
Gets the matrix/ Returns this instance when set
- Type
- Layout | Object
changeTickOrientation(tickText, axisInstance)
Parameters:
Name | Type | Description |
---|---|---|
tickText |
* | |
axisInstance |
* |
- Source:
checkExistence(keys, obj) → {Object}
Checks the existence of keys in an object
Parameters:
Name | Type | Description |
---|---|---|
keys |
Array | Set of keys which are to be checked |
obj |
Object | whose keys are checked from the set of keys provided |
- Source:
Returns:
Error if the keys are absent, or the object itself
- Type
- Object
checkPath(str)
Parameters:
Name | Type | Description |
---|---|---|
str |
* |
checkPath(str)
Parameters:
Name | Type | Description |
---|---|---|
str |
* |
clearCaching() → {VisualUnit}
Clears all the previous cached data.
- Source:
Returns:
Instance of visual unit.
- Type
- VisualUnit
click(instance, targetEl, behaviours)
Adds mouse interactions to target element.
Parameters:
Name | Type | Description |
---|---|---|
instance |
VisualUnit | instance of visual unit. |
targetEl |
SVGElement | Element on which the event listeners will be attached. |
behaviours |
Array | Array of behaviours |
clipElement(container, measurement, id)
Clips an element with given measurement. Basically it is used to hide overflowing portions
of any element.
Parameters:
Name | Type | Description |
---|---|---|
container |
SVGElement | svg element which needs to be clipped. |
measurement |
Object | Dimensions of the clipped rectangle. |
id |
string | Unique id of the clip element |
- Source:
clone(o) → {Object}
Deep copies an object and returns a new object.
Parameters:
Name | Type | Description |
---|---|---|
o |
Object | Object to clone |
- Source:
Returns:
New Object.
- Type
- Object
color(encoding) → {Canvas}
Takes a variable and assign it to color encoding channel. Color scale is created based on the type of the
varaible assigned. If a dimension is passed, the discrete color scale is created. If a measure is passed gradient
color scale is created.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
encoding |
string | object | Name of the variable which is assigned to color encoding channel or an object
containing scale information
Properties
|
- Source:
Returns:
Instance of current canvas
- Type
- Canvas
colorInterpolator()
Gets the rgb interpolator from d3 color
- Source:
columnFilter(colData, colIdx, matrix, rIdx, type) → {boolean}
This callback is used to filter the array of
placeholder cells and filter out cells which have
appeared in a previous row.
Parameters:
Name | Type | Description |
---|---|---|
colData |
Placeholder | Instance of placeholder. |
colIdx |
number | The index of the placeholder in array. |
matrix |
Array | The 2d array for which filtering is to be done |
rIdx |
number | The index of the row of the placeholder in array. |
type |
string | The type of matrix it is (rowLeft, rowRight, colTop, colBottom) |
Returns:
flag to keep/remove element.
- Type
- boolean
columnMatrix(matrix) → {Layout|Object}
Sets/Gets the matrix for columns
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Object | matrices for the layout |
Returns:
Gets the matrix/ Returns this instance when set
- Type
- Layout | Object
columns(bottomVars, topVars) → {Canvas}
Takes the variable using which the column facets are made. Columns facets are vertical facet. The variables in
parameter of the method controls presentation of facets can have different variations.
Parameters:
Name | Type | Description |
---|---|---|
bottomVars |
Array.<string> | null | Variables using which the bottom facets are created |
topVars |
Array.<string> | null | Variables using which the top facets are created |
- Source:
Returns:
Instance of current canvas
}
- Type
- Canvas
concatModels(dm1, dm2)
Parameters:
Name | Type | Description |
---|---|---|
dm1 |
* | |
dm2 |
* |
- Source:
config() → {Object}
Returns the configuration of the layer.
Returns:
Configuration of layer.
- Type
- Object
config(config) → {BarLayer|Object}
Sets the configuration of a layer.Configuration includes encoding and other configuration such as transform,
transition, className, etc.
When used as setter,
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Layer configuration
Properties
|
Returns:
-
Instance of bar layer When used as getter,
- Type
- BarLayer
-
Layer configuration.
- Type
- Object
config(config) → {Env}
Sets the configuration for canvases. User passed configuration is merged with default configuration and then
set to canvas
This is a getter-setter function.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Partial or full configuration of canvas.
Properties
|
- Source:
Returns:
Instance of the environment
- Type
- Env
config(config) → {TextLayer|Object}
Sets the configuration of a layer.Configuration includes encoding and other configuration such as transform,
transition, className, etc.
When used as setter,
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Layer configuration
Properties
|
Returns:
-
Instance of text layer When used as getter,
- Type
- TextLayer
-
Layer configuration.
- Type
- Object
config(config) → {AreaLayer|Object}
Sets the configuration of a layer.Configuration includes encoding and other configuration such as transform,
transition, className, etc.
When used as setter,
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Layer configuration
Properties
|
Returns:
-
Instance of area layer When used as getter,
- Type
- AreaLayer
-
Layer configuration.
- Type
- Object
config(config) → {ArcLayer|Object}
Sets the configuration of a layer.Configuration includes encoding and other configuration such as transform,
transition, className, etc.
When used as setter,
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Layer configuration
Properties
|
Returns:
-
Instance of arc layer When used as getter,
- Type
- ArcLayer
-
Layer configuration.
- Type
- Object
config(config) → {Object}
Returns the config of the layer
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | Configuration of layer |
Returns:
configuration of layer
- Type
- Object
config()
Property accessor for config of the class. Config is passed as an object.
- Source:
config(config) → {LineLayer|Object}
Sets the configuration of a layer.Configuration includes encoding and other configuration such as transform,
transition, className, etc.
When used as setter,
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Layer configuration
Properties
|
Returns:
-
Instance of line layer When used as getter,
- Type
- LineLayer
-
Layer configuration.
- Type
- Object
config(config) → {TickLayer|Object}
Sets the configuration of a layer.Configuration includes encoding and other configuration such as transform,
transition, className, etc.
When used as setter,
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Layer configuration
Properties
|
Returns:
-
Instance of Tick layer When used as getter,
- Type
- TickLayer
-
Layer configuration.
- Type
- Object
config(config) → {Layout|Object}
Sets/Gets the config for the layout
Parameters:
Name | Type | Description |
---|---|---|
config |
Object | configuration for the layout |
Returns:
Gets the Config/ Returns this instance when set
- Type
- Layout | Object
config(config) → {PointLayer|Object}
Sets the configuration of a layer.Configuration includes encoding and other configuration such as transform,
transition, className, etc.
When used as setter,
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | Layer configuration
Properties
|
Returns:
-
Instance of Point layer When used as getter,
- Type
- PointLayer
-
Layer configuration.
- Type
- Object
config(…config) → {Tooltip}
Sets the configuration of tooltip.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
Object |
<repeatable> |
Configuration of tooltip |
- Source:
Returns:
Instance of tooltip
- Type
- Tooltip
convertToVar(fields, datamodel)
Parameters:
Name | Type | Description |
---|---|---|
fields |
* | |
datamodel |
* |
create(idopt, data, layers, config) → {VisualUnit}
Static helper for creates a unit instance
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
Object |
<optional> |
optional unique identifier for a unit; , id is calculated internally |
data |
DataModel | instance of datamodel | |
layers |
Array.<Layer> | layer configuration | |
config |
Object | configurtion for the visual unit |
- Source:
Returns:
Instance of a unit
- Type
- VisualUnit
createAxisCells(selection, axes, axisIndex, cells) → {Object}
Creates axis cells based on the set of axes
Parameters:
Name | Type | Description |
---|---|---|
selection |
Selection | Contains a selection of the axis units |
axes |
Array | Actual axis units |
axisIndex |
number | 0-> primary axis, 1-> secondary axis(when dual axis is made) |
cells |
Object | Contains a collection of the cells |
Returns:
return either set of axis/blank cells depending on the config
- Type
- Object
createElement(tag, mount) → {Object}
This function appends a dom element in another element.
Parameters:
Name | Type | Description |
---|---|---|
tag |
Object | The tag name of the element to append |
mount |
Object | Mount point fo the element |
- Source:
Returns:
selection of the appended element
- Type
- Object
createElements(params)
Creates svg or html elements by binding data to the selection.Removes extra elements
on exit.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | Parameter object
Properties
|
- Source:
createHeading(config, type, labelManager, cell)
Parameters:
Name | Type | Description |
---|---|---|
config |
* | |
type |
* | |
labelManager |
* | |
cell |
* |
- Source:
createScale(params) → {Object}
This function is used to create a scale that is assigned to
an instance of axis.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | the input parameters to create a Scale object
Properties
|
- Source:
Returns:
instance of scale
- Type
- Object
createSelectedDataModel(datamodel, fieldNames, fieldValues) → {Object}
Creates a selected datamodel from a parent datamodel and a set of field names
Parameters:
Name | Type | Description |
---|---|---|
datamodel |
Object | provided as input |
fieldNames |
Array | schema names |
fieldValues |
Array | values of those schema names to be selected |
Returns:
creates a new selected datamodel
- Type
- Object
createShape(d, elem)
Parameters:
Name | Type | Description |
---|---|---|
d |
* | |
elem |
* |
createShape(d, elem)
Parameters:
Name | Type | Description |
---|---|---|
d |
* | |
elem |
* |
createSimpleAxis(axisInfo, field, axesCreators)
Parameters:
Name | Type | Description |
---|---|---|
axisInfo |
* | |
field |
* | |
axesCreators |
* |
createTextCells(selection, headers, cells, labelManager) → {Object}
Creates header cells based on the set of headers
Parameters:
Name | Type | Description |
---|---|---|
selection |
Object | Contains a selection of the header units |
headers |
string | Contains a list of the headers |
cells |
Object | Contains a collection of the cells |
labelManager |
Object | smart label instance |
Returns:
return either set of header cells depending on the config
- Type
- Object
data()
Property accessor for data member of the class. Data is passed to the system by calling this method.
- Source:
data(data) → {BaseLayer}
Updates the layer with new data model.
Parameters:
Name | Type | Description |
---|---|---|
data |
DataModel | Instance of new data model. |
Returns:
Instance of layer.
- Type
- BaseLayer
data(data) → {VisualUnit}
Updates the visual unit with new data model. This also internally updates the datamodel of all the layers and
rerenders them.
Parameters:
Name | Type | Description |
---|---|---|
data |
DataModel | Instance of new data model. |
Returns:
Instance of visual unit.
- Type
- VisualUnit
data(data) → {Env}
Sets the data configuration property.
This is a getter-setter function.
Parameters:
Name | Type | Description |
---|---|---|
data |
DataModel | Instance of datamodel to be visualized |
- Source:
Returns:
Instance of the environment
- Type
- Env
data(dataModel) → {DataModel}
Acts as a getter or setter function
When setter
Returns the datamodel of the layer
Parameters:
Name | Type | Description |
---|---|---|
dataModel |
DataModel | instance of DataModel |
Returns:
DataModel instance of the layer
- Type
- DataModel
defaultConfig() → {Object}
Returns the default configuration of tooltip
- Source:
Returns:
Configuration of tooltip.
- Type
- Object
defaultConfig() → {Object}
Returns the default configuration of simple axis
Returns:
default configurations
- Type
- Object
defaultConfig() → {Object}
Returns the default configuration of tooltip
- Source:
Returns:
Configuration of tooltip.
- Type
- Object
defaultSizeValue() → {number}
Returns the default area value of the anchor point.
Returns:
Default area value of anchor.
- Type
- number
dehighlightPoint() → {BaseLayer}
Abstract method for deselecting points
Returns:
Instance of base layer
- Type
- BaseLayer
dependencies(dependencies) → {BaseLayer}
Sets or gets the dependencies.
Parameters:
Name | Type | Description |
---|---|---|
dependencies |
Object | Dependencies needed by layer |
Returns:
Instance of base layer.
- Type
- BaseLayer
detail(encoding) → {Canvas}
Takes a dimension which wont be assigned in any encoding channels but would be used to mantain granularity of
data.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
encoding |
string | object | Name of the variable which is assigned to size encoding channel or an object
containing scale information.
Properties
|
- Source:
Returns:
Instance of current canvas
- Type
- Canvas
discreteRange(domainValue, scale, domain, uniqueVals)
Parameters:
Name | Type | Description |
---|---|---|
domainValue |
* | |
scale |
* | |
domain |
* | |
uniqueVals |
* |
dispatchBehaviour(behaviour, payload) → {GroupFireBolt}
Dispatches a behavioural action with a payload. It takes the name of the behavioural action and a payload
object which contains the criteria aend an array of side effects which determines what side effects are
going to be shown in each visual unit of the canvas. It prepares the datamodel from the given criteria
and initiates a propagation from the datamodel of canvas. Then all the visual units of canvas which listens
to the propagation gets informed on which rows got selected and dispatches the behavioural action sent during
propagation.
To dispatch a behavioural action on the canvas
```
// Get the firebolt instance of the canvas
const firebolt = canvas.firebolt();
// Dispatch a brush behaviour
firebolt.dispatchBehaviour('brush', {
// Selects all the rows with Horsepower having range between 100 and 200.
criteria: {
Horsepower: [100, 200]
}
});
// On dispatch of this behavioural action, a selection box gets created and plots gets faded out which are the
// default side effects mapped to this behavioural action.
```
```
Additionally, it can also be passed an array of side effects in the payload.
// Dispatch a select behaviour with only crossline as side effect.
firebolt.dispatchBehaviour('select', {
criteria: {
Cylinders: ['8']
},
sideEffects: ['crossline']
});
```
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
behaviour |
string | Name of the behavioural action | |||||||||
payload |
Object | Object which contains the interaction information.
Properties
|
Returns:
Instance of firebolt.
- Type
- GroupFireBolt
drawArea(params)
Draws a line from the points
Generates a svg path string
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | Contains container, points and interpolate attribute. |
drawText(container, data) → {Selection}
Draws svg text in the specified container.
Parameters:
Name | Type | Description |
---|---|---|
container |
SVGElement | Container where labels will be appended. |
data |
Array.<Object> | Data of the elements. |
Returns:
d3 selection of the elements.
- Type
- Selection
enableCaching() → {VisualUnit}
Caches all the datamodels in an array from the next `data()` call on visual unit until `clearCaching()` or
`resetData()` is called on it.
- Source:
Returns:
Instance of visual unit.
- Type
- VisualUnit
enableChainedTransaction(transactionModel, transactionEndpoint, transactionItems) → {any}
Description @todo
Parameters:
Name | Type | Description |
---|---|---|
transactionModel |
any | @todo |
transactionEndpoint |
any | @todo |
transactionItems |
any | @todo |
- Source:
Returns:
@todo
- Type
- any
equals() → {Boolean}
Returns true if two variable instances are same.If both variable has the same field names, they are equal.
Returns:
Whether two variable instances are same.
- Type
- Boolean
escapeHTML(str)
Parameters:
Name | Type | Description |
---|---|---|
str |
* |
- Source:
facetByFields() → {Array}
Returns the facet field names and their values associated with this visual unit.
Returns:
Facet field information.
```
[
['Cylinders', 'Origin'], // First array defines the name of the facet fields.
['8', 'USA'] // Second array defines the values of the corresponding facet fields.
]
```
- Type
- Array
fields() → {Object}
Returns the axis fields of the visual unit. It returns the variable instances of the primary and secondary axis
fields attached with the visual unit.
Returns:
X and Y Axis fields.
```
{
x: [SimpleVariable/ComposedVar, SimpleVariable/ComposedVar],
y: [SimpleVariable/ComposedVar,SimpleVariable/ComposedVar]
}
```
- Type
- Object
filterPropagationModel(model, propModel)
Parameters:
Name | Type | Description |
---|---|---|
model |
* | |
propModel |
* |
- Source:
findInPage(i, page)
Parameters:
Name | Type | Description |
---|---|---|
i |
* | |
page |
* |
- Source:
firebolt() → {Firebolt}
Returns the instance of firebolt associated with this visual unit. Firebolt dispatches the behavioural actions
when any physical action happens on the elements of visual unit.
- Source:
Returns:
Instance of firebolt.
- Type
- Firebolt
generateGetterSetters(context, props)
Parameters:
Name | Type | Description |
---|---|---|
context |
* | |
props |
* |
- Source:
generatePlaceholders(normalizedOptions, matrices, projections, cells, labelManager) → {Object}
Creates a set of placeholders as a part of selection object
Parameters:
Name | Type | Description |
---|---|---|
normalizedOptions |
Array | contains normalized rows and columns |
matrices |
Array | contains axis and value matrices |
projections |
aArrayny | contains set of row and column projections |
cells |
Object | Contains a collection of the cells |
labelManager |
Object | smart label instance |
Returns:
Creates a set of placeholders as a part of selections
- Type
- Object
getArraySum(arr, prop)
Parameters:
Name | Type | Description |
---|---|---|
arr |
* | |
prop |
* |
- Source:
getAxisConfig(axisInfo, field, axesCreators)
Parameters:
Name | Type | Description |
---|---|---|
axisInfo |
* | |
field |
* | |
axesCreators |
* |
getAxisOffset(timeDiff, range, domain)
Parameters:
Name | Type | Description |
---|---|---|
timeDiff |
* | |
range |
* | |
domain |
* |
getD3Drag() → {Object}
Gets the d3 drag function
- Source:
Returns:
d3 drag
- Type
- Object
getDataDomain() → {Object}
Gets the domain for all axes of this visual unit.
- Source:
Returns:
Domains of each data field.
- Type
- Object
getDataModelFromIdentifiers(dataModel, identifiers)
Parameters:
Name | Type | Description |
---|---|---|
dataModel |
* | |
identifiers |
* |
- Source:
getDataModelFromRange(dataModel, criteria)
Parameters:
Name | Type | Description |
---|---|---|
dataModel |
* | |
criteria |
* |
- Source:
getDependencyOrder(graph) → {Object}
DESCRIPTION TODO
Parameters:
Name | Type | Description |
---|---|---|
graph |
Object | graph whose dependency order has to be generated |
- Source:
Returns:
- Type
- Object
getDomain(encodingType) → {Object}
Returns the domain for the axis.
Parameters:
Name | Type | Description |
---|---|---|
encodingType |
string | type of encoding x, y, color, etc. |
Returns:
Axis domains
- Type
- Object
getDomainFromData(data, fields, fieldType) → {Array}
Gets the domain from the data based on the field name and type of field
Parameters:
Name | Type | Description |
---|---|---|
data |
Array.<Object> | Array.<Array> | Data Array |
fields |
Array.<string> | Array of fields from where the domain will be calculated |
fieldType |
string | Type of field - nominal, quantitiative, temporal. |
- Source:
Returns:
Usually contains a min and max value if field is quantitative or
an array of values if field type is nominal or ordinal
- Type
- Array
getDrawingContext() → {Object}
Returns the drawing information from visual unit.Drawing context contains the dimensions of unit and the svg
container of the visual unit.
- Source:
Returns:
Drawing information.
```
{
htmlContainer: // Html container of svg container of the visual unit
svgContainer: // Root svg container
width: // Width of the visual unit
height: // Height of the visual unit
sideEffectGroup: // Svg group for drawing side effect elements.
parentContainer: // Parent html container of the visual unit.
xOffset: // x offset space from the starting x position of the container,
yOffset: // y offset space from the starting y position of the container
}
```
- Type
- Object
getElementsByClassName(node, className) → {HTMLElement|SVGElement}
Returns the element of the corresponding classname.
Parameters:
Name | Type | Description |
---|---|---|
node |
HTMLElement | SVGElement | html or svg node element. |
className |
string | css class to be applied. |
- Source:
Returns:
html or svg element.
- Type
- HTMLElement | SVGElement
getEvent() → {Object}
Gets the d3 event function
- Source:
Returns:
d3 event
- Type
- Object
getExtremePoint(points, compareValue, minOrMax) → {Object}
Returns the maximum or minimum points of a compare value from an array of objects.
Parameters:
Name | Type | Description |
---|---|---|
points |
Array | Array of objects |
compareValue |
string | Key in the object on which the comparing will be done. |
minOrMax |
string | minimum or maximum. |
- Source:
Returns:
Minimum or maximum point.
- Type
- Object
getFieldNames(fields1, fields2opt)
Gets name of fields form the variables
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
fields1 |
* | |||
fields2 |
* |
<optional> |
[] |
getLayerByName(name) → {VisualUnit}
Returns the layer instance which matches the supplied layer name. If no layer is found, then it returns
undefined.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of layer. |
- Source:
Returns:
Layer instance.
- Type
- VisualUnit
getLayersByType(type) → {Array}
Returns an array of layer instances which matches the supplied mark type.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Mark type of layer. |
- Source:
Returns:
Array of layer instances.
- Type
- Array
getMatrixMeasurement(matrix, type) → {Object}
Gets measurement for an instance of visual matrix
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Array | instance of visual matrix |
type |
string | height/width |
Returns:
Logical height/width of the matrix
- Type
- Object
getMax(data, field) → {number}
Gets the maximum value from an array of objects for a given property name
Parameters:
Name | Type | Description |
---|---|---|
data |
Array.<Object> | Array of objects |
field |
string | Field name |
- Source:
Returns:
Maximum value
- Type
- number
getMaxPoint(points, compareValue) → {Object}
Returns the maximum point of a compare value from an array of objects.
Parameters:
Name | Type | Description |
---|---|---|
points |
Array | Array of objects |
compareValue |
string | Key in the object on which the comparing will be done. |
- Source:
Returns:
Maximum point.
- Type
- Object
getMeasureInfo(isTransposed)
Parameters:
Name | Type | Description |
---|---|---|
isTransposed |
* |
- Source:
getMembers() → {Array}
Return the field names associated with this variable instance.
Returns:
Array of fields.
- Type
- Array
getMin(data, field) → {number}
Gets the minimum value from an array of objects for a given property name
Parameters:
Name | Type | Description |
---|---|---|
data |
Array.<Object> | Array of objects |
field |
string | Field name |
- Source:
Returns:
Minimum value
- Type
- number
getMinDiff() → {number}
Returns the minimum consecutive difference between the data values of this variable.
Returns:
Minimum consecutive difference.
- Type
- number
getMinPoint(points, compareValue) → {Object}
Returns the minimum point of a compare value from an array of objects.
Parameters:
Name | Type | Description |
---|---|---|
points |
Array | Array of objects |
compareValue |
string | Key in the object on which the comparing will be done. |
- Source:
Returns:
Minimum point.
- Type
- Object
getMousePos(element, event) → {Object}
Gets the mouse position relative to an svg type of element
Parameters:
Name | Type | Description |
---|---|---|
element |
SVGElement | Any svg element like rect, circle, etc. |
event |
Event | Event object. |
- Source:
Returns:
x and y position relative to the container element passed.
- Type
- Object
getNearestPoint() → {BaseLayer}
Abstract method for getting nearest point
Returns:
Instance of base layer
- Type
- BaseLayer
getNearestPoint(x, y, config) → {Object}
Returns the point located nearest to the supplied x and y position. It returns the unique identifiers of the
point. This function also accepts an additional configuration `getAllPoints` inside `config` object in the third
argument which if set to true, then it returns the identifiers of all the points which falls on the nearest
x value or y value if any one of the field is a dimension. Additionally, a target property is also returned
which contains the identifier of the nearest point. If no nearest point is found, then it returns identifier
as null.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
x |
number | X Position of the point from where nearest point is to be found. | |||||||||
y |
number | Y Position of the point from where nearest point is to be found. | |||||||||
config |
Object | Additional configuration options.
Properties
|
- Source:
Returns:
Nearest point information
```
{
id: [['Origin'], ['USA'], ['Japan']], // Identifiers of all the points closest to the x value.
target: [['Origin'], ['Japan']] // Identifier of the nearest point.
}
```
- Type
- Object
getNearestRange(v1, v2) → {Array}
Gets the nearest range value from the given range values.
Parameters:
Name | Type | Description |
---|---|---|
v1 |
number | Start range value |
v2 |
number | End range value |
Returns:
range values
- Type
- Array
getObjProp(obj, …fields)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
* | ||
fields |
* |
<repeatable> |
- Source:
getPlotPointsFromIdentifiers(identifiers, config) → {Array}
Get the information of all the marks such as x, y position and size from supplied identifiers. It
returns an array of points whose data matches the given identifiers.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
identifiers |
Array | Object | Field names and their corresponding values. ``` identifiers can be given in an array of array, ['Origin', 'Name'], // Names of the fields supplied in first array ['USA', 'ford'], // Data values of each field supplied in rest of the arrays. ['Japan', 'ford'] or in an object, { Origin: ['USA'] } ``` | |||||||||||||||
config |
Object | Optional configurations which decides which information of the mark will
be retrieved.
Properties
|
- Source:
Returns:
Array of objects containing the information of each point.
```
By default, the method returns the array of points in this structure,
[
{
x: 20,
y: 100,
width: 200,
height: 100
}
]
If 'config.getAllAttrs' is true, then it returns all the information of each mark,
[
// Positions of mark on initial state of transition.
enter: {
x: 0,
y: 0
},
// Final positions of the mark
update: {
x: 20,
y: 10
},
style: // css styles of each mark
source: [200, 'USA'] // Row information of each mark
id: 20 // Row id of each mark
]
```
- Type
- Array
getScaleType(domainType, rangeType, steps)
Parameters:
Name | Type | Description |
---|---|---|
domainType |
* | |
rangeType |
* | |
steps |
* |
- Source:
getScheme(scheme) → {Object}
Accepts a scheme in a string format and returns the scale from d3-scale-chromatic
Parameters:
Name | Type | Description |
---|---|---|
scheme |
string | a string representing the kind of scheme for the color axis |
- Source:
Returns:
The corresponding scale from a scheme type from d3 chromatic scale
- Type
- Object
getSchemeType(scheme)
Parameters:
Name | Type | Description |
---|---|---|
scheme |
* |
- Source:
getSkeletons(context, mount)
Parameters:
Name | Type | Description |
---|---|---|
context |
* | |
mount |
* |
- Source:
getUniqueId() → {string}
Returns unique id
- Source:
Returns:
Unique id string
- Type
- string
getWindow() → {Window}
Returns the browser window object
- Source:
Returns:
Window object
- Type
- Window
hasOwn(source, property) → {boolean}
Checks if the property string is present in the source object
Parameters:
Name | Type | Description |
---|---|---|
source |
Object | source object whom you want to check the property |
property |
string | key name that need to be checked |
Returns:
returns true if the property found in the source object
- Type
- boolean
headerCreator(config, cellType, labelManager, prevCell)
Parameters:
Name | Type | Description |
---|---|---|
config |
* | |
cellType |
* | |
labelManager |
* | |
prevCell |
* |
- Source:
headerPlaceholderGn(context, selectionObj, cells, labelManager)
Parameters:
Name | Type | Description |
---|---|---|
context |
* | |
selectionObj |
* | |
cells |
* | |
labelManager |
* |
height()
Property accessor for height of the class. Height is passed as an integer.
- Source:
height(width) → {Env}
Sets the height configuration property. Height in px is total horizontal space each canvas should take.
This is a getter-setter function.
Parameters:
Name | Type | Description |
---|---|---|
width |
Number | Height of the visualization area |
- Source:
Returns:
Instance of the environment
- Type
- Env
hide() → {Tooltip}
Hides the tooltip element.
- Source:
Returns:
Instance of tooltip.
- Type
- Tooltip
highlightPoint() → {BaseLayer}
Abstract method for highlighting points
Returns:
Instance of base layer
- Type
- BaseLayer
hslInterpolator()
Gets the hsl interpolator from d3 color
- Source:
hslToRgb(Number, Number, Number)
Converts an HSL color value to RGB. Conversion formula
adapted from http://en.wikipedia.org/wiki/HSL_color_space.
Assumes h, s, and l are contained in the set [0, 1] and
returns r, g, and b in the set [0, 255].
Parameters:
Name | Type | Description |
---|---|---|
Number |
h The hue | |
Number |
s The saturation | |
Number |
l The lightness |
- Source:
Returns:
Array The RGB representation
hsvToRgb(Number, Number, Number)
Converts an HSV color value to RGB. Conversion formula
adapted from http://en.wikipedia.org/wiki/HSV_color_space.
Assumes h, s, and v are contained in the set [0, 1] and
returns r, g, and b in the set [0, 255].
Parameters:
Name | Type | Description |
---|---|---|
Number |
h The hue | |
Number |
s The saturation | |
Number |
v The value |
- Source:
Returns:
Array The RGB representation
html(strings, exps) → {function}
A string template tagged function which sanitizes input html formatted string according to the allowed html tags.
This is used to render html in canvas components like title and tooltip.
To render html in canvas components,
```
canvas.title(html`TITLE`);
```
Parameters:
Name | Type | Description |
---|---|---|
strings |
Array.<string> | The string parts of the template. |
exps |
Array | The list of evaluated expression values. |
- Source:
Returns:
Returns a function which returns the sanitized html string.
- Type
- function
id() → {string}
Returns the unique id of this visual unit.
- Source:
Returns:
Unique identifier.
- Type
- string
id() → {string}
Returns the unique identifier of this layer
Returns:
id of the layer
- Type
- string
indexedDomain(domain)
Parameters:
Name | Type | Description |
---|---|---|
domain |
* |
indexedDomain(domain)
Parameters:
Name | Type | Description |
---|---|---|
domain |
* |
indexedDomainMeasure(domain)
Parameters:
Name | Type | Description |
---|---|---|
domain |
* |
indexedRange(domainValue, scale, domain)
Parameters:
Name | Type | Description |
---|---|---|
domainValue |
* | |
scale |
* | |
domain |
* |
interpolator()
Gets the interpolator function from d3 color
- Source:
intSanitizer(val) → {number|null}
Sanitize an input number / string mixed number. Currently dot in the no is not supported.
Parameters:
Name | Type | Description |
---|---|---|
val |
number | string | pure number or string mixed number |
- Source:
Returns:
Number if it can be extracted. Otherwise null
- Type
- number | null
invert(…value) → {number}
Returns the value from the domain when given a value from the range.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
number |
<repeatable> |
Value from the range. |
Returns:
Value
- Type
- number
invert(…value) → {number}
Returns the value from the domain when given a value from the range.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
number |
<repeatable> |
Value from the range. |
Returns:
Value
- Type
- number
isEqual(type) → {Object}
Returns a validation function which can be used to validate variables against a type and value
Parameters:
Name | Type | Description |
---|---|---|
type |
any | type of value that the object should have |
- Source:
Returns:
validation function
- Type
- Object
isHTMLElem(elem)
Chceks if the element is istanceof HTMLElement
Parameters:
Name | Type | Description |
---|---|---|
elem |
Object | any JS Object |
- Source:
layerRegistry(override) → {Env|object}
Components of Muze are loaded from registry. User can override the default component by overriding the registry
with new component definition.
Muze composes layers to create a visualization. Each layer contain one mark (plot) type. Superposition of
one or multiple such layers create one visulization. Muze provides definition of atomic layers. A new layer can
be created and used as a mark type. `layerRegistry` handles the registrtion process. Atomic layers are
- AreaLayer
- ArcLayer
- LineLayer
- TextLayer
- PointLayer
- TickLayer
- BarLayer
- BaseLayer
For `layerRegistry` a new layer can be registered by using a new key.
```
const PointLayer = env.layerRegistry().point;
env.layerRegistry({
grass: class GrassLayer extends PointLayer {
render () {
// renders layer here
}
}
});
```
Access the new layer type by mentioning it as a mark type
```
.layers([{
mark: 'bar',
encoding: {
y: 'Acceleration'
}
}, {
mark: 'grass', // new mark type
encoding: {
y: 'Displacement'
}
}])
```
When called as a setter
Parameters:
Name | Type | Description |
---|---|---|
override |
Object | Key value pair where keys are the name of the cells user with to override. Allowed keys are - `Area` - `Arc` - `Line` - `Text` - `Point` - `Tick` - `Bar` And value being the overridden class definition. |
- Source:
Returns:
-
Instance of current environment When called as a getter
- Type
- Env
-
Object containing the registration key and class definition ``` { Area: AreaLayer, Text: TextLayer, Arc: ArcLayer, Line: LineLayer, Bar: BarLayer, Line: LineLayer, Point: PointLayer, Tick: TickLayer } ```
- Type
- object
layers(def) → {Canvas}
Defines an array of layers for the canvas. Each object in the array contains the definition of each layer which
will be shown in the canvas. Based on the rows and columns, and the x and y encoding fields given in the layer
definition, it will be decided which layer will be shown on which unit in the canvas.
To give a layer definition,
```
canvas
.rows(['Acceleration', 'Displacement'])
.columns(['Origin'])
.layers([
{
mark: 'bar',
encoding: {
y: 'Acceleration'
}
},
{
mark: 'line',
encoding: {
y: 'Displacement'
}
}
]);
```
This will create a two visual units on top of each other, and plot one bar layer for Acceleration measure and
a line layer for Displacement measure.
Parameters:
Name | Type | Description |
---|---|---|
def |
LayerConfig | Layers definition |
- Source:
Returns:
Instance of current canvas
- Type
- Canvas
layers() → {Array}
Returns the instances of the layers which is created by the visual unit.
Returns:
Array of layer instances.
- Type
- Array
makeElement(parent, elemType, data, selector) → {HTMLElement}
It creates a new d3 element on the parent element
Parameters:
Name | Type | Description |
---|---|---|
parent |
Selection | Element to which the element is to be appended |
elemType |
Object | Type of the new element |
data |
Array | Data for the new element |
selector |
Object | classname/id/tagname for the element |
- Source:
Returns:
Newly Created Element
- Type
- HTMLElement
matrices(matrices) → {Layout|Object}
Sets/Gets the matrices for the layout
Parameters:
Name | Type | Description |
---|---|---|
matrices |
Object | matrices for the layout |
Returns:
Gets the matrices/ Returns this instance when set
- Type
- Layout | Object
measurement(measurement) → {Layout|Object}
Sets/Gets the measurement for the layout
Parameters:
Name | Type | Description |
---|---|---|
measurement |
Object | measurement for the layout |
Returns:
Gets the measurement/ Returns this instance when set
- Type
- Layout | Object
measurement() → {Object}
Returns the measurement of the VisualUnit where the layer has been rendered.
Returns:
Width and height of the visual unit.
- Type
- Object
mergeRecursive(source, sink) → {Object}
Merges the sink object in the source by recursively iterating through the object properties
Parameters:
Name | Type | Description |
---|---|---|
source |
Object | Source Object |
sink |
Object | Sink Object |
- Source:
Returns:
Merged object
- Type
- Object
minUnitHeight(minWidthopt) → {Env}
Sets the configuration property for setting minimium unit height. *Unit* here is VisualUnit component of
Muze.
This is a getter-setter function.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
minWidth |
Number |
<optional> |
150 | Min height of a VisualUnit |
- Source:
Returns:
Instance of the environment
- Type
- Env
minUnitWidth(minWidthopt) → {Env}
Sets the configuration property for setting minimium unit width. *Unit* here is VisualUnit component of
Muze.
This is a getter-setter function.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
minWidth |
Number |
<optional> |
150 | Min width of a VisualUnit |
- Source:
Returns:
Instance of the environment
- Type
- Env
mount(mountPoint)
Sets the container element for the layer to be renderered.
Parameters:
Name | Type | Description |
---|---|---|
mountPoint |
SVGElement | SVG element or group element. |
mount(el)
Attach a mount point to the canvas. Canvas starts rendering whenever it gets the mount point. However the
rendering starts happenning in the next animation frame. Any property change after that triggers the auto render.
Parameters:
Name | Type | Description |
---|---|---|
el |
HTMLElement | string | Reference of html element or css selectors on which the viz will house. |
- Source:
mountPoint(mountPoint) → {Layout|Object}
Sets/Gets the mountPoint for the layout
Parameters:
Name | Type | Description |
---|---|---|
mountPoint |
Object | mountPoint for the layout |
Returns:
Gets the mountPoint/ Returns this instance when set
- Type
- Layout | Object
nestCollection(params) → {Array.<Object>}
Groups the data into a hierarchical tree structure based on one or more fields.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | Configuration properties for nesting data
Properties
|
- Source:
Returns:
Grouped data array
- Type
- Array.<Object>
nextFrame(fn)
Parameters:
Name | Type | Description |
---|---|---|
fn |
* |
- Source:
normalDomain(domain)
Parameters:
Name | Type | Description |
---|---|---|
domain |
* |
normalDomain(domain)
Parameters:
Name | Type | Description |
---|---|---|
domain |
* |
normalizeFields(fields, fieldMap) → {Array}
Gets the list of normalized fields
Parameters:
Name | Type | Description |
---|---|---|
fields |
Array | List of fields in the view |
fieldMap |
Object | Mapping of fields in the datamodel |
Returns:
fields normalized by measurement and dimensions
- Type
- Array
normalRange(domainValue, scale)
Parameters:
Name | Type | Description |
---|---|---|
domainValue |
* | |
scale |
* |
normalRange(domainValue, scale)
Parameters:
Name | Type | Description |
---|---|---|
domainValue |
* | |
scale |
* |
numberFormat() → {function}
Gets the number formatter function of this variable.
Returns:
Number formatter function.
- Type
- function
numberInterpolator()
Gets the number interpolator from d3 color
- Source:
objectIterator(obj, fn)
Iterates over the properties of an object and applies the function
Parameters:
Name | Type | Description |
---|---|---|
obj |
any | object to be iterated upon |
fn |
any | function to be applied on it |
- Source:
oneVar() → {string}
Gets the field name associated with this variable instance.
Returns:
Name of the field.
- Type
- string
orderFields(fieldList, fieldMap) → {Array}
Gets the list of fields in a sorted order by measurement and dimension
Parameters:
Name | Type | Description |
---|---|---|
fieldList |
Array | List of fields in the view |
fieldMap |
Object | Mapping of fields in the datamodel |
Returns:
fields sorted by measurement and dimensions
- Type
- Array
parentAlias() → {string}
Returns the alias of the visual group which houses this visual unit.
Returns:
Alias of the parent visual group.
- Type
- string
piecewiseInterpolator()
Gets the piecewise interpolator from d3 color
- Source:
pieceWiseRange(domainValue, scale, domain)
Parameters:
Name | Type | Description |
---|---|---|
domainValue |
* | |
scale |
* | |
domain |
* |
position(x, y) → {Tooltip}
Positions the tooltip at the given x and y position.
Parameters:
Name | Type | Description |
---|---|---|
x |
number | x position |
y |
number | y position |
- Source:
Returns:
Instance of tooltip.
- Type
- Tooltip
positionRelativeTo(dim)
Positions the tooltip relative to a rectangular box. It takes care of tooltip overflowing the
boundaries.
Parameters:
Name | Type | Description |
---|---|---|
dim |
Object | Dimensions of the plot. |
- Source:
prepareGridContainer(mountPoint, measurement, classPrefix)
Parameters:
Name | Type | Description |
---|---|---|
mountPoint |
* | |
measurement |
* | |
classPrefix |
* |
- Source:
projectRows(datamodel) → {Object}
projects row model based on the set of row and/or column and other projection fields
Parameters:
Name | Type | Description |
---|---|---|
datamodel |
Object | provided as input |
Returns:
Projected datamodel
- Type
- Object
pushToMatrix(context, callback)
Adds the datamodels to current row index based on column fields
Parameters:
Name | Type | Description |
---|---|---|
context |
Array | current context |
callback |
Array | List of facets applied to the current datamodel |
registerListeners(context, listenerMap)
Parameters:
Name | Type | Description |
---|---|---|
context |
* | |
listenerMap |
* |
- Source:
removeClass(element, className, selector, filterFn)
Removes the css class from elements which passes the filter function.If filter function is not given,
then all elements will be applied the class.
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | SVGElement | element |
className |
string | css class |
selector |
string | css selector |
filterFn |
function | filter method. |
- Source:
removeLayerByName(name) → {VisualUnit}
Removes the layer instance which matches the supplied layer name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of layer |
- Source:
Returns:
Instance of visual unit.
- Type
- VisualUnit
removeLayersByType(type) → {VisualUnit}
Removes all the layer instances which matches the supplied mark type.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Mark type of layer. |
- Source:
Returns:
Instance of visual unit.
- Type
- VisualUnit
render() → {VisualUnit}
Renders the visual unit. It creates the layout and renders the axes and layers.
- Source:
Returns:
Instance of visual unit.
- Type
- VisualUnit
renderAxis(axisInstance)
This method is used to render the axis inside an
svg container.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
axisInstance |
Object | the nput object required to render axis
Properties
|
- Source:
renderHeader(context, container, type, headers)
Parameters:
Name | Type | Description |
---|---|---|
context |
* | |
container |
* | |
type |
* | |
headers |
* |
- Source:
renderLegend(context, container, legendComponents)
Parameters:
Name | Type | Description |
---|---|---|
context |
* | |
container |
* | |
legendComponents |
* |
- Source:
renderMatrices(matrices, mountPoints, layoutDimensions)
Renders all the matrices of the layout
Parameters:
Name | Type | Description |
---|---|---|
matrices |
Array | Set of matrices in the layout |
mountPoints |
Array | Mount points for each row of matrix |
layoutDimensions |
Array | Dimensions(height/width) of all the matrices |
renderMatrix(matrices, mountPoint, type, dimensions)
Renders a set of matrices in a row
Parameters:
Name | Type | Description |
---|---|---|
matrices |
Array | Set of matrices in a row |
mountPoint |
Selection | Mount point for the row |
type |
string | top/center/bottom |
dimensions |
Object | dimensions of the matrix |
renderTable(mount, className, rowData) → {Selection}
Creates a table element of the layout
Parameters:
Name | Type | Description |
---|---|---|
mount |
Object | Mount point for table elements |
className |
string | defines class name |
rowData |
Array | set of rows for the table |
Returns:
set of selections for the table
- Type
- Selection
replaceCSSPrefix(newName, oldName)
Parameters:
Name | Type | Description |
---|---|---|
newName |
* | |
oldName |
* |
- Source:
resetData() → {VisualUnit}
Resets the data of visual unit to original data model. It also clears the cached data.
- Source:
Returns:
Instance of visual unit.
- Type
- VisualUnit
resolveDimByField(type, fieldInfo, config, data)
Parameters:
Name | Type | Description |
---|---|---|
type |
* | |
fieldInfo |
* | |
config |
* | |
data |
* |
resolveDimensions(data, config, axes)
Parameters:
Name | Type | Description |
---|---|---|
data |
* | |
config |
* | |
axes |
* |
resolver(resolveFn) → {function}
At first call it accepts one function
calling it second time accepts notification object.
notification object then called with first accepted function
Parameters:
Name | Type | Description |
---|---|---|
resolveFn |
function | a promise's resolve function |
Returns:
a function to accept notification object
- Type
- function
resolveTitleSubTitleContent(rawContent)
Parameters:
Name | Type | Description |
---|---|---|
rawContent |
* |
- Source:
retinalFields() → {Array}
Returns the retinal fields like color, shape and size field associated with this visual unit.
Returns:
Color, shape and size fields.
- Type
- Array
rgbToHsv(Number, Number, Number)
Converts an RGB color value to HSV. Conversion formula
adapted from http://en.wikipedia.org/wiki/HSV_color_space.
Assumes r, g, and b are contained in the set [0, 255] and
returns h, s, and v in the set [0, 1].
Parameters:
Name | Type | Description |
---|---|---|
Number |
r The red color value | |
Number |
g The green color value | |
Number |
b The blue color value |
- Source:
Returns:
Array The HSV representation
rotateAxis(instance, container, labelManager, config)
Parameters:
Name | Type | Description |
---|---|---|
instance |
* | |
container |
* | |
labelManager |
* | |
config |
* |
- Source:
rowMatrix(matrix) → {Layout|Object}
Sets/Gets the matrix for row
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Object | matrices for the layout |
Returns:
Gets the matrix/ Returns this instance when set
- Type
- Layout | Object
rows(leftVars, rightVars) → {Canvas}
Takes the variable using which the row facets are made. Row facets are horizontal facet. The variables in
parameter of the method controls presentation of facets can have different variations.
Parameters:
Name | Type | Description |
---|---|---|
leftVars |
Array.<string> | null | Variables using which the left facets are created |
rightVars |
Array.<string> | null | Variables using which the right facets are created |
- Source:
Returns:
instance of current canvas
- Type
- Canvas
selectElement(element) → {Selection}
This function takes a raw DOM element or
a string and returns a d3 selection of that element.
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | string | The element to wrap in d3 selection. |
- Source:
Returns:
Instance of d3 selection.
- Type
- Selection
serialize() → {Object}
Returns the serialized configuration of visual unit.
- Source:
Returns:
serialized configuration
- Type
- Object
serialize() → {Object}
Returns a serialized schema of the layer
Returns:
Serialized schema
- Type
- Object
serialize() → {Object}
Returns an object which is used to recreate the layout.
Returns:
the serialized components
- Type
- Object
setAttrs(element, attrs, className) → {SVGElement|HTMLElement}
Sets attributes in the svg or html element
Parameters:
Name | Type | Description |
---|---|---|
element |
SVGElement | HTMLElement | The element on which attrs will be applied |
attrs |
Array.<Object> | Array of attributes |
className |
string | className of elements to select. |
- Source:
Returns:
SVGElement or html element.
- Type
- SVGElement | HTMLElement
setAxisNamePos(textNode, orientation, measures)
Parameters:
Name | Type | Description |
---|---|---|
textNode |
* | |
orientation |
* | |
measures |
* |
- Source:
setElementAttrs(element, attrs)
Sets the attributes to the element.
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | SVGElement | Element on which attributes will be applied |
attrs |
Object | Attributes which need to be applied |
- Source:
setFixedBaseline(tickText, config, labelManager)
Sets a fixed baseline for the first ticks so that they can render effectively within
the given area
Parameters:
Name | Type | Description |
---|---|---|
tickText |
* | |
config |
* | |
labelManager |
* |
setFixedBaseline(tickText, config, labelManager)
Sets a fixed baseline for the first ticks so that they can render effectively within
the given area
Parameters:
Name | Type | Description |
---|---|---|
tickText |
* | |
config |
* | |
labelManager |
* |
setLabelRotationForAxes(columns)
Sets the rotation for all x axes if any axis has the rotation config set in the
entire view
Parameters:
Name | Type | Description |
---|---|---|
columns |
Array | Column cells that contain the axes cells |
- Source:
setMatrixMeasurement(matrix, type, value)
Sets available space for an instance of visual matrix
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Array | instance of visual matrix |
type |
string | height/width |
value |
number | Value of measurement |
setStyles(element, styles) → {SVGElement|HTMLElement}
Sets styles in the svg or html element
Parameters:
Name | Type | Description |
---|---|---|
element |
SVGElement | HTMLElement | The element on which styles will be applied |
styles |
Array.<Object> | Array of style attributes |
- Source:
Returns:
SVGElement or html element.
- Type
- SVGElement | HTMLElement
shape(encoding) → {Canvas}
Takes a variable and assign it to shape encoding channel. Shape scale always expect a dimension assigned to the
channel.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
encoding |
string | object | Name of the dimension which is assigned to shape encoding channel or an object
containing scale information.
Properties
|
- Source:
Returns:
Instance of current canvas
- Type
- Canvas
share(vars) → {ComposedVars}
This method creates a new composed variable instance from multiple variables. This is required when we have multiple
variables on a single axis and the union of domain of all the variables needs to be set on the axis.
To create a new composed variable from multiple fields,
```
const sharedVar = share('open', 'high', 'low', 'close');
canvas.rows([sharedVar])
.columns(['date']);
```
Parameters:
Name | Type | Description |
---|---|---|
vars |
Array | Variable names. |
- Source:
Returns:
Instance of composed variable
- Type
- ComposedVars
shiftHeaders(context, shifter)
Parameters:
Name | Type | Description |
---|---|---|
context |
* | |
shifter |
* |
- Source:
show() → {Tooltip}
Shows the tooltip element.
- Source:
Returns:
Instance of tooltip.
- Type
- Tooltip
size(encoding) → {Canvas}
Takes a variable and assign it to size encoding channel. Size encoding can take either a measure or a dimension.
Size encoding determines size of a mark.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
encoding |
string | object | Name of the variable which is assigned to size encoding channel or an object
containing scale information.
Properties
|
- Source:
Returns:
Instance of current canvas
- Type
- Canvas
steppedDomain(domain, stops)
Parameters:
Name | Type | Description |
---|---|---|
domain |
* | |
stops |
* |
steppedDomain(domain, intervals)
Parameters:
Name | Type | Description |
---|---|---|
domain |
* | |
intervals |
* |
strategies(stops)
Parameters:
Name | Type | Description |
---|---|---|
stops |
* |
subtitle(text, configopt) → {Canvas}
Provides the subtitle for a visualization.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text |
string | Subtitle text. Text returned from `operator.html` is also supported. | ||||||||||||||||
config |
object |
<optional> |
Subtitle configuration.
Properties
|
- Source:
Returns:
Instance of current canvas
- Type
- Canvas
subtype() → {string}
Returns the subtype of the variable. Subtype can be categorical or temporal. If no subtype is found, then it
returns the type of the variable.
Returns:
Subtype of variable.
- Type
- string
title(text, configopt) → {Canvas}
Provides the title for a visualization.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
text |
string | Title text. Text returned from `operator.html` is also supported. | ||||||||||||||||
config |
object |
<optional> |
Title configuration.
Properties
|
- Source:
Returns:
Instance of current canvas
- Type
- Canvas
transactor(holder, options, model) → {Array}
Setter getter creator from config
Format
PROPERTRY_NAME: {
value: // default value of the property,
meta: {
typeCheck: // The setter value will be checked using this. If the value is function then the setter value
// is passed as args. (Optional)
typeExpected: // The output of typecheck action will be tested against this. Truthy value will set the
// value to the setter
sanitizaiton: // Need for sanitization before type is checked
}
}
Parameters:
Name | Type | Description |
---|---|---|
holder |
Object | an empty object on which the getters and setters will be mounted |
options |
Object | options config based on which the getters and setters are determined. |
model |
Hyperdis | optional model to attach the property. If not sent new moel is created. |
- Source:
Returns:
- Type
- Array
transform(def) → {Canvas}
Creates named transformed data from root data. Here the data is an instance of a DataModel.
```
.transform({
averageLine: [(dm) => dm.groupBy([''], { Horsepower: 'avg'})]
});
```
Parameters:
Name | Type | Description |
---|---|---|
def |
Object | named definition of transformed data. This is a key value pair, where the key is name of the source and value being the transfromation function. The name is used to refer in layers to invoke and attach the data source to the layer instance. |
- Source:
Returns:
Instance of current canvas
- Type
- Canvas
transitionBars(elem, datum, index, context)
Parameters:
Name | Type | Description |
---|---|---|
elem |
* | |
datum |
* | |
index |
* | |
context |
* |
transposeArray(arr)
Parameters:
Name | Type | Description |
---|---|---|
arr |
* |
- Source:
treeShakeNode(node)
Parameters:
Name | Type | Description |
---|---|---|
node |
* |
- Source:
type() → {string}
Returns the type of the variable. Whether it is measure or dimension.
Returns:
Type of variable.
- Type
- string
unionDomain(domains, fieldType) → {Array}
Union Domain values
Parameters:
Name | Type | Description |
---|---|---|
domains |
Array.<Array> | Array of domain values |
fieldType |
string | type of field - dimension,measure or datetime. |
- Source:
Returns:
Unioned domain of all domain values.
- Type
- Array
unique(arr)
Parameters:
Name | Type | Description |
---|---|---|
arr |
* |
- Source:
uniqueKeyGenerator(facets, keyArray)
Parameters:
Name | Type | Description |
---|---|---|
facets |
* | |
keyArray |
* |
uniqueRange(domainValue, scale, domain, uniqueVals)
Parameters:
Name | Type | Description |
---|---|---|
domainValue |
* | |
scale |
* | |
domain |
* | |
uniqueVals |
* |
update()
Update model. The format contains presentation strategy which determines how to show the content.
If no strategy is mentioned then default is to show key value pair
- Source:
updateCells(resolver, facets)
Updates row and column cells with the geom cell corresponding to the facet keys
Parameters:
Name | Type | Description |
---|---|---|
resolver |
* | |
facets |
* |
updateScaleRange(scale, range) → {Scale}
This method is used to update the range of a scale
so that the core module can remain agnostic of the d3
scale api.
Parameters:
Name | Type | Description |
---|---|---|
scale |
Scale | Instance of d3 Scale. |
range |
Array | new range of the scale. |
- Source:
Returns:
Updated scale.
- Type
- Scale
width()
Property accessor for width of the class. Width is passed as an integer.
- Source:
width(width) → {Env}
Sets the width configuration property. Width in px is total horizontal space each canvas should take.
This is a getter-setter function.
Parameters:
Name | Type | Description |
---|---|---|
width |
Number | Width of the visualization area |
- Source:
Returns:
Instance of the environment
- Type
- Env