rayli commited on
Commit
dcebb9e
·
verified ·
1 Parent(s): a3f0291

Fix parameter panel and orientation picker spacing

Browse files
Files changed (1) hide show
  1. app.py +38 -11
app.py CHANGED
@@ -143,11 +143,17 @@ DEMO_CSS = """
143
  }
144
  .mesh-panel .model3d-container,
145
  .mesh-panel model-viewer {
146
- height: 360px !important;
 
 
 
 
 
 
147
  }
148
  .mesh-examples {
149
  flex: 0 0 auto;
150
- max-height: 105px;
151
  overflow-y: auto;
152
  border: 1px solid #d7deea;
153
  border-radius: 6px;
@@ -192,15 +198,21 @@ DEMO_CSS = """
192
  .orientation-panel {
193
  display: flex;
194
  flex-direction: column;
195
- gap: 8px;
196
  }
197
  .orientation-panel .markdown {
198
  flex: 0 0 auto !important;
199
  margin: 0 !important;
 
200
  }
201
  .orientation-panel .markdown h3,
202
  .orientation-panel .markdown p {
203
- margin-bottom: 4px !important;
 
 
 
 
 
204
  }
205
  .upright-picker-grid {
206
  flex: 0 0 auto !important;
@@ -209,7 +221,9 @@ DEMO_CSS = """
209
  width: 100% !important;
210
  display: flex !important;
211
  flex-direction: column !important;
212
- gap: 8px !important;
 
 
213
  }
214
  .upright-picker-row {
215
  flex: 0 0 auto !important;
@@ -329,6 +343,13 @@ DEMO_CSS = """
329
  .capped-output canvas {
330
  max-height: 390px !important;
331
  }
 
 
 
 
 
 
 
332
  """
333
 
334
  KINEMATIC_TREE_EDITOR_CSS = """
@@ -3516,19 +3537,16 @@ def create_gradio_app(app: InstructParticulateApp) -> gr.Blocks:
3516
 
3517
  with gr.Row(equal_height=True, elem_classes=["demo-row", "demo-top-row"]):
3518
  with gr.Column(scale=1, elem_classes=["demo-panel", "mesh-panel"]):
3519
- input_mesh = gr.Model3D(label="Input Mesh", interactive=True, height=360)
3520
  examples = _example_meshes()
3521
  examples_container = None
3522
- if examples:
3523
- with gr.Column(elem_classes=["mesh-examples"]) as examples_container:
3524
- pass
3525
  mesh_status = gr.Textbox(
3526
  label="Mesh Status",
3527
  interactive=False,
3528
  visible=False,
3529
  elem_classes=["kinematic-json-sync"],
3530
  )
3531
- with gr.Accordion("Inference Parameters", open=True):
3532
  with gr.Row():
3533
  num_query_points = gr.Number(
3534
  value=102400,
@@ -3569,6 +3587,9 @@ def create_gradio_app(app: InstructParticulateApp) -> gr.Blocks:
3569
  label="Joint Confidence Temperature",
3570
  minimum=0.01,
3571
  )
 
 
 
3572
 
3573
  with gr.Column(scale=1, elem_classes=["demo-panel", "kin-panel"]):
3574
  extract_button = gr.Button("Extract Kinematic Structure")
@@ -3700,7 +3721,13 @@ def create_gradio_app(app: InstructParticulateApp) -> gr.Blocks:
3700
  visible=False,
3701
  elem_classes=["kinematic-json-sync"],
3702
  )
3703
- status = gr.Textbox(label="Status", interactive=False)
 
 
 
 
 
 
3704
 
3705
  input_mesh.change(
3706
  fn=app.register_mesh,
 
143
  }
144
  .mesh-panel .model3d-container,
145
  .mesh-panel model-viewer {
146
+ height: 300px !important;
147
+ }
148
+ .inference-params-panel {
149
+ flex: 0 0 auto !important;
150
+ }
151
+ .inference-params-panel .form {
152
+ gap: 6px !important;
153
  }
154
  .mesh-examples {
155
  flex: 0 0 auto;
156
+ max-height: 82px;
157
  overflow-y: auto;
158
  border: 1px solid #d7deea;
159
  border-radius: 6px;
 
198
  .orientation-panel {
199
  display: flex;
200
  flex-direction: column;
201
+ gap: 0 !important;
202
  }
203
  .orientation-panel .markdown {
204
  flex: 0 0 auto !important;
205
  margin: 0 !important;
206
+ padding-bottom: 0 !important;
207
  }
208
  .orientation-panel .markdown h3,
209
  .orientation-panel .markdown p {
210
+ margin-bottom: 0 !important;
211
+ }
212
+ .orientation-panel > .form,
213
+ .orientation-panel > div,
214
+ .orientation-panel .form {
215
+ gap: 0 !important;
216
  }
217
  .upright-picker-grid {
218
  flex: 0 0 auto !important;
 
221
  width: 100% !important;
222
  display: flex !important;
223
  flex-direction: column !important;
224
+ gap: 6px !important;
225
+ margin-top: 0 !important;
226
+ padding-top: 0 !important;
227
  }
228
  .upright-picker-row {
229
  flex: 0 0 auto !important;
 
343
  .capped-output canvas {
344
  max-height: 390px !important;
345
  }
346
+ .compact-status {
347
+ flex: 0 0 auto !important;
348
+ }
349
+ .compact-status textarea {
350
+ min-height: 38px !important;
351
+ max-height: 52px !important;
352
+ }
353
  """
354
 
355
  KINEMATIC_TREE_EDITOR_CSS = """
 
3537
 
3538
  with gr.Row(equal_height=True, elem_classes=["demo-row", "demo-top-row"]):
3539
  with gr.Column(scale=1, elem_classes=["demo-panel", "mesh-panel"]):
3540
+ input_mesh = gr.Model3D(label="Input Mesh", interactive=True, height=300)
3541
  examples = _example_meshes()
3542
  examples_container = None
 
 
 
3543
  mesh_status = gr.Textbox(
3544
  label="Mesh Status",
3545
  interactive=False,
3546
  visible=False,
3547
  elem_classes=["kinematic-json-sync"],
3548
  )
3549
+ with gr.Accordion("Inference Parameters", open=True, elem_classes=["inference-params-panel"]):
3550
  with gr.Row():
3551
  num_query_points = gr.Number(
3552
  value=102400,
 
3587
  label="Joint Confidence Temperature",
3588
  minimum=0.01,
3589
  )
3590
+ if examples:
3591
+ with gr.Column(elem_classes=["mesh-examples"]) as examples_container:
3592
+ pass
3593
 
3594
  with gr.Column(scale=1, elem_classes=["demo-panel", "kin-panel"]):
3595
  extract_button = gr.Button("Extract Kinematic Structure")
 
3721
  visible=False,
3722
  elem_classes=["kinematic-json-sync"],
3723
  )
3724
+ status = gr.Textbox(
3725
+ label="Status",
3726
+ interactive=False,
3727
+ lines=1,
3728
+ max_lines=2,
3729
+ elem_classes=["compact-status"],
3730
+ )
3731
 
3732
  input_mesh.change(
3733
  fn=app.register_mesh,