We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
When using
viewer = $3Dmol.createViewer("Model", {defaultcolors: $3Dmol.elementColors.Jmol});
the color scheme gets applied to models added using
viewer.addModel(xyz_data, "xyz");
but not when using
viewer.addModelsAsFrames(xyz_data, "xyz");
To Reproduce
This code gives the default color for the nitrogen atom
<div style="text-align: center;"> <div id="Model" style="width: 500px; height: 500px;"></div> </div> <script> $(document).ready(function() { var viewer = $3Dmol.createViewer("Model", {defaultcolors: $3Dmol.elementColors.Jmol}); var xyz_data = `1 test N 0.0 0.0 0.0 1 test N 0.0 0.0 0.0`; viewer.addModelsAsFrames(xyz_data, "xyz"); viewer.setStyle({}, {stick: {radius: 0.15},sphere: {scale: 0.25}}); viewer.zoomTo(); viewer.setViewStyle({style: 'outline', color: 'black', width: 0.02}); viewer.render(); }); </script>
While using addModel gives the correct jmol color:
addModel
<div style="text-align: center;"> <div id="Model" style="width: 500px; height: 500px;"></div> </div> <script> $(document).ready(function() { var viewer = $3Dmol.createViewer("Model", {defaultcolors: $3Dmol.elementColors.Jmol}); var xyz_data = `1 test N 0.0 0.0 0.0`; viewer.addModel(xyz_data, "xyz"); viewer.setStyle({}, {stick: {radius: 0.15},sphere: {scale: 0.25}}); viewer.zoomTo(); viewer.setViewStyle({style: 'outline', color: 'black', width: 0.02}); viewer.render(); }); </script>
Expected behavior
defaultcolors should be applied to models added using addModelsAsFrames
addModelsAsFrames
The text was updated successfully, but these errors were encountered:
Fix issue #764
dec52bc
Options were not being set correctly for any of the multimodel addModel variants. They are now.
Thanks for the complete bug report! Fixed in the above commit: https://3dmol.org/tests/auto/generate_test.cgi?test=defaultcolors
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When using
viewer = $3Dmol.createViewer("Model", {defaultcolors: $3Dmol.elementColors.Jmol});
the color scheme gets applied to models added using
viewer.addModel(xyz_data, "xyz");
but not when using
viewer.addModelsAsFrames(xyz_data, "xyz");
To Reproduce
This code gives the default color for the nitrogen atom
While using
addModel
gives the correct jmol color:Expected behavior
defaultcolors should be applied to models added using
addModelsAsFrames
The text was updated successfully, but these errors were encountered: