NPellet / visualizer

Other
43 stars 24 forks source link

How to add an action with from visualizer-helper #1120

Closed lpatiny closed 5 years ago

lpatiny commented 5 years ago

Currently we can add dynamically typerenderer which is really practical.

I would like to do the same with Action. For example of the molecular formula helper.

Can we do this today ? Or could you add an API.addAction('xxx', function) ?

stropitek commented 5 years ago

Can you elaborate on the molecular formula helper example?

lpatiny commented 5 years ago

I would like to easily add an action that shows the help about how to enter a molecular formula and what are the groups that are available.

Currently I go in the general preferences of the view in order to add the action and the corresponding code.

Would be practical if this action (and some other) could be directly added from a file that is in the visualizer-helper.

stropitek commented 5 years ago

You should have the logic that shows the help in the visualizer-helper, but handling the action should be done in the view. (like we usually do, in a code executor in a switch statement that handles all actions).