Skip to main content
Version: Next

sortMetricsDisplayOrder()

function sortMetricsDisplayOrder(
metrics,
sortId,
displayOrder): object[]

Sorts metrics by ID given a user-defined metric dimension (sortId) and array of ID values in the order they should be sorted Useful for applying a "display order" to metrics Example - sortId = classId, displayOrder = ['sand','gravel','coral']

Parameters

ParameterTypeDefault valueDescription
metricsobject[]undefined
sortId| "classId" | "metricId" | "geographyId" | "sketchId" | "groupId""classId"
displayOrderstring[]undefined

Returns

object[]

new array of sorted metrics