-
Notifications
You must be signed in to change notification settings - Fork 4
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
Selections interface refactoring #183
Comments
I like it. |
Done, in the storylinesidekeyclean branch all views use the new interface for whatever their primary thing to select is, except for the comparison view which doesn't seem to have anything selectable (it does use the new interface internally now). For the storyline view, it uses it's own selection object for node selections and uses the facet and global per-field selections (#186) for entity selections. The interface changed a bit, see selections.js. This could potentially have introduced bugs since it touched many parts of the code. However, so far I've only found it to have eliminated a couple of minor bugs (consistency between visual selections and clear buttons or the constraints list). |
I think likely there is more we can do with this interface. For example, if there was a convenient way to make a selection that merges multiple selections objects, that could encapsulate the storyline view's interactions with the facet/per-field selections. I haven't come up with anything definite for that yet, though. |
In having the storyline make facet selections for #168, I've refactored the facet code around a new selections (in this case a set of selected entity values) interface, with a general implementation in utils.js. The interface allows directly changing which items are selected and watching for changes, separate from internal code or the constraints system. This system allows factoring out some of the common callback spaghetti code into functions which setup coordination between the selection and another interface. It may cost a few more total callbacks but I think can simplify the code a lot.
Since all the views require the user making some selection of objects, I'd like to change all the view code to use the same interface.
For example, the callback spaghetti in the facet setup() function is replaced with:
and those functions isolate code for specific interactions, eg:
While having one view select something in another view is now trivial, eg for the storyline:
The text was updated successfully, but these errors were encountered: