open-reaction-database / ord-interface

Search/browse interface and APIs for the Open Reaction Database
https://open-reaction-database.org
Apache License 2.0
20 stars 11 forks source link

New Dataset Viewer #146

Open miori-nd opened 1 month ago

miori-nd commented 1 month ago

Provides a new experience for viewing datasets.

  1. Today, clicking on a Dataset ID on the Browse page will lead to a regular search with that Dataset ID passed in as a filter. With these changes, clicking on a Dataset ID on the Browse page will now lead to a new, dedicated landing page for that particular dataset. The URL takes the form of: https://open-reaction-database.org/dataset/
  2. This new page contains 3 sections: Charts, Metadata, and Reactions
  3. The Charts section currently shows 2 charts powered by d3.js visualization library that show the number of times that a particular molecule occurred in that dataset - one chart shows this frequency for molecules that acted as a reactant, and the other chart shows this frequency for molecules that acted as a product of a reaction. There are also 2 new API routes used to deliver these statistics from ORD.
  4. The Dataset Metadata section displays the Dataset ID, Name, Description and the number of reactions in the dataset. If the data is missing, a placeholder will be shown.
  5. Reactions in the dataset are shown as standard ReactionCards as they would be in the regular search experience. The user is able to load more cards and page through all of the reactions in the dataset at the bottom of the page; this is consistent with the current search experience. The user can click on the Full Details button on each card to view the full details of each reaction.
skearnes commented 3 weeks ago

@miori-nd are you ok with me pushing some commits here to get the tests working, or would you like to handle the failures? I'd like to see green before I dig into the changes.

miori-nd commented 3 weeks ago

@skearnes Go for it, ty

skearnes commented 3 weeks ago

Tests are passing; I'm going to deploy to staging to test it out.

skearnes commented 3 weeks ago

This is nice! A few comments:

miori-nd commented 3 weeks ago

Thanks a mil @skearnes, I will get those problems addressed.

Also, when we go to prod, we should ping @bdeadman to do an announcement that this functionality is changing.

skearnes commented 3 weeks ago

(For showing structures, I recommend RDKit JS. If that doesn't work for some reason, we also have API endpoints for the editor that can do the rendering.)

miori-nd commented 17 hours ago

@skearnes

Addressed issues with the new charts not loading by adding a NULL filter to the SQL for those charts. I'm confident this should fix that issue because the API appeared to be trying to read in None values as Strings and failing

The issues with reactions not loading should also be fixed.

I updated the layout of the page to show the charts in a sidebar. Clicking the Expand button will Expand the view, and it can also be collapsed back to the sidebar view.

And tooltips are now visible on cursor hover, click not needed.