partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
248 stars 61 forks source link

Customize toolbar of editor associated with viewer example. #206

Open cleblond opened 3 years ago

cleblond commented 3 years ago

Is there a way to customize the toolbar of the composer that opens from a viewer? Maybe a setCommonToolButtons and setChemToolButtons for the editor of a viewer.

partridgejiang commented 3 years ago

Hi @cleblond, you can use property editorProperties of a viewer to customize properties of the composer opened from viewer, e.g.:

viewer.setEditorProperties({
  'commonToolButtons': ['loadData', 'saveData'], 
  'chemToolButtons': ['manipulate', 'erase', 'bond', 'atom']
});
cleblond commented 3 years ago

Awesome thanks much!