Commit 2e72f836 authored by maxchaza's avatar maxchaza

D3Extension documentation

parent 2e83748a
......@@ -4,4 +4,10 @@ MetExploreViz provides an interactive visualisation of metabolic networks in ord
# Local update
To use MetExploreViz in local environment, you have to build the application with [sencha command](https://www.sencha.com/products/extjs/cmd-download/) : sencha app build.
\ No newline at end of file
To use MetExploreViz in local environment, you have to build the application with [sencha command](https://www.sencha.com/products/extjs/cmd-download/)
> sencha app build.
# Generate developer documentation
To use generate developer documentation in local environment, you have to build the doc with [JS Duck](https://github.com/senchalabs/jsduck)
> jsduck --config doc-conf.json --output docs
......@@ -2,3 +2,13 @@
This folder contains resources (such as images) needed by the application. This file can
be removed if not needed.
## /libs/
### /functions/
Controllers of d3js drawing
### /model/
Basic models
### /metExploreViz.js
Global functions of MetExploreViz
/*******************************
* @author MC
* Functions to extend d3js selection function
* Functions to extend d3js selection functions
*/
/*******************************
* Manage attribute setting
* @param attr
* @param val
*/
d3.selection.prototype.attrEditor = function(attr, val) {
var selection = this;
......@@ -41,6 +47,8 @@ d3.selection.prototype.attrEditor = function(attr, val) {
* @param ry
* @param stroke
* @param strokewidth
* @param backgroundColor
* @param transparency
*/
d3.selection.prototype.addNodeForm = function(width, height, rx, ry, stroke, strokewidth, backgroundColor, transparency) {
......@@ -110,7 +118,7 @@ d3.selection.prototype.addNodeText = function(style) {
var minDim = Math.min(style.getWidth(),style.getHeight());
// Listening font-size attribute tu update tspan dy attr similarly
// Listening font-size attribute to update tspan dy attr similarly
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.type == "attributes") {
......@@ -223,20 +231,13 @@ d3.selection.prototype.addNodeText = function(style) {
};
/*******************************
* Add text to node
* Set node label
* @param style in function of node biological type
* @param label to give
*/
d3.selection.prototype.setLabelNodeText = function(style, label) {
this
.each(function(d) {
//
// observer.observe(this, {
// attributes: true, //configure it to listen to attribute changes
// characterData: true,
// attributeOldValue: true,
// characterDataOldValue: true,
// attributeFilter:["style"]
// });
var el = d3.select(this);
var name = style.getDisplayLabel(d, label, false);
......@@ -273,6 +274,7 @@ d3.selection.prototype.setLabelNodeText = function(style, label) {
/*******************************
* Add text to node
* @param style in function of node biological type
* @param val to use as label
*/
d3.selection.prototype.setLabelNodeTextByValue = function(style, val) {
var selection = this;
......
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