-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Francy modal menus are not language-agnostic #43
Comments
Hi Odile, This was a hack to make it work with JupyterKernel that implements a native GAP kernel. francy/js/packages/francy-core/src/render/callback.js Lines 88 to 90 in 3802f26
In order to make it work with the python Kernel we need to change a bit this https://jupyter-notebook.readthedocs.io/en/stable/comms.html I might be able to spend some time in a near future and try to sort this out... Manuel |
Yes, comms would be great :) I've been told, though, that comms are difficult to handle with GAP. So I have been trying to implement a switch in _execute function. We can easily send some additional parameters with the callback (like the programming language...), and use them to decide what to do. Of course that would be another hack, but would be a great satisfaction for the users. If you don't agree, I would be happy to help on the comms' strategy, though. |
I still remember the day I wrote the first version of this hack by the end of January 2017 in Edinburgh at the ICMS... and it managed to live for so long... I would give a try with I'm open for suggestions ;) |
The callback string (the command line) to be passed is language dependent. Therefore, we need to first parse the callback that comes from the interface, then construct a language-specific string. Alternatively: make this language-specific string already at modal menu build time. But this would make a more language-specific JSON. Don't know if that's any better. |
As for passing the language parameter, an easy solution is to pass it as knownArgs first element. Another one would be to have language a parameter in its own. |
How do you run your JS test files please? For instance: |
You have to run all the tests for all the packages:
|
@zerline if you proceed with a solution for this issue, I'll be happy to evaluate the pull request |
@mcmartins would you want to have a look at this commit ? This code i's actually using the callback object language parameter. I still don't see any result, though.
|
NB: defining a |
The callback modal calls this {
"callback": {
"id": "callback_1",
"funcname": "showfacts",
"trigger": "click",
"knownArgs": [],
"requiredArgs": {}
},
} This So the function being In GAP the callback defined before would execute a function as follows:
The result is then re-drawn on the screen... |
Thanks very much! |
Well, the outputs in Francy are usually added to |
Of course, being able to deal with comms would be a great step forward! As for my example with ipywidgets.Output, here is a small test notebook at https://gke.mybinder.org/v2/gh/zerline/francy-widget/develop?filepath=test/MenuWithOutput.ipynb |
Ok, I’ve implemented an outofthebox solution so you won’t need to do any hack on the Trigger function. |
You can give it a try here |
It looks good, and quite nice. And useful. |
I'm not planning to develop further functionality, but would be nice if someone could spend sometime investigating how to implement this, perhaps improving the JupyterGapKernel as well. |
Hi again!
I'm trying to get a modal menu on graph nodes, on a python kernel.
Francy JS code (in francy-core/src/render/callback.js) calls a Trigger function, which does not exist in Python.
Did you think of any more general message handling feature?
The text was updated successfully, but these errors were encountered: