Skip to content

Commit 52b9957

Browse files
committed
update: fix to_json
1 parent 6843802 commit 52b9957

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

utils/visualize.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import io
2-
import json
32
import time
43
from enum import Enum
54
from typing import Dict, List, Optional, Tuple, Union
@@ -132,7 +131,7 @@ def get_wave_js(material_json, div_id=default_div_id):
132131

133132
def render_wave(material, properties, width=600, height=600):
134133
timestamp = time.time()
135-
material_json = json.dumps(material.to_json(), indent=2)
134+
material_json = material.to_json()
136135
div_id = f"wave-{timestamp}"
137136

138137
display(HTML(get_wave_html(div_id, width, height, properties.title)))
@@ -147,7 +146,7 @@ def render_wave_grid(materials, properties, width=400, height=400, max_columns=3
147146

148147
for i, material in enumerate(materials):
149148
html = get_wave_html(f"wave-{i}-{timestamp}", width, height, title=properties.title)
150-
js = get_wave_js(json.dumps(material.to_json(), indent=2), f"wave-{i}-{timestamp}")
149+
js = get_wave_js(material.to_json(), f"wave-{i}-{timestamp}")
151150
html_items.append(widgets.HTML(html))
152151
js_items.append(Javascript(js))
153152

0 commit comments

Comments
 (0)