-
-
Save ricardo101289/6f23be26716976546ece to your computer and use it in GitHub Desktop.
Proyecto_web
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>D3</title> | |
<center><img src="http://original.livestream.com/filestore/logos/4907675e-88cc-ceff-091a-206d3b58fa42-banner.png" class="img-responsive" width="1000" height="30"></center> | |
<br> | |
<br> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> | |
</script> | |
</head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.1/d3.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> | |
</script> | |
<body> | |
<div class="container"> | |
<div class="row"> | |
<input type="text" id="b"> | |
<input type="button" id="buscar" value="Buscar"> | |
</div> | |
<hr> | |
<div class="row"> | |
<div class="col-md-4 thumbnail" style="float:left" id="chart"></div> | |
<div class="col-md-8"> | |
Detalle de Nodo Pulsado | |
<div id="viz"></div> | |
<div id="detalle"> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div id="graph"> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cont =0; | |
var cont2=0; | |
jQuery(document).ready(function($) { | |
console.log('ready'); | |
$("#buscar").on("click", function(){ | |
var texto =""; | |
var tag = $("#b").val(); | |
console.log("taggg"); | |
console.log(tag); | |
if (tag != null) { | |
jQuery.ajax({ | |
url: 'http://carbono.utpl.edu.ec:8080/RESTFUL_SICA/webresources/entidades.librospublicados/buscarPorId?id='+tag+'&jsoncallback=?', | |
type: 'POST', | |
dataType: 'json', | |
data: {}, | |
complete: function(xhr, textStatus) { | |
//called when complete | |
console.log("complete"+textStatus); | |
}, | |
success: function(data, textStatus, xhr) { | |
//called when successful | |
//console.log("abajo esta el json"); | |
console.log(JSON.stringify(data)); | |
graficar(data); | |
}, | |
error: function(xhr, textStatus, errorThrown) { | |
console.log("error"+textStatus); | |
//called when there is an error | |
} | |
}); | |
}; | |
if (tag == "") { | |
jQuery.ajax({ | |
url: 'http://carbono.utpl.edu.ec:8080/RESTFUL_SICA/webresources/entidades.librospublicados/listar?jsoncallback=?', | |
type: 'POST', | |
dataType: 'json', | |
data: {}, | |
complete: function(xhr, textStatus) { | |
//called when complete | |
console.log("complete"+textStatus); | |
}, | |
success: function(data, textStatus, xhr) { | |
//called when successful | |
//console.log("abajo esta el json"); | |
//console.log(JSON.stringify(data)); | |
graficar(data); | |
}, | |
error: function(xhr, textStatus, errorThrown) { | |
console.log("error"+textStatus); | |
//called when there is an error | |
} | |
}); | |
}; | |
}); | |
}); | |
function graficar(data){ | |
console.log ("estamoss en funcion graficar "); | |
//console.log (JSON.stringify(nodes)); | |
var vis = d3.select("#chart") | |
.append("svg") | |
.attr("width", 200).attr("height", 200); | |
fabricarjson(data); | |
} | |
function Fabricarjson(data){ | |
var json; | |
console.log ("estamos en la funcion fabricar json"); | |
console.log (JSON.stringify(data)); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
circle { | |
color: black; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment