create new tag
, view all tags

TWikiDrawSvgPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on TWikiDrawSvgPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

TWikiDrawSvgPlugin Discussions

Not a plugin, just a placeholder so that I don't forget. A useful plugin would be to show & edit scaleable SVG images. Scalable Vector Graphics (SVG) is a W3C standard, http://www.w3.org/Graphics/SVG/Overview.htm8

http://www.ep.cs.nott.ac.uk/projects/SVG/svgpl/ is a Perl library to manipulate SVG format. ( out of date??? Last Updated: 06/15/2000 13:00:04 GMT)

-- PeterThoeny - 16 Feb 2001

SVG Modules on CPAN

There are now more than 80 SVG-related modules available for download. Some of my favorites are below.

SVG - A module for programatically generating SVG content.

SVG::Parser - A module for parsing SVG

SVG::template::Graph - A module for generating business graphics in SVG

GD::SVG - A module for generating SVG with GD.

Inline SVG with iframe

SVG drawings can be included into TWiki with inline frames.

Top in SVG: an example of an SVG document inlined in SVG.

You can do neat things like this with inline SVG:


<iframe src="http://roitsystems.com/SVG-Widgets/samples/SiemensClock.svg" height="513" width="513" frameborder="1" >
... Sorry you need an SVG plugin ...

original with credits to Stefan Oskam, the author of the Siemens SVG clock concept.

-- RonanOger - 13 Feb 2006

more resources for SVG

batik : http://xml.apache.org/batik _

svgwiki : http://www.protocol7.com/svg-wiki/

Perl serverside portal: Perl tutorials for generating SVG serverside. Includes a discussion forum, a number of examples, and various developer resources.

-- RonanOger - 13 Feb 2006

SVG Whiteboard



(click to enlarge)

-- DennisDaniels - 21 Mar 2002

I totally agree with RobWalker in that SVG is superior - mostly thanks to the direct rendering in browsers. Other points include: it's all-XML, it supports animations (as in "presentations") and other various cool stuff, it makes linking more easy (you don't have to confuse people with that there is one .draw and one .gif version of the same file!)... And it's defined by the W3C, which is motivation enough in itself.

Developing a good clientside java(-script?) editor for SVG is much more likely to be of benefit for other projects outsite TWiki. (As opposed to .draw, that is.)

My idea of the ultimate editor plugin also includes a somewhat fancier interface than the current basic boxes-and-arrows. It shouldn't be too hard defining a way of creating symbol-sets for different diagram types common in designing and mindstorming (4+1 views of software development, UML symbols, basic networking diagrams, etc.). I reckon they call these sets "stencils" in Visio.

Say for example, you'd write

%DRAWING{stencil="uml-basic" stencil="uml-extra"}%
...to have the editor load symbol-sets accordingly.

-- ConnyBrunnkvist - 14 Jun 2002

Here is the project made by my students on adding SVG save/load to the plugin. Is is a good start for future work: it adds:

  • SVG save+reload
  • runs with Java webstart instead of as an applet (then can run on java-less browsers, and avoid bugs in browser embedded java implementations)
I post it here as they have no more time to work on it.

Here is their readme:

TWikiDrawSVG Plugin using Java Web Start and SVG technologies GuillaumeWenger & ChristopheRei Ecole des Mines de Paris - ISIA

TWiki is installed on many web sites, mainly behind corporate firewalls. TWiki is being used by many major companies, because it is very user friendly compared to some well established commercial groupware systems like Lotus Notes. TWikiDrawSVG is a plugin based on TWikiDrawPlugin and our improvements allow the users to :

  • edit one picture via Java Web Start, a new technology which allows all users (provided that they have downloaded Java Web Start available on the Sun web site) not to depend on the web browser;
  • save and view this picture as a SVG document.
  • Scalable Vector Graphics format (SVG) is a new Web graphics format and technology based on XML. SVG allows Web designers and developers to easily integrate vector graphics and text with XML, HTML, CSS and JavaScript to create high quality, interactive user interfaces and online applications that can be delivered to any viewing device.

The new code proposed here launches Java Web Start application, takes the previous saving format, parses it and transforms it into a SVG format. The applet's improvement uses SvgSaver.class which parses the previous applet's saved document, and translate it into SVG format. The old application was based on the Jar (~ 2 Mo) and the .draw (~ 10 Ko) files downloading via the network and the execution was done by the browser, like a common applet. Now, the system based on the Java Web Start technology allows a faster execution after the first use. Thus, the application is dowloaded at the first connection, then JWS manages the upgrading for the next connections. So the next execution are faster and only the .jnlp (~ 2 Ko) and the .draw files are exchanched between the provider and the customer.

-- ColasNahaboo - 14 Jun 2002

Moved above comments from TWikiDrawPluginDev to here. Thanks for making this available to the TWiki community!

A SVG version of the TWikiDrawPlugin is nice. Probably best to keep both projects running in parallel until there is broader support for SVG in browsers.

-- PeterThoeny - 15 Jun 2002

Note that this plugin never sends SVG to the browser, it uses it only as a save file format, so you do not need any SVG support in the browser. The user need to install Java Webstart, though... but thus you get rid of browser issues...

Doing an editor in pure SVG would be currently a nightmare, as all the code would have to be in javascript, and javascript support is hell... In which JS would you code: the browser's (IE, NS, opera...), the SVG plugin's (Adobe, Batik, Mozilla...), as they are all noticably different...

We are quite versed in SVG as our team does the Batik SVG toolkit ( http://xml.apache.org/batik ), and SVG is really usable server-side, but I guess it will take 2 years before being realistically usable natively in a wide array of browsers.

-- ColasNahaboo - 15 Jun 2002

However, the readme has "save and view this picture as a SVG document". Does that mean that a SVG browser plugin is needed to view the picture, or is the GIF file still produced?

-- PeterThoeny - 15 Jun 2002

It just adds the svg file format, the rest (GIF file) is still there.

Note that since the java code now runs as a standalone application and not anymore in the browser (due to java web start), it is totally deconnected from the browser. But since now a .SVG is also saved on the TWiki server, you can click directly on it as an attachment and view (but not edit) the file if your browser can display SVG...

Actually, this SVG plugin imposes much less dependencies on browser features than the previous one...

-- ColasNahaboo - 15 Jun 2002

I also added this to TWikiDrawPluginDev.

Can the SVG graphic file be used to generate a <map> on the fly? It would be really neat to be able to create a sensitive map over a drawing, with links to other pages - for example, a flow diagram. The map should be sensitive to boxes, text, and lines drawn between boxes at the minimum.

-- CrawfordCurrie - 26 Jun 2002

Mmm... I think you want to add the "map/link" feature to the drawing applet code, so that it saves not a mere GIF, but a gif with a client-side map to provide linkink feature even if the browser does not have SVG (nor java) support. Of course, One will add also the links into the generated SVG, too...

-- ColasNahaboo - 05 Jul 2002

Some links to SVG converters and editors: http://www.protocol7.com/svg-wiki/ow.asp?OtherImplementations

-- PeterThoeny - 05 Sep 2002

I tried installing it, and it works, although the java web start is actually slower than running TWikiDrawPlugin as an applet (on my Solaris system). I'm not too Java savvy, so does anybody know if it is possible to convert the SVG version back to an applet? I went and took a look at the web start jnlp specs, and it seems that you can make it run regular applets as well. So you could make the editor available as both an applet and a web start standalone app.

-- WoutMertens - 18 Sep 2002

Our organization would find a lot of value in a plug-in like this, especially if it took advantage of the native TWiki versioning. For example, if my drawing is on version 20, I might want to see what version 5 looked like, and who made changes. I can imagine that displaying the diffs would not be trivial, but it should be simple enough to display the SVG from a specific version, as it is all XML in the background.

-- AndrewBadstubner - 23 Jan 2003

Speaking of diffs, how hard would it be to filter out all elements that hadn't changed between to versions so that just the elements that changed could be displayed?

-- SamHasler - 27 Jan 2003

I'm glad to see that the SVG draw plugin is making progress. I'll have to install it.

I'm using the TWikiDrawPlugin a bit. I'm finding that I often want to use it off-line, on my laptop, with no webserver or twiki server running. Is there a version that will put .draw into a file? Similarly for the SVG version: is there a standalone version? Or can any SVG editor producer SVG code that the SVG draw plugin can handle?

Overall, however, while the draw plugin is nice, it really is much harder to use than fancy drawing tools. See ThoughtsAboutUsingExternalApplications.

(Copying this comment to both TWikiDrawSvgPluginDev and TWikiDrawPluginDev.)

-- AndyGlew - 23 Sep 2003

checked .zip into CVS

-- WillNorris - 19 Jul 2005

We can edit the SVG in the Browswer. I'm testing it in FireFox 1.5: http://gnosislivre.org/twiki/bin/view/Aurium/EditandoSVGComJavaScript

If somebody don't use firefox, thei can use the adobe plugin... Edit in the browswer is better!

To create the bitmap image for the page this plugin can use the Inkscape. It can generate configured images by the command line.

-- AurelioAHeckert - 12 Mar 2006

Looks very promising, maybe this will result in a SvgDrawPlugin some day.

-- FranzJosefSilli - 12 Mar 2006

Added page attachments directory creation; fixed href generation to work in Mozilla; repackaged with gif files for description page put into appropriate place.

-- DmitryShikhaleev - 31 Oct 2006

Thanks Dmitry for working on this. Some feedback:

  • It looks like TWikiDrawSvgPlugin.txt is has a lot of content from an older version of TWikiDrawPlugin's TWikiDrawPlugin.txt topic. How about merging ReadMe-TWikiDrawSvgPlugin.txt into TWikiDrawSvgPlugin.txt and updating the plugin topic to be SVG draw specific?
  • Attach the package to the TWikiDrawSvgPlugin topic & update that topic with the text of the plugin topic.

As an idea, the barrier to adoption could be reduced if the dependency on Java Web Start is reduced to a standard Java VM instead.

-- PeterThoeny - 31 Oct 2006

http://glipssvgeditor.sourceforge.net/ - an open source SVG graphics editor

-- PeterThoeny - 09 Nov 2006

I'm really interested in getting this going.

I have a good working knowledge of both Perl and Java and I'd be interested in putting some time time into this, but I'm not sure where to start.

Peter, can you give an overview of how the existing TWikiDrawPlugin works? E.g.:

  • How does the Plugin code communicate to the server?
  • How are files up/downloaded before/after editing?
  • How does the Plugin call the Java applet? What does the .draw -> .gif conversion?

Any pointers would be great.

-- DuncanKinnear - 20 Mar 2007

The plugin is basically very thin. It simply expands %DRAWING{name}% to the proper image URL, linked to a template page that contains the Java applet.

Download the TWikiDrawPlugin and look at lib/TWiki/Plugins/TWikiDrawPlugin.pm. It contains a commonTagsHandler handler that expands the %DRAWING{...}%, linking to an oops URL with template twikidraw. The templates/twikidraw.tmpl contains the applet tags. One parameter is, drawpath, it points to the .draw file, e.g. this is the "download".

For "upload", the applet does two or three file attach operations, one for the .draw (so that it can be edited next time), one for the .gif (so that you can see and print the image), and optionally a .map file (if there are areas defined.) The Java applet uses ACME Labs' GifEncoder Java utility to convert a drawing into a .gif file format. Study the Java source to see how this works.

-- PeterThoeny - 20 Mar 2007

Ideally we would create a light weight solution purely with Javascript and CSS, without Java applet. There is Wikipedia:SVG-edit / http://code.google.com/p/svg-edit/, which is a web-based, JavaScript-driven SVG editor that works in any modern browser. Exactly what we need! There might be other choices too.

This looks like a fun & sexy project. Anyone interested in tackling this project?

-- PeterThoeny - 2010-12-01

Ping! This would be a very useful plugin to have.

-- PeterThoeny - 2011-04-06

Ping again. This came up again in an e-mail.

It looks like Wikipedia:SVG-edit is exactly what we need. You can try it out. MediaWiki has a SVG-edit extensions, http://www.mediawiki.org/wiki/Extension:SVGEdit

-- Peter Thoeny - 2013-06-20

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivezip TWikiDrawSvgPlugin.zip r2 r1 manage 380.8 K 2006-10-31 - 11:16 DmitryShikhaleev Added page attachments directory creation; fixed href generation to work in Mozilla; repackaged with gif files for description page put into appropriate place.
Edit | Attach | Watch | Print version | History: r32 < r31 < r30 < r29 < r28 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r32 - 2013-06-20 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.