Re: applying custom styles to diagrams
- From: Hans Breuer <hans breuer org>
- To: niklas brueckenschlaeger de, discussions about usage and development of dia <dia-list gnome org>
- Subject: Re: applying custom styles to diagrams
- Date: Wed, 10 Nov 2010 23:32:09 +0100
At 10.11.2010 09:59, niklas | brueckenschlaeger wrote:
I'm trying to export diagrams to SVG, then styling them with CSS. This
doesn't work right now because the SVG carries no semantics (i.e. IDs or
Looking at diasvg.py, it seems like in the renderer there's no access to
the original semantic objects (UML Class, Association, ...) anymore.
Right, the usual renderer interface is pure drawing.
Only a much higher level, see export-object.py as example. Or codegen.py
for something producing more useful output.
On the C-level there also is Renderer::draw_object(Object *), but
currently there is no way to "overwrite" it from PyDia code. Also missing
is the ability to call the base class implmentation, i.e. get the drawing
call within the same renderer.
Is there maybe a higher point in the API to hook into for implementing
It would also be fine just to be able to generate extra output,
with all the objects in the order they were rendered, then I can
post-process that SVG to add the appropriate classes.
Although the rendering order is deterministic as in:
for layer in data.layers :
for o in layer.objects :
you still would have a hard time to match the rendering calls with the
objects. The best way would be implementing both draw_object parts as
outlined above, but that involves some C hacking in the bindings.
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it. -- Dilbert
] [Thread Prev