new ChemObjInserter()
        A chem widget to insert chem viewer elements to HTML document.
This widget is mainly designed for extra web editor plugins or browser addons.
    
    
    
    
    
    
    Properties:
| Name | Type | Description | 
|---|---|---|
viewer | 
            
            Kekule.ChemWidget.Viewer | The viewer instance embedded in this widget. | 
renderType | 
            
            Int | Display in 2D or 3D. Value from Kekule.Render.RendererType. | 
chemObj | 
            
            Kekule.ChemObject | The root object in editor. | 
showInfo | 
            
            Bool | Whether info label is shown. | 
Extends
- Kekule.ChemWidget.AbstractWidget
 
Classes
Methods
- 
    
        
createExportImgElement(doc, dataType, options) → {HTMLElement}
 - 
    
    Export viewer to a new created HTML img element.
Parameters:
Name Type Description docHTMLElement dataTypeString Export image data type optionsHash Returns:
- Type
 - HTMLElement
 
 - 
    
        
exportDetails(dataType, options) → {Hash}
 - 
    
    Export drawing content in viewer and with additional informations (such as draw options).
Parameters:
Name Type Description dataTypeString optionsHash Returns:
- Type
 - Hash
 
 - 
    
        
exportToDataUri(dataType, options) → {String}
 - 
    
    Export drawing content in viewer to a data URL for
tag to use.
Parameters:
Name Type Description dataTypeString Type of image data, e.g. 'image/png'. optionsHash Export options, usually this is a number between 0 and 1 indicating image quality if the requested type is image/jpeg or image/webp. Returns:
- Type
 - String
 
 - 
    
        
getContextDimension() → {Hash}
 - 
    
    Returns dimension of viewer context.
Returns:
- Type
 - Hash
 
 - 
    
        
getExportImgElemAttributes(dataType, options) → {Hash}
 - 
    
    If export viewer to a HTML img element, this method returns the essential attributes.
Parameters:
Name Type Description dataTypeString Export image data type. optionsHash Returns:
Attribute/value pairs.- Type
 - Hash
 
 - 
    
        
importChemObjWithDetails(chemObj, detail)
 - 
    
    Load a chem object and apply settings in this widget from specified attribs.
Parameters:
Name Type Description chemObjKekule.ChemObject detailHash  - 
    
        
importFromElem(element)
 - 
    
    Load a chem object and apply settings in this widget from an HTML element previously exported.
Parameters:
Name Type Description elementHTMLElement  - 
    
        
importFromElemAttribs(attribs)
 - 
    
    Load a chem object and apply settings in this widget from hash attribs of an HTML element prviously exported.
Parameters:
Name Type Description attribsHash  - 
    
        
initialize()
 - 
    
        
setContextDimension(dimension)
 - 
    
    Resize self to make viewer context at dimension.
Parameters:
Name Type Description dimensionHash