buildinves commited on
Commit
55e4536
·
verified ·
1 Parent(s): 71a91ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -1,4 +1,3 @@
1
-
2
  import gradio as gr
3
  import pandas as pd
4
  import numpy as np
@@ -154,6 +153,19 @@ class AdvancedGridOptimizer:
154
  x_pos = 0
155
  for i, (width, lot_type) in enumerate(solution):
156
  # Get base color
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  ax1.set_xlim(-5, stage_width + 5)
158
  # Adjust y-limits for rear laneway
159
  if self.md_load_type == 'rear':
 
 
1
  import gradio as gr
2
  import pandas as pd
3
  import numpy as np
 
153
  x_pos = 0
154
  for i, (width, lot_type) in enumerate(solution):
155
  # Get base color
156
+ if width in colors:
157
+ base_color = colors[width]
158
+ else:
159
+ # Use MD colors if in MD mode
160
+ if self.development_mode == 'medium_density':
161
+ if width <= 6.0:
162
+ base_color = colors.get(4.5, '#6B4C8A')
163
+ else:
164
+ base_color = colors.get(7.0, '#4A7C7E')
165
+ else:
166
+ closest_width = min(colors.keys(), key=lambda x: abs(x - width))
167
+ base_color = colors[closest_width]
168
+ # Get base color
169
  ax1.set_xlim(-5, stage_width + 5)
170
  # Adjust y-limits for rear laneway
171
  if self.md_load_type == 'rear':