Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Change default background color #30

Open
Birch78 opened this issue Mar 30, 2018 · 4 comments
Open

Change default background color #30

Birch78 opened this issue Mar 30, 2018 · 4 comments

Comments

@Birch78
Copy link

Birch78 commented Mar 30, 2018

Hi guys

I am using the simple code to implement LiteMol on my webpage, and it is working fine. But how can I change the default background color from black to white??
THANKS

My code

<!-- Complied & minified library css -->
<link rel="stylesheet" href="//www.ebi.ac.uk/pdbe/pdb-component-library/v1.0/css/pdb.component.library.min-1.0.0.css" />


<!-- Dependencey scripts (these can be skipped if already included in page) -->
<script src="//www.ebi.ac.uk/pdbe/pdb-component-library/libs/d3.min.js"></script>
<script src="//www.ebi.ac.uk/pdbe/pdb-component-library/libs/angular.1.4.7.min.js"></script>

<!-- Complied & minified library JS -->
<script src="//www.ebi.ac.uk/pdbe/pdb-component-library/v1.0/js/pdb.component.library.min-1.0.0.js"></script>

<script>
  angular.element(document).ready(function () {
      angular.bootstrap(document, ['pdb.component.library']);
  });
</script>

LiteMol Component Demo

<div class="view3d">
  <pdb-lite-mol pdb-id="''" source-url="https://www.epsdatabase.com/litemol_js/1dv9.pdb" source-format="pdb" hide-controls="true"></pdb-lite-mol>
</div>
@dsehnal
Copy link
Owner

dsehnal commented Apr 4, 2018

Hi,

it is shown how to do this in examples at the pdb-lite-mol wrapper page: https://github.com/mandarsd/pdb-lite-mol/blob/master/examples/main/litemol-customize-demo.html

David

@mandarsd
Copy link
Contributor

mandarsd commented Apr 8, 2018

@dsehnal Thanks for adding the example.
@Birch78 Here is demo fyr https://embed.plnkr.co/KIpwZLQClq6hMyh7SU5Y/

@Birch78
Copy link
Author

Birch78 commented Apr 10, 2018

Hi mandarsd
Thanks a lot, your example is working great when I use
<pdb-lite-mol id="litemol_1cbs" pdb-id="'1cbs'" hide-controls="true"></pdb-lite-mol>
but when I want to use my own pdb file like this
<pdb-lite-mol pdb-id="'streptococcus_macedonicus_sc136'" source url="http://www.epsdatabase.com/pdb/streptococcus_macedonicus_sc136.pdb" source-format="pdb" hide-controls="true"></pdb-lite-mol>
the background goes back to black??? Why is that??

@mandarsd
Copy link
Contributor

mandarsd commented Apr 10, 2018

On compareing the elements above, it looks like you are missing the id attribute in yours. Add id="litemol_1cbs".

In script.js of the demo, you can see that id is used to bind to the scope of the component.
var litemolElement = document.getElementById('litemol_1cbs');

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants