Subversion Repository Public Repository

ramani

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head> 
        
    </h:head>
 
    <h:body>
        <ui:composition template="../template.xhtml">
            <ui:define name="caminho">
                <h:outputLabel value="/ Criar visualização"
                               style="font-weight: bold"/>
            </ui:define>
            <ui:define name="conteudoCentro">
                <p:layout>
                    <h:form>
                    <p:layoutUnit position="west">
                            <h:panelGroup id="pgroup">

                                <center>
                                    <h:outputLabel value="Menu"
                                                   style="font-size: 25px; font-weight: bold"/>
                                    <hr/>
                                    <p:commandButton value="Voltar"
                                                     title="Voltar para a página inicial"
                                                     action="/projeto/listarProjetos.xhtml"
                                                     style="width: 99%"
                                                     ajax="false"
                                                     immediate="true"
                                                     icon="ui-icon-arrowreturnthick-1-w"
                                                     iconPos="right"/>

                                </center>
                            </h:panelGroup>
                        </p:layoutUnit>
                   
                    <p:layoutUnit position="center">
                        <center>
                            <h:outputLabel value="Grafo de Citações"
                                           style="font-size: 25px; font-weight: bold"/>
                            
                        <h:outputStylesheet library="css" name="grafo.css"/>
                        <h:outputScript library="js" name="d3.v3.min.js"></h:outputScript>
                        <script>
                            
                            var links = ${grafoBean.getCitacoes()};
                            var nodes={};
                            var margin = {top: 80, right: 0, bottom: 10, left: 80};
                            var width = 1024,
                                height = 768;
                            
                            var svg = d3.select("body").append("svg")
                                        .style("position","absolute")
                                        .style("left","80")
                                        .style("top","80")
                                        .style("bottom","10")
                                        .style("right","00")
                                        .append("g")
                                        .attr("transform", "translate(0,0)");
                           
                      
                            links.forEach(function(link) {
                                            link.source = nodes[link.source] || (nodes[link.source] = {name: link.source});
                                            link.target = nodes[link.target] || (nodes[link.target] = {name: link.target});
                                          });
                          
                            var force = d3.layout.force()
                                        .nodes(d3.values(nodes))
                                        .links(links)
                                        .size([width-margin.left - margin.right, height - margin.top - margin.bottom])
                                        .linkDistance(60)
                                        .charge(-300)
                                        .on("tick", tick)
                                        .start();
                                   
                                   svg.append("defs").selectAll("marker")
                                      .data([1,2,3,6])
                                      .enter().append("marker")
                                      .attr("id", function(d) { return d; })
                                      .attr("viewBox", "0 -5 10 10")
                                      .attr("refX", 15)
                                      .attr("refY", -1.5)
                                      .attr("markerWidth", 6)
                                      .attr("markerHeight", 6)
                                      .attr("orient", "auto")
                                      .append("path")
                                      .attr("d", "M0,-5L10,0L0,5");

                                    var path = svg.append("g").selectAll("path")
                                                  .data(force.links())
                                                  .enter().append("path")
                                                  .attr("class", function(d) { return "link " + d.type; })
                                                  .attr("marker-end", function(d) { return "url(#" + d.type + ")"; });
                                          
                                    var circle = svg.append("g").selectAll("circle")
                                                    .data(force.nodes())
                                                    .enter().append("circle")
                                                    .attr("r", 5)
                                                    .call(force.drag);

                                    var text = svg.append("g").selectAll("text")
                                                  .data(force.nodes())
                                                  .enter().append("text")
                                                  .attr("x", 8)
                                                  .attr("y", ".31em")
                                                  .text(function(d) { return d.name; });

                                    function tick() {
                                      path.attr("d", linkArc);
                                      circle.attr("transform", transform);
                                      text.attr("transform", transform);
                                    }

                                    function linkArc(d) {
                                      var dx = d.target.x - d.source.x,
                                          dy = d.target.y - d.source.y,
                                          dr = Math.sqrt(dx * dx + dy * dy);
                                      return "M" + d.source.x + "," + d.source.y + "A" + dr + "," + dr + " 0 0,1 " + d.target.x + "," + d.target.y;
                                    }

                                    function transform(d) {
                                      return "translate(" + d.x + "," + d.y + ")";
                                    }   
                        </script>
                        </center>
                    </p:layoutUnit>
                </h:form>
                </p:layout>
          </ui:define>
        </ui:composition>
    </h:body>
</html>

Commits for ramani/Ramani/web/visualizacao/Citacao.xhtml

Diff revisions: vs.
Revision Author Commited Message
437 Diff Diff masahiro.arthur picture masahiro.arthur Wed 28 May, 2014 16:28:23 +0000
436 Diff Diff masahiro.arthur picture masahiro.arthur Mon 26 May, 2014 16:48:20 +0000

Visualização de Citações Feita (aumentar o tamanho do nó ainda não pode ser implementado)

434 Diff Diff masahiro.arthur picture masahiro.arthur Mon 12 May, 2014 15:26:52 +0000
433 Diff Diff masahiro.arthur picture masahiro.arthur Wed 07 May, 2014 16:56:08 +0000
432 Diff Diff masahiro.arthur picture masahiro.arthur Mon 05 May, 2014 16:02:01 +0000

Extraçao de Dados quase concluída

430 Diff Diff masahiro.arthur picture masahiro.arthur Mon 28 Apr, 2014 16:03:29 +0000
429 Diff Diff masahiro.arthur picture masahiro.arthur Fri 25 Apr, 2014 14:53:57 +0000
428 Diff Diff masahiro.arthur picture masahiro.arthur Mon 21 Apr, 2014 23:56:19 +0000
423 Diff Diff masahiro.arthur picture masahiro.arthur Wed 16 Apr, 2014 15:30:08 +0000

Bean ainda incompleto

410 masahiro.arthur picture masahiro.arthur Tue 01 Apr, 2014 14:09:37 +0000

visualização com php incompleta