Skip to content

parameters

Chris Churas edited this page Oct 23, 2024 · 8 revisions

List of Parameter objects that denote parameters to display to the user.

{
   "displayName": "Algorithm", // Key of the parameter, used as the label
   "description": "Choose to use Louvain or newer Leiden algorithm", // Tooltip or hint
   "type": "text", // Other values: "dropDown", "radio", "checkBox", "nodeColumn", "edgeColumn"
   "valueList": ["louvain", "leiden"], // Applicable when type="dropDown"
   "defaultValue": "louvain", // Default or selected value
   "validationType": "string|number|digits", // Data type is only used for text field or data type. It is ignored for other input types.
   "columnTypeFilter": "number|list|<cx2 type>", //Only for node or edge column type.
                               //Can be one of the cx2 supported datatype, number(for long or integer) or list(for any list type)                       
   "validationHelp": "Must be set to louvain or leiden",
   "validationRegex": "louvain|leiden", // Ignored for certain types
   "minValue": null, // Applies to numeric textBox
   "maxValue": null  // Applies to numeric textBox
}

displayName

Key of the parameter, used as the label

description

Tooltip or hint describing the parameter with more detail.

type

Defines UI component to show to the user.

  • text - Text box
  • dropDown - Dropdown box with values extracted from valueList and selected value set to defaultValue
  • radio - Radio button group with values set to valueList and defaultValue selected otherwise no selection
  • checkBox - checkbox with value checked if defaultValue is true
    • When sending the result back, set value to true if checked or false|null if not checked
  • nodeColumn - Dropdown that provides a list of node columns from currently selected network. defaultValue value should be used to set the default selection. columnTypeFilter should be applied to limit what columns are in this list.
  • edgeColumn Dropdown that provides a list of edge columns from currently selected network. defaultValue value should be used to set the default selection. columnTypeFilter should be applied to limit what columns are in this list.

valueList

Values are used to populate UI components of type dropDown or radio

defaultValue

Default value to set for UI components and what they mean differs depending on type value

  • text - Set the value of the text box to this
  • checkBox - If this value is true it means the UI should check the box, otherwise leave box unchecked
  • dropDown - If possible, UI should set the the selected value to this
  • radio - If possible, UI should set radio value to this
  • nodeColumn or edgeColumn - If possible, UI should set this as selected column

validationType

Only used for UI component of type text and can be set to one of the following:

  • number Allow only floating point numbers or numbers with decimals (24.5, 12, -1234.23433). Can be limited by maxValue and minValue.

  • digits Allow only digits that are wholenumbers ie (1,2,3,34,-1,-10). A (-) at the start is allowed to denote negative numbers. Can be limited by maxValue and minValue.

  • string Allow ASCI characters. Can be limited by validationRegex.

columnTypeFilter

Filters what node/edge columns should be displayed in UI component. Can be the following:

  • Any CX2 data type
  • number - Any type of number long, integer, or double
  • wholenumber - Any whole number long or integer
  • list - Any list type
  • list_of_number - Any list type of number list_of_long, list_of_integer, or list_of_double
  • list_of_wholenumber - Any list of whole number list_of_long or list_of_integer

Only used for UI component of type nodeColumn or edgeColumn

validationHelp

Only used for UI component of type text and is the message to display if validation fails.

validationRegex

Can be set to regex to verify text matches. Only used for UI component of type text when validationType is set to string

minValue

Minimum value allowed in text field. If less, then validationHelp should be displayed to user. Only used for UI component of type text when validationType is set to number or digits

maxValue

Maximum value allowed in text field. If exceeded, then validationHelp should be displayed to user. Only used for UI component of type text when validationType is set to number or digits

Original example:

{
  "displayName": "Configuration Model",
  "description": "Configuration model which must be one of following:: RB, RBER, CPM, Suprise, Significance, Default",
  "type": "text",
  "valueList": null,
  "defaultValue": "Default",
  "validationType": "string",
  "columnTypeFilter": null,
  "validationHelp": "Must be one of following: RB, RBER, CPM, Suprise, Significance, Default",
  "validationRegex": "RB|RBER|CPM|Suprise|Significance|Default",
  "minValue": null,
  "maxValue": null
}