About the “margin” property. Thank you for your report. You’re right. There is a mistake in the docs.
You should use editor.diagram.config.margin.x = 100;
instead of editor.diagram.config.margin = 100;
Here is a working example: DHTMLX Snippet Tool
We’ll fix this typo in the near future.
undo/redo buttons
If I understood you correctly You are trying to add the custom undo/redo buttons to the editor menu.
Please, note that these buttons are already presented in the “edit” menu section:
while you are already using this section it in your config, so these duplicating items have conflict.
So, you should try to assign unique ids to that new undo/red items: