Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
viz-layout-panel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetaboHUB
web-components
viz-layout-panel
Commits
e348af78
Commit
e348af78
authored
4 months ago
by
Elora-V
Browse files
Options
Downloads
Patches
Plain Diff
function individual translation of param
parent
881b964c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/helpers/ParametersChoices.ts
+64
-1
64 additions, 1 deletion
src/helpers/ParametersChoices.ts
with
64 additions
and
1 deletion
src/helpers/ParametersChoices.ts
+
64
−
1
View file @
e348af78
...
...
@@ -52,13 +52,76 @@ export function getKeyFromValueNumber(object:{[key:string|number]:number|string}
//___________________ Node spacing __________________________
/**
* Converts a position on the slider to the node spacing parameter.
*
* @param slideNumber - the position of the slider
* @returns node spacing as a number of nodes between two ranks
*/
function
nodeSpacingToParam
(
slideNumber
:
number
):
number
{
switch
(
slideNumber
){
case
0
:
return
1
;
case
2
:
return
5
;
default
:
return
3
;
}
}
/**
* Converts the parameter for node spacing into a corresponding position on the slider.
*
* @param {number} nodeSpacing - node spacing parameter.
* @returns {number} - The position on the slider.
*/
function
nodeSpacingToSlider
(
nodeSpacing
:
number
):
number
{
switch
(
nodeSpacing
){
case
1
:
return
0
;
case
5
:
return
2
;
default
:
return
1
;
}
}
//___________________ Edge lenght side compounds __________________________
/**
* Converts a position on the slider to the edge length (for side compounds) parameter.
*
* @param slideNumber - the position of the slider
* @returns node spacing as a number of nodes between two ranks
*/
function
edgeLengthSideCompoundsToParam
(
slideNumber
:
number
):
number
{
switch
(
slideNumber
){
case
0
:
return
1
/
3
;
case
2
:
return
1
;
default
:
return
1
/
2
;
}
}
/**
* Converts the parameter for the edge length (for side compounds) into a corresponding position on the slider.
*
* @param {number} nodeSpacing - the edge length (for side compounds) parameter.
* @returns {number} - The position on the slider.
*/
function
edgeLengthSideCompoundsToSlider
(
nodeSpacing
:
number
):
number
{
switch
(
nodeSpacing
){
case
1
/
3
:
return
0
;
case
1
:
return
2
;
default
:
return
1
;
}
}
//___________________ Side compounds steps __________________________
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment