Dear,
I'm trying to visualize molecule from mol file and it works well. And I would like to change text size of angle, distance and dihedral angles. Because It seems small.
Are there any way to do it?
Thanks.
The distance/angle/dihedral representations all have a labelSize parameter. If you're picking atoms to create measurements, then it's actually just updating a special representation that's automatically created for each molecule, e.g. to set the labelSize to 2.0 (default is 0.7) on the first component's dihedral measurements you can do:
stage.compList[0].dihedralRepresentation.setParameters({labelSize: 2.0})
I'm not sure there's a neat way to override the defaults, but if you always want them at a particular value you could add a listener to the componentAdded signal, this means every time you load a molecule the labelSize will be set to 2 on the relevant representations:
stage.signals.componentAdded.add(function(c) {
var p = {labelSize: 2.0}
c.distanceRepresentation.setParameters(p)
c.angleRepresentation.setParameters(p)
c.dihedralRepresentation.setParameters(p)
})
I'm not sure there's a neat way to override the defaults
You can use NGL.setMeasurementDefaultParams 馃檪
Options available are as defined in NGL globals in MeasurementDefaultParams, any options not overwritten remain as the defaults:
https://github.com/nglviewer/ngl/blob/6174bc6feea2957e82472746c849c107059d1d04/src/globals.ts#L62-L79
Yes, what he said! Thanks Harry!
Hi @fredludlow @harryjubb,
Thanks for prompt reply!
NGL.setMeasurementDefaultParams works very well.
I appreciate your kind support!
Thanks ;)
Most helpful comment
You can use
NGL.setMeasurementDefaultParams馃檪Options available are as defined in NGL globals in
MeasurementDefaultParams, any options not overwritten remain as the defaults:https://github.com/nglviewer/ngl/blob/6174bc6feea2957e82472746c849c107059d1d04/src/globals.ts#L62-L79