Browse Source

wip, moved themes to mol-view

Alexander Rose 6 years ago
parent
commit
3f9a822235
30 changed files with 123 additions and 134 deletions
  1. 2 1
      src/mol-app/ui/transform/backbone.tsx
  2. 2 1
      src/mol-app/ui/transform/ball-and-stick.tsx
  3. 2 1
      src/mol-app/ui/transform/carbohydrate.tsx
  4. 2 1
      src/mol-app/ui/transform/cartoon.tsx
  5. 2 1
      src/mol-app/ui/transform/distance-restraint.tsx
  6. 2 1
      src/mol-app/ui/transform/spacefill.tsx
  7. 2 1
      src/mol-geo/representation/structure/index.ts
  8. 1 1
      src/mol-geo/representation/structure/representation/ball-and-stick.ts
  9. 1 1
      src/mol-geo/representation/structure/representation/distance-restraint.ts
  10. 1 1
      src/mol-geo/representation/structure/visual/carbohydrate-link-cylinder.ts
  11. 1 1
      src/mol-geo/representation/structure/visual/carbohydrate-symbol-mesh.ts
  12. 1 1
      src/mol-geo/representation/structure/visual/cross-link-restraint-cylinder.ts
  13. 1 1
      src/mol-geo/representation/structure/visual/element-point.ts
  14. 1 1
      src/mol-geo/representation/structure/visual/inter-unit-link-cylinder.ts
  15. 1 1
      src/mol-geo/representation/structure/visual/intra-unit-link-cylinder.ts
  16. 2 3
      src/mol-geo/representation/structure/visual/util/common.ts
  17. 1 2
      src/mol-geo/representation/structure/visual/util/element.ts
  18. 0 42
      src/mol-geo/theme/index.ts
  19. 0 31
      src/mol-geo/theme/structure/color/index.ts
  20. 0 22
      src/mol-geo/theme/structure/size/index.ts
  21. 50 0
      src/mol-view/theme/color.ts
  22. 2 3
      src/mol-view/theme/color/carbohydrate-symbol.ts
  23. 1 2
      src/mol-view/theme/color/chain-id.ts
  24. 2 3
      src/mol-view/theme/color/element-index.ts
  25. 1 2
      src/mol-view/theme/color/element-symbol.ts
  26. 1 2
      src/mol-view/theme/color/uniform.ts
  27. 2 3
      src/mol-view/theme/color/unit-index.ts
  28. 37 0
      src/mol-view/theme/size.ts
  29. 1 2
      src/mol-view/theme/size/physical.ts
  30. 1 2
      src/mol-view/theme/size/uniform.ts

+ 2 - 1
src/mol-app/ui/transform/backbone.tsx

@@ -15,7 +15,8 @@ import { Toggle } from '../controls/common';
 import { BackboneEntity } from 'mol-view/state/entity';
 import { BackboneUpdate } from 'mol-view/state/transform'
 import { StateContext } from 'mol-view/state/context';
-import { ColorThemeProps, SizeThemeProps, ColorThemeNames, ColorThemeName } from 'mol-geo/theme';
+import { ColorThemeProps, ColorThemeNames, ColorThemeName } from 'mol-view/theme/color';
+import { SizeThemeProps } from 'mol-view/theme/size';
 import { Color, ColorNames } from 'mol-util/color';
 import { Slider } from '../controls/slider';
 import { VisualQuality } from 'mol-geo/representation/util';

+ 2 - 1
src/mol-app/ui/transform/ball-and-stick.tsx

@@ -15,7 +15,8 @@ import { Toggle } from '../controls/common';
 import { DistanceRestraintEntity } from 'mol-view/state/entity';
 import { DistanceRestraintUpdate } from 'mol-view/state/transform'
 import { StateContext } from 'mol-view/state/context';
-import { ColorThemeProps, SizeThemeProps, ColorThemeName, ColorThemeNames } from 'mol-geo/theme';
+import { ColorThemeProps, ColorThemeNames, ColorThemeName } from 'mol-view/theme/color';
+import { SizeThemeProps } from 'mol-view/theme/size';
 import { Color, ColorNames } from 'mol-util/color';
 import { Slider } from '../controls/slider';
 import { VisualQuality } from 'mol-geo/representation/util';

+ 2 - 1
src/mol-app/ui/transform/carbohydrate.tsx

@@ -15,7 +15,8 @@ import { Toggle } from '../controls/common';
 import { CarbohydrateEntity } from 'mol-view/state/entity';
 import { CarbohydrateUpdate } from 'mol-view/state/transform'
 import { StateContext } from 'mol-view/state/context';
-import { ColorThemeProps, SizeThemeProps, ColorThemeName, ColorThemeNames } from 'mol-geo/theme';
+import { ColorThemeProps, ColorThemeNames, ColorThemeName } from 'mol-view/theme/color';
+import { SizeThemeProps } from 'mol-view/theme/size';
 import { Color, ColorNames } from 'mol-util/color';
 import { Slider } from '../controls/slider';
 import { VisualQuality } from 'mol-geo/representation/util';

+ 2 - 1
src/mol-app/ui/transform/cartoon.tsx

@@ -15,7 +15,8 @@ import { Toggle } from '../controls/common';
 import { CartoonEntity } from 'mol-view/state/entity';
 import { CartoonUpdate } from 'mol-view/state/transform'
 import { StateContext } from 'mol-view/state/context';
-import { ColorThemeProps, SizeThemeProps, ColorThemeName, ColorThemeNames } from 'mol-geo/theme';
+import { ColorThemeProps, ColorThemeNames, ColorThemeName } from 'mol-view/theme/color';
+import { SizeThemeProps } from 'mol-view/theme/size';
 import { Color, ColorNames } from 'mol-util/color';
 import { Slider } from '../controls/slider';
 import { VisualQuality } from 'mol-geo/representation/util';

+ 2 - 1
src/mol-app/ui/transform/distance-restraint.tsx

@@ -15,7 +15,8 @@ import { Toggle } from '../controls/common';
 import { DistanceRestraintEntity } from 'mol-view/state/entity';
 import { DistanceRestraintUpdate } from 'mol-view/state/transform'
 import { StateContext } from 'mol-view/state/context';
-import { ColorThemeProps, SizeThemeProps, ColorThemeName, ColorThemeNames } from 'mol-geo/theme';
+import { ColorThemeProps, ColorThemeNames, ColorThemeName } from 'mol-view/theme/color';
+import { SizeThemeProps } from 'mol-view/theme/size';
 import { Color, ColorNames } from 'mol-util/color';
 import { Slider } from '../controls/slider';
 import { VisualQuality } from 'mol-geo/representation/util';

+ 2 - 1
src/mol-app/ui/transform/spacefill.tsx

@@ -15,7 +15,8 @@ import { Toggle } from '../controls/common';
 import { SpacefillEntity } from 'mol-view/state/entity';
 import { SpacefillUpdate } from 'mol-view/state/transform'
 import { StateContext } from 'mol-view/state/context';
-import { ColorThemeProps, SizeThemeProps, ColorThemeName, ColorThemeNames } from 'mol-geo/theme';
+import { ColorThemeProps, ColorThemeNames, ColorThemeName } from 'mol-view/theme/color';
+import { SizeThemeProps } from 'mol-view/theme/size';
 import { Color, ColorNames } from 'mol-util/color';
 import { Slider } from '../controls/slider';
 import { VisualQuality } from 'mol-geo/representation/util';

+ 2 - 1
src/mol-geo/representation/structure/index.ts

@@ -6,8 +6,9 @@
  */
 
 import { Structure } from 'mol-model/structure';
+import { ColorThemeProps } from 'mol-view/theme/color';
+import { SizeThemeProps } from 'mol-view/theme/size';
 import { Representation, RepresentationProps } from '..';
-import { ColorThemeProps, SizeThemeProps } from '../../theme';
 import { DefaultBaseProps, DefaultMeshProps } from '../util';
 
 export interface StructureRepresentation<P extends RepresentationProps = {}> extends Representation<Structure, P> { }

+ 1 - 1
src/mol-geo/representation/structure/representation/ball-and-stick.ts

@@ -12,8 +12,8 @@ import { Structure, Unit } from 'mol-model/structure';
 import { Task } from 'mol-task';
 import { Loci, isEmptyLoci } from 'mol-model/loci';
 import { MarkerAction } from '../../../util/marker-data';
-import { SizeThemeProps } from '../../../theme';
 import { InterUnitLinkVisual } from '../visual/inter-unit-link-cylinder';
+import { SizeThemeProps } from 'mol-view/theme/size';
 
 export const DefaultBallAndStickProps = {
     ...DefaultElementSphereProps,

+ 1 - 1
src/mol-geo/representation/structure/representation/distance-restraint.ts

@@ -10,8 +10,8 @@ import { Structure } from 'mol-model/structure';
 import { Task } from 'mol-task';
 import { Loci } from 'mol-model/loci';
 import { MarkerAction } from '../../../util/marker-data';
-import { SizeThemeProps } from '../../../theme';
 import { CrossLinkRestraintVisual, DefaultCrossLinkRestraintProps } from '../visual/cross-link-restraint-cylinder';
+import { SizeThemeProps } from 'mol-view/theme/size';
 
 export const DefaultDistanceRestraintProps = {
     ...DefaultCrossLinkRestraintProps,

+ 1 - 1
src/mol-geo/representation/structure/visual/carbohydrate-link-cylinder.ts

@@ -10,13 +10,13 @@ import { RuntimeContext } from 'mol-task'
 import { Mesh } from '../../../shape/mesh';
 import { PickingId } from '../../../util/picking';
 import { Loci, EmptyLoci } from 'mol-model/loci';
-import { SizeThemeProps } from '../../../theme';
 import { DefaultMeshProps } from '../../util';
 import { Vec3 } from 'mol-math/linear-algebra';
 import { LocationIterator } from './util/location-iterator';
 import { createLinkCylinderMesh, DefaultLinkCylinderProps, LinkCylinderProps } from './util/link';
 import { OrderedSet, Interval } from 'mol-data/int';
 import { ComplexMeshVisual } from '../complex-visual';
+import { SizeThemeProps } from 'mol-view/theme/size';
 
 // TODO create seperate visual
 // for (let i = 0, il = carbohydrates.terminalLinks.length; i < il; ++i) {

+ 1 - 1
src/mol-geo/representation/structure/visual/carbohydrate-symbol-mesh.ts

@@ -10,7 +10,6 @@ import { RuntimeContext } from 'mol-task'
 import { Mesh } from '../../../shape/mesh';
 import { PickingId } from '../../../util/picking';
 import { Loci, EmptyLoci } from 'mol-model/loci';
-import { SizeThemeProps } from '../../../theme';
 import { DefaultMeshProps } from '../../util';
 import { MeshBuilder } from '../../../shape/mesh-builder';
 import { Vec3, Mat4 } from 'mol-math/linear-algebra';
@@ -18,6 +17,7 @@ import { getSaccharideShape, SaccharideShapes } from 'mol-model/structure/struct
 import { LocationIterator } from './util/location-iterator';
 import { OrderedSet, Interval } from 'mol-data/int';
 import { ComplexMeshVisual } from '../complex-visual';
+import { SizeThemeProps } from 'mol-view/theme/size';
 
 const t = Mat4.identity()
 const sVec = Vec3.zero()

+ 1 - 1
src/mol-geo/representation/structure/visual/cross-link-restraint-cylinder.ts

@@ -12,10 +12,10 @@ import { Mesh } from '../../../shape/mesh';
 import { PickingId } from '../../../util/picking';
 import { Vec3 } from 'mol-math/linear-algebra';
 import { Loci, EmptyLoci } from 'mol-model/loci';
-import { SizeThemeProps } from '../../../theme';
 import { ComplexMeshVisual } from '../complex-visual';
 import { LocationIterator } from './util/location-iterator';
 import { Interval } from 'mol-data/int';
+import { SizeThemeProps } from 'mol-view/theme/size';
 
 async function createCrossLinkRestraintCylinderMesh(ctx: RuntimeContext, structure: Structure, props: LinkCylinderProps, mesh?: Mesh) {
 

+ 1 - 1
src/mol-geo/representation/structure/visual/element-point.ts

@@ -11,7 +11,6 @@ import { Unit } from 'mol-model/structure';
 import { RuntimeContext } from 'mol-task'
 
 import { UnitsVisual, DefaultStructureProps } from '..';
-import { SizeThemeProps } from '../../../theme';
 import { getElementLoci } from './util/element';
 import { createTransforms, createColors, createSizes } from './util/common';
 import { deepEqual, defaults } from 'mol-util';
@@ -23,6 +22,7 @@ import { MarkerAction, createMarkers } from '../../../util/marker-data';
 import { Vec3 } from 'mol-math/linear-algebra';
 import { fillSerial } from 'mol-util/array';
 import { StructureElementIterator } from './util/location-iterator';
+import { SizeThemeProps } from 'mol-view/theme/size';
 
 export const DefaultPointProps = {
     ...DefaultStructureProps,

+ 1 - 1
src/mol-geo/representation/structure/visual/inter-unit-link-cylinder.ts

@@ -12,10 +12,10 @@ import { Mesh } from '../../../shape/mesh';
 import { PickingId } from '../../../util/picking';
 import { Vec3 } from 'mol-math/linear-algebra';
 import { Loci, EmptyLoci } from 'mol-model/loci';
-import { SizeThemeProps } from '../../../theme';
 import { LinkIterator } from './util/location-iterator';
 import { ComplexMeshVisual } from '../complex-visual';
 import { Interval } from 'mol-data/int';
+import { SizeThemeProps } from 'mol-view/theme/size';
 
 async function createInterUnitLinkCylinderMesh(ctx: RuntimeContext, structure: Structure, props: LinkCylinderProps, mesh?: Mesh) {
     const links = structure.links

+ 1 - 1
src/mol-geo/representation/structure/visual/intra-unit-link-cylinder.ts

@@ -13,10 +13,10 @@ import { Mesh } from '../../../shape/mesh';
 import { PickingId } from '../../../util/picking';
 import { Vec3 } from 'mol-math/linear-algebra';
 import { Loci, EmptyLoci } from 'mol-model/loci';
-import { SizeThemeProps } from '../../../theme';
 import { LinkIterator } from './util/location-iterator';
 import { UnitsMeshVisual, DefaultUnitsMeshProps } from '../units-visual';
 import { Interval } from 'mol-data/int';
+import { SizeThemeProps } from 'mol-view/theme/size';
 
 async function createIntraUnitLinkCylinderMesh(ctx: RuntimeContext, unit: Unit, props: LinkCylinderProps, mesh?: Mesh) {
     if (!Unit.isAtomic(unit)) return Mesh.createEmpty(mesh)

+ 2 - 3
src/mol-geo/representation/structure/visual/util/common.ts

@@ -10,8 +10,6 @@ import { Mat4 } from 'mol-math/linear-algebra'
 
 import { createUniformColor, ColorData, createElementColor, createElementInstanceColor, createInstanceColor } from '../../../../util/color-data';
 import { createUniformSize, SizeData, createElementSize, createElementInstanceSize, createInstanceSize } from '../../../../util/size-data';
-import { ColorThemeProps, SizeThemeProps } from '../../../../theme';
-import { ColorTheme } from '../../../../theme/structure/color';
 import { ValueCell } from 'mol-util';
 import { LocationIterator } from './location-iterator';
 import { Mesh } from '../../../../shape/mesh';
@@ -21,7 +19,8 @@ import { MeshProps, createMeshValues, createRenderableState } from '../../../uti
 import { StructureProps } from '../..';
 import { createMarkers } from '../../../../util/marker-data';
 import { createMeshRenderObject } from 'mol-gl/render-object';
-import { SizeTheme } from '../../../../theme/structure/size';
+import { ColorThemeProps, ColorTheme } from 'mol-view/theme/color';
+import { SizeThemeProps, SizeTheme } from 'mol-view/theme/size';
 
 export function createTransforms({ units }: Unit.SymmetryGroup, transforms?: ValueCell<Float32Array>) {
     const unitCount = units.length

+ 1 - 2
src/mol-geo/representation/structure/visual/util/element.ts

@@ -13,8 +13,7 @@ import { MeshBuilder } from '../../../../shape/mesh-builder';
 import { Loci, EmptyLoci } from 'mol-model/loci';
 import { Interval, OrderedSet } from 'mol-data/int';
 import { PickingId } from '../../../../util/picking';
-import { SizeThemeProps } from '../../../../theme';
-import { SizeTheme } from '../../../../theme/structure/size';
+import { SizeTheme, SizeThemeProps } from 'mol-view/theme/size';
 
 export interface ElementSphereMeshProps {
     sizeTheme: SizeThemeProps,

+ 0 - 42
src/mol-geo/theme/index.ts

@@ -1,42 +0,0 @@
-/**
- * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
- *
- * @author Alexander Rose <alexander.rose@weirdbyte.de>
- */
-
-import { Color } from 'mol-util/color';
-import { Structure } from 'mol-model/structure';
-
-export interface ColorThemeProps {
-    name: 'element-index' | 'chain-id'| 'unit-index' | 'uniform' | 'carbohydrate-symbol' | 'element-symbol'
-    domain?: [number, number]
-    value?: Color
-    structure?: Structure
-}
-
-export const ColorThemeInfo = {
-    'element-index': {},
-    'carbohydrate-symbol': {},
-    'chain-id': {},
-    'element-symbol': {},
-    'unit-index': {},
-    'uniform': {}
-}
-export type ColorThemeName = keyof typeof ColorThemeInfo
-export const ColorThemeNames = Object.keys(ColorThemeInfo)
-
-//
-
-export interface SizeThemeProps {
-    name: 'physical' | 'uniform'
-    value?: number
-    factor?: number
-    structure?: Structure
-}
-
-export const SizeThemeInfo = {
-    'physical': {},
-    'uniform': {}
-}
-export type SizeThemeName = keyof typeof SizeThemeInfo
-export const SizeThemeNames = Object.keys(SizeThemeInfo)

+ 0 - 31
src/mol-geo/theme/structure/color/index.ts

@@ -1,31 +0,0 @@
-/**
- * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
- *
- * @author Alexander Rose <alexander.rose@weirdbyte.de>
- */
-
-import { ColorThemeProps } from '../..';
-
-import { ElementIndexColorTheme } from './element-index';
-import { CarbohydrateSymbolColorTheme } from './carbohydrate-symbol';
-import { ChainIdColorTheme } from './chain-id';
-import { ElementSymbolColorTheme } from './element-symbol';
-import { UnitIndexColorTheme } from './unit-index';
-import { UniformColorTheme } from './uniform';
-import { ColorType, LocationColor } from '../../../util/color-data';
-
-export interface ColorTheme {
-    kind: ColorType
-    color: LocationColor
-}
-
-export function ColorTheme(props: ColorThemeProps): ColorTheme {
-    switch (props.name) {
-        case 'element-index': return ElementIndexColorTheme(props)
-        case 'carbohydrate-symbol': return CarbohydrateSymbolColorTheme(props)
-        case 'chain-id': return ChainIdColorTheme(props)
-        case 'element-symbol': return ElementSymbolColorTheme(props)
-        case 'unit-index': return UnitIndexColorTheme(props)
-        case 'uniform': return UniformColorTheme(props)
-    }
-}

+ 0 - 22
src/mol-geo/theme/structure/size/index.ts

@@ -1,22 +0,0 @@
-/**
- * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
- *
- * @author Alexander Rose <alexander.rose@weirdbyte.de>
- */
-
-import { SizeType, LocationSize } from '../../../util/size-data';
-import { SizeThemeProps } from '../..';
-import { PhysicalSizeTheme } from './physical';
-import { UniformSizeTheme } from './uniform';
-
-export interface SizeTheme {
-    kind: SizeType
-    size: LocationSize
-}
-
-export function SizeTheme(props: SizeThemeProps): SizeTheme {
-    switch (props.name) {
-        case 'physical': return PhysicalSizeTheme(props)
-        case 'uniform': return UniformSizeTheme(props)
-    }
-}

+ 50 - 0
src/mol-view/theme/color.ts

@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
+ */
+
+import { Color } from 'mol-util/color';
+import { Structure } from 'mol-model/structure';
+import { ColorType, LocationColor } from 'mol-geo/util/color-data';
+
+import { ElementIndexColorTheme } from './color/element-index';
+import { CarbohydrateSymbolColorTheme } from './color/carbohydrate-symbol';
+import { ChainIdColorTheme } from './color/chain-id';
+import { ElementSymbolColorTheme } from './color/element-symbol';
+import { UnitIndexColorTheme } from './color/unit-index';
+import { UniformColorTheme } from './color/uniform';
+
+export interface ColorTheme {
+    kind: ColorType
+    color: LocationColor
+}
+
+export function ColorTheme(props: ColorThemeProps): ColorTheme {
+    switch (props.name) {
+        case 'element-index': return ElementIndexColorTheme(props)
+        case 'carbohydrate-symbol': return CarbohydrateSymbolColorTheme(props)
+        case 'chain-id': return ChainIdColorTheme(props)
+        case 'element-symbol': return ElementSymbolColorTheme(props)
+        case 'unit-index': return UnitIndexColorTheme(props)
+        case 'uniform': return UniformColorTheme(props)
+    }
+}
+
+export interface ColorThemeProps {
+    name: 'element-index' | 'chain-id'| 'unit-index' | 'uniform' | 'carbohydrate-symbol' | 'element-symbol'
+    domain?: [number, number]
+    value?: Color
+    structure?: Structure
+}
+
+export const ColorThemeInfo = {
+    'element-index': {},
+    'carbohydrate-symbol': {},
+    'chain-id': {},
+    'element-symbol': {},
+    'unit-index': {},
+    'uniform': {}
+}
+export type ColorThemeName = keyof typeof ColorThemeInfo
+export const ColorThemeNames = Object.keys(ColorThemeInfo)

+ 2 - 3
src/mol-geo/theme/structure/color/carbohydrate-symbol.ts → src/mol-view/theme/color/carbohydrate-symbol.ts

@@ -6,11 +6,10 @@
 
 import { StructureElement, Link, ElementIndex, Unit } from 'mol-model/structure';
 
-import { ColorThemeProps } from '../..';
 import { SaccharideColors } from 'mol-model/structure/structure/carbohydrates/constants';
 import { Location } from 'mol-model/location';
-import { ColorTheme } from '.';
-import { LocationColor } from '../../../util/color-data';
+import { ColorThemeProps, ColorTheme } from '../color';
+import { LocationColor } from 'mol-geo/util/color-data';
 
 const DefaultColor = 0xCCCCCC;
 

+ 1 - 2
src/mol-geo/theme/structure/color/chain-id.ts → src/mol-view/theme/color/chain-id.ts

@@ -8,8 +8,7 @@ import { Unit, StructureProperties, StructureElement, Link } from 'mol-model/str
 
 import { ColorScale, Color } from 'mol-util/color';
 import { Location } from 'mol-model/location';
-import { ColorThemeProps } from '../..';
-import { ColorTheme } from '.';
+import { ColorThemeProps, ColorTheme } from '../color';
 
 function getAsymId(unit: Unit): StructureElement.Property<string> {
     switch (unit.kind) {

+ 2 - 3
src/mol-geo/theme/structure/color/element-index.ts → src/mol-view/theme/color/element-index.ts

@@ -6,11 +6,10 @@
 
 import { ColorScale, Color } from 'mol-util/color';
 import { Location } from 'mol-model/location';
-import { ColorThemeProps } from '../..';
 import { StructureElement, Link, Unit } from 'mol-model/structure';
 import { OrderedSet } from 'mol-data/int';
-import { ColorTheme } from '.';
-import { LocationColor } from '../../../util/color-data';
+import { LocationColor } from 'mol-geo/util/color-data';
+import { ColorThemeProps, ColorTheme } from '../color';
 
 const DefaultColor = 0xCCCCCC;
 

+ 1 - 2
src/mol-geo/theme/structure/color/element-symbol.ts → src/mol-view/theme/color/element-symbol.ts

@@ -8,8 +8,7 @@ import { ElementSymbol } from 'mol-model/structure/model/types';
 import { Color } from 'mol-util/color';
 import { StructureElement, Unit, Link } from 'mol-model/structure';
 import { Location } from 'mol-model/location';
-import { ColorThemeProps } from '../..';
-import { ColorTheme } from '.';
+import { ColorThemeProps, ColorTheme } from '../color';
 
 // from Jmol http://jmol.sourceforge.net/jscolors/ (or 0xFFFFFF)
 export const ElementSymbolColors: { [k: string]: Color } = {

+ 1 - 2
src/mol-geo/theme/structure/color/uniform.ts → src/mol-view/theme/color/uniform.ts

@@ -4,8 +4,7 @@
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
 
-import { ColorThemeProps } from '../..';
-import { ColorTheme } from '.';
+import { ColorTheme, ColorThemeProps } from '../color';
 
 const DefaultColor = 0xCCCCCC;
 

+ 2 - 3
src/mol-geo/theme/structure/color/unit-index.ts → src/mol-view/theme/color/unit-index.ts

@@ -6,10 +6,9 @@
 
 import { ColorScale, Color } from 'mol-util/color';
 import { Location } from 'mol-model/location';
-import { ColorThemeProps } from '../..';
 import { Unit, StructureElement, Link } from 'mol-model/structure';
-import { ColorTheme } from '.';
-import { LocationColor } from '../../../util/color-data';
+import { LocationColor } from 'mol-geo/util/color-data';
+import { ColorTheme, ColorThemeProps } from '../color';
 
 const DefaultColor = 0xCCCCCC;
 

+ 37 - 0
src/mol-view/theme/size.ts

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
+ */
+
+import { Structure } from 'mol-model/structure';
+import { SizeType, LocationSize } from 'mol-geo/util/size-data';
+
+import { PhysicalSizeTheme } from './size/physical';
+import { UniformSizeTheme } from './size/uniform';
+
+export interface SizeTheme {
+    kind: SizeType
+    size: LocationSize
+}
+
+export function SizeTheme(props: SizeThemeProps): SizeTheme {
+    switch (props.name) {
+        case 'physical': return PhysicalSizeTheme(props)
+        case 'uniform': return UniformSizeTheme(props)
+    }
+}
+
+export interface SizeThemeProps {
+    name: 'physical' | 'uniform'
+    value?: number
+    factor?: number
+    structure?: Structure
+}
+
+export const SizeThemeInfo = {
+    'physical': {},
+    'uniform': {}
+}
+export type SizeThemeName = keyof typeof SizeThemeInfo
+export const SizeThemeNames = Object.keys(SizeThemeInfo)

+ 1 - 2
src/mol-geo/theme/structure/size/physical.ts → src/mol-view/theme/size/physical.ts

@@ -6,8 +6,7 @@
 
 import { StructureElement, Unit, StructureProperties, Link } from 'mol-model/structure';
 import { Location } from 'mol-model/location';
-import { SizeTheme } from '.';
-import { SizeThemeProps } from '../..';
+import { SizeThemeProps, SizeTheme } from '../size';
 
 const DefaultSize = 1
 const DefaultFactor = 1

+ 1 - 2
src/mol-geo/theme/structure/size/uniform.ts → src/mol-view/theme/size/uniform.ts

@@ -4,8 +4,7 @@
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
 
-import { SizeThemeProps } from '../..';
-import { SizeTheme } from '.';
+import { SizeTheme, SizeThemeProps } from '../size';
 
 const DefaultSize = 1
 const DefaultFactor = 1