Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,14 +39,8 @@ class CalculadoraCenarios:
|
|
| 39 |
def calculate_and_return_df(receitas_iniciais, custos_operacionais_iniciais, depreciacao_amortizacao_inicial, taxa_crescimento_receitas, taxa_reducao_custos):
|
| 40 |
cenario = CalculadoraCenarios(receitas_iniciais, custos_operacionais_iniciais, depreciacao_amortizacao_inicial, taxa_crescimento_receitas, taxa_reducao_custos)
|
| 41 |
df = cenario.calcular_cenario()
|
| 42 |
-
df = df.set_index('Ano') #
|
| 43 |
-
return df.
|
| 44 |
-
{'selector': 'th', 'props': [('background', '#606060'), ('color', 'white'), ('font-family', 'verdana')]},
|
| 45 |
-
{'selector': 'td', 'props': [('font-family', 'verdana')]},
|
| 46 |
-
{'selector': 'tr:nth-of-type(odd)', 'props': [('background', '#DCDCDC')]},
|
| 47 |
-
{'selector': 'tr:nth-of-type(even)', 'props': [('background', 'white')]},
|
| 48 |
-
{'selector': 'tr:hover', 'props': [('background-color', '#F5F5F5')]}
|
| 49 |
-
]).render() # Convertendo DataFrame para HTML com estilos CSS
|
| 50 |
|
| 51 |
# Interface Gradio
|
| 52 |
iface = gr.Interface(
|
|
@@ -58,9 +52,8 @@ iface = gr.Interface(
|
|
| 58 |
gr.Slider(minimum=0, maximum=1, label="Taxa de Crescimento Anual das Receitas"),
|
| 59 |
gr.Slider(minimum=0, maximum=1, label="Taxa de Redução Anual dos Custos"),
|
| 60 |
],
|
| 61 |
-
outputs=gr.
|
| 62 |
live=True, # Enable live updates
|
| 63 |
-
css='.output_html {width: 100%; height: auto;}'
|
| 64 |
)
|
| 65 |
|
| 66 |
# Lançar a interface Gradio
|
|
|
|
| 39 |
def calculate_and_return_df(receitas_iniciais, custos_operacionais_iniciais, depreciacao_amortizacao_inicial, taxa_crescimento_receitas, taxa_reducao_custos):
|
| 40 |
cenario = CalculadoraCenarios(receitas_iniciais, custos_operacionais_iniciais, depreciacao_amortizacao_inicial, taxa_crescimento_receitas, taxa_reducao_custos)
|
| 41 |
df = cenario.calcular_cenario()
|
| 42 |
+
df = df.set_index('Ano') # Definir 'Ano' como índice
|
| 43 |
+
return df.to_markdown() # Convertendo DataFrame para Markdown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
# Interface Gradio
|
| 46 |
iface = gr.Interface(
|
|
|
|
| 52 |
gr.Slider(minimum=0, maximum=1, label="Taxa de Crescimento Anual das Receitas"),
|
| 53 |
gr.Slider(minimum=0, maximum=1, label="Taxa de Redução Anual dos Custos"),
|
| 54 |
],
|
| 55 |
+
outputs=gr.Markdown(), # Usando Markdown para exibir resultados
|
| 56 |
live=True, # Enable live updates
|
|
|
|
| 57 |
)
|
| 58 |
|
| 59 |
# Lançar a interface Gradio
|