...
 
Commits (2)
......@@ -5,6 +5,8 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
public/dist/
# Runtime data
pids
*.pid
......
......@@ -7,8 +7,11 @@ Instructions for installation
- Install Nodejs (https://nodejs.org/en/download/)
- Install Git (https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- Clone the project using the command: git clone
- Inside the project folder execute the command: npm install
- Inside the project folder execute the command: npm start
- Inside the project folder modify the file webpack.config where it indicates the execution mode: development or production
- Inside the project folder, in route folder modify the file db.js config where it indicates the ip, port, user and password of access to the database
- Inside the project folder execute the command: yarn install
- Inside the project folder execute the command: yarn run build
- Inside the project folder execute the command: yarn run start
- The project runs on the ip: localhost: 3000
......
......@@ -5,7 +5,7 @@
*/
var app = require('../app');
var debug = require('debug')('espol-dashboard-lala:server');
var debug = require('debug')('name_app:server');
var http = require('http');
/**
......
......@@ -9,7 +9,6 @@
<link rel="shortcut icon" href="images/espolLogo.png" />
<link rel="stylesheet" type="text/css" href="stylesheets/menu/default.css" />
<link rel="stylesheet" type="text/css" href="stylesheets/menu/component.css" />
<script src="javascripts/menu/modernizr.custom.js"></script>
</head>
<body>
......@@ -115,4 +114,4 @@
</script>
</body>
</html>
\ No newline at end of file
</html>
commit c1913b33dce691e7618a3cf303e2f72d1e75f19e (HEAD -> master, origin/master, origin/HEAD)
Author: Alberto Jimenez <alberto.jimenez@cti.espol.edu.ec>
Date: Wed Jan 2 11:46:30 2019 -0500
Cambios varios
commit 3b2c7a7c8a0e116992708ccf3e9b5c5b9617f4de
Author: Alberto Jimenez <alberto.jimenez@cti.espol.edu.ec>
Date: Mon Dec 10 08:34:16 2018 -0500
Modificación varias en el estilo
commit d93ab81642dd08a0cb22d379359f4c0e0d6237b1
Author: Alberto Jimenez <alberto.jimenez@cti.espol.edu.ec>
Date: Fri Dec 7 09:27:33 2018 -0500
Cambios en diseño del div central y en el menu
commit 62a61d0c93bb02ab7f3f8c562f6c5e058b886d04
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Wed Dec 5 21:26:01 2018 -0500
Modify headers in main pages and finish a first implementation for all the front end
commit 3fc389cb14a510384522356b90d2bad5cd90c63d
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Wed Dec 5 16:22:25 2018 -0500
Implement menu for individual options and link with the main card menu
commit 5101461d53765855795d28e9db1f5f670290879d
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Wed Dec 5 11:29:56 2018 -0500
Add info icon and text to dropout section
commit d3199827033607cc8a963741e14ff185991c0563
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Wed Dec 5 09:47:29 2018 -0500
Finish styling for complete dashboard
commit 5a6f5216f4f946b47b2619c8d4f8bf4787c7d600
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Wed Dec 5 00:16:59 2018 -0500
Implement the complete version of teh dashboard by using iframes and complete the styling and structuring of it
commit dd55886b81a779290c96804052a8a67a16cd23ac
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Tue Dec 4 21:35:33 2018 -0500
Unify matricula for all pages by using a main.j script
commit ce23db34a213d9d8b05b5c01d1a8ec0110206055
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Tue Dec 4 21:08:45 2018 -0500
Finish materiasSugeridas section
commit 8d59d84790361f7311b5e024391150f8c0bafe7c
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Tue Dec 4 16:24:20 2018 -0500
Implement with data the difficulty factor viosualization, but some thing s have to be still done.
commit bc858b44f4103a833f05d68404a43aac91452545
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Tue Dec 4 13:03:34 2018 -0500
Implement and adapt the basic graphics for horizontal bar chart
commit 6a900ea56263d76eb68ce02edb67ec4bdce419e9
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Mon Dec 3 22:22:54 2018 -0500
Render academic load chart for materias sugeridas
commit 7b7c3b4d515567360970adaf7c4ec57ec9a5cb9b
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Mon Dec 3 16:22:35 2018 -0500
Start to implement lists for materias disponibles and materias sugeridas. Add endpoint to retrieve info about courses and generate data for the visualizations
commit ee2cdf2ee49b9a1ceca815c608c4d3e2600d87d5
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Mon Dec 3 14:05:58 2018 -0500
Implement the auomatic placement of the indicator for student in the popup for materia
commit ca23091b5bce21d4884d611b0820f9739a5e5eef
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Mon Dec 3 13:01:50 2018 -0500
Implement icon placement graphics in distribution of subject for historial, but the action of placement have to be coded yet
commit ece11c853f31bcbc347fcd479943395357ee4982
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Mon Dec 3 12:18:25 2018 -0500
Fix tooltip position for bar chart considering scroll position
commit 31549dae9b1b0f9ebfeb4f546b44ca098ce6f919
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Mon Dec 3 12:06:11 2018 -0500
Finish the implementation the popup for each subject in historial without the placement of the student in the distribution
commit 87717a49174fcbc14e07bd3011465fe41d2b4c5c
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Mon Dec 3 08:48:22 2018 -0500
Fix bug in estadisticas carreras regardign switching of type of promedios
commit a039209a45f9518bd0590e64fbb7e6c43bd9f517
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sun Dec 2 23:04:57 2018 -0500
Separate the code for bars in order to use for materia popup in historial academico. Implement the retriving of data from the db regarding a subject and show the bar chart considering percentajes for paralelo for now.
commit 82cb9ea90ea88fa9500952834828ee8d39e2131c
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sun Dec 2 17:16:12 2018 -0500
Implement visualization for bienestar estudiantil card usign real data, also implement th popup for each report
commit 71fef161a101ff0f742a69a58aecdca3a173a4d1
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sun Dec 2 15:53:26 2018 -0500
Implement the order of suggested subjects in comparativo de materias
commit bb18724bbe8d2d3332d4307a00d8db1b1fbd4e66
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sun Dec 2 14:39:58 2018 -0500
Finish visualization for comparativo de materias with all the features
commit 66f26d28f732240f23348331991abeb5ee3c1f93
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sun Dec 2 12:34:35 2018 -0500
Add random data to comparativo de materias and change css according to the needs. The analysis and term selection have to be completed yet
commit d246f85ad774ad34c37e911c926f18ade9bfb212
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sun Dec 2 10:01:01 2018 -0500
Change position for css in html pages and complete the visualization for informes de bienestar without actual data
commit d45c8ae5d70710e9a1097ff207cc958b9f5b36cc
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sat Dec 1 19:46:44 2018 -0500
Implement visualization for comparativo de materias without adjusting dynamic data.
commit 31d93545d406b7ae232bd3ee0664ef9a7002a993
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sat Dec 1 16:24:25 2018 -0500
Implement dropout visualization template
commit 762ccbf3bd2381d78f21cf881ac1e2866e9c75ac
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sat Dec 1 14:19:39 2018 -0500
Add real data to estadisticas por carrera and adjust the visualization including loading element
commit 55af8f8449e45ebc4e1d8b7a90a34eb3a95048b5
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sat Dec 1 13:01:54 2018 -0500
Modify query for estadisticas carrera in order to suppor year cohort
commit a88508260c8828326f499a47914e445f39898a52
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sat Dec 1 12:16:18 2018 -0500
Add query to retrieve the data for estadisticas carrera
commit 25ce238ec28600da9ce476efb7f18f8786f8a488
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Fri Nov 30 21:37:32 2018 -0500
Update interaction with estadisticas carrera regarding maouse over event
commit db0aee45d656667808ae579fd9e5e66a414bbf89
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Fri Nov 30 16:21:42 2018 -0500
Update estadisticas carreras chart
commit 0e9dfd1f58e8e24afc97d037f1a47a1fcc1a47d4
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Sun Nov 25 09:46:22 2018 -0500
MOdify historial in order to fix the header on top
commit 1065bc2bd05f23de79344d0ae1ebb9c0eee1f954
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Fri Nov 23 12:12:08 2018 -0500
MOdify card grid visualization in order to try to fit it to screen height and and student data to academic history
commit 99d3531628a407560ee08f4ba31b0f55f3470285
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Wed Nov 21 10:55:33 2018 -0500
Implemented click and scrolling for RP subjects
commit 7ffc60d34755f5cd1e2ac9cb1904865b56856078
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Tue Nov 20 16:23:51 2018 -0500
Implement lines for rp subjects, some issues have to be still solved
commit ee394f3081c0db76bee36b4952eaec04bd92b4ae
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Fri Nov 16 13:07:01 2018 -0500
Add leyenda and start to implement rp connection lines
commit 2b183efa1b6cd95ccd2029928a6a0db859e49c06
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Thu Nov 15 14:58:44 2018 -0500
Add colors and simbols to each subjet for historial academico
commit cd258b08cb7d8c7f3b10eaf161f4a76aa28c76d5
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Wed Nov 14 13:05:44 2018 -0500
Implement a raw version of historico de estudiante by retreiving data from lala db
commit 711d358f364bb897af04aeb1672ad2b9b646b826
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Mon Nov 12 17:12:43 2018 -0500
Allow to show tooltip and info for parameters in career comparision chart
commit b0645968dd5d6adb9dc2c59545ebcd73528b2027
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Thu Nov 8 17:06:10 2018 -0500
Modify grid to support espol dashboard
commit af7c4158f5e4a85ac27d1541462a5ad1a92dcb38
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Tue Oct 30 14:09:46 2018 -0500
Generate project using expressjs framework
commit e7340a2c92088af09dabcbf1ee7c406adae505c2
Author: Pedro Lucas <pedro.lucas@cti.espol.edu.ec>
Date: Tue Oct 30 14:00:15 2018 -0500
add README
This diff is collapsed.
......@@ -3,19 +3,41 @@
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
"start": "nodemon ./bin/www ",
"build": "webpack",
"watch:dev": "webpack-dev-server --content-base src --hot --inline"
},
"dependencies": {
"atob": "^2.1.2",
"cookie-parser": "~1.4.3",
"d3": "^5.9.1",
"d3-queue": "^3.0.7",
"debug": "~2.6.9",
"ejs": "~2.5.7",
"eslint": "^5.9.0",
"express": "~4.16.0",
"express-session": "^1.15.6",
"glob": "^7.1.3",
"http-errors": "~1.6.2",
"isnumeric": "^0.3.3",
"jquery": "^3.3.1",
"lodash": "^4.17.11",
"moment-timezone": "^0.5.23",
"morgan": "~1.9.0",
"pg-promise": "^8.5.2"
"pg-promise": "^8.5.2",
"queue": "^6.0.0",
"request": "~2.88.0",
"xml2js": "~0.4.19",
"xmlhttprequest": "~1.8.0"
},
"devDependencies": {
"moment-timezone-data-webpack-plugin": "^1.0.3",
"nodemon": "^1.18.10",
"pm2": "^3.3.1",
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.1",
"webpack-modernizr-loader": "^5.0.0",
"webpack-obfuscator": "^0.18.0"
}
}
import { SetGlobalData, server_name } from '../shared/start'
import $ from 'jquery';
window.jQuery = $;
window.$ = $;
try {
let urlParams = new URLSearchParams(window.location.search)
const tokenParam = urlParams.get('token')
SetGlobalData(tokenParam)
} catch (err) {
console.error(err)
} finally {
}
var matricula_token = 'Mjg5MDIxMDYxNA==';
var w = window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;
var h = window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;
let h1 = h * 0.80;
let h2 = h * 0.70;
function OpenHistorial(){
window.open(server_name + '/historial_academico?token='+ matricula_token, '_blank', 'toolbar=0,location=0,menubar=0,width=' + w +',height='+ h1);
}
function OpenEstadisticas(){
window.open(server_name + '/estadistica_adicional?token='+matricula_token, '_blank', 'toolbar=0,location=0,menubar=0,width=' + w +',height='+ h2);
}
function OpenSugeridas(){
window.open(server_name + '/materias_disponibles?token='+matricula_token, '_blank', 'toolbar=0,location=0,menubar=0,fullscreen=yes,resizable=no,titlebar=no,toolbar=no,statusbar=no,width=' + w +',height='+ h2);
}
$(document).ready(() => {
$('#btn_hist').click(() => {
OpenHistorial()
})
$('#btn_est').click(() => {
OpenEstadisticas()
})
$('#btn_mat').click(() => {
OpenSugeridas()
})
})
import $ from 'jquery';
import * as d3 from 'd3'
import { server_name } from '../shared/start'
import { ShowLoader, HideLoader } from '../shared/loader'
window.jQuery = $;
window.$ = $;
var matricula = window.global_matricula;
var routes = ["/db/dropoutStudent/" + matricula];
var promises = [];
routes.forEach(function(url) {
promises.push(d3.json(url))
});
$(document).ready(() => {
Promise.all(promises).then(function(values) {
render_dropout(null, values[0])
}).catch((err) => {
console.error(err) // REMOVE THIS
});
//$(".comparativo_materias_card").css("width", "auto");
ShowLoader("loader_drop");
function render_dropout(error,data){
var dropoutFactor = 0.00;
if(data[0].dropout === undefined || data[0].dropout == null){
dropoutFactor = 0.00; // Definir valor en caso de no haber valor de dropout
}else{
dropoutFactor = data[0].dropout.toFixed(2);
}
HideLoader("loader_drop");
$("#dropout").show();
$( document ).ready(function() {
if (typeof parent.resizeIFrame !== "undefined"){
parent.resizeIFrame("dropout_frame", "31em", "20em");
}
});
var riskMessages = [//Check if these messages make sense
{b:0, t: 0.2, msg:"Riesgo Bajo"},
{b:0.2, t: 0.4, msg:"Riesgo Moderado"},
{b:0.4, t: 0.6, msg:"Riesgo Considerable"},
{b:0.6, t: 0.8, msg:"Riesgo Alto"},
{b:0.8, t: 1.0, msg:"Riesgo Muy Alto"},
{b:1.0, t: 2.0, msg:"Riesgo Muy Alto"},
];
var cropHeight = 15.0 * dropoutFactor;
var cropTop = 15.0 - cropHeight;
var marginImgTop = - (15.0 - cropHeight);
$(".img_crop").css("height", cropHeight + "em");
$(".img_crop").css("top", cropTop + "em");
$(".dropout_img").css("margin-top", marginImgTop + "em");
var selectedRiskMsg = "";
for(var i = 0; i < riskMessages.length; i++){
if(dropoutFactor >= riskMessages[i].b && dropoutFactor < riskMessages[i].t){
selectedRiskMsg = riskMessages[i].msg;
break;
}
}
var prc_dropout = (dropoutFactor * 100).toFixed(1);
$("#dropout_percentaje").html("<b>"+prc_dropout+" %");//</b><br> " + selectedRiskMsg);
var perc_container = 14.0 - (14.0 * dropoutFactor);
$(".dropout_perc_container").css("margin-top", perc_container + "em");
}
})
\ No newline at end of file
import $ from 'jquery';
import * as d3 from 'd3'
import { server_name } from '../shared/start'
import { ShowLoader, HideLoader } from '../shared/loader'
import { DrawChart } from '../shared/barChart'
import { wrap, DrawHorizontalBarChart } from '../shared/horizontalBarChart'
window.jQuery = $;
window.$ = $;
var matricula = window.global_matricula;
var routes = ["/db/estadisticascarrera/" + matricula];
var promises = [];
routes.forEach(function(url) {
promises.push(d3.json(url))
});
$(document).ready(() => {
Promise.all(promises).then(function(values) {
render_estadisticascarrera(null, values[0])
}).catch((err) => {
// console.error(err) // REMOVE THIS
});
$(".estadisticas_carrera_card").css("width", "auto");
ShowLoader("loader_est");
let dataSemestre = [];
let dataGeneral = [];
function render_estadisticascarrera(error, data) {
$(".filter_panel").css("display", "table");
var label_cat1 = "Cohorte " + $("#student_mat").html().substring(0, 4);;
var label_cat2 = "Todos";
var label_cat3 = "Estudiante";
function GetTooltipStr(prom, tasa, mat_tom, mat_ap, mat_rp, addWord, n){
if(n==0){
return "<b>Promedio:</b> " + prom +
"<br/> <b>Tasa de AP:</b> " + (tasa * 100).toFixed(2) + "%" +
"<br/> <b>"+addWord+"Materias Tomadas:</b> " + mat_tom +
"<br/> <b>"+addWord+"Materias Aprobadas:</b> " + mat_ap +
"<br/> <b>"+addWord+"Materias Reprobadas:</b> " + mat_rp
}else{
return "<b>Promedio:</b> " + prom +
"<br/> <b>Total:</b> " + n + " estudiantes" +
"<br/> <b>Tasa de AP:</b> " + (tasa * 100).toFixed(2) + "%" +
"<br/> <b>"+addWord+"Materias Tomadas:</b> " + mat_tom +
"<br/> <b>"+addWord+"Materias Aprobadas:</b> " + mat_ap +
"<br/> <b>"+addWord+"Materias Reprobadas:</b> " + mat_rp
}
}
for (var i = 0; i < data.length; i++) {
dataGeneral[i] = {
Date: data[i].anio + "-" + data[i].termino,
Categories: [{ Name: label_cat1, Value: data[i].prom_sem_promo, Tooltip_str: GetTooltipStr(data[i].prom_sem_promo, data[i].prom_mat_ap_promo / data[i].prom_mat_total_promo, data[i].prom_mat_total_promo, data[i].prom_mat_ap_promo, data[i].prom_mat_rp_promo, "Promedio ", data[i].n_prom_sem_promo) },
{ Name: label_cat2, Value: data[i].prom_sem_carrera, Tooltip_str: GetTooltipStr(data[i].prom_sem_carrera, data[i].prom_mat_ap_carrera / data[i].prom_mat_total_carrera, data[i].prom_mat_total_carrera, data[i].prom_mat_ap_carrera, data[i].prom_mat_rp_carrera, "Promedio ", data[i].n_prom_sem_carrera) }],
LineCategory: [{ Name: label_cat3, Value: data[i].prom_semestral, Tooltip_str: GetTooltipStr(data[i].prom_semestral, data[i].materias_ap / (data[i].materias_ap + data[i].materias_rp), data[i].materias_ap + data[i].materias_rp , data[i].materias_ap , data[i].materias_rp , "", 0) }]
};
}
DrawEstadisticasBarChart(dataGeneral);
HideLoader("loader_est");
if (typeof parent.resizeIFrame !== "undefined"){
parent.resizeIFrame("estadisticas_carrera_frame", $(".estadisticas_carrera_card").width(), $(".estadisticas_carrera_card").height());
}
}
function DrawEstadisticasBarChart(data){
DrawChart(data, "estadisticas_carrera", "dashboard",10,"Promedio", -30, 10, 80, 300,
["#70ad47", "#5b9bd5", "#7b6888", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"],
["#ffc000", "#06bf00", "#98bdc5", "#671919", "#0b172b"],
["#baea9a", "#a2d0f9", "#d4bee2", "#6b486b", "#a05d56", "#d0743c", "#ff8c00"],
"","", parseFloat(d3.select(".estadisticas_carrera_card").style("font-size")),
null
);
}
})
import $ from 'jquery';
import * as d3 from 'd3'
import { server_name } from '../shared/start'
import { ShowLoader, HideLoader } from '../shared/loader'
import { DrawChart } from '../shared/barChart'
import { wrap, DrawHorizontalBarChart } from '../shared/horizontalBarChart'
window.jQuery = $;
window.$ = $;
var routes = ["/db/informesBienestar/" + window.global_matricula];
var promises = [];
routes.forEach(function(url) {
promises.push(d3.json(url))
});
$(document).ready(() => {
Promise.all(promises).then(function(values) {
render_informes(null, values[0])
}).catch((err) => {
console.error(err) // REMOVE THIS
});
$(".informes_bienestar_card").css("width", "auto");
ShowLoader("loader_bien");
var dataBienestar = [];
function render_informes(error, data) {;
dataBienestar = data;
//$(".informes_bienestar_card").css("width", "60em");
// $(".bienestar_title").css("display", "block");
$("#informes_bienestar").css("display", "block");
$("#informes_bienestar").html(
"<table>" +
" <tr class='informe_header'>" +
"<th>Semestre</th>" +
"<th>Tipo</th>" +
"<th>Encargado</th>" +
"<th>Informe</th>" +
"<th>Fecha</th>" +
" </tr>" +
"</table>"
);
if(data.length == 0){
$("#informes_bienestar table").append(
"<tr class='informe_item'>" +
"<td colspan='6' style='text-align: center;'> No existen informes del estudiante</td>" +
"</tr>"
);
}
for (var i = 0; i < data.length; i++) {
console.log(data[i]);
var tipo = data[i].tipo_derivacion;
var encargado = data[i].encargado;
var description = data[i].resumen;
var incidencia = data[i].tipo_incidencia;
if(incidencia.indexOf("Derivac")==0 || incidencia === "Seguimiento"){
incidencia = tipo;
}
var fecha_registro = "";
try {
fecha_registro = data[i].fecha_registro.split("T")[0];
}catch(err) {
fecha_registro = "No definido";
}
$("#informes_bienestar table").append(
"<tr class='informe_item'>" +
"<td class='informe_semestre'>" + data[i].anio.trim() + "-" + data[i].semestre.trim() + "</td>" +
"<td>" + incidencia + "</td>" +
"<td>" + encargado + "</td>" +
"<td style='width: 40%;'>" + description + "</td>" +
"<td>" + fecha_registro + "</td>" +
"</tr>"
);
}
$('#close').click(function () {
$('#overlay').fadeOut(200);
});
$("#overlay").click(function (event) {
if (event.target.id == "overlay") {
$('#overlay').fadeOut(200);
}
});
HideLoader("loader_bien");
if (typeof parent.resizeIFrame !== "undefined"){
parent.resizeIFrame("informes_bienestar_frame", $(".informes_bienestar_card").width(), $(".informes_bienestar_card").height() * 1.1);
}
}
function onClickInforme(indexData){
$('#overlay').fadeIn(200);
$("#informe_term").html(dataBienestar[indexData].anio.trim() + "-" + dataBienestar[indexData].semestre.trim());
$("#informe_derivacion").html(dataBienestar[indexData].tipo_derivacion);
$("#informe_encargado").html(dataBienestar[indexData].encargado);
$("#informe_resumen").html(dataBienestar[indexData].resumen);
if (typeof parent.resizeIFrame !== "undefined"){
parent.resizeIFrame("informes_bienestar_frame", $("#popup").width() * 1.1, $("#popup").height() * 1.1);
}
}
function onClosePopupInforme(){
if (typeof parent.resizeIFrame !== "undefined"){
parent.resizeIFrame("informes_bienestar_frame", $(".informes_bienestar_card").width(), $(".informes_bienestar_card").height() * 1.1);
}
}
})
This diff is collapsed.
import $ from 'jquery';
import * as d3 from 'd3'
window.jQuery = $;
window.$ = $;
export function DrawHorizontalBarChart(data,
containerId,
tootltipId,
customWidth,
customHeight,
documentFontSizePx,
xLabel) {
$("#" + containerId).html("");
// //sort bars based on value
// data = data.sort(function (a, b) {
// return d3.ascending(a.value, b.value);
// })
data = data.reverse();
//set up svg using margin conventions - we'll need plenty of room on the left for labels
var fontFactor = documentFontSizePx / 14.0;
var margin = {
top: 10 * fontFactor,
right: 25 * fontFactor,
bottom: 40 * fontFactor,
left: 160 * fontFactor
};
var width = customWidth * fontFactor - margin.left - margin.right,
height = customHeight * fontFactor - margin.top - margin.bottom;
var svg = d3.select("#" + containerId).append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
// Define the div for the tooltip
var tooltipDiv = d3.select("#" + tootltipId).append("div")
.attr("class", "tooltipH")
.style("opacity", 0);
function SetTooltipData(element, tootltipContent) {
element.on("mouseover", function (dt) {
tooltipDiv.transition()
.duration(200)
.style("opacity", .98);
tooltipDiv.html(tootltipContent)
.style("left", (d3.event.pageX) + "px")
.style("top", (d3.event.pageY - document.body.scrollTop - 28) + "px");
})
.on("mouseout", function (d) {
tooltipDiv.transition()
.duration(500)
.style("opacity", 0);
});
}
var x = d3.scaleLinear()
.range([0, width])
.domain([0, 1]);
// .domain([0, d3.max(data, function (d) {
// return d.value;
// })]);
var y = d3.scaleBand()
.rangeRound([height, 0], .4)
.domain(data.map(function (d) {
return d.name;
}));
//make y axis to show bar names
var yAxis = d3.axisLeft(y).tickSize(0);
var xAxis = d3.axisBottom(x)
.scale(x)
.ticks(5)
.tickSize(-height, 0, 0)
.tickFormat(d3.format(",.2f"))
svg.append("g")
.attr("class", "x haxis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
var gy = svg.append("g")
.attr("class", "y haxis")
.call(yAxis)
.selectAll(".tick text")
.call(function (text) {
text.each(function () {
var text = d3.select(this);
var content = text.text();
text.text(content.substring(0, 21) + (content.length > 21 ? ".. " : ""));
});
});
var bars = svg.selectAll(".barH")
.data(data)
.enter()
.append("g")
//append rects
bars.append("rect")
.attr("class", "barH")
.attr("y", function (d) {
SetTooltipData(d3.select(this),d.tooltip);
return y(d.name);
})
.attr("height", y.bandwidth()-7)
.attr("x", 0)
// .attr("width", function (d) {
// return x(d.value);
// })
.transition().delay(200).attrTween("width", function (d) {
var i = d3.interpolate(0, x(d.value));
return function (t) {
return i(t);
}
});
// //add a value label to the right of each bar
// bars.append("text")
// .attr("class", "label")
// //y position of the label is halfway down the bar
// .attr("y", function (d) {
// return y(d.name) + y.rangeBand() / 2 + 4;
// })
// //x position is 3 pixels to the right of the bar
// .attr("x", function (d) {
// return x(d.value) + 3;
// })
// .text(function (d) {
// return d.value;
// });
// Legends
function getTextWidth(text, fontSize, fontName) {
let c = document.createElement("canvas");
let ctx = c.getContext("2d");
ctx.font = fontSize + ' ' + fontName;
return ctx.measureText(text).width;
}
var textWidthHolder = 0;
var LegendHolder = svg.append("g").attr("class", "legendHolder");
var legend = LegendHolder.selectAll(".legend")
.data([{ "Name": xLabel }])
.enter().append("g")
.attr("class", "legend")
.attr("transform", function (d, i) { return "translate(0," + (height + margin.bottom * 0.5) + ")"; })
.each(function (d, i) {
// Legend Symbols
d3.select(this).append("rect")
.attr("width", function () { return 18 })
.attr("x", function (b) {
let left = (i + 1) * 15 + i * 18 + i * 5 + textWidthHolder;
return left;
})
.attr("y", function (b) { return 0; })
.attr("height", function (b) { return 18; })
.style("fill", function (b) { return d3.select(".barH").style("fill"); });
// Legend Text
d3.select(this).append("text")
.attr("x", function (b) {
let left = (i + 1) * 15 + (i + 1) * 18 + (i + 1) * 5 + textWidthHolder;
return left;
})
.attr("y", 9)
.attr("dy", ".35em")
.style("text-anchor", "start")
.text(d.Name);
textWidthHolder += getTextWidth(d.Name, d3.select(this).style("font-size"), "calibri");
});
// Legend Placing
d3.select("#" + containerId).select(".legendHolder").attr("transform", function (d) {
let thisWidth = d3.select(this).node().getBBox().width;
return "translate(" + ((width) / 2 - thisWidth / 2) + ",0)";
})
}
export function wrap(text, width) {
text.each(function () {
var text = d3.select(this),
words = text.text().split(/\s+/).reverse(),
word,
line = [],
lineNumber = 0,
lineHeight = 1.1, // ems
y = text.attr("y"),
dy = parseFloat(text.attr("dy")),
tspan = text.text(null).append("tspan").attr("x", 0).attr("y", y).attr("dy", dy + "em");
while (word = words.pop()) {
line.push(word);
tspan.text(line.join(" "));
if (tspan.node().getComputedTextLength() > width) {
line.pop();
tspan.text(line.join(" "));
line = [word];
tspan = text.append("tspan").attr("x", 0).attr("y", y).attr("dy", ++lineNumber * lineHeight + dy + "em").text(word);
}
}
});
}
export function ShowLoader(time) {
$('.loader').show();
$('.progress-bar').animate({
width: "100%"
}, time);
}
export function HideLoader() {
$('.loader').hide();
$('.progress-bar').finish();
$('.progress-bar').css('width', "0%");
}
export function ShowLoader(idloader) {
$('#'+ idloader).show();
}
export function HideLoader(idloader) {
$('#'+ idloader).hide();
}
/**
* cbpHorizontalSlideOutMenu.js v1.0.0
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2013, Codrops
* http://www.codrops.com
*/
var globalMenuBgHeight = -1;
;( function( window ) {
'use strict';
var document = window.document;
function extend( a, b ) {
for( var key in b ) {
if( b.hasOwnProperty( key ) ) {
a[key] = b[key];
}
}
return a;
}
function cbpHorizontalSlideOutMenu( el, options ) {
this.el = el;
this.options = extend( this.defaults, options );
this._init();
}
cbpHorizontalSlideOutMenu.prototype = {
defaults : {},
_init : function() {
this.current = -1;
this.touch = Modernizr.touch;
this.menu = this.el.querySelector( '.cbp-hsmenu' );
this.menuItems = this.el.querySelectorAll( '.cbp-hsmenu > li' );
this.menuBg = document.createElement( 'div' );
this.menuBg.className = 'cbp-hsmenubg';
this.el.appendChild( this.menuBg );
this._initEvents();
},
_openMenu : function( el, ev ) {
var self = this,
item = el.parentNode,
items = Array.prototype.slice.call( this.menuItems ),
submenu = item.querySelector( '.cbp-hssubmenu' ),
closeCurrent = function( current ) {
var current = current || self.menuItems[ self.current ];
current.className = '';
current.setAttribute( 'data-open', '' );
},
closePanel = function() {
self.current = -1;
self.menuBg.style.height = '0px';
};
if( submenu ) {
if(ev !== null)
ev.preventDefault();
if( item.getAttribute( 'data-open' ) === 'open' ) {
closeCurrent( item );
closePanel();
}
else {
item.setAttribute( 'data-open', 'open' );
if( self.current !== -1 ) {
closeCurrent();
}
self.current = items.indexOf( item );
item.className = 'cbp-hsitem-open';
self.menuBg.style.height = ((globalMenuBgHeight > -1 ? globalMenuBgHeight : submenu.offsetHeight) + parseInt($("body").css("font-size"))) + 'px';
globalMenuBgHeight = -1;
}
}
else {
if( self.current !== -1 ) {
closeCurrent();
closePanel();
}
}
},
_initEvents : function() {
var self = this;
Array.prototype.slice.call( this.menuItems ).forEach( function( el, i ) {
var trigger = el.querySelector( 'a' );
if( self.touch ) {
trigger.addEventListener( 'touchstart', function( ev ) { self._openMenu( this, ev ); } );
}
else {
trigger.addEventListener( 'click', function( ev ) { self._openMenu( this, ev ); } );
}
} );
window.addEventListener( 'resize', function( ev ) { self._resizeHandler(); } );
},
// taken from https://github.com/desandro/vanilla-masonry/blob/master/masonry.js by David DeSandro
// original debounce by John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
_resizeHandler : function() {
var self = this;
function delayed() {
self._resize();
self._resizeTimeout = null;
}
if ( this._resizeTimeout ) {
clearTimeout( this._resizeTimeout );
}
this._resizeTimeout = setTimeout( delayed, 50 );
},
_resize : function() {
if( this.current !== -1 ) {
this.menuBg.style.height = this.menuItems[ this.current ].querySelector( '.cbp-hssubmenu' ).offsetHeight + 'px';
}
}
}
// add to global namespace
window.cbpHorizontalSlideOutMenu = cbpHorizontalSlideOutMenu;
} )( window );
function resizeMenuBg(newHeight){
globalMenuBgHeight = newHeight;
}
function loadChart(menu){
var url = new URL(window.location.href);
var chart = url.searchParams.get("c");
if(chart !== null)
menu._openMenu( $('#' + chart).get(0), null );
}
\ No newline at end of file
/**
* cbpHorizontalSlideOutMenu.min.js v1.0.0
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2013, Codrops
* http://www.codrops.com
*/
(function(b){var a=b.document;function d(f,e){for(var g in e){if(e.hasOwnProperty(g)){f[g]=e[g]}}return f}function c(f,e){this.el=f;this.options=d(this.defaults,e);this._init()}c.prototype={defaults:{},_init:function(){this.current=-1;this.touch=Modernizr.touch;this.menu=this.el.querySelector(".cbp-hsmenu");this.menuItems=this.el.querySelectorAll(".cbp-hsmenu > li");this.menuBg=a.createElement("div");this.menuBg.className="cbp-hsmenubg";this.el.appendChild(this.menuBg);this._initEvents()},_openMenu:function(i,k){var g=this,j=i.parentNode,f=Array.prototype.slice.call(this.menuItems),h=j.querySelector(".cbp-hssubmenu"),l=function(m){var m=m||g.menuItems[g.current];m.className="";m.setAttribute("data-open","")},e=function(){g.current=-1;g.menuBg.style.height="0px"};if(h){k.preventDefault();if(j.getAttribute("data-open")==="open"){l(j);e()}else{j.setAttribute("data-open","open");if(g.current!==-1){l()}g.current=f.indexOf(j);j.className="cbp-hsitem-open";g.menuBg.style.height=h.offsetHeight+"px"}}else{if(g.current!==-1){l();e()}}},_initEvents:function(){var e=this;Array.prototype.slice.call(this.menuItems).forEach(function(h,g){var f=h.querySelector("a");if(e.touch){f.addEventListener("touchstart",function(i){e._openMenu(this,i)})}else{f.addEventListener("click",function(i){e._openMenu(this,i)})}});b.addEventListener("resize",function(f){e._resizeHandler()})},_resizeHandler:function(){var e=this;function f(){e._resize();e._resizeTimeout=null}if(this._resizeTimeout){clearTimeout(this._resizeTimeout)}this._resizeTimeout=setTimeout(f,50)},_resize:function(){if(this.current!==-1){this.menuBg.style.height=this.menuItems[this.current].querySelector(".cbp-hssubmenu").offsetHeight+"px"}}};b.cbpHorizontalSlideOutMenu=c})(window);
\ No newline at end of file
export var server_name = "http://localhost:3000";
export function SetGlobalData(matricula){
window.global_matricula = matricula;
}
//200810760
//199100116
//199102310
//201314906
//201712692
//200836179
//200014074
//201233289
//201302656
//201517178 *
//201305134
//"CI014", 201302656
// INICCST, 200810760
// "CI001", 201305134
var global_matricula = "";//"201517178";
var global_matricula = "";
var server_name = "http://localhost:3000";
function SetGlobalData(matricula){
......
import moment from 'moment-timezone';
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','javascripts/googleAnalytics/googleAnalytics.js','ga');
class Tracker {
constructor(APP_category){
this.APP_category = APP_category;
ga('create', '', 'auto');
}
sendEvent(eventName,userID,data,timing){
//console.log(timing);
let sessionID = new Date().getTime() + '.' + Math.random().toString(36).substring(5);
let momentFormat = moment.tz(new Date(), "America/Guayaquil").format('MM/DD/YYYY H:mm:ss.SSS');
//console.log(momentFormat);
let timestamp = momentFormat !== 'Invalid date' ? momentFormat : new Date();
let dataEvent = {
'dimension1': sessionID,
'dimension2': timestamp,
'dimension3': userID,
'dimension4': data
};
if(timing!=undefined) dataEvent['metric1'] = timing;
//console.log(dataEvent);
ga('send', 'event', this.APP_category, eventName,'null',dataEvent)
}
}
window.tracker = new Tracker('V1');
const trackingPages = {'estadistica_adicional':start_estadistica_traking,'historial_academico': function callback(page){},'materias_disponibles':start_materias_disponibles_tracking}
$(document).ready(function(){
let page = window.location.pathname.split('/')[1];
if(trackingPages[page]){
let data = `page=${page}`;
window.tracker.sendEvent('onLoad',window.global_matricula,data);
trackingPages[page](page);
}
});
function start_estadistica_traking(page){
let start,timing;
const limit = 2;
const card_classes = ['estadisticas_carrera_card','comparativo_materia_card','dropout_card','informes_bienestar_card'];
card_classes.forEach(function(className){
$(`.${className}`).mouseenter(function(){start = Date.now();});
$(`.${className}`).mouseleave(function(){
timing = (Date.now() - start) / 1000;
if(timing > limit){
let data = `page=${page},target=${className},timing=${timing}`;
window.tracker.sendEvent('mouseEnter',window.global_matricula,data,timing);
}
});
});
}
function start_materias_disponibles_tracking(page){
let start,timing;
const limit = 2;
const card_classes = ['materias_sugeridas_load_card','materias_sugeridas_gen_card'];
card_classes.forEach(function(className){
$(`#${className}`).mouseenter(function(){ start = Date.now();});
$(`#${className}`).mouseleave(function(){
timing = (Date.now() - start) / 1000;
if(timing > limit){
let data = `page=${page},target=${className},timing=${timing}`;
window.tracker.sendEvent('mouseEnter',window.global_matricula,data,timing);
//console.log("fuera de "+className,data);
}
});
});
}
function start_historial_traking(page){
$(`.hist_item`).click(function(){
let subjectId = $(this).find("span").first().text();
let data = `page=${page},target=${subjectId}`;
window.tracker.sendEvent('onClick',window.global_matricula,data);
});
$('#par_rbt,#sem_rbt').click(function(){
let subjectId = $('#mat_title').text().split(' - ')[0];
let target = $(this).attr('id') === 'par_rbt' ? 'paralelo_estudiante':'todos_paralelos';
let data = `page=${page},target=${target},subject=${subjectId}`;
window.tracker.sendEvent('onChange',window.global_matricula,data);
});
}
window.start_historial_traking = start_historial_traking;
This source diff could not be displayed because it is too large. You can view the blob instead.
.comparativo_materia_card{
font: 10px sans-serif;
height: auto;
font: 11px sans-serif;
height: fit-content;
margin: 0 auto;
}
.comparativo_materias_card{
font: 10px sans-serif;
font: 11px sans-serif;
/* background: rgb(235, 235, 235); */
/* box-shadow: 0 2px 5px rgba(0,0,0,0.1); */
height: auto;
height: fit-content;
margin: 0 auto;
/* padding: 0.5em; */
}
......
......@@ -19,7 +19,8 @@
.dashboard_card{
vertical-align:middle;
margin: 0.7em;
padding-bottom: 0.5em;
max-width: 60em;
width: auto;
border: 1px solid rgb(7, 23, 111);
}
......@@ -37,74 +38,4 @@
margin: 0 auto;
display: block;
padding: 1em;
}
/* header {
width: 90%;
margin: 0 auto;
margin-top: 1em;
border: 0.15em solid #264c6a;
border-radius: 1em;
height: 8.8em;
padding-left: 1em;
padding-right: 1em;
}
header h1{
text-align: center;
font-size: 2.5em;
margin: 0 auto;
font-family: 'Lato', Calibri, Arial, sans-serif;
color: #264c6a;
font-weight: normal;
margin-top: 0.5em;
margin-bottom: 0;
}
.st_mat{
text-align: left;
float: left;
font-size: 1.5em;
margin: 0.75em;
font-family: 'Lato', Calibri, Arial, sans-serif;
color: #264c6a;
}
.st_prg{
text-align: right;
float: left;
font-size: 1.5em;
margin: 0.75em;
margin-left: 2em;
font-family: 'Lato', Calibri, Arial, sans-serif;
color: #264c6a;
}
.espol_logo{
width: auto;
height: 8.5vh;
float: right;
margin-top: 1vh;
margin-right: 1.5em;
}
.home_link{
margin-top: 0.5em;
border: 0.15em solid #264c6a;
border-radius: 1em;
text-decoration: none;
padding: 0.5em;
position: absolute;
background-color: rgb(179, 210, 236);
font-weight: bold;
color: #264c6a;
}
.home_link:hover{
background-color: rgb(253, 220, 148);
}
.home_icon{
width: 2em;
height: auto;
} */
\ No newline at end of file
}
\ No newline at end of file
.estadisticas_carrera_card{
font: 10px sans-serif;
/* background: rgb(235, 235, 235); */
/* box-shadow: 0 2px 5px rgba(0,0,0,0.1); */
font: 11px sans-serif;
margin: 0 auto;
width: 100%;
/* height: 100vh; */
width: fit-content;
}
#estadisticas_carrera {
margin: 0 auto;
}
.filter_panel{
display: table;
margin: 0 auto;
padding: 1em;
font-size: 1.5em;
}
.filter_panel .radio_avg{
height:1em;
width: 1.5em;
}
.filter_panel .radio_avg:hover{
cursor: pointer;
}
.selected_label{
color: #001c43;
font-weight: 900;
}
.estadisticas_carrera_title {
background-color: #001c43;
}
......
......@@ -268,23 +268,23 @@
/*Radio buttons*/
.filter_materia{
.filter_paralelo{
display: table;
margin: 0 25px;
padding: 1em;
font-size: 1.5em;
}
.filter_materia .radio_paralelo{
.filter_paralelo .radio_paralelo{
height:1em;
width: 1.5em;
}
.filter_materia .radio_paralelo:hover{
.filter_paralelo .radio_paralelo:hover{
cursor: pointer;
}
.filter_materia label{
.filter_paralelo label{
font-size: 0.7em;
}
.selected_label_mat{
......