Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
sort_lookup_table [2026/07/07 19:51] chrystian Document Sort Lookup Table functor |
sort_lookup_table [2026/08/28 03:35] (current) hermann Sync from local documentation review |
||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== Description ===== | ===== Description ===== | ||
| - | Sort the content of a lookup table. | + | |
| + | Sorts the content of a lookup table. | ||
| ===== Inputs ===== | ===== Inputs ===== | ||
| - | ^ Name ^ Type ^ Description ^ | + | ^ Name ^ Type ^ Description ^ |
| - | | Values Or Ids | [[Lookup Table Type]] | The input list of values or ids. The keys are used to specify the order of the values or ids in this list. This list is used as a list of values if the additional list is not provided. Otherwise, the list is assumed to represent ids whose values are specified in the property list. | | + | | Values Or Ids | [[Lookup Table Type]] | List of values or ids to sort; the keys only indicate the order of the entries in this list, so it corresponds to a plain list whose keys are indices and whose values are the elements. If Properties is not provided, this list is treated as a list of values to sort directly. Otherwise, it is treated as a list of ids, whose corresponding values are looked up in Properties. | |
| ===== Optional Inputs ===== | ===== Optional Inputs ===== | ||
| - | ^ Name ^ Type ^ Description ^ | + | ^ Name ^ Type ^ Description ^ Default Value ^ |
| - | | Use Ascending Order | [[Boolean Table Type]] | If true, the list is sorted from lowest to highest (ascending order). Otherwise, the list is sorted from highest to lowest (descending order). | | + | | Use Ascending Order | [[Boolean Value Type]] | If true, values or ids are sorted from lowest to highest, by the values used for comparison; if false, from highest to lowest. | True | |
| - | | Properties | [[Lookup Table Type]] | List specifying the values corresponding to the ids provided by the \"valuesOrIds\" list. | | + | | Properties | [[Lookup Table Type]] | Lookup table mapping each id in Values Or Ids to the value used to sort it. If not provided, Values Or Ids is sorted directly as a list of values. | .none | |
| ===== Outputs ===== | ===== Outputs ===== | ||
| - | ^ Name ^ Type ^ Description ^ | + | ^ Name ^ Type ^ Description ^ |
| - | | Sorted Values Or Ids | [[Lookup Table Type]] | List of sorted values or ids. | | + | | Sorted Values Or Ids | [[Lookup Table Type]] | Values Or Ids reordered so that its values (or, when Properties is given, the corresponding looked-up values) are sorted, with keys reassigned as sequential indices reflecting the new order. | |
| ===== Group ===== | ===== Group ===== | ||
| - | [[Functor List#LookupTable | LookupTable]] | + | [[Functor List#Lookup Table | Lookup Table]] |
| ===== Notes ===== | ===== Notes ===== | ||
| - | The keys of the input table indicate only the order of the values in the table. Therefore, the input table corresponds to a list in which the keys are the indices and the values are the elements. The same applies to the output table. | + | The keys of Values Or Ids indicate only the order of its entries, not their content; the same is true of Sorted Values Or Ids. |
| ===== Internal Name ===== | ===== Internal Name ===== | ||