github-actions[bot] commited on
Commit
45c78fb
·
1 Parent(s): 030978c

Sync from GitHub: 7d7b1dbe8c39c888eece4bb10c966bfbf7bf2886

Browse files
Files changed (2) hide show
  1. app.py +16 -1
  2. demos/compare.py +11 -6
app.py CHANGED
@@ -39,10 +39,25 @@ custom_css = """
39
  display: flex;
40
  flex-direction: column;
41
  justify-content: flex-end;
42
- height: 240px; /* Fixed height */
43
  object-fit: contain; /* Scale the content to fit within the element */
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  #chunked-text span.label {
47
  text-transform: none !important;
48
  }
 
39
  display: flex;
40
  flex-direction: column;
41
  justify-content: flex-end;
42
+ height: 300px !important; /* Fixed height for proper bar display */
43
  object-fit: contain; /* Scale the content to fit within the element */
44
  }
45
 
46
+ .iscc-unit-sim > div {
47
+ height: 100% !important;
48
+ display: flex;
49
+ flex-direction: column;
50
+ }
51
+
52
+ .iscc-unit-sim .plotly {
53
+ height: 100% !important;
54
+ flex: 1;
55
+ }
56
+
57
+ .iscc-unit-sim .plotly > div {
58
+ height: 100% !important;
59
+ }
60
+
61
  #chunked-text span.label {
62
  text-transform: none !important;
63
  }
demos/compare.py CHANGED
@@ -44,11 +44,15 @@ custom_css = """
44
  }
45
 
46
  .iscc-unit-sim {
47
- display: flex;
48
- flex-direction: column;
49
- justify-content: flex-end;
50
- height: 120px; /* Fixed height */
51
- object-fit: contain; /* Scale the content to fit within the element */
 
 
 
 
52
  }
53
 
54
  .modebar-btn {
@@ -128,7 +132,7 @@ def similarity_plot(sim_data):
128
 
129
  # Update layout for aesthetics
130
  fig.update_layout(
131
- height=len(sim_data) * 40,
132
  autosize=True,
133
  xaxis=dict(
134
  title="",
@@ -142,6 +146,7 @@ def similarity_plot(sim_data):
142
  paper_bgcolor="rgba(0,0,0,0)",
143
  plot_bgcolor="rgba(0,0,0,0)",
144
  showlegend=False,
 
145
  modebar_remove=[
146
  "toImage",
147
  "zoom",
 
44
  }
45
 
46
  .iscc-unit-sim {
47
+ height: 300px !important; /* Fixed height for proper bar display */
48
+ }
49
+
50
+ .iscc-unit-sim .js-plotly-plot {
51
+ height: 100% !important;
52
+ }
53
+
54
+ .iscc-unit-sim .plotly {
55
+ height: 100% !important;
56
  }
57
 
58
  .modebar-btn {
 
132
 
133
  # Update layout for aesthetics
134
  fig.update_layout(
135
+ height=280, # Set explicit height for Gradio 5 compatibility
136
  autosize=True,
137
  xaxis=dict(
138
  title="",
 
146
  paper_bgcolor="rgba(0,0,0,0)",
147
  plot_bgcolor="rgba(0,0,0,0)",
148
  showlegend=False,
149
+ margin=dict(l=0, r=0, t=10, b=10), # Reduce margins to maximize bar space
150
  modebar_remove=[
151
  "toImage",
152
  "zoom",