Sketcher
Molecule sketcher that supports multiple dynamically initialized implementations.
Extends
Constructors
new Sketcher()
new Sketcher(
mode?,validationFunc?):Sketcher
Parameters
| Parameter | Type |
|---|---|
mode? | SKETCHER_MODE |
validationFunc? | (s) => null | string |
Returns
Overrides
Source
Properties
| Property | Modifier | Type | Default value | Description | Inherited from |
|---|---|---|---|---|---|
_align | public | boolean | true | - | - |
_autoResized | public | boolean | true | - | - |
_functions | protected | Func[] | [] | - | Widget._functions |
_highlight | public | boolean | true | - | - |
_isSubstructureFilter | public | boolean | false | - | - |
_mode | public | SKETCHER_MODE | SKETCHER_MODE.INPLACE | - | - |
_molfile | public | null | string | null | - | - |
_properties | protected | Property[] | [] | - | Widget._properties |
_root | protected | HTMLElement | undefined | - | Widget._root |
_sketcherTypeChanged | public | boolean | false | - | - |
_smarts | public | null | string | null | - | - |
_smiles | public | null | string | null | - | - |
_validationFunc | public | (molecule: string) => null | string | ... | - | - |
alighInput | public | InputBase<any> | undefined | - | - |
changedSub | public | null | Subscription | null | - | - |
clearSketcherButton | public | HTMLButtonElement | undefined | - | - |
dart | public | any | undefined | - | Widget.dart |
emptySketcherLink | public | HTMLDivElement | undefined | - | - |
error | public | null | string | null | - | - |
errorDiv | public | HTMLDivElement | ... | - | - |
extSketcherCanvas | public | HTMLCanvasElement | ... | - | - |
extSketcherDiv | public | HTMLDivElement | ... | - | - |
factory | public | null | Func | null | Constructor function. No parameters, returns [Widget]. | Widget.factory |
filterOptionsDiv | public | HTMLDivElement | ... | - | - |
highlightInput | public | InputBase<any> | undefined | - | - |
host | public | HTMLDivElement | ... | - | - |
inplaceSketcherDiv | public | null | HTMLDivElement | null | - | - |
invalidMoleculeWarning | public | HTMLDivElement | ... | - | - |
isDetached | public | boolean | false | - | Widget.isDetached |
listeners | public | Function[] | [] | - | - |
loader | public | HTMLDivElement | ... | - | - |
molFileUnits | public | Notation | Notation.MolBlock | - | - |
molInput | public | HTMLInputElement | ... | - | - |
onAlignedChanged | public | Subject<boolean> | ... | - | - |
onChanged | public | Subject<any> | ... | - | - |
onHighlightChanged | public | Subject<boolean> | ... | - | - |
props | public | any | undefined | - | Widget.props |
resized | public | boolean | false | - | - |
sketcher | public | null | SketcherBase | null | - | - |
sketcherDialogOpened | public | boolean | false | - | - |
sketcherFunctions | public | Func[] | [] | - | - |
subs | public | Subscription[] | undefined | - | Widget.subs |
syncCurrentObject | public | boolean | true | Whether the currently drawn molecule becomes the current object as you sketch it | - |
temp | public | any | undefined | Contains auxiliary information | Widget.temp |
FAVORITES_KEY | readonly | "chem-molecule-favorites" | 'chem-molecule-favorites' | - | - |
RECENT_KEY | readonly | "chem-molecule-recent" | 'chem-molecule-recent' | - | - |
Accessors
align
getalign():boolean
setalign(value):void
Parameters
| Parameter | Type |
|---|---|
value | boolean |
Returns
boolean
Source
autoResized
getautoResized():boolean
Returns
boolean
Source
calculating
getcalculating():boolean
setcalculating(value):void
Parameters
| Parameter | Type |
|---|---|
value | boolean |
Returns
boolean
Source
children
getchildren():Widget<any>[]
Parent widget up the DOM tree, or null.
Returns
Widget<any>[]
Source
filterOptions
getfilterOptions():HTMLElement
Returns
HTMLElement
Source
height
getheight():number
Returns
number
Source
highlight
gethighlight():boolean
sethighlight(value):void
Parameters
| Parameter | Type |
|---|---|
value | boolean |
Returns
boolean
Source
isResizing
getisResizing():boolean
Returns
boolean
Source
isSubstructureFilter
getisSubstructureFilter():boolean
setisSubstructureFilter(value):void
Parameters
| Parameter | Type |
|---|---|
value | boolean |
Returns
boolean
Source
parent
getparent():null|Widget<any>
Parent widget up the DOM tree, or null.
Returns
null | Widget<any>
Source
root
getroot():HTMLElement
Widget's visual root.
setroot(r):void
Parameters
| Parameter | Type |
|---|---|
r | HTMLElement |
Returns
HTMLElement
Source
sketcherType
setsketcherType(type):void
Parameters
| Parameter | Type |
|---|---|
type | string |
Source
sketcherTypeChanged
getsketcherTypeChanged():boolean
Returns
boolean
Source
supportedExportFormats
getsupportedExportFormats():string[]
Returns
string[]
Source
type
gettype():string
Returns
string
Source
width
getwidth():number
Returns
number
Source
Methods
_setSketcherSize()
private_setSketcherSize():void
Returns
void
Source
_setSketcherType()
private_setSketcherType(sketcherType):void
Parameters
| Parameter | Type |
|---|---|
sketcherType | string |
Returns
void
Source
addProperty()
privateaddProperty(propertyName,propertyType,defaultValue,options):any
Registers an property with the specified type, name, and defaultValue.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
propertyName | string | undefined | |
propertyType | "string" | "bigint" | "object" | "map" | "file" | "view" | "blob" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | "num" | "string_list" | "dataframe_list" | "cell" | "column" | "column_list" | "graphics" | "tablerowfiltercall" | "colfiltercall" | "bitset" | "dynamic" | "viewer" | "list" | "semantic_value" | "func" | "funccall" | "property" | "categorical" | "numerical" | "GridCellRenderArgs" | "element" | "TableView" | "User" | "Menu" | "Project" | "event_data" | "progressindicator" | "Credentials" | "ScriptEnvironment" | "Notebook" | undefined | |
defaultValue | any | null | |
options | null | object & IProperty | null |
Returns
any
Inherited from
See
Registered property gets added to properties. Returns default value, thus allowing to combine registering a property with the initialization
Source
apply()
apply(
properties):Widget<any>
Parameters
| Parameter | Type | Description |
|---|---|---|
properties | object |
Returns
Widget<any>
Inherited from
Source
createAlignHighlightInputs()
createAlignHighlightInputs(
key,inputName,callback):InputBase<boolean>
Parameters
| Parameter | Type |
|---|---|
key | string |
inputName | string |
callback | () => void |
Returns
InputBase<boolean>
Source
createClearSketcherButton()
createClearSketcherButton(
canvas):HTMLButtonElement
Parameters
| Parameter | Type |
|---|---|
canvas | HTMLCanvasElement |
Returns
HTMLButtonElement
Source
createExternalModeSketcher()
createExternalModeSketcher():
HTMLElement
Returns
HTMLElement
Source
createInplaceModeSketcher()
createInplaceModeSketcher():
HTMLElement
Returns
HTMLElement
Source
createMoleculeTooltip()
createMoleculeTooltip(
currentMolfile):HTMLElement
Parameters
| Parameter | Type |
|---|---|
currentMolfile | string |
Returns
HTMLElement
Source
createSketcher()
createSketcher():
void
Returns
void
Source
detach()
detach():
void
Gets called when a widget is detached and will no longer be used. Typically used for unsubscribing from events. Be sure to call super.detach() if this method is overridden.
Returns
void
Overrides
Source
drawToCanvas()
drawToCanvas(
w,h,molecule):HTMLElement
Parameters
| Parameter | Type |
|---|---|
w | number |
h | number |
molecule | string |
Returns
HTMLElement
Source
getDartProperties()
getDartProperties():
any[]
Returns
any[]
Inherited from
Source
getFunctions()
getFunctions():
Func[]
Functions that are applicable to this particular widget. Used in the UI to display context actions, and for the AI integrations.
Returns
Func[]
Inherited from
Source
getMolFile()
getMolFile():
string
Returns
string
Source
getProperties()
getProperties():
Property[]
Returns all properties of this widget.
Returns
Property[]
Inherited from
Source
getSmarts()
getSmarts():
Promise<null|string>
Returns
Promise<null | string>
Source
getSmiles()
getSmiles():
string
Returns
string
Source
isEmpty()
isEmpty():
boolean
Returns
boolean
Source
isInPopupContainer()
isInPopupContainer():
boolean
Returns
boolean
Source
onFrameAttached()
onFrameAttached(
dataFrame):void
Parameters
| Parameter | Type |
|---|---|
dataFrame | DataFrame |
Returns
void
Inherited from
Source
onPropertyChanged()
onPropertyChanged(
property):void
Gets called when viewer's property is changed.
Parameters
| Parameter | Type | Description |
|---|---|---|
property | null | Property | or null, if multiple properties were changed. |
Returns
void
Inherited from
Source
resize()
resize():
void
Returns
void
Source
setChangeListenerCallback()
setChangeListenerCallback(
callback):void
Parameters
| Parameter | Type |
|---|---|
callback | () => void |
Returns
void
Source
setExternalModeForSubstrFilter()
setExternalModeForSubstrFilter():
void
In case sketcher is opened in filter panel use EXTERNAL mode
Returns
void
Source
setMolFile()
setMolFile(
x):void
Parameters
| Parameter | Type |
|---|---|
x | string |
Returns
void
Source
setMolecule()
setMolecule(
molString,substructure):void
Sets the molecule, supports either SMILES, SMARTS or MOLBLOCK formats
Parameters
| Parameter | Type | Default value |
|---|---|---|
molString | string | undefined |
substructure | boolean | false |
Returns
void
Source
setSmarts()
setSmarts(
x):void
Parameters
| Parameter | Type |
|---|---|
x | string |
Returns
void
Source
setSmiles()
setSmiles(
x):void
Parameters
| Parameter | Type |
|---|---|
x | string |
Returns
void
Source
setValue()
setValue(
x):void
Sets SMILES, MOLBLOCK, or any other molecule representation
Parameters
| Parameter | Type |
|---|---|
x | string |
Returns
void
Source
sourceRowsChanged()
sourceRowsChanged():
void
Returns
void
Inherited from
Source
sub()
sub(
subscription):void
Registers a subscription to an external event.
Parameters
| Parameter | Type | Description |
|---|---|---|
subscription | Subscription |
Returns
void
Inherited from
Source
toDart()
toDart():
any
Returns
any
Inherited from
Source
updateExtSketcherContent()
updateExtSketcherContent():
void
Returns
void
Source
updateInvalidMoleculeWarning()
updateInvalidMoleculeWarning():
void
Returns
void
Source
validate()
validate(
x):void
Parameters
| Parameter | Type |
|---|---|
x | string |
Returns
void
Source
addToCollection()
staticaddToCollection(key,molecule):void
Parameters
| Parameter | Type |
|---|---|
key | string |
molecule | string |
Returns
void
Source
checkDuplicatesAndAddToStorage()
staticcheckDuplicatesAndAddToStorage(storage,molecule,localStorageKey):void
Parameters
| Parameter | Type |
|---|---|
storage | string[] |
molecule | string |
localStorageKey | string |
Returns
void
Source
find()
staticfind(root):null|Widget<any>
Finds existing widget from its visual root.
Parameters
| Parameter | Type |
|---|---|
root | Element |
Returns
null | Widget<any>
Inherited from
Source
fromRoot()
staticfromRoot(root):Widget<any>
Creates a new widget from the root element.
Parameters
| Parameter | Type |
|---|---|
root | HTMLElement |
Returns
Widget<any>
Inherited from
Source
getAll()
staticgetAll():Widget<any>[]
Returns all currently active widgets.
Returns
Widget<any>[]
Inherited from
Source
getCollection()
staticgetCollection(key):string[]
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
string[]
Source
isEmptyMolfile()
staticisEmptyMolfile(molFile):boolean
Parameters
| Parameter | Type |
|---|---|
molFile | string |
Returns
boolean