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
f9828bc0
Commit
f9828bc0
authored
6 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
wip animations
parent
a9d20c7e
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/state/animation/manager.ts
+7
-0
7 additions, 0 deletions
src/mol-plugin/state/animation/manager.ts
src/mol-plugin/state/animation/model.ts
+37
-0
37 additions, 0 deletions
src/mol-plugin/state/animation/model.ts
with
44 additions
and
0 deletions
src/mol-plugin/state/animation/manager.ts
0 → 100644
+
7
−
0
View file @
f9828bc0
/**
* Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
// TODO
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mol-plugin/state/animation/model.ts
0 → 100644
+
37
−
0
View file @
f9828bc0
/**
* Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import
{
ParamDefinition
as
PD
}
from
'
mol-util/param-definition
'
;
import
{
PluginContext
}
from
'
mol-plugin/context
'
;
export
{
PluginStateAnimation
}
interface
PluginStateAnimation
<
P
extends
PD
.
Params
,
S
>
{
id
:
string
,
params
:
(
ctx
:
PluginContext
)
=>
P
,
initialState
(
params
:
PD
.
Values
<
P
>
,
ctx
:
PluginContext
):
S
,
/**
* Apply the current frame and modify the state.
* @param t Current absolute time since the animation started.
*/
apply
(
state
:
S
,
t
:
number
,
ctx
:
PluginStateAnimation
.
Context
<
P
>
):
Promise
<
PluginStateAnimation
.
ApplyResult
<
S
>>
,
/**
* The state must be serializable to JSON. If JSON.stringify is not enough,
* custom serializer can be provided.
*/
stateSerialization
?:
{
toJson
?(
state
:
S
):
any
,
fromJson
?(
data
:
any
):
S
}
}
namespace
PluginStateAnimation
{
export
type
ApplyResult
<
S
>
=
{
kind
:
'
finished
'
}
|
{
kind
:
'
next
'
,
state
:
S
}
export
interface
Context
<
P
extends
PD
.
Params
>
{
params
:
PD
.
Values
<
P
>
,
plugin
:
PluginContext
}
}
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