@@ -473,6 +496,10 @@ var gap = 70;
var schema = d3.select(".dataModelSchema")
.attr("height", cellHeight * (data.length + dataref.length + (1 + dataref.length%2)*1.5) + 2*margins.top);
+var divD3 = d3.select("#dataModelGraph").append("div")
+ .attr("class","tooltipD3")
+ .style("opacity",0);
+
// 1) Horn construction (top lines used to display referencing classes which doesn't have a linkset attribute)
//
if(dataref.length > 1)
@@ -590,11 +617,19 @@ field.append("text")
.attr("y", cellHeight / 2)
.attr("dy", ".35em")
.text(function(d) { return d.label; });
+
+field.append("text")
+ .attr("x", function(d){ return 7*d.label.length/2 })
+ .attr("y", cellHeight / 2)
+ .attr("dy", ".35em")
+ .attr("class", function(d, i){return (d.relation_type == 2 ? "selfattrtxt" : "");})
+ .text(function(d) { return ((d.relation_type == 2) ? '\uf01e' : '' ); });
+
// 4) Classes that our main class is refering to
//
field.filter(function(d) {
- return (d.related != null);
+ return (d.related != null) && (d.relation_type != 2);
}).append("a")
.attr("xlink:href",function(d){ return refClassLinkpre + d.related + refClassLinksuf})
.append("rect")
@@ -607,7 +642,7 @@ field.filter(function(d) {
.attr("transform", function(d, i) { return "translate("+ d.related_position*(relatedCellWidth/2+cellWidth/2+gap) +", 0)"; });
field.filter(function(d) {
- return (d.related != null);
+ return (d.related != null) && (d.relation_type != 2);
}).append("a")
.attr("xlink:href",function(d){ return refClassLinkpre + d.related + refClassLinksuf})
.append("text")
@@ -618,9 +653,20 @@ field.filter(function(d) {
.attr("transform", function(d, i) { return "translate("+ (d.related_position*(relatedCellWidth/2+cellWidth/2+gap)) +", 0)"; });
field.filter(function(d) {
- return (d.related != null);
+ return (d.related != null) && (d.relation_type != 2);
}).append("path")
- .attr("d", "M"+cellWidth/2+" "+cellHeight/2+" h"+(gap-2)+" m-10 0l-5 3 m5 -3 l-5 -3")
+ .attr("d", "M"+cellWidth/2+" "+cellHeight/2+" h"+(gap-2))
+ .attr("fill", "transparent")
+ .attr("stroke", "black")
+ .attr("stroke-linecap", "round")
+ .attr("stroke-width", 2)
+ .attr("transform", function(d, i) { return (d.related_position < 0) ? "rotate(180, 0, "+(cellHeight/2)+")" : ""});
+
+
+field.filter(function(d) {
+ return (d.related != null) && (d.relation_type == 3 || d.relation_type == 0);
+}).append("path")
+ .attr("d","M"+ (gap - 2 + cellWidth/2) +" "+cellHeight/2+" m-10 0l-5 3 m5 -3 l-5 -3")
.attr("fill", "transparent")
.attr("stroke", "black")
.attr("stroke-linecap", "round")
@@ -628,7 +674,7 @@ field.filter(function(d) {
.attr("transform", function(d, i) { return (d.related_position < 0) ? "rotate(180, 0, "+(cellHeight/2)+")" : ""});
field.filter(function(d) {
- return (d.related != null) && (d.relation_type == 1);
+ return (d.related != null) && (d.relation_type == 1 || d.relation_type == 0);
}).append("path")
.attr("d", "M"+cellWidth/1.9*-1+" "+cellHeight/2+" m-10 0l-5 3 m5 -3 l-5 -3")
.attr("fill", "transparent")
@@ -638,7 +684,31 @@ field.filter(function(d) {
.attr("transform", function(d, i) { return (d.related_position < 0) ? "rotate(360, 0, "+(cellHeight/2)+")" : "rotate(180, 0, "+(cellHeight/2)+")"});
field.filter(function(d) {
- return (d.related != null);
+ return (d.related != null) && (d.relation_type == 0);
+}).append("circle")
+ .attr("r", 5)
+ .attr("cy", cellHeight/2)
+ .on('mouseover',function(d){
+ divD3.transition()
+ .duration(200)
+ .style("opacity","1");
+ divD3.style("left", (d3.event.pageX - 7*d['tooltip_data']['class'].length/2) + "px");
+ divD3.style("top", (d3.event.pageY - 65) + "px");
+ divD3.html( '' + d['tooltip_data']['class'] + '
'
+ + ( (d.related_position < 0) ? d['tooltip_data']['to_remote'] : d['tooltip_data']['to_me'] ) + '
'
+ + ( (d.related_position < 0) ? d['tooltip_data']['to_me'] : d['tooltip_data']['to_remote'] ) + ' ');
+ })
+ .on('mouseout',function(d){
+ divD3.transition()
+ .duration(500)
+ .style("opacity","0");
+ })
+ .attr("transform", function(d, i) { return "translate("+ d.related_position*(cellWidth+gap+2)/2 +", 0)"; });
+
+
+
+field.filter(function(d) {
+ return (d.related != null) && (d.relation_type != 2);
}).append("svg:image")
.attr("x", -relatedCellWidth/2)
.attr("width", cellHeight)