@@ -103,10 +103,13 @@ def display():
103
103
type = str , default = 'Surface' , show_default = True )
104
104
@click .option (
105
105
'--output-format' , '-of' , help = 'Text for the output format of the resulting '
106
- 'VisualizationSet File (.vsf). Choose from: vsf, pkl, vtkjs. Note that vsf .'
107
- 'refers to the JSON version of the VisualizationSet file. Also not that '
108
- 'ladybug-vtk must be installed in order for the vtkjs option to be usable. '
109
- 'The vtkjs option also requires an explicit --output-file to be specified.' ,
106
+ 'VisualizationSet File (.vsf). Choose from: vsf, json, pkl, vtkjs, html. Note '
107
+ 'that both vsf and json refer to the the JSON version of the VisualizationSet '
108
+ 'file and the distinction between the two is only for help in coordinating file '
109
+ 'extensions (since both .vsf and .json can be acceptable). Also note that '
110
+ 'ladybug-vtk must be installed in order for the vtkjs or html options to be usable '
111
+ 'and the html format refers to a web page with the vtkjs file embedded within it. '
112
+ 'The vtkjs and html options also require an explicit --output-file to be specified.' ,
110
113
type = str , default = 'vsf' , show_default = True )
111
114
@click .option (
112
115
'--output-file' , help = 'Optional file to output the JSON string of '
@@ -146,14 +149,19 @@ def model_to_vis_set(
146
149
vis_set .to_pkl (out_file , out_folder )
147
150
else :
148
151
output_file .write (pickle .dumps (vis_set .to_dict ()))
149
- elif output_format == 'vtkjs' :
152
+ elif output_format in ( 'vtkjs' , 'html' ) :
150
153
assert output_file .name != '<stdout>' , \
151
154
'Must specify an --output-file to use --output-format vtkjs.'
152
155
out_folder , out_file = os .path .split (output_file .name )
153
156
try :
154
157
if out_file .endswith ('.vtkjs' ):
155
158
out_file = out_file [:- 6 ]
156
- vis_set .to_vtkjs (output_folder = out_folder , file_name = out_file )
159
+ elif out_file .endswith ('.html' ):
160
+ out_file = out_file [:- 5 ]
161
+ if output_format == 'vtkjs' :
162
+ vis_set .to_vtkjs (output_folder = out_folder , file_name = out_file )
163
+ if output_format == 'html' :
164
+ vis_set .to_html (output_folder = out_folder , file_name = out_file )
157
165
except AttributeError as ae :
158
166
raise AttributeError (
159
167
'Ladybug-vtk must be installed in order to use --output-format '
0 commit comments