datalab-dev / quintessence_web_app

Repository for the Quintessence Web Project applying Topic Models and Word Embeddings to EEBO-TCP
http://quintessence.ds.lib.ucdavis.edu/
0 stars 0 forks source link

bug: when selecting new model in dropdown for word embedding draws wrong network #79

Closed avkoehl closed 2 years ago

avkoehl commented 3 years ago

If you have selected several terms. Sometimes when you select a new model from the dropdown it will redraw the network multiple times, with the last redraw being the network of a previously selected but not current term

avkoehl commented 2 years ago

Probably best to detach the visualization refresh from the 'on-selected' attribute of the dropdown. Instead have a submit button. This will resolve some glitches when moving through the options quickly, and may resolve this issue as well

avkoehl commented 2 years ago

This was occurring because of the nested drop down items not having access to the correct 'term' variable. When multiple terms had been selected, the callback on model switching would submit two requests, one for each of the terms, and these would override each other. I don't understand javascript well enough to fix this elegantly. Made the 'term' variable a global to resolve this.