ChristopherChudzicki / math3d

Legacy version: Use math3d-react repo instead
MIT License
12 stars 4 forks source link

Store number of times accessed in database #92

Closed ChristopherChudzicki closed 7 years ago

ChristopherChudzicki commented 7 years ago

It might be fun to add a metadata field showing the number of times a database graph has been accessed. Each time a user loads a graph from db, the counter would be incremented once.

stardust66 commented 7 years ago

I can do this if you don't mind.

ChristopherChudzicki commented 7 years ago

@stardust66 That would be great!

stardust66 commented 7 years ago

@ChristopherChudzicki I don't know where to display the property in the UI so I just added it as the times_accessed field to the settings object.

ChristopherChudzicki commented 7 years ago

Thanks for implementing this!

I'm actually not sure that times_accessed needs to be displayed in the UI. Mostly it's metadata that I want to track because I think it could be useful in the future. I should probably have said this in the initial issue: Some reasons I see to track this data:

  1. As a developer, it's interesting to know whether users are mostly creating new visualizations or loading old ones.
  2. If it ever became necessary to delete graphs from the database (e.g., for space), we could delete graphs based on number of views. (There are probably better ways)
  3. Could be of interest to have a list of "popular graphs"

With that in mind, I also don't think we need to attach it to math3d.settings...let's remove line line 235 in index.html for now.

Other than that, I'm ready to merge it.

stardust66 commented 7 years ago

@ChristopherChudzicki I just reverted the very last commit. That should work.

ChristopherChudzicki commented 7 years ago

Resolved by https://github.com/ChristopherChudzicki/math3d/pull/93