@@ -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 ):
@@ -165,7 +165,6 @@ class Sample(ReferencedObject):
165165
166166 def __init__ (self , values , reference_path : str = "#" , name : str = "" ):
167167 self .values = values
168- self .reference_path = reference_path
169168 super ().__init__ (type_ = "sample" , reference_path = reference_path , name = name )
170169
171170 def to_dict (self , use_pointers : bool = True , memo = None , path : str = '#' , id_method = True ,
@@ -1505,10 +1504,10 @@ def __init__(self, plots: List[PlotDataObject], sizes: List[Window] = None, elem
15051504 super ().__init__ (width = width , height = height , type_ = 'multiplot' , name = name )
15061505
15071506
1508- def plot_data_path (debug_mode : bool = False , version : str = None ):
1507+ def plot_data_path (local : bool = False , version : str = None ):
15091508 """ Get path of plot_data package to write it in html file of Figure to draw. """
15101509 version , folder , filename = get_current_link (version = version )
1511- if debug_mode :
1510+ if local :
15121511 core_path = os .sep .join (os .getcwd ().split (os .sep )[:- 1 ] + [folder , filename ])
15131512 if os .path .isfile (core_path ):
15141513 return core_path .replace (" " , "%20" )
@@ -1526,17 +1525,17 @@ def make_filepath(filepath: str = None):
15261525 return filepath
15271526
15281527
1529- def plot_canvas (plot_data_object : Figure , filepath : str = None , debug_mode : bool = False , canvas_id : str = 'canvas' ,
1528+ def plot_canvas (plot_data_object : Figure , filepath : str = None , local : bool = False , canvas_id : str = 'canvas' ,
15301529 force_version : str = None , width : float = None , height : float = None ):
15311530 """
15321531 Creates a html file and plots input data in web browser.
15331532
15341533 :param plot_data_object: a PlotDataObject(ie Scatter, ParallelPlot,\
15351534 MultiplePlots, Graph2D, PrimitiveGroup or PrimitiveGroupContainer)
15361535 :type plot_data_object: PlotDataObject
1537- :param debug_mode : uses local library if True, uses typescript \
1536+ :param local : uses local library if True, uses typescript \
15381537 library from cdn if False
1539- :type debug_mode : bool
1538+ :type local : bool
15401539 :param canvas_id: set canvas' id, ie name
15411540 :type canvas_id: str
15421541 :param width: set the canvas' width:
@@ -1550,7 +1549,7 @@ def plot_canvas(plot_data_object: Figure, filepath: str = None, debug_mode: bool
15501549 plot_data_object .width = width
15511550 if height :
15521551 plot_data_object .height = height
1553- plot_data_object .plot (filepath = filepath , debug_mode = debug_mode , canvas_id = canvas_id , version = force_version )
1552+ plot_data_object .plot (filepath = filepath , local = local , canvas_id = canvas_id , version = force_version )
15541553
15551554
15561555def write_json_for_tests (plot_data_object : PlotDataObject , json_path : str ):
0 commit comments