molstar
Version:
A comprehensive macromolecular library.
123 lines (122 loc) • 5.15 kB
TypeScript
/**
* Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { StructureRepresentationPresetProvider } from '../../mol-plugin-state/builder/structure/representation-preset';
import { DataFormatProvider } from '../../mol-plugin-state/formats/provider';
import { BuiltInTrajectoryFormat } from '../../mol-plugin-state/formats/trajectory';
import { BuildInVolumeFormat } from '../../mol-plugin-state/formats/volume';
import { PluginUIContext } from '../../mol-plugin-ui/context';
import { PluginLayoutControlsDisplay } from '../../mol-plugin/layout';
import { PluginState } from '../../mol-plugin/state';
import { Color } from '../../mol-util/color';
import '../../mol-util/polyfill';
import './embedded.html';
import './favicon.ico';
import './index.html';
export { PLUGIN_VERSION as version } from '../../mol-plugin/version';
export { setDebugMode, setProductionMode } from '../../mol-util/debug';
declare const DefaultViewerOptions: {
customFormats: [string, DataFormatProvider<any, any, any>][];
extensions: ("g3d" | "cellpack" | "dnatco-confal-pyramids" | "pdbe-structure-quality-report" | "rcsb-assembly-symmetry" | "rcsb-validation-report" | "anvil-membrane-orientation" | "mp4-export" | "geo-export")[];
layoutIsExpanded: boolean;
layoutShowControls: boolean;
layoutShowRemoteState: boolean;
layoutControlsDisplay: PluginLayoutControlsDisplay;
layoutShowSequence: boolean;
layoutShowLog: boolean;
layoutShowLeftPanel: boolean;
collapseLeftPanel: boolean;
disableAntialiasing: boolean | undefined;
pixelScale: number | undefined;
pickScale: number | undefined;
pickPadding: number | undefined;
enableWboit: boolean | undefined;
viewportShowExpand: boolean | undefined;
viewportShowControls: boolean | undefined;
viewportShowSettings: boolean | undefined;
viewportShowSelectionMode: boolean | undefined;
viewportShowAnimation: boolean | undefined;
pluginStateServer: string | undefined;
volumeStreamingServer: string | undefined;
volumeStreamingDisabled: boolean;
pdbProvider: "rcsb" | "pdbe" | undefined;
emdbProvider: import("../../mol-plugin-state/actions/volume").EmdbDownloadProvider | undefined;
};
declare type ViewerOptions = typeof DefaultViewerOptions;
export declare class Viewer {
plugin: PluginUIContext;
constructor(elementOrId: string | HTMLElement, options?: Partial<ViewerOptions>);
setRemoteSnapshot(id: string): Promise<void>;
loadSnapshotFromUrl(url: string, type: PluginState.SnapshotType): Promise<void>;
loadStructureFromUrl(url: string, format?: BuiltInTrajectoryFormat, isBinary?: boolean, options?: LoadStructureOptions): Promise<void>;
loadAllModelsOrAssemblyFromUrl(url: string, format?: BuiltInTrajectoryFormat, isBinary?: boolean, options?: LoadStructureOptions): Promise<void>;
loadStructureFromData(data: string | number[], format: BuiltInTrajectoryFormat, options?: {
dataLabel?: string;
}): Promise<void>;
loadPdb(pdb: string, options?: LoadStructureOptions): Promise<void>;
loadPdbDev(pdbDev: string): Promise<void>;
loadEmdb(emdb: string, options?: {
detail?: number;
}): Promise<void>;
/**
* @example Load X-ray density from volume server
viewer.loadVolumeFromUrl({
url: 'https://www.ebi.ac.uk/pdbe/densities/x-ray/1tqn/cell?detail=3',
format: 'dscif',
isBinary: true
}, [{
type: 'relative',
value: 1.5,
color: 0x3362B2
}, {
type: 'relative',
value: 3,
color: 0x33BB33,
volumeIndex: 1
}, {
type: 'relative',
value: -3,
color: 0xBB3333,
volumeIndex: 1
}], {
entryId: ['2FO-FC', 'FO-FC'],
isLazy: true
});
* *********************
* @example Load EM density from volume server
viewer.loadVolumeFromUrl({
url: 'https://maps.rcsb.org/em/emd-30210/cell?detail=6',
format: 'dscif',
isBinary: true
}, [{
type: 'relative',
value: 1,
color: 0x3377aa
}], {
entryId: 'EMD-30210',
isLazy: true
});
*/
loadVolumeFromUrl({ url, format, isBinary }: {
url: string;
format: BuildInVolumeFormat;
isBinary: boolean;
}, isovalues: VolumeIsovalueInfo[], options?: {
entryId?: string | string[];
isLazy?: boolean;
}): Promise<void>;
handleResize(): void;
}
export interface LoadStructureOptions {
representationParams?: StructureRepresentationPresetProvider.CommonParams;
}
export interface VolumeIsovalueInfo {
type: 'absolute' | 'relative';
value: number;
color: Color;
alpha?: number;
volumeIndex?: number;
}