diff --git a/src/apps/viewer/extensions/jolecule.ts b/src/apps/viewer/extensions/jolecule.ts deleted file mode 100644 index 678a722fd7e4901046992bf3cfdbe49d4500d9fd..0000000000000000000000000000000000000000 --- a/src/apps/viewer/extensions/jolecule.ts +++ /dev/null @@ -1,168 +0,0 @@ -// /** -// * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info. -// * -// * @author David Sehnal <david.sehnal@gmail.com> -// */ - -// import { StateTree, StateBuilder, StateAction, State } from '../../../mol-state'; -// import { StateTransforms } from '../../../mol-plugin/state/transforms'; -// import { createModelTree } from '../../../mol-plugin/state/actions/structure'; -// import { PluginContext } from '../../../mol-plugin/context'; -// import { PluginStateObject } from '../../../mol-plugin/state/objects'; -// import { ParamDefinition } from '../../../mol-util/param-definition'; -// import { PluginCommands } from '../../../mol-plugin/command'; -// import { Vec3 } from '../../../mol-math/linear-algebra'; -// import { PluginStateSnapshotManager } from '../../../mol-plugin/state/snapshots'; -// import { MolScriptBuilder as MS } from '../../../mol-script/language/builder'; -// import { Text } from '../../../mol-geo/geometry/text/text'; -// import { UUID } from '../../../mol-util'; -// import { ColorNames } from '../../../mol-util/color/names'; -// import { Camera } from '../../../mol-canvas3d/camera'; -// import { createStructureRepresentation3dParamss } from '../../../mol-plugin/state/transforms/representation'; -// import { createDefaultStructureComplex } from '../../../mol-plugin/util/structure-complex-helper'; - -// export const CreateJoleculeState = StateAction.build({ -// display: { name: 'Jolecule State Import' }, -// params: { id: ParamDefinition.Text('1mbo') }, -// from: PluginStateObject.Root -// })(async ({ ref, state, params }, plugin: PluginContext) => { -// try { -// const id = params.id.trim().toLowerCase(); -// const data = await plugin.runTask(plugin.fetch({ url: `https://jolecule.appspot.com/pdb/${id}.views.json`, type: 'json' })) as JoleculeSnapshot[]; - -// data.sort((a, b) => a.order - b.order); - -// await PluginCommands.State.RemoveObject.dispatch(plugin, { state, ref }); -// plugin.state.snapshots.clear(); - -// const template = createTemplate(plugin, state, id); -// const snapshots = data.map((e, idx) => buildSnapshot(plugin, template, { e, idx, len: data.length })); -// for (const s of snapshots) { -// plugin.state.snapshots.add(s); -// } - -// PluginCommands.State.Snapshots.Apply.dispatch(plugin, { id: snapshots[0].snapshot.id }); -// } catch (e) { -// plugin.log.error(`Jolecule Failed: ${e}`); -// } -// }); - -// interface JoleculeSnapshot { -// order: number, -// distances: { i_atom1: number, i_atom2: number }[], -// labels: { i_atom: number, text: string }[], -// camera: { up: Vec3, pos: Vec3, in: Vec3, slab: { z_front: number, z_back: number, zoom: number } }, -// selected: number[], -// text: string -// } - -// function createTemplate(plugin: PluginContext, state: State, id: string) { -// const b = new StateBuilder.Root(state.tree); -// const data = b.toRoot().apply(StateTransforms.Data.Download, { url: `https://www.ebi.ac.uk/pdbe/static/entry/${id}_updated.cif` }, { state: { isGhost: true }}); -// const model = createModelTree(data, 'cif'); -// const structure = model.apply(StateTransforms.Model.StructureFromModel); -// createDefaultStructureComplex(plugin, structure); -// return { tree: b.getTree(), structure: structure.ref }; -// } - -// const labelOptions: ParamDefinition.Values<Text.Params> = { -// ...ParamDefinition.getDefaultValues(Text.Params), -// tether: true, -// sizeFactor: 1.3, -// attachment: 'bottom-right', -// offsetZ: 10, -// background: true, -// backgroundMargin: 0.2, -// backgroundColor: ColorNames.skyblue, -// backgroundOpacity: 0.9 -// } - -// // const distanceLabelOptions = { -// // ...ParamDefinition.getDefaultValues(Text.Params), -// // sizeFactor: 1, -// // offsetX: 0, -// // offsetY: 0, -// // offsetZ: 10, -// // background: true, -// // backgroundMargin: 0.2, -// // backgroundColor: ColorNames.snow, -// // backgroundOpacity: 0.9 -// // } - -// function buildSnapshot(plugin: PluginContext, template: { tree: StateTree, structure: string }, params: { e: JoleculeSnapshot, idx: number, len: number }): PluginStateSnapshotManager.Entry { -// const b = new StateBuilder.Root(template.tree); - -// let i = 0; -// for (const l of params.e.labels) { -// const expression = createExpression([l.i_atom]); -// const group = b.to(template.structure) -// .group(StateTransforms.Misc.CreateGroup, { label: `Label ${++i}` }); - -// group -// .apply(StateTransforms.Model.StructureSelectionFromExpression, { expression, label: 'Atom' }) -// .apply(StateTransforms.Representation.StructureLabels3D, { -// target: { name: 'static-text', params: { value: l.text || '' } }, -// options: labelOptions -// }); - -// group -// .apply(StateTransforms.Model.StructureSelectionFromExpression, { expression: MS.struct.modifier.wholeResidues([ expression ]), label: 'Residue' }) -// .apply(StateTransforms.Representation.StructureRepresentation3D, -// createStructureRepresentation3dParamss.getDefaultParamsStatic(plugin, 'ball-and-stick', { })); -// } -// if (params.e.selected && params.e.selected.length > 0) { -// b.to(template.structure) -// .apply(StateTransforms.Model.StructureSelectionFromExpression, { expression: createExpression(params.e.selected), label: `Selected` }) -// .apply(StateTransforms.Representation.StructureRepresentation3D, -// createStructureRepresentation3dParamss.getDefaultParamsStatic(plugin, 'ball-and-stick')); -// } -// // TODO -// // for (const l of params.e.distances) { -// // b.to('structure') -// // .apply(StateTransforms.Model.StructureSelectionFromExpression, { query: createQuery([l.i_atom1, l.i_atom2]), label: `Distance ${++i}` }) -// // .apply(StateTransforms.Representation.StructureLabels3D, { -// // target: { name: 'static-text', params: { value: l. || '' } }, -// // options: labelOptions -// // }); -// // } -// return PluginStateSnapshotManager.Entry({ -// id: UUID.create22(), -// data: { tree: StateTree.toJSON(b.getTree()) }, -// camera: { -// current: getCameraSnapshot(params.e.camera), -// transitionStyle: 'animate', -// transitionDurationInMs: 350 -// } -// }, { -// name: params.e.text -// }); -// } - -// function getCameraSnapshot(e: JoleculeSnapshot['camera']): Camera.Snapshot { -// const direction = Vec3.sub(Vec3(), e.pos, e.in); -// Vec3.normalize(direction, direction); -// const up = Vec3.sub(Vec3(), e.pos, e.up); -// Vec3.normalize(up, up); - -// const s: Camera.Snapshot = { -// mode: 'perspective', -// fov: Math.PI / 4, -// position: Vec3.scaleAndAdd(Vec3(), e.pos, direction, e.slab.zoom), -// target: e.pos, -// radius: (e.slab.z_back - e.slab.z_front) / 2, -// fog: 50, -// up, -// }; -// return s; -// } - -// function createExpression(atomIndices: number[]) { -// if (atomIndices.length === 0) return MS.struct.generator.empty(); - -// return MS.struct.generator.atomGroups({ -// 'atom-test': atomIndices.length === 1 -// ? MS.core.rel.eq([MS.struct.atomProperty.core.sourceIndex(), atomIndices[0]]) -// : MS.core.set.has([MS.set.apply(null, atomIndices), MS.struct.atomProperty.core.sourceIndex()]), -// 'group-by': 0 -// }); -// } \ No newline at end of file diff --git a/src/apps/viewer/index.ts b/src/apps/viewer/index.ts index 5dd4449c6ae56796b1071bac104b03dd66ad7c1c..64afb24014811f308969011375cd9bb5862aaac9 100644 --- a/src/apps/viewer/index.ts +++ b/src/apps/viewer/index.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2018-2019 mol* contributors, licensed under MIT, See LICENSE file for more info. + * Copyright (c) 2018-2020 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> @@ -12,10 +12,9 @@ import './favicon.ico'; import { PluginContext } from '../../mol-plugin/context'; import { PluginCommands } from '../../mol-plugin/commands'; import { PluginSpec } from '../../mol-plugin/spec'; -import { LoadCellPackModel } from './extensions/cellpack/model'; -import { StructureFromCellpack } from './extensions/cellpack/state'; import { DownloadStructure } from '../../mol-plugin-state/actions/structure'; import { PluginConfig } from '../../mol-plugin/config'; +import { CellPack } from '../../extensions/cellpack'; require('mol-plugin-ui/skin/light.scss'); function getParam(name: string, regex: string): string { @@ -27,13 +26,11 @@ const hideControls = getParam('hide-controls', `[^&]+`) === '1'; function init() { const spec: PluginSpec = { - actions: [ - ...DefaultPluginSpec.actions, - // PluginSpec.Action(CreateJoleculeState), - PluginSpec.Action(LoadCellPackModel), - PluginSpec.Action(StructureFromCellpack), + actions: [...DefaultPluginSpec.actions], + behaviors: [ + ...DefaultPluginSpec.behaviors, + PluginSpec.Behavior(CellPack) ], - behaviors: [...DefaultPluginSpec.behaviors], animations: [...DefaultPluginSpec.animations || []], customParamEditors: DefaultPluginSpec.customParamEditors, layout: { diff --git a/src/apps/viewer/extensions/cellpack/color.ts b/src/extensions/cellpack/color.ts similarity index 82% rename from src/apps/viewer/extensions/cellpack/color.ts rename to src/extensions/cellpack/color.ts index 7491face8403910983893864d36f9ae5d69e8bdf..492b602c9e4da9334b404611650bce6127e2a254 100644 --- a/src/apps/viewer/extensions/cellpack/color.ts +++ b/src/extensions/cellpack/color.ts @@ -4,17 +4,17 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { ThemeDataContext } from '../../../../mol-theme/theme'; -import { ParamDefinition as PD } from '../../../../mol-util/param-definition'; -import { Color } from '../../../../mol-util/color'; -import { getPalette } from '../../../../mol-util/color/palette'; -import { ColorTheme, LocationColor } from '../../../../mol-theme/color'; -import { ScaleLegend, TableLegend } from '../../../../mol-util/legend'; -import { StructureElement, Bond } from '../../../../mol-model/structure'; -import { Location } from '../../../../mol-model/location'; +import { ThemeDataContext } from '../../mol-theme/theme'; +import { ParamDefinition as PD } from '../../mol-util/param-definition'; +import { Color } from '../../mol-util/color'; +import { getPalette } from '../../mol-util/color/palette'; +import { ColorTheme, LocationColor } from '../../mol-theme/color'; +import { ScaleLegend, TableLegend } from '../../mol-util/legend'; +import { StructureElement, Bond } from '../../mol-model/structure'; +import { Location } from '../../mol-model/location'; import { CellPackInfoProvider } from './property'; -import { distinctColors } from '../../../../mol-util/color/distinct'; -import { Hcl } from '../../../../mol-util/color/spaces/hcl'; +import { distinctColors } from '../../mol-util/color/distinct'; +import { Hcl } from '../../mol-util/color/spaces/hcl'; const DefaultColor = Color(0xCCCCCC); diff --git a/src/apps/viewer/extensions/cellpack/curve.ts b/src/extensions/cellpack/curve.ts similarity index 98% rename from src/apps/viewer/extensions/cellpack/curve.ts rename to src/extensions/cellpack/curve.ts index e939cbe12f851b2a7366490e95d66ec9ac268c59..df94b0a15443f67140ed366bba487a568f76538f 100644 --- a/src/apps/viewer/extensions/cellpack/curve.ts +++ b/src/extensions/cellpack/curve.ts @@ -5,8 +5,8 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { Vec3, Quat, Mat4 } from '../../../../mol-math/linear-algebra'; -import { NumberArray } from '../../../../mol-util/type-helpers'; +import { Vec3, Quat, Mat4 } from '../../mol-math/linear-algebra'; +import { NumberArray } from '../../mol-util/type-helpers'; interface Frame { t: Vec3, diff --git a/src/apps/viewer/extensions/cellpack/data.ts b/src/extensions/cellpack/data.ts similarity index 96% rename from src/apps/viewer/extensions/cellpack/data.ts rename to src/extensions/cellpack/data.ts index ff393fac6d2e8526608b6f50af7d9aa763b37de9..32979bdd8dda59a58e178b09df526f633de5ae40 100644 --- a/src/apps/viewer/extensions/cellpack/data.ts +++ b/src/extensions/cellpack/data.ts @@ -4,7 +4,7 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { Vec3, Quat } from '../../../../mol-math/linear-algebra'; +import { Vec3, Quat } from '../../mol-math/linear-algebra'; export interface CellPack { cell: Cell diff --git a/src/extensions/cellpack/index.ts b/src/extensions/cellpack/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..3f5e7ca810a09aca909b4bee85694c1c9a60412f --- /dev/null +++ b/src/extensions/cellpack/index.ts @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info. + * + * @author Alexander Rose <alexander.rose@weirdbyte.de> + */ + +import { PluginBehavior } from '../../mol-plugin/behavior'; +import { CellPackColorThemeProvider } from './color'; +import { LoadCellPackModel } from './model'; + + +export const CellPack = PluginBehavior.create<{ autoAttach: boolean, showTooltip: boolean }>({ + name: 'cellpack', + category: 'custom-props', + display: { + name: 'CellPack', + description: 'CellPack Model Loading and Viewing.' + }, + ctor: class extends PluginBehavior.Handler<{ autoAttach: boolean, showTooltip: boolean }> { + register(): void { + this.ctx.state.data.actions.add(LoadCellPackModel); + this.ctx.representation.structure.themes.colorThemeRegistry.add(CellPackColorThemeProvider); + } + + unregister() { + this.ctx.state.data.actions.remove(LoadCellPackModel); + this.ctx.representation.structure.themes.colorThemeRegistry.remove(CellPackColorThemeProvider); + } + } +}); \ No newline at end of file diff --git a/src/apps/viewer/extensions/cellpack/model.ts b/src/extensions/cellpack/model.ts similarity index 92% rename from src/apps/viewer/extensions/cellpack/model.ts rename to src/extensions/cellpack/model.ts index 907bf7cdfd8d3734d4eb822d468f0298d715c12f..31db029d681fb6640f9da7e7cde39ede5320d35a 100644 --- a/src/apps/viewer/extensions/cellpack/model.ts +++ b/src/extensions/cellpack/model.ts @@ -4,31 +4,30 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { StateAction, StateBuilder, StateTransformer, State } from '../../../../mol-state'; -import { PluginContext } from '../../../../mol-plugin/context'; -import { PluginStateObject as PSO } from '../../../../mol-plugin-state/objects'; -import { ParamDefinition as PD } from '../../../../mol-util/param-definition'; +import { StateAction, StateBuilder, StateTransformer, State } from '../../mol-state'; +import { PluginContext } from '../../mol-plugin/context'; +import { PluginStateObject as PSO } from '../../mol-plugin-state/objects'; +import { ParamDefinition as PD } from '../../mol-util/param-definition'; import { Ingredient, IngredientSource, CellPacking } from './data'; import { getFromPdb, getFromCellPackDB, IngredientFiles, parseCif, parsePDBfile } from './util'; -import { Model, Structure, StructureSymmetry, StructureSelection, QueryContext, Unit } from '../../../../mol-model/structure'; -import { trajectoryFromMmCIF, MmcifFormat } from '../../../../mol-model-formats/structure/mmcif'; -import { trajectoryFromPDB } from '../../../../mol-model-formats/structure/pdb'; -import { Mat4, Vec3, Quat } from '../../../../mol-math/linear-algebra'; -import { SymmetryOperator } from '../../../../mol-math/geometry'; -import { Task, RuntimeContext } from '../../../../mol-task'; -import { StateTransforms } from '../../../../mol-plugin-state/transforms'; +import { Model, Structure, StructureSymmetry, StructureSelection, QueryContext, Unit } from '../../mol-model/structure'; +import { trajectoryFromMmCIF, MmcifFormat } from '../../mol-model-formats/structure/mmcif'; +import { trajectoryFromPDB } from '../../mol-model-formats/structure/pdb'; +import { Mat4, Vec3, Quat } from '../../mol-math/linear-algebra'; +import { SymmetryOperator } from '../../mol-math/geometry'; +import { Task, RuntimeContext } from '../../mol-task'; +import { StateTransforms } from '../../mol-plugin-state/transforms'; import { ParseCellPack, StructureFromCellpack, DefaultCellPackBaseUrl } from './state'; -import { MolScriptBuilder as MS } from '../../../../mol-script/language/builder'; +import { MolScriptBuilder as MS } from '../../mol-script/language/builder'; import { getMatFromResamplePoints } from './curve'; -import { compile } from '../../../../mol-script/runtime/query/compiler'; -import { CifCategory, CifField } from '../../../../mol-io/reader/cif'; -import { mmCIF_Schema } from '../../../../mol-io/reader/cif/schema/mmcif'; -import { Column } from '../../../../mol-data/db'; -import { createModels } from '../../../../mol-model-formats/structure/basic/parser'; +import { compile } from '../../mol-script/runtime/query/compiler'; +import { CifCategory, CifField } from '../../mol-io/reader/cif'; +import { mmCIF_Schema } from '../../mol-io/reader/cif/schema/mmcif'; +import { Column } from '../../mol-data/db'; +import { createModels } from '../../mol-model-formats/structure/basic/parser'; import { CellpackPackingPreset, CellpackMembranePreset } from './preset'; -import { AjaxTask } from '../../../../mol-util/data-source'; +import { AjaxTask } from '../../mol-util/data-source'; import { CellPackInfoProvider } from './property'; -import { CellPackColorThemeProvider } from './color'; function getCellPackModelUrl(fileName: string, baseUrl: string) { return `${baseUrl}/results/${fileName}`; @@ -498,7 +497,7 @@ const LoadCellPackModelParams = { }, { isExpanded: true }), preset: PD.Group({ traceOnly: PD.Boolean(false), - representation: PD.Select('gaussian-surface', PD.arrayToOptions(['spacefill', 'gaussian-surface', 'point', 'ellipsoid'])) + representation: PD.Select('gaussian-surface', PD.arrayToOptions(['spacefill', 'gaussian-surface', 'point', 'orientation'])) }, { isExpanded: true }) }; type LoadCellPackModelParams = PD.Values<typeof LoadCellPackModelParams> @@ -508,10 +507,6 @@ export const LoadCellPackModel = StateAction.build({ params: LoadCellPackModelParams, from: PSO.Root })(({ state, params }, ctx: PluginContext) => Task.create('CellPack Loader', async taskCtx => { - if (!ctx.representation.structure.themes.colorThemeRegistry.has(CellPackColorThemeProvider)) { - ctx.representation.structure.themes.colorThemeRegistry.add(CellPackColorThemeProvider); - } - if (params.source.name === 'id' && params.source.params === 'hiv_lipids.bcif') { await loadHivMembrane(ctx, taskCtx, state, params); } else { diff --git a/src/apps/viewer/extensions/cellpack/preset.ts b/src/extensions/cellpack/preset.ts similarity index 92% rename from src/apps/viewer/extensions/cellpack/preset.ts rename to src/extensions/cellpack/preset.ts index 3ce35d6253979c61da58fb364dd6120578534f43..f150d06768414d42f1a755c3fea7a6e9de343b13 100644 --- a/src/apps/viewer/extensions/cellpack/preset.ts +++ b/src/extensions/cellpack/preset.ts @@ -4,10 +4,10 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { StateObjectRef } from '../../../../mol-state'; -import { StructureRepresentationPresetProvider, presetStaticComponent } from '../../../../mol-plugin-state/builder/structure/representation-preset'; -import { ParamDefinition as PD } from '../../../../mol-util/param-definition'; -import { ColorNames } from '../../../../mol-util/color/names'; +import { StateObjectRef } from '../../mol-state'; +import { StructureRepresentationPresetProvider, presetStaticComponent } from '../../mol-plugin-state/builder/structure/representation-preset'; +import { ParamDefinition as PD } from '../../mol-util/param-definition'; +import { ColorNames } from '../../mol-util/color/names'; import { CellPackColorThemeProvider } from './color'; export const CellpackPackingPresetParams = { diff --git a/src/apps/viewer/extensions/cellpack/property.ts b/src/extensions/cellpack/property.ts similarity index 74% rename from src/apps/viewer/extensions/cellpack/property.ts rename to src/extensions/cellpack/property.ts index 10a63ab4017adc3bdf5e633da68af42de7bd5ee4..71c2e622f5cede38603ff63ff0a9744595bdb189 100644 --- a/src/apps/viewer/extensions/cellpack/property.ts +++ b/src/extensions/cellpack/property.ts @@ -4,10 +4,10 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { CustomStructureProperty } from '../../../../mol-model-props/common/custom-structure-property'; -import { Structure, CustomPropertyDescriptor } from '../../../../mol-model/structure'; -import { CustomProperty } from '../../../../mol-model-props/common/custom-property'; -import { ParamDefinition as PD } from '../../../../mol-util/param-definition'; +import { CustomStructureProperty } from '../../mol-model-props/common/custom-structure-property'; +import { Structure, CustomPropertyDescriptor } from '../../mol-model/structure'; +import { CustomProperty } from '../../mol-model-props/common/custom-property'; +import { ParamDefinition as PD } from '../../mol-util/param-definition'; export type CellPackInfoValue = { packingsCount: number diff --git a/src/apps/viewer/extensions/cellpack/state.ts b/src/extensions/cellpack/state.ts similarity index 95% rename from src/apps/viewer/extensions/cellpack/state.ts rename to src/extensions/cellpack/state.ts index 11be3241c9279e466fcd37302085bc43393e8b9b..ac8407c360770c37a4a7a539a4bf7b0272b8d2bb 100644 --- a/src/apps/viewer/extensions/cellpack/state.ts +++ b/src/extensions/cellpack/state.ts @@ -4,9 +4,9 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { PluginStateObject as PSO, PluginStateTransform } from '../../../../mol-plugin-state/objects'; -import { ParamDefinition as PD } from '../../../../mol-util/param-definition'; -import { Task } from '../../../../mol-task'; +import { PluginStateObject as PSO, PluginStateTransform } from '../../mol-plugin-state/objects'; +import { ParamDefinition as PD } from '../../mol-util/param-definition'; +import { Task } from '../../mol-task'; import { CellPack as _CellPack, Cell, CellPacking } from './data'; import { createStructureFromCellPack } from './model'; import { IngredientFiles } from './util'; diff --git a/src/apps/viewer/extensions/cellpack/util.ts b/src/extensions/cellpack/util.ts similarity index 92% rename from src/apps/viewer/extensions/cellpack/util.ts rename to src/extensions/cellpack/util.ts index 127e80fcc59e57953e8f0f8cf426089e0924fafd..eed3dc761558713c015d4e84c00aeffdba945ca5 100644 --- a/src/apps/viewer/extensions/cellpack/util.ts +++ b/src/extensions/cellpack/util.ts @@ -4,8 +4,8 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { CIF } from '../../../../mol-io/reader/cif'; -import { parsePDB } from '../../../../mol-io/reader/pdb/parser'; +import { CIF } from '../../mol-io/reader/cif'; +import { parsePDB } from '../../mol-io/reader/pdb/parser'; export async function parseCif(data: string|Uint8Array) { const comp = CIF.parse(data);