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
0a0612ba
Commit
0a0612ba
authored
6 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
wip, params
parent
8d7ae26d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mol-plugin/behavior/static/representation.ts
+2
-0
2 additions, 0 deletions
src/mol-plugin/behavior/static/representation.ts
src/mol-state/reducer.ts
+4
-0
4 additions, 0 deletions
src/mol-state/reducer.ts
src/mol-util/param-definition.ts
+12
-2
12 additions, 2 deletions
src/mol-util/param-definition.ts
with
18 additions
and
2 deletions
src/mol-plugin/behavior/static/representation.ts
+
2
−
0
View file @
0a0612ba
...
...
@@ -18,6 +18,8 @@ export function SyncRepresentationToCanvas(ctx: PluginContext) {
ctx
.
canvas3d
.
add
(
e
.
obj
.
data
);
ctx
.
canvas3d
.
requestDraw
(
true
);
console
.
log
(
e
.
obj
.
data
);
// TODO: update visiblity
});
events
.
object
.
updated
.
subscribe
(
e
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/mol-state/reducer.ts
0 → 100644
+
4
−
0
View file @
0a0612ba
// TODO: state reducers
// The idea is to have "reduced"/computed objects from a state
// basicaly something like this Reduce(selection: StateSelection) => Value
// the reducer would be automatically called each time a state update is finished and any object of the selection is updated.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mol-util/param-definition.ts
+
12
−
2
View file @
0a0612ba
...
...
@@ -90,7 +90,17 @@ export namespace ParamDefinition {
return
{
type
:
'
interval
'
,
label
,
description
,
defaultValue
}
}
export
type
Any
=
/* GenericValue<any> | */
Select
<
any
>
|
MultiSelect
<
any
>
|
Boolean
|
Range
|
Text
|
Color
|
Numeric
|
Interval
export
interface
Obj
<
P
extends
Params
>
extends
Base
<
{
[
K
in
keyof
P
]:
P
[
K
][
'
defaultValue
'
]}
>
{
type
:
'
obj
'
,
pivot
?:
keyof
P
,
params
:
P
}
export
function
Obj
<
P
extends
Params
>
(
label
:
string
,
description
:
string
,
params
:
P
,
pivot
?:
keyof
P
):
Obj
<
P
>
{
return
{
type
:
'
obj
'
,
label
,
description
,
defaultValue
:
getDefaultValues
(
params
),
params
,
pivot
};
}
export
type
Any
=
Select
<
any
>
|
MultiSelect
<
any
>
|
Boolean
|
Range
|
Text
|
Color
|
Numeric
|
Interval
|
Obj
<
any
>
export
type
Params
=
{
[
k
:
string
]:
Any
}
export
type
DefaultValues
<
T
extends
Params
>
=
{
[
k
in
keyof
T
]:
T
[
k
][
'
defaultValue
'
]
}
...
...
@@ -117,7 +127,7 @@ export namespace ParamDefinition {
definition
?(
a
:
A
,
globalCtx
:
Ctx
):
{
[
K
in
keyof
P
]?:
Any
},
/** Check the parameters and return a list of errors if the are not valid. */
validate
?(
params
:
P
,
a
:
A
,
globalCtx
:
unknown
):
ParamErrors
|
undefined
,
/** Optional custom parameter equality. Use
deep
structural equal by default. */
/** Optional custom parameter equality. Use
shallow
structural equal by default. */
areEqual
?(
oldParams
:
P
,
newParams
:
P
):
boolean
}
}
\ No newline at end of file
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