File tree 1 file changed +5
-20
lines changed
1 file changed +5
-20
lines changed Original file line number Diff line number Diff line change 46
46
import subprocess
47
47
from dataclasses import dataclass , replace
48
48
from enum import Enum , auto
49
- from typing import Optional , Tuple
49
+ from typing import Callable , Optional , Tuple
50
50
51
51
import click
52
52
import coloredlogs
63
63
}
64
64
65
65
66
- class ChartStyle (Enum ):
67
- TREE_MAP = auto ()
68
- SUNBURST = auto ()
69
- ICICLE = auto ()
70
-
71
-
72
66
__CHART_STYLES__ = {
73
- "treemap" : ChartStyle . TREE_MAP ,
74
- "sunburst" : ChartStyle . SUNBURST ,
75
- "icicle" : ChartStyle . ICICLE ,
67
+ "treemap" : px . treemap ,
68
+ "sunburst" : px . sunburst ,
69
+ "icicle" : px . icicle ,
76
70
}
77
71
78
72
@@ -363,7 +357,7 @@ def build_treemap(
363
357
name : str ,
364
358
symbols : list [Symbol ],
365
359
separator : str ,
366
- style : ChartStyle ,
360
+ figure_generator : Callable ,
367
361
max_depth : int ,
368
362
zoom : Optional [str ],
369
363
strip : Optional [str ],
@@ -465,15 +459,6 @@ def build_treemap(
465
459
466
460
data ["name_with_size" ][idx ] = f"{ short_name } : { data ["size" ][idx ]} "
467
461
468
-
469
- match style :
470
- case ChartStyle .TREE_MAP :
471
- figure_generator = px .treemap
472
- case ChartStyle .SUNBURST :
473
- figure_generator = px .sunburst
474
- case ChartStyle .ICICLE :
475
- figure_generator = px .icicle
476
-
477
462
fig = figure_generator (
478
463
data ,
479
464
names = "name_with_size" ,
You can’t perform that action at this time.
0 commit comments