.. include:: ../../toolkit-substitutions
.. include:: ../../common/cookbook/cookbook-hyperlinks
.. include:: ../substitutions

.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OERenderContactMap

.. oe:function:: OERenderContactMap

   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OERenderContactMap(OEDepict::OEImageBase& image,
                                 const OE2DActiveSiteDisplay& adisp)

   .. oe:language:: python

      .. oe:api:: python

         OERenderContactMap(image: OEImageBase, adisp: OE2DActiveSiteDisplay) -> bool

   Renders the protein-ligand contact map with *residue* toggle buttons.
   Clicking on any residue will highlight those ligand atoms that
   interact with the residue.

   .. note::

      This functionality is **only available** for :file:`.svg`
      image format. In all other image formats it only depicts
      the residue circles.

      The generated :file:`svg` image should be included into and
      HTML page with the SVG MIME type.

      .. code-block:: console

         <object data="<imagename>.svg" type="image/svg+xml"></object>

   *image*
     The image on which the contact map is rendered.

   *adisp*
     The :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object that holds the
     data necessary to depict the interactions of an active site.

   The following code snippet shows how to use the :oe:func:`OEGrapheme::OERenderContactMap`
   function. The image created is shown in
   :ref:`Figure: Example of using the OERenderContactMap function<figure_RenderContactMap>`.

   **Example:**

   .. oe:source:: RenderContactMap.py
      :language: python
      :noindent:
      :frag:     SNIPPET-RENDER-CONTACTMAP

   .. oe:source:: RenderContactMap.cpp
      :language: c++
      :noindent:
      :frag:     SNIPPET-RENDER-CONTACTMAP

   .. oe:source:: RenderContactMap.java
      :language: java
      :noindent:
      :frag:     SNIPPET-RENDER-CONTACTMAP

   .. oe:source:: RenderContactMap.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-RENDER-CONTACTMAP

   .. _figure_RenderContactMap:

   .. only:: oehtml

      .. raw:: html

         <p align="center">
         <b>click on any residue circles</b>
         </p>

         <p align="center">
         <object data="../../_images/RenderContactMap.svg" type="image/svg+xml"  width = "600" ></object>
         <p>

         <p align="center">
         <b>Example of using the OERenderContactMap function</b>
         <p>

      .. image:: ../images/RenderContactMap.svg
         :width: 1pt


   .. only:: oepdf

      |NOPDFIMAGE|

   .. seealso::

      * :oe:func:`OEGrapheme::OERenderActiveSite` function
      * :oe:func:`OEGrapheme::OERenderActiveSiteMaps` function
      * :oe:func:`OEGrapheme::OERenderBFactorMap` function
      * :oe:func:`OEGrapheme::OERenderUnpairedInteractionMap` function

   .. admonition:: Code Example

      * `Visualizing Protein-Ligand Contacts`_ **OpenEye Python Cookbook** recipe

