Remove main application file app.py and update dependencies for modular dashboard architecture
- Deleted `app.py`, consolidating the main application logic into a modular structure for improved maintainability. - Added `dash-mantine-components` dependency to enhance UI component capabilities. - Updated `pyproject.toml` and `uv.lock` to reflect the new dependency. - Adjusted imports in `components/__init__.py` and `chart_controls.py` to align with the new modular design. - Cleaned up unused parameter controls in the market data layout to streamline the user interface.
This commit is contained in:
@@ -2,11 +2,10 @@
|
||||
Reusable UI components for the dashboard.
|
||||
"""
|
||||
|
||||
from .chart_controls import create_chart_config_panel
|
||||
from .indicator_modal import create_indicator_modal
|
||||
from .chart_controls import create_chart_config_panel, create_parameter_controls
|
||||
|
||||
__all__ = [
|
||||
'create_indicator_modal',
|
||||
'create_chart_config_panel',
|
||||
'create_parameter_controls'
|
||||
'create_indicator_modal'
|
||||
]
|
||||
@@ -91,105 +91,6 @@ def create_chart_config_panel(strategy_options, overlay_options, subplot_options
|
||||
})
|
||||
|
||||
|
||||
def create_parameter_controls():
|
||||
"""Create the parameter controls section for indicator configuration."""
|
||||
return html.Div([
|
||||
html.H5("📊 Indicator Parameters", style={'color': '#2c3e50', 'margin-bottom': '15px'}),
|
||||
|
||||
# SMA/EMA Period Controls
|
||||
html.Div([
|
||||
html.Label("Moving Average Period:", style={'font-weight': 'bold', 'margin-bottom': '5px'}),
|
||||
dcc.Slider(
|
||||
id='ma-period-slider',
|
||||
min=5, max=200, step=5, value=20,
|
||||
marks={i: str(i) for i in [5, 20, 50, 100, 200]},
|
||||
tooltip={'placement': 'bottom', 'always_visible': True}
|
||||
)
|
||||
], style={'margin-bottom': '20px'}),
|
||||
|
||||
# RSI Period Control
|
||||
html.Div([
|
||||
html.Label("RSI Period:", style={'font-weight': 'bold', 'margin-bottom': '5px'}),
|
||||
dcc.Slider(
|
||||
id='rsi-period-slider',
|
||||
min=7, max=30, step=1, value=14,
|
||||
marks={i: str(i) for i in [7, 14, 21, 30]},
|
||||
tooltip={'placement': 'bottom', 'always_visible': True}
|
||||
)
|
||||
], style={'margin-bottom': '20px'}),
|
||||
|
||||
# MACD Parameters
|
||||
html.Div([
|
||||
html.Label("MACD Parameters:", style={'font-weight': 'bold', 'margin-bottom': '10px'}),
|
||||
html.Div([
|
||||
html.Div([
|
||||
html.Label("Fast:", style={'font-size': '12px'}),
|
||||
dcc.Input(
|
||||
id='macd-fast-input',
|
||||
type='number',
|
||||
value=12,
|
||||
min=5, max=50,
|
||||
style={'width': '60px', 'margin-left': '5px'}
|
||||
)
|
||||
], style={'display': 'inline-block', 'margin-right': '15px'}),
|
||||
html.Div([
|
||||
html.Label("Slow:", style={'font-size': '12px'}),
|
||||
dcc.Input(
|
||||
id='macd-slow-input',
|
||||
type='number',
|
||||
value=26,
|
||||
min=10, max=100,
|
||||
style={'width': '60px', 'margin-left': '5px'}
|
||||
)
|
||||
], style={'display': 'inline-block', 'margin-right': '15px'}),
|
||||
html.Div([
|
||||
html.Label("Signal:", style={'font-size': '12px'}),
|
||||
dcc.Input(
|
||||
id='macd-signal-input',
|
||||
type='number',
|
||||
value=9,
|
||||
min=3, max=20,
|
||||
style={'width': '60px', 'margin-left': '5px'}
|
||||
)
|
||||
], style={'display': 'inline-block'})
|
||||
])
|
||||
], style={'margin-bottom': '20px'}),
|
||||
|
||||
# Bollinger Bands Parameters
|
||||
html.Div([
|
||||
html.Label("Bollinger Bands:", style={'font-weight': 'bold', 'margin-bottom': '10px'}),
|
||||
html.Div([
|
||||
html.Div([
|
||||
html.Label("Period:", style={'font-size': '12px'}),
|
||||
dcc.Input(
|
||||
id='bb-period-input',
|
||||
type='number',
|
||||
value=20,
|
||||
min=5, max=50,
|
||||
style={'width': '60px', 'margin-left': '5px'}
|
||||
)
|
||||
], style={'display': 'inline-block', 'margin-right': '15px'}),
|
||||
html.Div([
|
||||
html.Label("Std Dev:", style={'font-size': '12px'}),
|
||||
dcc.Input(
|
||||
id='bb-stddev-input',
|
||||
type='number',
|
||||
value=2.0,
|
||||
min=1.0, max=3.0, step=0.1,
|
||||
style={'width': '70px', 'margin-left': '5px'}
|
||||
)
|
||||
], style={'display': 'inline-block'})
|
||||
])
|
||||
])
|
||||
], style={
|
||||
'border': '1px solid #bdc3c7',
|
||||
'border-radius': '8px',
|
||||
'padding': '15px',
|
||||
'background-color': '#f8f9fa',
|
||||
'margin-bottom': '20px'
|
||||
})
|
||||
|
||||
|
||||
def create_auto_update_control():
|
||||
"""Create the auto-update control section."""
|
||||
return html.Div([
|
||||
|
||||
@@ -10,7 +10,6 @@ from components.charts.indicator_manager import get_indicator_manager
|
||||
from components.charts.indicator_defaults import ensure_default_indicators
|
||||
from dashboard.components.chart_controls import (
|
||||
create_chart_config_panel,
|
||||
create_parameter_controls,
|
||||
create_auto_update_control
|
||||
)
|
||||
|
||||
@@ -76,7 +75,6 @@ def get_market_data_layout():
|
||||
|
||||
# Create components using the new modular functions
|
||||
chart_config_panel = create_chart_config_panel(strategy_options, overlay_options, subplot_options)
|
||||
parameter_controls = create_parameter_controls()
|
||||
auto_update_control = create_auto_update_control()
|
||||
|
||||
return html.Div([
|
||||
@@ -110,9 +108,6 @@ def get_market_data_layout():
|
||||
# Chart Configuration Panel
|
||||
chart_config_panel,
|
||||
|
||||
# Parameter Controls Section
|
||||
parameter_controls,
|
||||
|
||||
# Auto-update control
|
||||
auto_update_control,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user