Yes, you can mix js with Python. If it is a function, no doubt you've
noticed you can use it directly, without conversion.
For objects, the JSObject() name is currently under review and might
change, so consider this quite preliminary, but poyol posted the
following on the french list after Pierre implemented the
functionality:
<body onLoad="brython()">
<script src="brython.js"></script>
<script src="
http://d3js.org/d3.v3.min.js"></script>
<div id="viz"></div>
<script type="text/javascript">
var sampleSVG = d3.select("#viz")
.append("svg")
.attr("width", 200)
.attr("height", 200);
</script>
<script type="text/python">
ssvg=JSObject(sampleSVG)
for i,color in zip(range(3),['blue','red','yellow']):
ssvg.append("circle").style("stroke", "gray").style("fill",
color).attr("r", (3-i)*10).attr("cx", 50).attr("cy", 50)
</script>
</body>
I think however that last night's build broke this...
Francois
> --
> You received this message because you are subscribed to the Google Groups
> "brython" group.
> To post to this group, send email to
bry...@googlegroups.com.
> To unsubscribe from this group, send email to
>
brython+u...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/brython/-/DRiFqDGIeCoJ.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>