Draw.io -- can we make a new shape library by importing SVG? - draw.io

I can generate SVG from other tools that already have the shapes that I need. Is there a way to import that SVG as a Draw.io library?
In other words, can I make a custom shape library in Draw.io by importing a collection of SVG shapes?

In the new/edit library dialog it says "drag images" into the dialog. That includes SVG images.

Related

Load shape ESRI to QGIS but not in correct position, how to reposition all of features on layer QGIS

I have Autocad DXF which has a design plan. Dxf file that I converted to a shape file using ogr2ogr tools to be able to import the QGIS application with quite perfect.
In QGIS plugins are called "OpenLayers" to add a basemap layer like googlemap, openstreet and etc.. But after I saw, the position of the layer design plan that I created, not in accordance with the position I want on the basemap.
I have tried to using "drag and drop" or "move feature (s)" tools in QGIS, but very slowly and cause no response (HUNG).
Is there a way to quickly move a layer to match the desired position?

Is raphael.js paper a real canvas?

I was researching what graphics to use for a project, and Raphael.js came to be a top contender. However, when reading the sample code and documentation, it shows that Raphael creates a canvas (via the paper variable on the homepage), and then you add stuff to it. Two months later, a passerby comes by and ask some question about our project, and I explained that we didn't use Raphael (instead we chose static SVG and D3) because Raphael used canvas's, and our project would have been greatly disadvantaged by using canvas's. So you Raphael expert's out there, is the canvas in Raphael an actual html canvas or not? and where can you link to it, so that you/and or I can send a pull request to explain that better upfront.
No Raphael's paper is SVG.
It is kinda strange, because the paper object property is called canvas but it only contains the SVGAnimatedString
Fiddle: http://jsfiddle.net/V2DGy/
Raphael uses SVG and VML to create graphics. The variable canvas is simply named as canvas and is not a canvas element. In fact, it is the root SVG element associated with that specific paper.
Raphael is very much similar to d3 but is more on thd lines of a graphics library and the added advantage of compatibility with Internet Explorer 6 through 8 (using VML instead of SVG.)
Though the variable name is misleading, yet Raphael mentions upfront in their home page that it is SVG library.
Quoting their website.
Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want to create your own specific chart or image crop and rotate widget, for example, you can achieve it simply and easily with this library.
Raphaël ['ræfeɪəl] uses the SVG W3C Recommendation and VML as a base for creating graphics. This means every graphical object you create is also a DOM object, so you can attach JavaScript event handlers or modify them later. Raphaël’s goal is to provide an adapter that will make drawing vector art compatible cross-browser and easy.
Raphaël currently supports Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ and Internet Explorer 6.0+.
No. Is svg. Totally different. Canvas contains "a picture", svg contains vectorial elements.

C++ save image as SVG

I have to save my chart as SVG file (my enviroment C++, eclipse C/C++, windows 7).
I'm able to save it as image file (as you can see bellow), but it's not enough.
I've tried:
gnuplot (gnuplot_i.hpp): don't know how to save the image as SVG file
simple-svg: don't know how not to show black points
cairo: i'm not able to use it at all
Could you recommend me some light and easy-to-understand-and-install tool which helps me to draw charts in C++ and save it directly as SVG file (so nothing like jpg2svg convertor:-)?
I know in command-line gnuplot, it is possible to save a plot as a SVG by doing:
> set term svg
> plot ...
Looking over gnuplot_i.hpp, I would suggest trying:
Gnuplot myGP;
myGP.set_terminal_std("svg");
myGP.setGNUPlotPath("/your/path/here");
myGP.showonscreen();
While I haven't tested it (and there may be more complexity in the Gnuplot class than I can see from the header file), the general idea is there. Set the terminal to svg, set the output path, and plot.
How exactly do you obtain that image? Is there something specific to it that prevents you from just fprintf-ing the image, since SVG is an XML (text) file format?

mupdf: how to put a fz_pixmap into Qt4 QPixmap

I am trying to exploit mupdf library (Qt4 app). I have taken some code from pdfdraw.c. I was able to create a pixmap (fz_pixmap) from a pdf page. Now I need to display the pixmap. It is likely I can use QPixmap but I ask how to do so.

Render a vector graphic (.svg) in C++

My and a friend are working on a 2D game where the graphics will be .svg files and we will scale them appropriately either by rasterizing them first, or rendering them directly on a surface (which still would require rasterization at some point).
The problem is, I've been looking all day to find a library that will allow me to take an .svg file and eventually get it to render in allegro. As far as I know, it would involve rasterization into some sort of format that allegro can read and then allegro could render the "flattened" image.
So what are some C++ libraries I could use for taking an .SVG file and "flattening" it so I can render it? The library obviously needs to support scaling too so I can scale the vector graphic then rasterize it.
I'm using Windows and Visual C++ Express 2010.
I've tried Cairo, but it only allows writing of .svg files and doesn't allow you to read the .svg file. I've also looked into librsvg which works with Cario, but I was having a lot of trouble getting it to work properly on Windows (because it has loads of GNOME dependencies). If you have any guides for getting these to work (on Windows) that would be great too.
The wxsvg library allows loading and manipulating SVG files. Qt also has an SVG module.
I'm coming a little late to the conversation, but I would suggest you to look at Nano SVG, an extremely lightweight svg renderer that doesn't need cairo/libsvg. I got nanosvg compiled and working in a couple of hours. It's very basic, but it gets the job done.
https://github.com/sammycage/lunasvg is a nice svg parsing, rendering and manipulating library. It is written with pure c++
SVG++ library provides advanced support for SVG reading, so that rendering SVG with allegro can be implemented in reasonable time.
I have recently put together an SVG renderer library in C++:
https://github.com/igagis/svgren
It uses AGG for rendering to off-screen surface.
Supports gradients and all kind of shapes.
Personally, I using NanoSVG in my Simple Viewer GL. It's allowing me easy to load and rasterize SVG images in few lines of code. But this library has weak SVG support.
With the help of nanosvg and many other c++ svg parsers, adding svg rendering capability to your application should be trivial. The recipe is as follows: svg parser + vector rendering library = trivial svg rendering. The vector rendering library can be cairo and a number of other libraries (nanovg comes to mind, as well as a number of other vg libraries). Here's an example of how to support svg rendering with cairo + fltk + nanosvg combo. Now, all the svg parsers, as well as cairo itself, along with other renderers, have bugs/shortcomings, but basic svg support should never present a problem.
I was looking for a real quick way to render SVG file in a Windows OS based MFC project.
In that case, Microsoft Browser Web Browser ActiveX Control is found to be an ideal solution.
And here is the result of loading SVG file using the Browser control.