PubChem Widgets 2.0f is released. The update substantially updates all table-based widgets and classification widgets, while adding new capabilities and features. The autocomplete widget remains unchanged from the previous version.
What are PubChem Widgets?
PubChem content is enormous and changes on a daily basis. Keeping an effective mirror of this corpus is not trivial. PubChem Widgets enable scientific web developers to display PubChem content within webpages they design. All data comes directly from PubChem and, therefore, obviates the need to mirror that content. This makes it easier to harness the vast scientific knowledge within PubChem on your own webpage, such as summaries of patents, bioactivities and PubMed articles linked to a PubChem record. They can also be used to provide an autocomplete function that suggests a list of terms when you type input into a search field.
What is new in PubChem Widgets 2.0f?
- More Data Views
PubChem Widgets 2.0f provides many more data views than the previous version. Any section or subsection of a PubChem Compound Summary, Substance Record, or BioAssay Record pages (except the very top section) can be accessed. What you see on PubChem pages is what you will get in the widgets. For instance, below is an InChI section from compound summary page for tiformin (https://pubchem.ncbi.nlm.nih.gov/compound/tiformin#section=InChI) in widget form:
- Simpler to embed
It is now simpler to embed a data view widget into any web page using PubChem Widgets 2.0f. All you need is to include an HTML iframe tag with a proper URL as the ‘src’ attribute. For instance, to embed a PubChem widget from the above example, add the following code to your webpage at the location where you want the widget to appear:
<iframe class="pubchem-widget" src="https://pubchem.ncbi.nlm.nih.gov/compound/tiformin#section=InChI&embed=true" style="border: 0; width: 100%; height: 250px;"> </iframe>
The widget then renders the desired content for you.
- Easier to resize
The open source iframe resizer is able to resize an iframe automatically for you. To use it, add the following code to your page (only once, even if you have multiple PubChem widgets on the same page) just before the closing body tag:
How to convert to PubChem Widgets 2.0f?
Detailed instruction on how to convert PubChem Widgets 2.0f is given in this Conversion Guide. PubChem Widgets 1.0 will be retired soon. If you are using the PubChem Widgets 1.0 tables and classifications in your web pages, please update to PubChem Widgets 2.0f as soon as possible. [Please note there is no change required for conversion of the autocomplete widgets.]
For more information on PubChem Widgets 2.0f, please read these pages:
- PubChem Widgets Help
- PubChem Autocomplete Widget
- PubChem Widgets Conversion Guide