Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
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
Michal Malý
Molstar
Commits
b5fc2405
Commit
b5fc2405
authored
6 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
Param tweaks
parent
9ee334be
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-plugin/ui/controls/parameters.tsx
+2
-1
2 additions, 1 deletion
src/mol-plugin/ui/controls/parameters.tsx
src/mol-util/param-definition.ts
+5
-5
5 additions, 5 deletions
src/mol-util/param-definition.ts
with
7 additions
and
6 deletions
src/mol-plugin/ui/controls/parameters.tsx
+
2
−
1
View file @
b5fc2405
...
...
@@ -28,6 +28,7 @@ export class ParameterControls<P extends PD.Params> extends React.PureComponent<
return
<
div
style
=
{
{
width
:
'
100%
'
}
}
>
{
Object
.
keys
(
params
).
map
(
key
=>
{
const
param
=
params
[
key
];
if
(
param
.
type
===
'
value
'
)
return
null
;
if
(
param
.
type
===
'
mapped
'
)
return
<
MappedControl
param
=
{
param
}
key
=
{
key
}
{
...
common
}
name
=
{
key
}
value
=
{
values
[
key
]
}
/>
if
(
param
.
type
===
'
group
'
)
return
<
GroupControl
param
=
{
param
}
key
=
{
key
}
{
...
common
}
name
=
{
key
}
value
=
{
values
[
key
]
}
/>
return
<
ParamWrapper
control
=
{
controlFor
(
param
)
}
param
=
{
param
}
key
=
{
key
}
{
...
common
}
name
=
{
key
}
value
=
{
values
[
key
]
}
/>
...
...
@@ -222,7 +223,7 @@ export class MappedControl extends React.PureComponent<MappedWrapperProps> {
<
div
style
=
{
{
borderLeft
:
'
5px solid #777
'
,
paddingLeft
:
'
5px
'
}
}
>
{
param
.
type
===
'
group
'
?
<
GroupControl
param
=
{
param
}
value
=
{
value
}
name
=
'param'
onChange
=
{
this
.
onChangeParam
}
onEnter
=
{
this
.
props
.
onEnter
}
isEnabled
=
{
this
.
props
.
isEnabled
}
/>
:
param
.
type
===
'
mapped
'
?
'
nested mapped params are not supported
'
:
param
.
type
===
'
mapped
'
||
param
.
type
===
'
value
'
?
null
:
<
ParamWrapper
control
=
{
controlFor
(
param
)
}
param
=
{
param
}
onChange
=
{
this
.
onChangeParam
}
onEnter
=
{
this
.
props
.
onEnter
}
isEnabled
=
{
this
.
props
.
isEnabled
}
name
=
{
'
value
'
}
value
=
{
value
}
/>
}
</
div
>
</
div
>
...
...
This diff is collapsed.
Click to expand it.
src/mol-util/param-definition.ts
+
5
−
5
View file @
b5fc2405
...
...
@@ -15,11 +15,11 @@ export namespace ParamDefinition {
defaultValue
:
T
}
export
interface
Generic
Value
<
T
>
extends
Base
<
T
>
{
type
:
'
generic-
value
'
export
interface
Value
<
T
>
extends
Base
<
T
>
{
type
:
'
value
'
}
export
function
Generic
Value
<
T
>
(
label
:
string
,
description
:
string
,
defaultValue
:
T
):
Generic
Value
<
T
>
{
return
{
type
:
'
generic-
value
'
,
label
,
description
,
defaultValue
}
export
function
Value
<
T
>
(
label
:
string
,
description
:
string
,
defaultValue
:
T
):
Value
<
T
>
{
return
{
type
:
'
value
'
,
label
,
description
,
defaultValue
}
}
export
interface
Select
<
T
extends
string
>
extends
Base
<
T
>
{
...
...
@@ -114,7 +114,7 @@ export namespace ParamDefinition {
};
}
export
type
Any
=
Select
<
any
>
|
MultiSelect
<
any
>
|
Boolean
|
Range
|
Text
|
Color
|
Numeric
|
Interval
|
Group
<
any
>
|
Mapped
<
any
>
export
type
Any
=
Value
<
any
>
|
Select
<
any
>
|
MultiSelect
<
any
>
|
Boolean
|
Range
|
Text
|
Color
|
Numeric
|
Interval
|
Group
<
any
>
|
Mapped
<
any
>
export
type
Params
=
{
[
k
:
string
]:
Any
}
export
type
Values
<
T
extends
Params
>
=
{
[
k
in
keyof
T
]:
T
[
k
][
'
defaultValue
'
]
}
...
...
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