.. _Py3DMolFormat:

3dmol format
============

Class: :class:`Py3DMolFormat <dpdata.plugins.3dmol.Py3DMolFormat>`


3DMol format.

To use this format,  py3Dmol should be installed in advance.
















Conversions
-----------

.. _Py3DMolFormat_to_system:

Convert from System to this format
``````````````````````````````````

.. py:function:: dpdata.System.to(fmt: Literal['3dmol'], f_idx: 'int' = 0, size: 'tuple[int]' = (300, 300), style: 'dict' = {'stick': {}, 'sphere': {'radius': 0.4}})
   :noindex:
.. py:function:: dpdata.System.to_3dmol(f_idx: 'int' = 0, size: 'tuple[int]' = (300, 300), style: 'dict' = {'stick': {}, 'sphere': {'radius': 0.4}})
   :noindex:

   
Show 3D structure of a frame in jupyter.


:Parameters:

    **f_idx** : int
        frame index to show

    **size** : tuple[int]
        (width, height) of the widget

    **style** : dict
        style of 3DMol. Read 3DMol documentation for details.













.. rubric:: Examples

>>> system.to_3dmol()





.. _Py3DMolFormat_to_labeled_system:

Convert from LabeledSystem to this format
`````````````````````````````````````````

.. py:function:: dpdata.LabeledSystem.to(fmt: Literal['3dmol'], f_idx: 'int' = 0, size: 'tuple[int]' = (300, 300), style: 'dict' = {'stick': {}, 'sphere': {'radius': 0.4}})
   :noindex:
.. py:function:: dpdata.LabeledSystem.to_3dmol(f_idx: 'int' = 0, size: 'tuple[int]' = (300, 300), style: 'dict' = {'stick': {}, 'sphere': {'radius': 0.4}})
   :noindex:

   
Show 3D structure of a frame in jupyter.


:Parameters:

    **f_idx** : int
        frame index to show

    **size** : tuple[int]
        (width, height) of the widget

    **style** : dict
        style of 3DMol. Read 3DMol documentation for details.













.. rubric:: Examples

>>> system.to_3dmol()



