Spaces:
Running
Running
simonduerr
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -40,15 +40,16 @@ with gr.Blocks() as demo:
|
|
40 |
|
41 |
view_str = gr.Textbox("viewMatrixResult", label="View Matrix", visible=False)
|
42 |
chains = gr.Textbox("chainsResult", label="Chains", visible=False)
|
43 |
-
|
44 |
|
45 |
btn = gr.Button("Vectorize")
|
46 |
html = gr.HTML("")
|
47 |
out_file = gr.File(label="Download SVG")
|
48 |
-
btn.click(None, [], [view_str, chains], js="() => [document.getElementById('viewMatrixResult').value, document.getElementById('chains').value]") #
|
49 |
# on change of chains trigger, rendering
|
50 |
view_str.change(predict, [inp, style, view_str, chains], [html, out_file])
|
51 |
chains.change(predict, [inp, style, view_str, chains], [html, out_file])
|
|
|
52 |
|
53 |
|
54 |
if __name__ == "__main__":
|
|
|
40 |
|
41 |
view_str = gr.Textbox("viewMatrixResult", label="View Matrix", visible=False)
|
42 |
chains = gr.Textbox("chainsResult", label="Chains", visible=False)
|
43 |
+
hidden_style = gr.Textbox(visible=False)
|
44 |
|
45 |
btn = gr.Button("Vectorize")
|
46 |
html = gr.HTML("")
|
47 |
out_file = gr.File(label="Download SVG")
|
48 |
+
btn.click(None, [style], [view_str, chains, hidden_style], js="(x) => [document.getElementById('viewMatrixResult').value, document.getElementById('chains').value], x") #
|
49 |
# on change of chains trigger, rendering
|
50 |
view_str.change(predict, [inp, style, view_str, chains], [html, out_file])
|
51 |
chains.change(predict, [inp, style, view_str, chains], [html, out_file])
|
52 |
+
hidden_style.change(predict, [inp, style, view_str, chains], [html, out_file])
|
53 |
|
54 |
|
55 |
if __name__ == "__main__":
|