Generate engineering analysis reports with interactive Plotly visualizations, standard report sections, and HTML export. Use for creating dashboards, analysis summaries, and technical documentation with charts.
import plotly.express as px
import pandas as pd
from pathlib import Path
from datetime import datetime
# Load data
df = pd.read_csv("../data/processed/results.csv")
# Create visualization
fig = px.line(df, x="date", y="value", title="Analysis Results")
# Generate HTML report
html = f"""<!DOCTYPE html>
<html>
<head><title>Engineering Report</title></head>
<body>
<h1>Analysis Report - {datetime.now().strftime('%Y-%m-%d')}</h1>
{fig.to_html(full_html=False, include_plotlyjs="cdn")}
</body>
</html>"""
Path("../reports/analysis.html").write_text(html)
print("Report generated: reports/analysis.html")
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import pandas as pd
from pathlib import Path
from datetime import datetime
def generate_report(
data_path: str,
*See sub-skills for full details.*
### Visualization Patterns
```python
def create_visualizations(df: pd.DataFrame, chart_configs: list) -> list:
"""Create Plotly figures from configuration."""
figures = []
for config in chart_configs:
chart_type = config.get('type', 'line')
if chart_type == 'line':
fig = px.line(
*See sub-skills for full details.*
### HTML Template
```python
def build_html_report(title: str, sections: dict, figures: list) -> str:
"""Build complete HTML report."""
# Convert figures to HTML
chart_html = '\n'.join([
f'<div class="chart-container">{fig.to_html(full_html=False, include_plotlyjs="cdn")}</div>'
for fig in figures
])
*See sub-skills for full details.*
## Integration
### With YAML Workflow
```yaml