Create your own shape for Dia

Created: 13 April 2012  Modified:

I needed to create a System Flow Diagram. I wanted to use Dia but I find their basic shapes unaesthetic. So I used Dia Installer Website to learn how. Between their custom objects and directions on the site it was relatively easy. Of course weeding through the less helpful sites and finding this information was somewhat difficult.

A sheet is a collection of shapes. A shape is a wrapper around a SVG image. If your browser support SVG you will be able to see the SVG image I created using Inkscape.

All of the files and more are in the 20120413Chris-Dia-Shapes.tar.gz file.

Action.shape

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <name>Action</name>
  <icon>Action.png</icon>
  <connections>
    <point x="1" y="1" main="yes"/>
    <point x="1" y="0" />
    <point x="0" y="1" />
    <point x="2" y="1" />
    <point x="1" y="2" />
  </connections>
  <textbox x1="0" y1="0" x2="2" y2="2" />
  <svg:svg>
    <svg:rect style="fill:default;stroke:bg;stroke-width:0;" x="0" y="0" width="2" height="2"/>
    <svg:image x="0" y="0" width="2" height="2" xlink:href="./Action.svg"/>
    
  </svg:svg>

</shape>

Action.svg

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="100"
   height="50"
   id="svg3777"
   version="1.1"
   inkscape:version="0.48.1 r9760"
   sodipodi:docname="Action.svg">
  <defs
     id="defs3779">
    <linearGradient
       id="linearGradient4435">
      <stop
         style="stop-color:#080808;stop-opacity:1;"
         offset="0"
         id="stop4437" />
      <stop
         id="stop4451"
         offset="0.07860228"
         style="stop-color:#7d6019;stop-opacity:1;" />
      <stop
         id="stop4449"
         offset="0.13536197"
         style="stop-color:#e8bd56;stop-opacity:1;" />
      <stop
         id="stop4443"
         offset="0.50731438"
         style="stop-color:#dfac33;stop-opacity:1;" />
      <stop
         style="stop-color:#e8bd56;stop-opacity:1;"
         offset="0.83510321"
         id="stop4447" />
      <stop
         style="stop-color:#7d6019;stop-opacity:1;"
         offset="0.9279992"
         id="stop4445" />
      <stop
         style="stop-color:#000000;stop-opacity:1;"
         offset="1"
         id="stop4439" />
    </linearGradient>
    <linearGradient
       id="linearGradient3911"
       osb:paint="gradient">
      <stop
         style="stop-color:#0000ff;stop-opacity:0.99350649;"
         offset="0"
         id="stop3913" />
      <stop
         id="stop4427"
         offset="0.5"
         style="stop-color:#11171a;stop-opacity:0.52156866;" />
      <stop
         style="stop-color:#ff0000;stop-opacity:0.04313726;"
         offset="1"
         id="stop3915" />
    </linearGradient>
    <linearGradient
       inkscape:collect="always"
       xlink:href="#linearGradient4435"
       id="linearGradient4441"
       x1="95"
       y1="12"
       x2="6.5"
       y2="43.5"
       gradientUnits="userSpaceOnUse" />
  </defs>
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="2"
     inkscape:cx="30"
     inkscape:cy="0"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     inkscape:window-width="1280"
     inkscape:window-height="938"
     inkscape:window-x="0"
     inkscape:window-y="45"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata3782">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(0,-3107.0866)">
    <rect
       style="fill:url(#linearGradient4441);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
       id="rect4433"
       width="99"
       height="51"
       x="0.5"
       y="0"
       transform="translate(0,3107.0866)"
       ry="23.089012" />
  </g>
</svg>

Chris_Activity.sheet

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns">
<!--Dia-Version: 0.97-->
<!--File: /home/lynchcs/.dia/sheets/Chris_Activity.sheet-->
<!--Date: Thu Apr 12 13:59:33 2012-->
<!--For: lynchcs-->

<name>Chris Activity</name>
<description></description>
<contents>
<!--add shapes here-->
<object name="Action">
<description>System Flow Action</description></object>
<object name="Decision">
<description>System Flow Decision</description></object>
<object name="Arrow1">
<description>System Flow Arrow1</description></object>


</contents></sheet>
tags: dia - shape - svg
   Less Is More