diff --git a/src/mol-plugin/behavior/dynamic/custom-props.ts b/src/mol-plugin/behavior/dynamic/custom-props.ts index 3b4c6f941c05684c6ff4b83aa7df9b2d6285a8d3..0c4680938fdb6087a9e1d41e648beb3276b35fad 100644 --- a/src/mol-plugin/behavior/dynamic/custom-props.ts +++ b/src/mol-plugin/behavior/dynamic/custom-props.ts @@ -39,7 +39,8 @@ export const PDBeStructureQualityReport = PluginBehavior.create<{ autoAttach: bo this.ctx.structureRepresentation.themeCtx.colorThemeRegistry.add('pdbe-structure-quality-report', { label: 'PDBe Structure Quality Report', factory: StructureQualityReportColorTheme, - getParams: () => ({}) + getParams: () => ({}), + defaultValues: {} }) } diff --git a/src/mol-plugin/state/transforms/representation.ts b/src/mol-plugin/state/transforms/representation.ts index 64c66e6c2660f79facd44cd2a60c6618174bf996..5ea400ae8624aed244518e79086f9aeaf2d66635 100644 --- a/src/mol-plugin/state/transforms/representation.ts +++ b/src/mol-plugin/state/transforms/representation.ts @@ -33,10 +33,8 @@ export namespace StructureRepresentation3DHelpers { export function getDefaultParamsStatic(ctx: PluginContext, name: BuiltInStructureRepresentationsName, meshParams?: Partial<PD.Values<UnitsMeshParams>>): Transformer.Params<StructureRepresentation3D> { const type = ctx.structureRepresentation.registry.get(name); - // TODO: there should be "static default properties" for the themes. - const themeDataCtx = { }; - const colorParams = ctx.structureRepresentation.themeCtx.colorThemeRegistry.get(type.defaultColorTheme).getParams(themeDataCtx); - const sizeParams = ctx.structureRepresentation.themeCtx.sizeThemeRegistry.get(type.defaultSizeTheme).getParams(themeDataCtx) + const colorParams = ctx.structureRepresentation.themeCtx.colorThemeRegistry.get(type.defaultColorTheme).defaultValues; + const sizeParams = ctx.structureRepresentation.themeCtx.sizeThemeRegistry.get(type.defaultSizeTheme).defaultValues return ({ type: { name, params: meshParams ? { ...type.defaultValues, ...meshParams } : type.defaultValues }, colorTheme: { name: type.defaultColorTheme, params: PD.getDefaultValues(colorParams) }, diff --git a/src/mol-theme/color.ts b/src/mol-theme/color.ts index e01bf5a667876dce361bbc51a312fe6771fb2cd5..32f98d654ed4b497d2390d26aceaaccf48acd3bf 100644 --- a/src/mol-theme/color.ts +++ b/src/mol-theme/color.ts @@ -55,8 +55,9 @@ namespace ColorTheme { readonly label: string readonly factory: (ctx: ThemeDataContext, props: PD.Values<P>) => ColorTheme<P> readonly getParams: (ctx: ThemeDataContext) => P + readonly defaultValues: PD.Values<P> } - export const EmptyProvider: Provider<{}> = { label: '', factory: EmptyFactory, getParams: () => ({}) } + export const EmptyProvider: Provider<{}> = { label: '', factory: EmptyFactory, getParams: () => ({}), defaultValues: {} } export class Registry { private _list: { name: string, provider: Provider<any> }[] = [] diff --git a/src/mol-theme/color/carbohydrate-symbol.ts b/src/mol-theme/color/carbohydrate-symbol.ts index 237dc5caaef0b5c8e35a2df113f36ac2d735884d..550c8f35d7799542fb62eba8903f7f1fdf5e50f2 100644 --- a/src/mol-theme/color/carbohydrate-symbol.ts +++ b/src/mol-theme/color/carbohydrate-symbol.ts @@ -77,5 +77,6 @@ export function CarbohydrateSymbolColorTheme(ctx: ThemeDataContext, props: PD.Va export const CarbohydrateSymbolColorThemeProvider: ColorTheme.Provider<CarbohydrateSymbolColorThemeParams> = { label: 'Carbohydrate Symbol', factory: CarbohydrateSymbolColorTheme, - getParams: getCarbohydrateSymbolColorThemeParams + getParams: getCarbohydrateSymbolColorThemeParams, + defaultValues: PD.getDefaultValues(CarbohydrateSymbolColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/chain-id.ts b/src/mol-theme/color/chain-id.ts index f8c6065f608a9acc568a2c5aab6b441ad0f6b1d2..eb37bf31c59088815d2d7401d5ef14645601c14e 100644 --- a/src/mol-theme/color/chain-id.ts +++ b/src/mol-theme/color/chain-id.ts @@ -94,5 +94,6 @@ export function ChainIdColorTheme(ctx: ThemeDataContext, props: PD.Values<ChainI export const ChainIdColorThemeProvider: ColorTheme.Provider<ChainIdColorThemeParams> = { label: 'Chain Id', factory: ChainIdColorTheme, - getParams: getChainIdColorThemeParams + getParams: getChainIdColorThemeParams, + defaultValues: PD.getDefaultValues(ChainIdColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/cross-link.ts b/src/mol-theme/color/cross-link.ts index 4c43e030a1d8a981f644c87fe6af66a558fb2bed..bfe6cc0acb1bf17374e3d745b804d63dfb3c4859 100644 --- a/src/mol-theme/color/cross-link.ts +++ b/src/mol-theme/color/cross-link.ts @@ -71,5 +71,6 @@ export function CrossLinkColorTheme(ctx: ThemeDataContext, props: PD.Values<Cros export const CrossLinkColorThemeProvider: ColorTheme.Provider<CrossLinkColorThemeParams> = { label: 'Cross Link', factory: CrossLinkColorTheme, - getParams: getCrossLinkColorThemeParams + getParams: getCrossLinkColorThemeParams, + defaultValues: PD.getDefaultValues(CrossLinkColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/element-index.ts b/src/mol-theme/color/element-index.ts index 5605cde9aa38612a2cbbbee73b0b0196ef0fafc2..c650f6c99f5847e7965840b431dbc08411571220 100644 --- a/src/mol-theme/color/element-index.ts +++ b/src/mol-theme/color/element-index.ts @@ -71,5 +71,6 @@ export function ElementIndexColorTheme(ctx: ThemeDataContext, props: PD.Values<E export const ElementIndexColorThemeProvider: ColorTheme.Provider<ElementIndexColorThemeParams> = { label: 'Element Index', factory: ElementIndexColorTheme, - getParams: getElementIndexColorThemeParams + getParams: getElementIndexColorThemeParams, + defaultValues: PD.getDefaultValues(ElementIndexColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/element-symbol.ts b/src/mol-theme/color/element-symbol.ts index 5ac58ef68fcab3c36f66012a8b2a588967b14264..bc15c9f232aedca3b9334eb6cd3f6751b2ba4438 100644 --- a/src/mol-theme/color/element-symbol.ts +++ b/src/mol-theme/color/element-symbol.ts @@ -63,5 +63,6 @@ export function ElementSymbolColorTheme(ctx: ThemeDataContext, props: PD.Values< export const ElementSymbolColorThemeProvider: ColorTheme.Provider<ElementSymbolColorThemeParams> = { label: 'Element Symbol', factory: ElementSymbolColorTheme, - getParams: getElementSymbolColorThemeParams + getParams: getElementSymbolColorThemeParams, + defaultValues: PD.getDefaultValues(ElementSymbolColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/molecule-type.ts b/src/mol-theme/color/molecule-type.ts index e4bc92b93f8dbb4c4b1d27a291dce73411f68017..b91c557afd98c6abb6dde170ad0a6ee4519b7aee 100644 --- a/src/mol-theme/color/molecule-type.ts +++ b/src/mol-theme/color/molecule-type.ts @@ -72,5 +72,6 @@ export function MoleculeTypeColorTheme(ctx: ThemeDataContext, props: PD.Values<M export const MoleculeTypeColorThemeProvider: ColorTheme.Provider<MoleculeTypeColorThemeParams> = { label: 'Molecule Type', factory: MoleculeTypeColorTheme, - getParams: getMoleculeTypeColorThemeParams + getParams: getMoleculeTypeColorThemeParams, + defaultValues: PD.getDefaultValues(MoleculeTypeColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/polymer-id.ts b/src/mol-theme/color/polymer-id.ts index 8ef2a42b8a726649b31d89b4d5bb2e8b6f5622c2..41b92030a827d5ab17c10d122a9c66370a6bf623 100644 --- a/src/mol-theme/color/polymer-id.ts +++ b/src/mol-theme/color/polymer-id.ts @@ -101,5 +101,6 @@ export function PolymerIdColorTheme(ctx: ThemeDataContext, props: PD.Values<Poly export const PolymerIdColorThemeProvider: ColorTheme.Provider<PolymerIdColorThemeParams> = { label: 'Polymer Id', factory: PolymerIdColorTheme, - getParams: getPolymerIdColorThemeParams + getParams: getPolymerIdColorThemeParams, + defaultValues: PD.getDefaultValues(PolymerIdColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/polymer-index.ts b/src/mol-theme/color/polymer-index.ts index 53ac666302efb9bb112c96a955345668539fa3aa..a51257fc888bfbc14189a5f8a42aaa398419354e 100644 --- a/src/mol-theme/color/polymer-index.ts +++ b/src/mol-theme/color/polymer-index.ts @@ -69,5 +69,6 @@ export function PolymerIndexColorTheme(ctx: ThemeDataContext, props: PD.Values<P export const PolymerIndexColorThemeProvider: ColorTheme.Provider<PolymerIndexColorThemeParams> = { label: 'Polymer Index', factory: PolymerIndexColorTheme, - getParams: getPolymerIndexColorThemeParams + getParams: getPolymerIndexColorThemeParams, + defaultValues: PD.getDefaultValues(PolymerIndexColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/residue-name.ts b/src/mol-theme/color/residue-name.ts index 9f4b8efc6bfa03d331feece34820cff8f916c8b7..682ae8a4bbe2aebbae81f9d5002a7ed6c66c7604 100644 --- a/src/mol-theme/color/residue-name.ts +++ b/src/mol-theme/color/residue-name.ts @@ -128,5 +128,6 @@ export function ResidueNameColorTheme(ctx: ThemeDataContext, props: PD.Values<Re export const ResidueNameColorThemeProvider: ColorTheme.Provider<ResidueNameColorThemeParams> = { label: 'Residue Name', factory: ResidueNameColorTheme, - getParams: getResidueNameColorThemeParams + getParams: getResidueNameColorThemeParams, + defaultValues: PD.getDefaultValues(ResidueNameColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/secondary-structure.ts b/src/mol-theme/color/secondary-structure.ts index 3deb17a2127e5799e5f806ca94bfe5b4e0e2a85d..6f2d094feecf2db20216fea84f4bc134997029bd 100644 --- a/src/mol-theme/color/secondary-structure.ts +++ b/src/mol-theme/color/secondary-structure.ts @@ -95,5 +95,6 @@ export function SecondaryStructureColorTheme(ctx: ThemeDataContext, props: PD.Va export const SecondaryStructureColorThemeProvider: ColorTheme.Provider<SecondaryStructureColorThemeParams> = { label: 'Secondary Structure', factory: SecondaryStructureColorTheme, - getParams: getSecondaryStructureColorThemeParams + getParams: getSecondaryStructureColorThemeParams, + defaultValues: PD.getDefaultValues(SecondaryStructureColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/sequence-id.ts b/src/mol-theme/color/sequence-id.ts index 96bf25a2320d464b067e5b1dfd4034e474cad1d0..cb8e49ffaacbfd888b3597cfb959c9c84dce9d83 100644 --- a/src/mol-theme/color/sequence-id.ts +++ b/src/mol-theme/color/sequence-id.ts @@ -102,5 +102,6 @@ export function SequenceIdColorTheme(ctx: ThemeDataContext, props: PD.Values<Seq export const SequenceIdColorThemeProvider: ColorTheme.Provider<SequenceIdColorThemeParams> = { label: 'Sequence Id', factory: SequenceIdColorTheme, - getParams: getSequenceIdColorThemeParams + getParams: getSequenceIdColorThemeParams, + defaultValues: PD.getDefaultValues(SequenceIdColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/shape-group.ts b/src/mol-theme/color/shape-group.ts index 052cd6d1ff13c17b390216f7113ea166b1fed9d1..b6cbba700b95935cda88dcd0ae6f4a393f2cbfe4 100644 --- a/src/mol-theme/color/shape-group.ts +++ b/src/mol-theme/color/shape-group.ts @@ -38,5 +38,6 @@ export function ShapeGroupColorTheme(ctx: ThemeDataContext, props: PD.Values<Sha export const ShapeGroupColorThemeProvider: ColorTheme.Provider<ShapeGroupColorThemeParams> = { label: 'Shape Group', factory: ShapeGroupColorTheme, - getParams: getShapeGroupColorThemeParams + getParams: getShapeGroupColorThemeParams, + defaultValues: PD.getDefaultValues(ShapeGroupColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/uniform.ts b/src/mol-theme/color/uniform.ts index 3908ac4e807cfb1d01765fe789b4d91221ca4ae3..8c702a9989c01c2bed0ebcd2e19068fc21a91a54 100644 --- a/src/mol-theme/color/uniform.ts +++ b/src/mol-theme/color/uniform.ts @@ -37,5 +37,6 @@ export function UniformColorTheme(ctx: ThemeDataContext, props: PD.Values<Unifor export const UniformColorThemeProvider: ColorTheme.Provider<UniformColorThemeParams> = { label: 'Uniform', factory: UniformColorTheme, - getParams: getUniformColorThemeParams + getParams: getUniformColorThemeParams, + defaultValues: PD.getDefaultValues(UniformColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/color/unit-index.ts b/src/mol-theme/color/unit-index.ts index fa179d1bbedadc3debdac4d2575b4e693518905a..4f9d14883d8cb91649250617549a839ed390970b 100644 --- a/src/mol-theme/color/unit-index.ts +++ b/src/mol-theme/color/unit-index.ts @@ -60,5 +60,6 @@ export function UnitIndexColorTheme(ctx: ThemeDataContext, props: PD.Values<Unit export const UnitIndexColorThemeProvider: ColorTheme.Provider<UnitIndexColorThemeParams> = { label: 'Unit Index', factory: UnitIndexColorTheme, - getParams: getUnitIndexColorThemeParams + getParams: getUnitIndexColorThemeParams, + defaultValues: PD.getDefaultValues(UnitIndexColorThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/size.ts b/src/mol-theme/size.ts index fe5a3a35265b6f11d71343e3c93508fdd75257e5..6433b60f3ae41ecede5ef4edbebd521333d42e7b 100644 --- a/src/mol-theme/size.ts +++ b/src/mol-theme/size.ts @@ -33,8 +33,9 @@ namespace SizeTheme { readonly label: string readonly factory: Factory<P> readonly getParams: (ctx: ThemeDataContext) => P + readonly defaultValues: PD.Values<P> } - export const EmptyProvider: Provider<{}> = { label: '', factory: EmptyFactory, getParams: () => ({}) } + export const EmptyProvider: Provider<{}> = { label: '', factory: EmptyFactory, getParams: () => ({}), defaultValues: {} } export class Registry { private _list: { name: string, provider: Provider<any> }[] = [] diff --git a/src/mol-theme/size/physical.ts b/src/mol-theme/size/physical.ts index 43da29365a2bf3e5ab76235a53d1090f55d3222a..b856912c418d09ae35c8e6aca966378b9381d30d 100644 --- a/src/mol-theme/size/physical.ts +++ b/src/mol-theme/size/physical.ts @@ -59,5 +59,6 @@ export function PhysicalSizeTheme(ctx: ThemeDataContext, props: PD.Values<Physic export const PhysicalSizeThemeProvider: SizeTheme.Provider<PhysicalSizeThemeParams> = { label: 'Physical', factory: PhysicalSizeTheme, - getParams: getPhysicalSizeThemeParams + getParams: getPhysicalSizeThemeParams, + defaultValues: PD.getDefaultValues(PhysicalSizeThemeParams) } \ No newline at end of file diff --git a/src/mol-theme/size/uniform.ts b/src/mol-theme/size/uniform.ts index c60239110b5850b5ea11c182a393cdf728871175..3d91d0c353985aeb0a5b5baedf15b7b93f775cee 100644 --- a/src/mol-theme/size/uniform.ts +++ b/src/mol-theme/size/uniform.ts @@ -33,5 +33,6 @@ export function UniformSizeTheme(ctx: ThemeDataContext, props: PD.Values<Uniform export const UniformSizeThemeProvider: SizeTheme.Provider<UniformSizeThemeParams> = { label: 'Uniform', factory: UniformSizeTheme, - getParams: getUniformSizeThemeParams + getParams: getUniformSizeThemeParams, + defaultValues: PD.getDefaultValues(UniformSizeThemeParams) } \ No newline at end of file