Experimenting with SVG foreignObject
HTML
<svg id="type-01" width="1110" height="190" viewBox="0 0 1110 190" preserveAspectRatio="xMinYMin">
<g class="node">
<rect class="box type anonymous" height="150" width="110" ry="5" rx="5" y="10" x="100"></rect>
<text class="name" dy="30" dx="155">01</text>
<foreignObject class="textholder" width="100" height="100" y="50" x="105">
<p xmlns="http://www.w3.org/1999/xhtml" class="description">blah blah blah blah blah blah blah</p>
</foreignObject>
<text class="cardinality" dy="35" dx="200">
</text>
<rect class="box" height="150" width="110" ry="5" rx="5" y="10" x="100">
</rect>
<a class="typelink"><text class="typename" dy="50" dx="155"></text></a>
</g>
</svg>
CSS
html {
height: 100%;
}
body {
height: 100%;
}
svg {
clear: both;
}
.box {
shape-rendering: crispEdges;
stroke-width: 4px;
fill: transparent;
stroke: none;
}
.linkarc {
shape-rendering: crispEdges;
stroke-width: 3px;
fill: transparent;
stroke: black;
}
text {
text-anchor: middle;
fill: black;
stroke: black;
}
.type {
fill: #A43437;
stroke: black;
}
.element {
fill: #5E7B80;
stroke: black;
}
.anonymous {
fill: #FF004D;
}
.attr {
fill: #FFE5A2;
stroke: black;
}
.enum {
fill: #FFCFA2;
stroke: black;
stroke-width: 2px;
}
.group {
fill: white;
stroke: black;
}
.optional {
stroke-dasharray: 5 2;
}
.cardinality {
font-size: 150%;
}
.typename {
font-style: italic
}
#graph {
width: 100%;
height: 100%;
padding: 0;
}
.svgholder {
width: 100%;
/*border: 2px solid;*/
}
.unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
}