Skip to content

Commit

Permalink
splitting and title-casing task IDs (keys) for display
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewcornell committed Jul 12, 2023
1 parent 92fdcc7 commit dc5e78b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ The component is initialized by a JavaScript object with the following keys and
- 'value': used as the main value that's passed around for the target
- 'text': human-readable text
- 'plot_text': plot text (purpose: TBD)
- `task_ids`: `object` defining the _tasks_ in the data as described in `_fetchData`'s `taskIDs` arg above. The object contains a `string` key for each task ID variable, the value of which is an `array` of `object`s defining possible values. The keys should consist of only ASCII letters, digits, '_', and '-', and should start with a letter. The objects have two keys:
- `task_ids`: `object` defining the _tasks_ in the data as described in `_fetchData`'s `taskIDs` arg above. The object contains a `string` key for each task ID variable, the value of which is an `array` of `object`s defining possible values. The keys should consist of only ASCII letters, digits, `_`, and `-`, and should start with a letter. (Note that, for display, the IDs are split on `_` and `-` and the title-cased.) The objects have two keys:
- `value`: used as the main value that's passed around for the task ID
- `text`: human-readable text

Expand Down
2 changes: 1 addition & 1 deletion dist/predtimechart.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/predtimechart.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function _createUIElements($componentDiv, isUemEnabled, taskIdsKeys) {
const $optionsForm = $('<form></form>');
$optionsForm.append(_createFormRow('target_variable', 'Outcome'));
taskIdsKeys.forEach(taskIdKey => {
$optionsForm.append(_createFormRow(taskIdKey, titleCase(taskIdKey)));
$optionsForm.append(_createFormRow(taskIdKey, titleCase(taskIdKey.replace(/[_-]/g, ' ')))); // replace w/spaces
});
$optionsForm.append(_createFormRow('intervals', 'Interval'));
$optionsDiv.append($optionsForm);
Expand Down

0 comments on commit dc5e78b

Please sign in to comment.