generated from RENCI/react-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #326 from RENCI/issue-296-field-units
Issue 296 field units
- Loading branch information
Showing
10 changed files
with
576 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
export const maxSliderValues = { | ||
"maxele": 10, | ||
"maxwvel": 100, | ||
"swan": 30 | ||
"maxele": { "metric": 10, "imperial": 30 }, | ||
"maxwvel": { "metric": 100, "imperial": 200 }, | ||
"swan": { "metric": 30, "imperial": 100 } | ||
}; | ||
|
||
export const sliderSteps = { | ||
"maxele": { "metric": 0.25, "imperial": 1 }, | ||
"maxwvel": { "metric": 1, "imperial": 5 }, | ||
"swan": { "metric": 0.5, "imperial": 5 } | ||
}; | ||
|
||
export const sliderMarkSteps = { | ||
"maxele": { "metric": 1, "imperial": 5 }, | ||
"maxwvel": { "metric": 10, "imperial": 20 }, | ||
"swan": { "metric": 5, "imperial": 10 } | ||
}; | ||
|
||
// find a float number in a colormap entry label and | ||
// return with designated decimal places. | ||
export const getFloatNumberFromLabel = (label, decimalPlaces) => { | ||
let num = 0.0; | ||
const labelMatch = label.match(/[+-]?\d+(\.\d+)?/g); | ||
if (labelMatch) | ||
num = parseFloat(labelMatch).toFixed(decimalPlaces); | ||
|
||
return num; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.