(component: str)
| 2 | |
| 3 | |
| 4 | def get_combined_css(component: str) -> str: |
| 5 | template_dir = importlib.resources.files(__package__) |
| 6 | |
| 7 | base_css = (template_dir / "_shared_assets" / "base.css").read_text(encoding="utf-8") |
| 8 | |
| 9 | if component == "flamegraph": |
| 10 | component_css = ( |
| 11 | template_dir / "_flamegraph_assets" / "flamegraph.css" |
| 12 | ).read_text(encoding="utf-8") |
| 13 | elif component == "heatmap": |
| 14 | component_css = (template_dir / "_heatmap_assets" / "heatmap.css").read_text( |
| 15 | encoding="utf-8" |
| 16 | ) |
| 17 | else: |
| 18 | raise ValueError( |
| 19 | f"Unknown component: {component}. Expected 'flamegraph' or 'heatmap'." |
| 20 | ) |
| 21 | |
| 22 | return f"{base_css}\n\n{component_css}" |
no test coverage detected
searching dependent graphs…