Commit bda9d6ae authored by Marc Duez's avatar Marc Duez

view.js : super class for all views

parent 809b543f
......@@ -8,7 +8,8 @@ requirejs.config({
require(['../conf'], function () {}, function(err) {});
require(["d3.v3",
require(["jquery",
"d3.v3",
"jquery.form",
"StackBlur",
"jspdf",
......@@ -19,6 +20,7 @@ require(["d3.v3",
"underscore",
"rgbcolor",
"file",
"../view",
"../compare",
"../menu",
"../dbscan",
......
......@@ -69,12 +69,14 @@
*/
/* constructor
/** constructor
*
* */
function Graph(id, model) {
//
View.call(this, model);
this.id = id;
this.m = model;
this.resizeW = 1; //coeff d'agrandissement/réduction largeur
this.resizeH = 1; //coeff d'agrandissement/réduction hauteur
......@@ -105,7 +107,7 @@ function Graph(id, model) {
this.m.graph = this // TODO: find a better way to do this
}
Graph.prototype = {
Graph.prototype = $.extend(Object.create(View.prototype), {
/* ************************************************ *
* BUILD FUNCTIONS
......@@ -1329,7 +1331,7 @@ Graph.prototype = {
}
} //fin Graph
}); //fin Graph
......
......@@ -38,9 +38,11 @@
* */
function List(id_list, id_data, model) {
var self=this;
View.call(this, model);
this.id = id_list; //ID de la div contenant la liste
this.id_data = id_data;
this.m = model; //Model utilisé
this.index = []
this.index_data = {};
this.clone_info = -1;
......@@ -57,7 +59,7 @@ function List(id_list, id_data, model) {
}
}
List.prototype = {
List.prototype = $.extend(Object.create(View.prototype), {
/**
*
......@@ -947,7 +949,7 @@ List.prototype = {
this.infoBox.lastElementChild.innerHTML = "";
}
} //fin prototype
}); //fin prototype
......
......@@ -22,8 +22,8 @@
*/
/** Model_loader constructor
* model function to load and save .vidjil/.analysis files
/** Model_loader constructor <br>
* model functions to load and save .vidjil/.analysis files
* @class Model_loader
* @constructor
* */
......
......@@ -23,8 +23,9 @@
function ScatterPlot(id, model) {
var self = this;
View.call(this, model);
this.id = id; //ID of the scatterPlot div
this.m = model; //Model object
//size ( computed value -> resize() function)
this.resizeCoef = 1; //Multiplifying factor, application to nodes radius
......@@ -155,7 +156,7 @@ function ScatterPlot(id, model) {
/*
Déclaration des fonctions attribuées à l'objet
*/
ScatterPlot.prototype = {
ScatterPlot.prototype = $.extend(Object.create(View.prototype), {
/* Fonction permettant l'initialisation complète du ScatterPlot
*/
......@@ -2203,4 +2204,4 @@ ScatterPlot.prototype = {
}
}
}
\ No newline at end of file
});
\ No newline at end of file
......@@ -33,11 +33,14 @@
CGI_ADDRESS = ""
/* segment constructor
*
* */
function Segment(id, model) {
View.call(this, model);
if (typeof config != 'undefined') {
if (config.cgi_address){
if (config.cgi_address) CGI_ADDRESS = config.cgi_address
......@@ -46,7 +49,6 @@ function Segment(id, model) {
}
this.id = id; //ID de la div contenant le segmenteur
this.m = model; //Model utilisé
this.m.view.push(this); //synchronisation au Model
this.starPath = "M 0,6.1176482 5.5244193, 5.5368104 8.0000008,0 10.172535,5.5368104 16,6.1176482 11.406183,9.9581144 12.947371,16 8.0000008,12.689863 3.0526285,16 4.4675491,10.033876 z"
this.cgi_address = CGI_ADDRESS
......@@ -67,15 +69,14 @@ function Segment(id, model) {
];
}
Segment.prototype = {
Segment.prototype = $.extend(Object.create(View.prototype), {
/*
*
* */
init: function () {
this.build()
},
build: function () {
......@@ -310,15 +311,6 @@ Segment.prototype = {
* */
resize: function () {},
/*
*
* */
update: function () {
for (var i = 0; i < this.m.clones.length; i++) {
this.updateElem([i]);
}
},
/*
*
* */
......@@ -717,7 +709,7 @@ Segment.prototype = {
},
} //fin prototype Segment
);
......
/*
* This file is part of Vidjil <http://www.vidjil.org>,
* High-throughput Analysis of V(D)J Immune Repertoire.
* Copyright (C) 2013, 2014, 2015 by Bonsai bioinformatics
* at CRIStAL (UMR CNRS 9189, Université Lille) and Inria Lille
* Contributors:
* Marc Duez <marc.duez@vidjil.org>
* The Vidjil Team <contact@vidjil.org>
*
* "Vidjil" is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* "Vidjil" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with "Vidjil". If not, see <http://www.gnu.org/licenses/>
*/
/** View constructor <br>
* model functions to load and save .vidjil/.analysis files
* @class Model_loader
* @constructor
* */
function View(model) {
this.m = model;
}
View.prototype = {
init : function () {
return this
},
update: function () {
for (var i = 0; i < this.m.clones.length; i++) {
this.updateElem([i]);
}
},
updateElem : function () {
},
updateElemStyle : function () {
},
}
\ No newline at end of file
......@@ -18,6 +18,7 @@
<script type="text/javascript" src='../../js/lib/file.js'></script>
<script type="text/javascript" src='../../js/lib/jquery.zclip.js'></script>
<script type="text/javascript" src='../../js/view.js'></script>
<script type="text/javascript" src='../../js/compare.js'></script>
<script type="text/javascript" src='../../js/menu.js'></script>
<script type="text/javascript" src='../../js/dbscan.js'></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment