@@ -127,21 +127,21 @@ def _export_formats(self) -> List[ExportFormat]:
127127 formats .append (ExportFormat (selector = "html" , extension = "html" , method_name = "to_html_stream" , text = False ))
128128 return formats
129129
130- def _to_html (self , debug_mode : bool = False , canvas_id : str = 'canvas' , version : str = None ):
131- lib_path = plot_data_path (debug_mode = debug_mode , version = version )
130+ def _to_html (self , local : bool = False , canvas_id : str = 'canvas' , version : str = None ):
131+ lib_path = plot_data_path (local = local , version = version )
132132 return self .template .substitute (data = json .dumps (self .to_dict ()), core_path = lib_path , canvas_id = canvas_id ,
133133 width = self .width , height = self .height )
134134
135- def to_html_stream (self , stream , debug_mode : bool = False , canvas_id : str = 'canvas' , version : str = None ):
135+ def to_html_stream (self , stream , local : bool = False , canvas_id : str = 'canvas' , version : str = None ):
136136 """ Export current Figure to its equivalent html stream file. """
137- html = self ._to_html (debug_mode = debug_mode , canvas_id = canvas_id , version = version )
137+ html = self ._to_html (local = local , canvas_id = canvas_id , version = version )
138138 stream .write (html )
139139
140- def to_html (self , filepath : str = None , debug_mode : bool = False , canvas_id : str = 'canvas' , version : str = None ):
140+ def to_html (self , filepath : str = None , local : bool = False , canvas_id : str = 'canvas' , version : str = None ):
141141 """ Export current Figure to an HTML file given by the filepath. """
142142 filepath = make_filepath (filepath = filepath )
143143 with open (filepath , 'w' , encoding = "utf-8" ) as file :
144- self .to_html_stream (file , debug_mode = debug_mode , canvas_id = canvas_id , version = version )
144+ self .to_html_stream (file , local = local , canvas_id = canvas_id , version = version )
145145 return filepath
146146
147147 def plot_data (self , ** kwargs ):
@@ -1505,10 +1505,10 @@ def __init__(self, plots: List[PlotDataObject], sizes: List[Window] = None, elem
15051505 super ().__init__ (width = width , height = height , type_ = 'multiplot' , name = name )
15061506
15071507
1508- def plot_data_path (debug_mode : bool = False , version : str = None ):
1508+ def plot_data_path (local : bool = False , version : str = None ):
15091509 """ Get path of plot_data package to write it in html file of Figure to draw. """
15101510 version , folder , filename = get_current_link (version = version )
1511- if debug_mode :
1511+ if local :
15121512 core_path = os .sep .join (os .getcwd ().split (os .sep )[:- 1 ] + [folder , filename ])
15131513 if os .path .isfile (core_path ):
15141514 return core_path .replace (" " , "%20" )
@@ -1526,17 +1526,17 @@ def make_filepath(filepath: str = None):
15261526 return filepath
15271527
15281528
1529- def plot_canvas (plot_data_object : Figure , filepath : str = None , debug_mode : bool = False , canvas_id : str = 'canvas' ,
1529+ def plot_canvas (plot_data_object : Figure , filepath : str = None , local : bool = False , canvas_id : str = 'canvas' ,
15301530 force_version : str = None , width : float = None , height : float = None ):
15311531 """
15321532 Creates a html file and plots input data in web browser.
15331533
15341534 :param plot_data_object: a PlotDataObject(ie Scatter, ParallelPlot,\
15351535 MultiplePlots, Graph2D, PrimitiveGroup or PrimitiveGroupContainer)
15361536 :type plot_data_object: PlotDataObject
1537- :param debug_mode : uses local library if True, uses typescript \
1537+ :param local : uses local library if True, uses typescript \
15381538 library from cdn if False
1539- :type debug_mode : bool
1539+ :type local : bool
15401540 :param canvas_id: set canvas' id, ie name
15411541 :type canvas_id: str
15421542 :param width: set the canvas' width:
@@ -1550,7 +1550,7 @@ def plot_canvas(plot_data_object: Figure, filepath: str = None, debug_mode: bool
15501550 plot_data_object .width = width
15511551 if height :
15521552 plot_data_object .height = height
1553- plot_data_object .plot (filepath = filepath , debug_mode = debug_mode , canvas_id = canvas_id , version = force_version )
1553+ plot_data_object .plot (filepath = filepath , local = local , canvas_id = canvas_id , version = force_version )
15541554
15551555
15561556def write_json_for_tests (plot_data_object : PlotDataObject , json_path : str ):
0 commit comments