m7n commited on
Commit
40dd3c9
·
1 Parent(s): 409422b

formatting updates

Browse files
Files changed (1) hide show
  1. app.py +19 -5
app.py CHANGED
@@ -253,7 +253,7 @@ def predict(text_input, sample_size_slider, reduce_sample_checkbox, sample_reduc
253
 
254
  hover_text=[str(row['title']) for ix, row in stacked_df.iterrows()],
255
  marker_color_array=stacked_df['color'],
256
- use_medoids=True,
257
  width=1000,
258
  height=1000,
259
  point_radius_min_pixels=1,
@@ -415,19 +415,32 @@ theme = gr.themes.Monochrome(
415
  button_secondary_border_color="black",
416
  button_secondary_text_color="black",
417
  button_border_width="2px",
418
-
419
  )
420
 
421
 
422
  # Gradio interface setup
423
- with gr.Blocks(theme=theme) as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  gr.Markdown("""
425
  <div style="max-width: 100%; margin: 0 auto;">
426
  <br>
427
 
428
  # OpenAlex Mapper
429
 
430
- OpenAlex Mapper is a way of projecting search queries from the amazing OpenAlex database on a background map of randomly sampled papers from OpenAlex, which allows you to easily investigate interdisciplinary connections. OpenAlex Mapper was developed by Maximilian Noichl and Andrea Loettgers at the Possible Life project.
431
 
432
  To use OpenAlex Mapper, first head over to [OpenAlex](https://openalex.org/) and search for something that interests you. For example, you could search for all the papers that make use of the [Kuramoto model](https://openalex.org/works?page=1&filter=default.search%3A%22Kuramoto%20Model%22), for all the papers that were published by researchers at [Utrecht University in 2019](https://openalex.org/works?page=1&filter=authorships.institutions.lineage%3Ai193662353,publication_year%3A2019), or for all the papers that cite Wittgenstein's [Philosophical Investigations](https://openalex.org/works?page=1&filter=cites%3Aw4251395411). Then you copy the URL to that search query into the OpenAlex search URL box below and click "Run Query." It will take a moment to download all of these records from OpenAlex and embed them on our interactive map. After a little time, that map will appear and be available for you to interact with and download. You can find more explanations in the FAQs below.
433
  </div>
@@ -499,7 +512,7 @@ with gr.Blocks(theme=theme) as demo:
499
  with gr.Column(scale=2):
500
  html = gr.HTML(
501
  value='<div style="width: 100%; height: 1000px; display: flex; justify-content: center; align-items: center; border: 1px solid #ccc; background-color: #f8f9fa;"><p style="font-size: 1.2em; color: #666;">The visualization map will appear here after running a query</p></div>',
502
- label="Map",
503
  show_label=True
504
  )
505
  gr.Markdown("""
@@ -526,6 +539,7 @@ with gr.Blocks(theme=theme) as demo:
526
  2. When pressing down a really high-dimensional space into a low-dimensional one, there will be trade-offs. For example, we see this big ring structure of the sciences on the map, but in the middle of the map there is a overly stretchedstring of bioinformaticsthat stretches from computer science at the bottom up to the life sciences clusters at the top. This is one of the areas where the UMAP algorithm had trouble pressing our high-dimensional dataset into a low-dimensional space. For more information on how to read a UMAP plot, I recommend looking into ["Understanding UMAP"](https://pair-code.github.io/understanding-umap/) by Andy Coenen & Adam Pearce.
527
 
528
  3. Finally, the labels we're using for the regions of this plot are created from OpenAlex's own labels of sub-disciplines. They give a rough indication of the papers that could be expected in this broad area of the map, but they are not necessarily the perfect label for the articles that are precisely below them. They are just located at the median point of a usually much larger, much broader, and fuzzier category, so they should always be taken with quite a big grain of salt.
 
529
  </div>
530
  """)
531
 
 
253
 
254
  hover_text=[str(row['title']) for ix, row in stacked_df.iterrows()],
255
  marker_color_array=stacked_df['color'],
256
+ use_medoids=False,
257
  width=1000,
258
  height=1000,
259
  point_radius_min_pixels=1,
 
415
  button_secondary_border_color="black",
416
  button_secondary_text_color="black",
417
  button_border_width="2px",
 
418
  )
419
 
420
 
421
  # Gradio interface setup
422
+ with gr.Blocks(theme=theme, css="""
423
+ .gradio-container a {
424
+ color: black !important;
425
+ text-decoration: none !important; /* Force remove default underline */
426
+ font-weight: bold;
427
+ transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
428
+ display: inline-block; /* Enable proper spacing for descenders */
429
+ line-height: 1.1; /* Adjust line height */
430
+ padding-bottom: 2px; /* Add space for descenders */
431
+ }
432
+ .gradio-container a:hover {
433
+ color: #b23310 !important;
434
+ border-bottom: 3px solid #b23310; /* Wider underline, only on hover */
435
+ }
436
+ """) as demo:
437
  gr.Markdown("""
438
  <div style="max-width: 100%; margin: 0 auto;">
439
  <br>
440
 
441
  # OpenAlex Mapper
442
 
443
+ OpenAlex Mapper is a way of projecting search queries from the amazing OpenAlex database on a background map of randomly sampled papers from OpenAlex, which allows you to easily investigate interdisciplinary connections. OpenAlex Mapper was developed by [Maximilian Noichl](https://maxnoichl.eu) and [Andrea Loettgers](https://unige.academia.edu/AndreaLoettgers) at the [Possible Life project](http://www.possiblelife.eu/).
444
 
445
  To use OpenAlex Mapper, first head over to [OpenAlex](https://openalex.org/) and search for something that interests you. For example, you could search for all the papers that make use of the [Kuramoto model](https://openalex.org/works?page=1&filter=default.search%3A%22Kuramoto%20Model%22), for all the papers that were published by researchers at [Utrecht University in 2019](https://openalex.org/works?page=1&filter=authorships.institutions.lineage%3Ai193662353,publication_year%3A2019), or for all the papers that cite Wittgenstein's [Philosophical Investigations](https://openalex.org/works?page=1&filter=cites%3Aw4251395411). Then you copy the URL to that search query into the OpenAlex search URL box below and click "Run Query." It will take a moment to download all of these records from OpenAlex and embed them on our interactive map. After a little time, that map will appear and be available for you to interact with and download. You can find more explanations in the FAQs below.
446
  </div>
 
512
  with gr.Column(scale=2):
513
  html = gr.HTML(
514
  value='<div style="width: 100%; height: 1000px; display: flex; justify-content: center; align-items: center; border: 1px solid #ccc; background-color: #f8f9fa;"><p style="font-size: 1.2em; color: #666;">The visualization map will appear here after running a query</p></div>',
515
+ label="",
516
  show_label=True
517
  )
518
  gr.Markdown("""
 
539
  2. When pressing down a really high-dimensional space into a low-dimensional one, there will be trade-offs. For example, we see this big ring structure of the sciences on the map, but in the middle of the map there is a overly stretchedstring of bioinformaticsthat stretches from computer science at the bottom up to the life sciences clusters at the top. This is one of the areas where the UMAP algorithm had trouble pressing our high-dimensional dataset into a low-dimensional space. For more information on how to read a UMAP plot, I recommend looking into ["Understanding UMAP"](https://pair-code.github.io/understanding-umap/) by Andy Coenen & Adam Pearce.
540
 
541
  3. Finally, the labels we're using for the regions of this plot are created from OpenAlex's own labels of sub-disciplines. They give a rough indication of the papers that could be expected in this broad area of the map, but they are not necessarily the perfect label for the articles that are precisely below them. They are just located at the median point of a usually much larger, much broader, and fuzzier category, so they should always be taken with quite a big grain of salt.
542
+
543
  </div>
544
  """)
545