Is it possible to parse an SVG file with say, svg.path · PyPI , and then use glyphs.Bezier to draw those paths? Also, is it possible to “fill” a bezier curve? Im am not certain on how SVG files specify this to begin with
Im interested in developing a way that allows me to draw things in Abode Illustrator, so I can add those to my visualization (and programmatically manipulate them)
I would say it’s certaintly possible, but there is currently no API built in to Bokeh to do that conversion. You would need to figure out how to transform the SVG information into the inputs that Bokeh expects.
Bezier glyphs in Bokeh are also not fill-able, at least at present. You would need to discretize the curve into individual cartesian points and draw instead with patch or patches, which do support filling. A “filled Bezier area” is something that could be considered as a feature, if you want to open a GitHub issue to discuss (especially if you can help collaborate on implementation).
Im not certain why they y coords need to be flipped, but this is certainly a promising start. I’ll open a GitHub issue for filled beziers (or bezier patches?), though Im not certain how much I’ll be able to contribute as I am a mid-level python programmer.
Thanks for the kind words Bryan! I was surprised when it worked right away to be honest haha. I opened a github feature request outlining mostly what I have here, but in more detail (link for future posterity).
In the meantime, do you have a suggestion on how I could approach discretizing the curve(s) into individual cartesian points? Thanks so much!
Hi @mmcguffi I am certain that someone has figured out how to discretize a bezier curve (consider: the curves can be drawn on the raster HTML canvas at all). But I am afraid I don’t have any specific experience or knowledge to pass on about how to do it.