Comments (2)
The applyPreset
function returns a dictionary with references. You should be able to do something like:
const polymerRef = preset.representation.representations.polymer;
// This actually makes me think it would be nice to have .updateRepresentation function on the corresponding manager
// to make this more straightforward
const update = plugin.build().to(polymerRef).update(createStructureRepresentationParams(....));
await update.commit();
Another option is to get the polymerRef
via plugin.state.data.selectQ()
, from hierarchy manager, or just by creating the initial tree yourself and storing the ref.
from molstar.
Thank you very much for the support you provided. It works by the following methods.
const preset = await this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default', {
structure: assemblyId ? {
name: 'assembly',
params: { id: assemblyId }
} : {
name: 'model',
params: {}
},
showUnitcell: true,
representationPreset: "coarse-surface",
representationPresetParams: {
theme: {
globalName: themeName || 'default',
}
}
});
const polymerRef = preset.representation.representations.polymer;
const update = this.plugin.build().to(polymerRef).update(createStructureRepresentationParams(this.plugin, undefined, {
type: 'gaussian-surface',
typeParams: {
radiusOffset: 1.2
},
color: themeName || 'atom-id'
}));
await update.commit();
By the way, the update method will cover old representationPresetParams, So still looking forward very much to the updateRepresentation related methods !
from molstar.
Related Issues (20)
- Need help producing a `PSO.Molecule.Structure` (confused by `...state.data.select`) to initiate Volume Streaming. HOT 2
- get the position of hovered residue then highlight next residue in molstar.js HOT 5
- Forcefully updating representation theme HOT 3
- Scripting selection HOT 2
- Is it possible to make a `PluginUIComponent` (ex. `SequenceView`) external to the default `PluginUI`? (Trying to pass `PluginUIContext` via `useContext`) HOT 2
- Drag and drop stopped working on Safari
- Move selected element(atoms, residue...) HOT 4
- Announcement: v4 beta HOT 12
- What is the correct config options to enable the `Settings/Controls Info`, `Screenshot/State` and the selection picker granularity panel? HOT 2
- Interactions between SDF entries and PDB entry HOT 2
- Get original cube file from loaded structure HOT 2
- How can I adjust/specify the size of the primitive/box cube? HOT 1
- How can I draw custom graphics through threejs in molstar?
- How can the graphics added by addCage be colored on six sides? HOT 1
- Representation as ball and stick with custom carbon color HOT 3
- Change the selection color of 3D structure HOT 2
- Can't highlight using both chain-test and residue-test HOT 3
- `react-markdown` should be an explicit `dependency` or `peerDependency` HOT 2
- Add Sass as peerDependency HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from molstar.