Back to home page

EIC code displayed by LXR

 
 

    


Warning, /image_browser/README.md is written in an unsupported language. File is not indexed.

0001 # image_browser
0002 Web application to display data quality plots: https://eic.jlab.org/epic/image_browser.html
0003 
0004 ## Front end
0005 
0006 Designs and prototypes are developed in Figma. If you have a Figma account, the design files can be shared with you. If you don't have a Figma account, you don't need one to contribute. 
0007 Currently, the page is built using HTML, functionality is given via Javascript, and CSS is used to make it *pretty*.  There is a version written in React on my local machine that has been fun to develop.
0008 
0009 To fetch information from the database for display on the page, we use PHP (though not required). 
0010 
0011 ## Back end  
0012 The system to display images is really quite simple. There is a directory, `/work/eic3/validation/images/` at Jefferson Lab that stores the raw image files. When new images are added here, a python script (image_crawler) checks to see if the database has seen the image before. If yes, the script moves on; else it inserts into the Plots table in the database.
0013 
0014 The database contains tables. The most important ones for this application are Plots and Plot_Types. Plot_Types stores information about the image including: name, filetype, point of contact, and any relevant "groups" the image belongs to. The Plots table stores the reference to the image itself, including: the path to the image, its corresponding ID from the Plot_Types table, and any relevant metadata (like a repo, PR, commit etc) associated with it. An example is shown below:
0015 
0016 
0017 Plot_Types:
0018 | ID | Name                    | FileType | Description | PointOfContact | PlotGroup |
0019 |----|-------------------------|----------|-------------|----------------|-----------|
0020 | 42 | genJetConstituentEnergy | png      | NULL        | jet_person@place.org  | 31        |
0021 
0022 Plots: 
0023 | ID   | Plot_Types_ID | Root Path                                                                        | MetaData |
0024 |------|---------------|-----------------------------------------------------------------------------|----------|
0025 | 2389 | 42            | /work/eic3/validation/images/24.03.1/epic_craterlake/DIS/NC/18x275/minQ2=1/ | NULL     |
0026 
0027 Now, if any future images named `genJetConstituentEnergy` show up in any subdirectory that is being watched by the crawler, they will automatically appear on the page.
0028 
0029 ## FAQs  
0030 
0031 ### How do I add plots to the page?
0032 There are multiple ways to do this. You can (and should) submit a macro to the benchmarks repository. You can also send it to the validation working group via email, Mattermost, etc and we will work with you to get it incorporated. 
0033 
0034 ### Can we ignore a plot once it is added?
0035 Yes. The database will still track the images but they will not be visible to the end user.
0036 
0037 ### Can the image crawler "crawl" over multiple directories?
0038 Yes. The only requirement is that it is a subdirectory of `/work/eic3/validation/images` as not *all* directories are visible to the web server. 
0039 
0040 ### How often does the page update with new plots?
0041 This is configurable. The crawler itself checks for duplicates in the database and if there is a crawler process already running, so we can update multiple times daily if need be. 
0042 
0043 
0044 
0045 
0046 
0047