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
3e07b95c
Commit
3e07b95c
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
wip, custom Loci and Location
parent
cc07b6a9
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/mol-model/location.ts
+14
-1
14 additions, 1 deletion
src/mol-model/location.ts
src/mol-model/loci.ts
+14
-1
14 additions, 1 deletion
src/mol-model/loci.ts
src/mol-view/label.ts
+2
-0
2 additions, 0 deletions
src/mol-view/label.ts
with
30 additions
and
2 deletions
src/mol-model/location.ts
+
14
−
1
View file @
3e07b95c
...
@@ -14,4 +14,17 @@ export function isNullLocation(x: any): x is NullLocation {
...
@@ -14,4 +14,17 @@ export function isNullLocation(x: any): x is NullLocation {
return
!!
x
&&
x
.
kind
===
'
null-location
'
;
return
!!
x
&&
x
.
kind
===
'
null-location
'
;
}
}
export
type
Location
=
StructureElement
|
Link
.
Location
|
NullLocation
/** A custom Location */
\ No newline at end of file
export
interface
CustomLocation
<
D
=
any
,
K
=
any
>
{
readonly
kind
:
'
custom-location
'
data
:
D
key
:
K
}
export
function
CustomLocation
<
D
,
K
>
(
data
:
D
,
key
:
K
):
CustomLocation
<
D
,
K
>
{
return
{
kind
:
'
custom-location
'
,
data
,
key
}
}
export
function
isCustomLocation
(
x
:
any
):
x
is
CustomLocation
<
any
,
any
>
{
return
!!
x
&&
x
.
kind
===
'
custom-location
'
;
}
export
type
Location
=
StructureElement
|
Link
.
Location
|
NullLocation
|
CustomLocation
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mol-model/loci.ts
+
14
−
1
View file @
3e07b95c
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
import
{
StructureElement
}
from
'
./structure
'
import
{
StructureElement
}
from
'
./structure
'
import
{
Link
}
from
'
./structure/structure/unit/links
'
import
{
Link
}
from
'
./structure/structure/unit/links
'
import
{
CustomLocation
}
from
'
./location
'
;
/** A Loci that includes every loci */
/** A Loci that includes every loci */
export
const
EveryLoci
=
{
kind
:
'
every-loci
'
as
'
every-loci
'
}
export
const
EveryLoci
=
{
kind
:
'
every-loci
'
as
'
every-loci
'
}
...
@@ -21,4 +22,16 @@ export function isEmptyLoci(x: any): x is EmptyLoci {
...
@@ -21,4 +22,16 @@ export function isEmptyLoci(x: any): x is EmptyLoci {
return
!!
x
&&
x
.
kind
===
'
empty-loci
'
;
return
!!
x
&&
x
.
kind
===
'
empty-loci
'
;
}
}
export
type
Loci
=
StructureElement
.
Loci
|
Link
.
Loci
|
EveryLoci
|
EmptyLoci
/** A Loci of custom locations */
\ No newline at end of file
export
interface
CustomLoci
<
D
=
any
,
K
=
any
>
{
readonly
kind
:
'
custom-loci
'
readonly
locations
:
ReadonlyArray
<
CustomLocation
>
}
export
function
CustomLoci
<
D
,
K
>
(
locations
:
CustomLocation
<
D
,
K
>
[]):
CustomLoci
<
D
,
K
>
{
return
{
kind
:
'
custom-loci
'
,
locations
}
}
export
function
isCustomLoci
(
x
:
any
):
x
is
CustomLoci
{
return
!!
x
&&
x
.
kind
===
'
custom-loci
'
;
}
export
type
Loci
=
StructureElement
.
Loci
|
Link
.
Loci
|
EveryLoci
|
EmptyLoci
|
CustomLoci
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mol-view/label.ts
+
2
−
0
View file @
3e07b95c
...
@@ -36,6 +36,8 @@ export function labelFirst(loci: Loci): string {
...
@@ -36,6 +36,8 @@ export function labelFirst(loci: Loci): string {
}
else
{
}
else
{
return
'
Unknown
'
return
'
Unknown
'
}
}
case
'
custom-loci
'
:
return
'
Custom
'
case
'
every-loci
'
:
case
'
every-loci
'
:
return
'
Everything
'
return
'
Everything
'
case
'
empty-loci
'
:
case
'
empty-loci
'
:
...
...
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