Update Properties
Set properties to define the appearance and behavior of visual objects.
msc.sortChildren(elem, property, descending, orderedVals)
Sorts the children of a group or the vertices of a path by a data attribute or a channel.
elem: Group or Pathproperty: a data attribute name or a channel (e.g.,"x","y","width","height")descending(Boolean, optional): whether to sort in descending orderorderedVals(Array, optional): explicit ranking of string attribute values to sort by- Return type:
void
msc.translate(elem, dx, dy)
Moves an element by the given offsets along the x and y axes.
elem: Mark, Group, vertex, or segmentdx(Number): offset along the x axisdy(Number): offset along the y axis- Return type:
void
msc.update(target, patch)
Updates the properties of an element or a layout. If peer elements share the same class ID they are updated together.
target: Mark, Group, vertex, segment, or layoutpatch(Object): properties to update, where each key is a channel (e.g.,"x","y","width","height","radius"), a style (e.g.,"fillColor","opacity"), or"layout"; for a layout, each key is a layout parameter (e.g.,msc.update(collection.layout, {gap: 2}))- Return type:
void