Skip to content

Commit 5b9987f

Browse files
lazy loading for figures
1 parent af89445 commit 5b9987f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/feelpp/benchmarking/json_report/figures/controller.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def __init__(self, data:pd.DataFrame, plot_config: Union[Dict,Plot], report_uuid
2828

2929
self.figure_views = {
3030
plot_type : {
31-
"plotly": PlotlyFigureFactory.create(plot_type,plot_config=self.plot_config),
32-
"latex": TikzFigureFactory.create(plot_type,plot_config=self.plot_config),
31+
"plotly": lambda pt=plot_type : PlotlyFigureFactory.create(pt,plot_config=self.plot_config),
32+
"latex": lambda pt=plot_type : TikzFigureFactory.create(pt,plot_config=self.plot_config)
3333
}
3434
for plot_type in self.plot_config.plot_types
3535
}
@@ -45,13 +45,13 @@ def coercePlotConfig(self, config):
4545

4646

4747
def renderFigure(self, plot_type, backend, transformation, data_dir = "." ):
48-
figure = self.figure_views[plot_type][backend]
48+
figure = self.figure_views[plot_type][backend]()
4949
if not figure:
5050
return None
5151
return figure.createFigure(self.transformed[transformation],data_dir)
5252

5353
def exportFigureData(self, plot_type, backend, transformation, formats=["csv"], outdir:str = ".") -> list[dict[str,str]]:
54-
figure = self.figure_views[plot_type][backend]
54+
figure = self.figure_views[plot_type][backend]()
5555
if not figure:
5656
return None
5757
if self.report_uuid:

0 commit comments

Comments
 (0)