SVG Support #143
Replies: 6 comments 4 replies
-
Also something I noticed with the above code was that even though I set |
Beta Was this translation helpful? Give feedback.
-
Hi @mwx23, I thought of this too and started with this: https://github.com/lona-web-org/lona/tree/fscherf/canvas-support My idea was to add API to use a canvas object in python like in Javascript from lona.html import Canvas, HTML, H1, P
from lona import LonaView
class CanvasView(LonaView):
def handle_request(self, request):
canvas = Canvas(width='300px', height='300px')
canvas.ctx.lineWidth = 10
canvas.ctx.strokeRect(75, 140, 150, 110)
canvas.ctx.fillRect(130, 190, 40, 60)
canvas.ctx.moveTo(50, 140)
canvas.ctx.lineTo(150, 60)
canvas.ctx.lineTo(250, 140)
canvas.ctx.closePath()
canvas.ctx.stroke()
return HTML(
H1('Canvas'),
P('This should show a house'),
canvas,
) Btw: Did you receive my email? |
Beta Was this translation helpful? Give feedback.
-
@mwx23 |
Beta Was this translation helpful? Give feedback.
-
@fscherf I've been avoiding emails but I'll check it in the morning :) Could you point me to the part in the client code where it receives the |
Beta Was this translation helpful? Give feedback.
-
@mwx23 :) Sure! When a node gets redered initially |
Beta Was this translation helpful? Give feedback.
-
@mwx23 i converted the issue into a discussion |
Beta Was this translation helpful? Give feedback.
-
This might be out of scope, but it would be super cool if you could manipulate
svg
elements withlona
.I've tried the following and appears in the DOM when you inspect it, but doesn't render.
I'm working on some widgets that I'll share when they're decent. It was super easy to wire them up, I'm experimenting with different patterns to expose the data back to
lona
. I'll post some new issues with questions I have regarding that.As per usual,
lona
rocks!Beta Was this translation helpful? Give feedback.
All reactions