@@ -11,7 +11,7 @@ class ReportFormat(StrEnum):
1111 ODT = auto ()
1212 REVEALJS = auto ()
1313 PPTX = auto ()
14- JUPYTER = auto ()
14+ JUPYTER = auto ()
1515
1616class QuartoReportView (r .ReportView ):
1717 """
@@ -241,21 +241,21 @@ def _generate_plot_content(self, plot, is_report_static) -> List[str]:
241241 else :
242242 html_plot_file = f"quarto_report/{ plot .name .replace (' ' , '_' )} .html"
243243
244- if plot .visualization_tool == r .VisualizationTool .PLOTLY :
244+ if plot .int_visualization_tool == r .IntVisualizationTool .PLOTLY :
245245 plot_content .append (self ._generate_plot_code (plot ))
246246 if is_report_static :
247247 plot_content .append (f"""fig_plotly.write_image("{ os .path .join (".." , static_plot_path )} ")\n ```\n """ )
248248 plot_content .append (self ._generate_image_content (static_plot_path , plot .name ))
249249 else :
250250 plot_content .append (f"""fig_plotly.show()\n ```\n """ )
251- elif plot .visualization_tool == r .VisualizationTool .ALTAIR :
251+ elif plot .int_visualization_tool == r .IntVisualizationTool .ALTAIR :
252252 plot_content .append (self ._generate_plot_code (plot ))
253253 if is_report_static :
254254 plot_content .append (f"""fig_altair.save("{ os .path .join (".." , static_plot_path )} ")\n ```\n """ )
255255 plot_content .append (self ._generate_image_content (static_plot_path , plot .name ))
256256 else :
257257 plot_content .append (f"""fig_altair\n ```\n """ )
258- elif plot .visualization_tool == r .VisualizationTool .PYVIS :
258+ elif plot .int_visualization_tool == r .IntVisualizationTool .PYVIS :
259259 G = plot .read_network ()
260260 num_nodes = G .number_of_nodes ()
261261 num_edges = G .number_of_edges ()
@@ -296,13 +296,13 @@ def _generate_plot_code(self, plot, output_file = "") -> str:
296296 plot_data = plot_file.read()
297297 """
298298 # Add specific code for each visualization tool
299- if plot .visualization_tool == r .VisualizationTool .PLOTLY :
299+ if plot .int_visualization_tool == r .IntVisualizationTool .PLOTLY :
300300 plot_code += """fig_plotly = pio.from_json(plot_data)
301301fig_plotly.update_layout(width=950, height=500)
302302 """
303- elif plot .visualization_tool == r .VisualizationTool .ALTAIR :
303+ elif plot .int_visualization_tool == r .IntVisualizationTool .ALTAIR :
304304 plot_code += """fig_altair = alt.Chart.from_json(plot_data).properties(width=900, height=400)"""
305- elif plot .visualization_tool == r .VisualizationTool .PYVIS :
305+ elif plot .int_visualization_tool == r .IntVisualizationTool .PYVIS :
306306 plot_code = f"""<div style="text-align: center;">
307307<iframe src="{ os .path .join (".." , output_file )} " alt="{ plot .name } plot" width="800px" height="630px"></iframe>
308308</div>\n """
@@ -451,8 +451,8 @@ def _generate_component_imports(self, component: r.Component) -> List[str]:
451451 # Dictionary to hold the imports for each component type
452452 components_imports = {
453453 'plot' : {
454- r .VisualizationTool .ALTAIR : ['import altair as alt' ],
455- r .VisualizationTool .PLOTLY : ['import plotly.io as pio' ]
454+ r .IntVisualizationTool .ALTAIR : ['import altair as alt' ],
455+ r .IntVisualizationTool .PLOTLY : ['import plotly.io as pio' ]
456456 },
457457 'dataframe' : ['import pandas as pd' , 'from itables import show' , 'import dataframe_image as dfi' ],
458458 'markdown' : ['import IPython.display as display' ]
@@ -464,9 +464,9 @@ def _generate_component_imports(self, component: r.Component) -> List[str]:
464464
465465 # Add relevant imports based on component type and visualization tool
466466 if component_type == r .ComponentType .PLOT :
467- visualization_tool = getattr (component , 'visualization_tool ' , None )
468- if visualization_tool in components_imports ['plot' ]:
469- component_imports .extend (components_imports ['plot' ][visualization_tool ])
467+ int_visualization_tool = getattr (component , 'int_visualization_tool ' , None )
468+ if int_visualization_tool in components_imports ['plot' ]:
469+ component_imports .extend (components_imports ['plot' ][int_visualization_tool ])
470470 elif component_type == r .ComponentType .DATAFRAME :
471471 component_imports .extend (components_imports ['dataframe' ])
472472 elif component_type == r .ComponentType .MARKDOWN :
0 commit comments