Skip to content
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

method to set custom click listener / load data from an external source #215

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

djkramnik
Copy link

Trying to use this library in a chrome extension, but needed a way to save data to chrome storage instead of localforage (for cross domain data storage). Created a few helper methods to enable this

  • setClickListener
  • clearClickListener
  • loadData

Let me know if open to this, I can flesh this out with documentation / tests. I admit it's a very straightforward implementation but tried not to change too much of what was present.

Usage would be like this:

// loading data into regression model from user controlled source (i.e. chrome storage) 
chrome.storage.sync.get('webgazer_data', function(data) {
  webgazer.loadData(data);
  webgazer.setClickListener((event, {data}) => {
    // saving reg data to custom data source
    chrome.storage.sync.set('webgazer_data', data)
  });
  await webgazer.begin();
});

@lukaas33
Copy link

Has there been any progress on getting this accepted?
I would find this helpful as well.

@jeffhuang
Copy link
Contributor

I think it requires some testing from people who are interested in this. So please report back if you've tried it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants