Comparar commits

..

4 Commits

Autor SHA1 Mensagem Data
Brian Broll 53ce61caa6 v1.1.0 2017-02-28 19:18:17 -06:00
Brian Broll 26398a38d0 Don't show monitor icon if connection. Fixes #983 (#984) 2017-02-26 07:57:45 -06:00
Brian Broll 11d0a5e113 Set the Output op color to light grey. Fixes #189 (#982) 2017-02-05 17:37:11 -06:00
Brian Broll 1d58dd19ab Added axis labeling to graph feedback. Fixes #979 (#981)
* WIP #979 Added 'xlabel', 'ylabel' to deepforge.Graph

* WIP #979 Added 'xlabel','ylabel' to the Graph metadata

* WIP #979 Updated graph to show xlabel, ylabel
2017-02-04 22:05:16 -06:00
12 arquivos alterados com 74 adições e 3924 exclusões
-3909
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+1 -1
Ver Arquivo
@@ -17,7 +17,7 @@
"watch-test": "nodemon --exec 'mocha --recursive test'",
"build-nn": "node ./utils/nn-parser.js"
},
"version": "1.0.0",
"version": "1.1.0",
"dependencies": {
"commander": "^2.9.0",
"dotenv": "^2.0.0",
+4
Ver Arquivo
@@ -30,6 +30,10 @@
GRAPH_CREATE: 'GRAPH',
GRAPH_PLOT: 'PLOT',
GRAPH_CREATE_LINE: 'LINE',
GRAPH_LABEL_AXIS: {
X: 'X',
Y: 'Y'
},
// Code Generation Constants
CTOR_ARGS_ATTR: 'ctor_arg_order',
@@ -2,9 +2,11 @@
/*jshint browser: true, camelcase: false*/
define([
'deepforge/Constants',
'decorators/EllipseDecorator/EasyDAG/EllipseDecorator.EasyDAGWidget',
'css!./OperationDecorator.EasyDAGWidget.css'
], function (
CONSTANTS,
DecoratorBase
) {
@@ -13,6 +15,7 @@ define([
var OperationDecorator,
NAME_MARGIN = 25,
DECORATOR_ID = 'OperationDecorator',
OPERATION_COLORS = {},
PORT_TOOLTIP_OPTS = {
tipJoint: 'left',
removeElementsOnHide: true,
@@ -24,8 +27,9 @@ define([
// - highlight ports
// - unhighlight ports
// - report the location of specific ports
OPERATION_COLORS[CONSTANTS.OP.OUTPUT] = '#b0bec5';
OperationDecorator = function (options) {
options.color = options.color || '#78909c';
options.color = options.color || OPERATION_COLORS[options.node.name] || '#78909c';
DecoratorBase.call(this, options);
this.id = this._node.id;
@@ -30,6 +30,30 @@ define([
this._metadata[id] = graph;
};
ExecuteJob.prototype[CONSTANTS.GRAPH_LABEL_AXIS.X] = function (job, id) {
var name = Array.prototype.slice.call(arguments, 2).join(' '),
jobId = this.core.getPath(job),
graph;
id = jobId + '/' + id;
this.logger.info(`Labeling the x-axis of ${id}: ${name}`);
graph = this._metadata[id];
this.setAttribute(graph, 'xlabel', name);
};
ExecuteJob.prototype[CONSTANTS.GRAPH_LABEL_AXIS.Y] = function (job, id) {
var name = Array.prototype.slice.call(arguments, 2).join(' '),
jobId = this.core.getPath(job),
graph;
id = jobId + '/' + id;
this.logger.info(`Labeling the y-axis of ${id}: ${name}`);
graph = this._metadata[id];
this.setAttribute(graph, 'ylabel', name);
};
ExecuteJob.prototype[CONSTANTS.GRAPH_PLOT] = function (job, id, x, y) {
var jobId = this.core.getPath(job),
nonNum = /[^\d-\.]*/g,
@@ -52,6 +52,14 @@ function Graph:line(name, opts)
return deepforge._Line(self.id, name, opts)
end
function Graph:xlabel(name)
deepforge._cmd('<%= GRAPH_LABEL_AXIS.X %>', self.id, name)
end
function Graph:ylabel(name)
deepforge._cmd('<%= GRAPH_LABEL_AXIS.Y %>', self.id, name)
end
-- Image support
local function saveImage(name, tensor)
require 'image'
Arquivo binário não exibido.
+1 -1
Ver Arquivo
@@ -1 +1 @@
0.4.1
0.5.0
@@ -99,6 +99,9 @@ define([
desc.type = 'line';
desc.points = points;
} else {
desc.xlabel = node.getAttribute('xlabel');
desc.ylabel = node.getAttribute('ylabel');
}
}
@@ -32,9 +32,7 @@ define([
SRC: 'src',
DST: 'dst'
},
DECORATORS = {
ArtifactFinder: 'ArtifactOpDecorator'
},
DECORATORS = {},
WIDGET_NAME = 'EasyDAG';
DECORATORS[CONSTANTS.OP.INPUT] = 'ArtifactOpDecorator';
@@ -23,7 +23,9 @@ define([
var jobName = this.selectedItem.desc.name;
// Check if it is an Input or Output job
if (jobName !== CONSTANTS.OP.INPUT && jobName !== CONSTANTS.OP.OUTPUT) {
if (!this.selectedItem.isConnection && jobName !== CONSTANTS.OP.INPUT &&
jobName !== CONSTANTS.OP.OUTPUT) {
new Buttons.Enter({
context: this._widget,
$pEl: this.$selection,
@@ -42,17 +42,16 @@ define([
chart.xAxis
.tickFormat(d3.format(',r'));
if (this.options.xAxis) {
chart.xAxis
.axisLabel(this.options.xAxis);
}
chart.yAxis.tickFormat(d3.format('.02f'));
if (this.options.yAxis) {
chart.yAxis
.axisLabel(this.options.yAxis);
}
if (this.options.xAxis) {
chart.xAxis
.axisLabel(this.options.xAxis);
}
var myData = this.getData();
@@ -83,6 +82,9 @@ define([
key: desc.name,
values: desc.points
};
} else {
this.options.xAxis = desc.xlabel;
this.options.yAxis = desc.ylabel;
}
this.refreshChart();
}
@@ -94,11 +96,14 @@ define([
};
LineGraphWidget.prototype.updateNode = function (desc) {
if (desc && this.lineData[desc.id]) {
if (this.lineData[desc.id]) {
this.lineData[desc.id].values = desc.points;
this.lineData[desc.id].key = desc.name;
this.refreshChart();
} else {
this.options.xAxis = desc.xlabel;
this.options.yAxis = desc.ylabel;
}
this.refreshChart();
};
LineGraphWidget.prototype.onWidgetContainerResize = function(width, height) {
@@ -111,6 +116,17 @@ define([
LineGraphWidget.prototype.updateChartData = function () {
if (this.$chart && this.chart) {
if (this.options.yAxis) {
this.chart.yAxis
.axisLabel(this.options.yAxis || '');
}
if (this.options.xAxis) {
this.chart.xAxis
.axisLabel(this.options.xAxis || '');
}
this.$chart
.datum(this.getData())
.call(this.chart);