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
0156c2c9
Commit
0156c2c9
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
wip, params
parent
233fcb5d
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
+5
-4
5 additions, 4 deletions
src/mol-plugin/ui/controls/parameters.tsx
src/mol-util/param-definition.ts
+2
-1
2 additions, 1 deletion
src/mol-util/param-definition.ts
with
7 additions
and
5 deletions
src/mol-plugin/ui/controls/parameters.tsx
+
5
−
4
View file @
0156c2c9
...
@@ -216,7 +216,7 @@ export class GroupControl extends React.PureComponent<GroupWrapperProps> {
...
@@ -216,7 +216,7 @@ export class GroupControl extends React.PureComponent<GroupWrapperProps> {
type
MappedWrapperProps
=
{
name
:
string
,
value
:
PD
.
Mapped
<
any
>
[
'
defaultValue
'
],
param
:
PD
.
Mapped
<
any
>
,
onChange
:
ParamOnChange
,
onEnter
?:
()
=>
void
,
isEnabled
?:
boolean
}
type
MappedWrapperProps
=
{
name
:
string
,
value
:
PD
.
Mapped
<
any
>
[
'
defaultValue
'
],
param
:
PD
.
Mapped
<
any
>
,
onChange
:
ParamOnChange
,
onEnter
?:
()
=>
void
,
isEnabled
?:
boolean
}
export
class
MappedControl
extends
React
.
PureComponent
<
MappedWrapperProps
>
{
export
class
MappedControl
extends
React
.
PureComponent
<
MappedWrapperProps
>
{
change
(
value
:
PD
.
Mapped
<
any
>
[
'
defaultValue
'
]
)
{
change
(
value
:
PD
.
Mapped
<
any
>
[
'
defaultValue
'
])
{
this
.
props
.
onChange
({
name
:
this
.
props
.
name
,
param
:
this
.
props
.
param
,
value
});
this
.
props
.
onChange
({
name
:
this
.
props
.
name
,
param
:
this
.
props
.
param
,
value
});
}
}
...
@@ -239,9 +239,10 @@ export class MappedControl extends React.PureComponent<MappedWrapperProps> {
...
@@ -239,9 +239,10 @@ export class MappedControl extends React.PureComponent<MappedWrapperProps> {
name
=
{
'
name
'
}
value
=
{
value
.
name
}
/>
name
=
{
'
name
'
}
value
=
{
value
.
name
}
/>
<
div
style
=
{
{
borderLeft
:
'
5px solid #777
'
,
paddingLeft
:
'
5px
'
}
}
>
<
div
style
=
{
{
borderLeft
:
'
5px solid #777
'
,
paddingLeft
:
'
5px
'
}
}
>
{
param
.
type
===
'
group
'
{
param
.
type
===
'
group
'
?
<
GroupControl
param
=
{
param
}
value
=
{
value
}
name
=
'param'
onChange
=
{
this
.
onChangeParam
}
onEnter
=
{
this
.
props
.
onEnter
}
isEnabled
=
{
this
.
props
.
isEnabled
}
/>
?
<
GroupControl
param
=
{
param
}
value
=
{
value
}
name
=
'param'
onChange
=
{
this
.
onChangeParam
}
onEnter
=
{
this
.
props
.
onEnter
}
isEnabled
=
{
this
.
props
.
isEnabled
}
/>
:
param
.
type
===
'
mapped
'
||
param
.
type
===
'
value
'
?
null
:
param
.
type
===
'
mapped
'
||
param
.
type
===
'
value
'
:
<
ParamWrapper
control
=
{
controlFor
(
param
)
}
param
=
{
param
}
onChange
=
{
this
.
onChangeParam
}
onEnter
=
{
this
.
props
.
onEnter
}
isEnabled
=
{
this
.
props
.
isEnabled
}
name
=
{
'
value
'
}
value
=
{
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
>
</
div
>
</
div
>
}
}
...
...
This diff is collapsed.
Click to expand it.
src/mol-util/param-definition.ts
+
2
−
1
View file @
0156c2c9
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
import
{
Color
as
ColorData
}
from
'
./color
'
;
import
{
Color
as
ColorData
}
from
'
./color
'
;
import
{
shallowClone
,
shallowEqual
}
from
'
mol-util
'
;
import
{
shallowClone
,
shallowEqual
}
from
'
mol-util
'
;
import
{
Vec2
}
from
'
mol-math/linear-algebra
'
;
import
{
Vec2
}
from
'
mol-math/linear-algebra
'
;
import
{
deepClone
}
from
'
./object
'
;
export
namespace
ParamDefinition
{
export
namespace
ParamDefinition
{
export
interface
Info
{
export
interface
Info
{
...
@@ -142,7 +143,7 @@ export namespace ParamDefinition {
...
@@ -142,7 +143,7 @@ export namespace ParamDefinition {
}
}
export
function
clone
<
P
extends
Params
>
(
params
:
P
):
P
{
export
function
clone
<
P
extends
Params
>
(
params
:
P
):
P
{
return
shallow
Clone
(
params
)
return
deep
Clone
(
params
)
}
}
/**
/**
...
...
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