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
1f3b16e6
Commit
1f3b16e6
authored
2 years ago
by
Michal Malý
Browse files
Options
Downloads
Patches
Plain Diff
Linter
parent
6219d8e5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/apps/rednatco/api-impl.ts
+3
-3
3 additions, 3 deletions
src/apps/rednatco/api-impl.ts
src/apps/rednatco/api.ts
+6
-6
6 additions, 6 deletions
src/apps/rednatco/api.ts
src/apps/rednatco/util.ts
+1
-1
1 addition, 1 deletion
src/apps/rednatco/util.ts
with
10 additions
and
10 deletions
src/apps/rednatco/api-impl.ts
+
3
−
3
View file @
1f3b16e6
...
@@ -2,8 +2,8 @@ import { ReDNATCOMsp } from './index';
...
@@ -2,8 +2,8 @@ import { ReDNATCOMsp } from './index';
import
{
ReDNATCOMspApi
}
from
'
./api
'
;
import
{
ReDNATCOMspApi
}
from
'
./api
'
;
export
class
ReDNATCOMspApiImpl
implements
ReDNATCOMspApi
.
Object
{
export
class
ReDNATCOMspApiImpl
implements
ReDNATCOMspApi
.
Object
{
private
target
:
ReDNATCOMsp
|
undefined
=
undefined
;
private
target
:
ReDNATCOMsp
|
undefined
=
undefined
;
private
onEvent
:
((
evt
:
ReDNATCOMspApi
.
Event
)
=>
void
)
|
undefined
;
private
onEvent
:
((
evt
:
ReDNATCOMspApi
.
Event
)
=>
void
)
|
undefined
;
private
check
()
{
private
check
()
{
if
(
!
this
.
target
)
if
(
!
this
.
target
)
...
@@ -34,7 +34,7 @@ export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object {
...
@@ -34,7 +34,7 @@ export class ReDNATCOMspApiImpl implements ReDNATCOMspApi.Object {
return
!!
this
.
target
;
return
!!
this
.
target
;
}
}
loadStructure
(
coords
:
{
data
:
string
,
type
:
'
cif
'
|
'
pdb
'
},
densityMaps
:
{
data
:
Uint8Array
,
type
:
'
ccp4
'
|
'
dsn6
'
,
kind
:
'
2fo-fc
'
|
'
fo-fc
'
|
'
em
'
}[]
|
null
)
{
loadStructure
(
coords
:
{
data
:
string
,
type
:
'
cif
'
|
'
pdb
'
},
densityMaps
:
{
data
:
Uint8Array
,
type
:
'
ccp4
'
|
'
dsn6
'
,
kind
:
'
2fo-fc
'
|
'
fo-fc
'
|
'
em
'
}[]
|
null
)
{
this
.
check
();
this
.
check
();
this
.
target
!
.
loadStructure
(
coords
,
densityMaps
);
this
.
target
!
.
loadStructure
(
coords
,
densityMaps
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/apps/rednatco/api.ts
+
6
−
6
View file @
1f3b16e6
...
@@ -15,7 +15,7 @@ export namespace ReDNATCOMspApi {
...
@@ -15,7 +15,7 @@ export namespace ReDNATCOMspApi {
}
}
export
namespace
Commands
{
export
namespace
Commands
{
export
type
Type
=
'
deselect-step
'
|
'
filter
'
|
'
redraw
'
|
'
select-step
'
|
'
switch-model
'
;
export
type
Type
=
'
deselect-step
'
|
'
filter
'
|
'
redraw
'
|
'
select-step
'
|
'
switch-model
'
;
export
type
DeselectStep
=
{
type
:
'
deselect-step
'
}
export
type
DeselectStep
=
{
type
:
'
deselect-step
'
}
export
function
DeselectStep
():
DeselectStep
{
export
function
DeselectStep
():
DeselectStep
{
...
@@ -36,7 +36,7 @@ export namespace ReDNATCOMspApi {
...
@@ -36,7 +36,7 @@ export namespace ReDNATCOMspApi {
prev
?:
Payloads
.
StepSelection
;
prev
?:
Payloads
.
StepSelection
;
next
?:
Payloads
.
StepSelection
next
?:
Payloads
.
StepSelection
}
}
export
function
SelectStep
(
step
:
Payloads
.
StepSelection
,
prev
:
Payloads
.
StepSelection
|
undefined
,
next
:
Payloads
.
StepSelection
|
undefined
):
SelectStep
{
export
function
SelectStep
(
step
:
Payloads
.
StepSelection
,
prev
:
Payloads
.
StepSelection
|
undefined
,
next
:
Payloads
.
StepSelection
|
undefined
):
SelectStep
{
return
{
type
:
'
select-step
'
,
step
,
prev
,
next
};
return
{
type
:
'
select-step
'
,
step
,
prev
,
next
};
}
}
...
@@ -51,7 +51,7 @@ export namespace ReDNATCOMspApi {
...
@@ -51,7 +51,7 @@ export namespace ReDNATCOMspApi {
Commands
.
SwitchModel
;
Commands
.
SwitchModel
;
export
namespace
Events
{
export
namespace
Events
{
export
type
Type
=
'
filter
'
|
'
ready
'
|
'
step-deselected
'
|
'
step-requested
'
|
'
step-selected
'
|
'
structure-loaded
'
;
export
type
Type
=
'
filter
'
|
'
ready
'
|
'
step-deselected
'
|
'
step-requested
'
|
'
step-selected
'
|
'
structure-loaded
'
;
export
type
Filter
=
{
type
:
'
filter
'
,
success
:
boolean
,
message
:
string
}
export
type
Filter
=
{
type
:
'
filter
'
,
success
:
boolean
,
message
:
string
}
export
function
FilterApplied
():
Filter
{
export
function
FilterApplied
():
Filter
{
...
@@ -97,7 +97,7 @@ export namespace ReDNATCOMspApi {
...
@@ -97,7 +97,7 @@ export namespace ReDNATCOMspApi {
Events
.
StructureLoaded
;
Events
.
StructureLoaded
;
export
namespace
Queries
{
export
namespace
Queries
{
export
type
Type
=
'
current-filter
'
|
'
current-model-number
'
|
'
selected-step
'
;
export
type
Type
=
'
current-filter
'
|
'
current-model-number
'
|
'
selected-step
'
;
export
type
CurrentFilter
=
{
type
:
'
current-filter
'
,
filter
:
Filters
.
All
}
export
type
CurrentFilter
=
{
type
:
'
current-filter
'
,
filter
:
Filters
.
All
}
export
function
CurrentFilter
(
filter
:
Filters
.
All
):
CurrentFilter
{
export
function
CurrentFilter
(
filter
:
Filters
.
All
):
CurrentFilter
{
...
@@ -114,7 +114,7 @@ export namespace ReDNATCOMspApi {
...
@@ -114,7 +114,7 @@ export namespace ReDNATCOMspApi {
return
{
type
:
'
selected-step
'
,
selected
};
return
{
type
:
'
selected-step
'
,
selected
};
}
}
}
}
export
type
Response
=
Queries
.
CurrentFilter
|
Queries
.
CurrentModelNumber
|
Queries
.
SelectedStep
;
export
type
Response
=
Queries
.
CurrentFilter
|
Queries
.
CurrentModelNumber
|
Queries
.
SelectedStep
;
export
type
ResponseTypes
=
{
export
type
ResponseTypes
=
{
'
current-filter
'
:
Queries
.
CurrentFilter
,
'
current-filter
'
:
Queries
.
CurrentFilter
,
'
current-model-number
'
:
Queries
.
CurrentModelNumber
,
'
current-model-number
'
:
Queries
.
CurrentModelNumber
,
...
@@ -126,7 +126,7 @@ export namespace ReDNATCOMspApi {
...
@@ -126,7 +126,7 @@ export namespace ReDNATCOMspApi {
event
:
(
evt
:
Event
)
=>
void
;
event
:
(
evt
:
Event
)
=>
void
;
init
:
(
elemId
:
string
,
onEvent
?:
(
evt
:
Event
)
=>
void
)
=>
void
;
init
:
(
elemId
:
string
,
onEvent
?:
(
evt
:
Event
)
=>
void
)
=>
void
;
isReady
:
()
=>
boolean
;
isReady
:
()
=>
boolean
;
loadStructure
:
(
coords
:
{
data
:
string
,
type
:
'
cif
'
|
'
pdb
'
},
densityMaps
:
{
data
:
Uint8Array
,
type
:
'
ccp4
'
|
'
dsn6
'
,
kind
:
'
2fo-fc
'
|
'
fo-fc
'
|
'
em
'
}[]
|
null
)
=>
void
;
loadStructure
:
(
coords
:
{
data
:
string
,
type
:
'
cif
'
|
'
pdb
'
},
densityMaps
:
{
data
:
Uint8Array
,
type
:
'
ccp4
'
|
'
dsn6
'
,
kind
:
'
2fo-fc
'
|
'
fo-fc
'
|
'
em
'
}[]
|
null
)
=>
void
;
query
:
<
T
extends
Queries
.
Type
>
(
type
:
T
)
=>
ResponseTypes
[
T
];
query
:
<
T
extends
Queries
.
Type
>
(
type
:
T
)
=>
ResponseTypes
[
T
];
}
}
}
}
This diff is collapsed.
Click to expand it.
src/apps/rednatco/util.ts
+
1
−
1
View file @
1f3b16e6
...
@@ -68,7 +68,7 @@ export function reduceDecimals(s: string) {
...
@@ -68,7 +68,7 @@ export function reduceDecimals(s: string) {
if
(
s
.
charCodeAt
(
idx
)
!==
Zero
)
if
(
s
.
charCodeAt
(
idx
)
!==
Zero
)
break
;
break
;
}
}
const
noDot
=
s
.
charCodeAt
(
idx
)
===
Period
?
0
:
1
const
noDot
=
s
.
charCodeAt
(
idx
)
===
Period
?
0
:
1
;
return
s
.
substring
(
0
,
idx
+
noDot
);
return
s
.
substring
(
0
,
idx
+
noDot
);
}
}
...
...
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