Commit 3666bb6f authored by Diego Rey's avatar Diego Rey
Browse files

Added polygon and line shapes

parent 8ea56b3d
...@@ -4139,7 +4139,7 @@ ...@@ -4139,7 +4139,7 @@
"dev": true "dev": true
}, },
"function-plot": { "function-plot": {
"version": "git://github.com/diego-rey/function-plot.git#81713c85f1fb90ff0f41a3dade1bcd831e80b6fa", "version": "git://github.com/diego-rey/function-plot.git#ecc44bb412db00356cb3dda42ea4c981eaad7bd6",
"from": "git://github.com/diego-rey/function-plot.git#feature/integration-multigraf-shape", "from": "git://github.com/diego-rey/function-plot.git#feature/integration-multigraf-shape",
"requires": { "requires": {
"array-range": "^1.0.1", "array-range": "^1.0.1",
......
...@@ -163,7 +163,6 @@ export class Graph2DComponent { ...@@ -163,7 +163,6 @@ export class Graph2DComponent {
}); });
} }
let bounding = this.getBounding(); let bounding = this.getBounding();
console.log(bounding);
this.instance = functionPlot({ this.instance = functionPlot({
target: '#graph2D-container', target: '#graph2D-container',
width: bounding.width, width: bounding.width,
...@@ -274,10 +273,6 @@ export class Graph2DComponent { ...@@ -274,10 +273,6 @@ export class Graph2DComponent {
} }
} }
onClickMe(event) {
console.log('click');
}
/** /**
* @name getBounding * @name getBounding
* @desc get the measures of the container of the graph * @desc get the measures of the container of the graph
...@@ -562,43 +557,42 @@ export class Graph2DComponent { ...@@ -562,43 +557,42 @@ export class Graph2DComponent {
* @param {Object} lineData Data of Line to be normalized * @param {Object} lineData Data of Line to be normalized
* @returns {Object} * @returns {Object}
*/ */
// public normalizeLineData = function ($lineData) { public normalizeLineData = function ($lineData) {
// var $lineNormalized:any = {}; var $lineNormalized:any = {};
// var $points = [] var $points = []
// for (var p of $lineData.pts) { for (var p of $lineData.pts) {
// $points.push([p[0],p[1]]); $points.push([p[0],p[1]]);
// } }
// $lineNormalized.points = $points; $lineNormalized.points = $points;
// $lineNormalized.color = $lineData.color; $lineNormalized.stroke = $lineData.color;
// $lineNormalized.rotation = $lineData.rot; $lineNormalized.rotation = $lineData.rot;
// $lineNormalized.fnType = 'points'; $lineNormalized.fnType = 'points';
// $lineNormalized.polylineType = 'line'; $lineNormalized.polylineType = 'line';
// $lineNormalized.graphType = 'polyline'; $lineNormalized.graphType = 'polyline';
// return $lineNormalized; return $lineNormalized;
// } }
/** /**
* @name normalizePolygonData * @name normalizePolygonData
* @desc Normalize Polygon data for Function Plot Library * @desc Normalize Polygon data for Function Plot Library
* @param {Object} textData Data of Polygon to be normalized * @param {Object} textData Data of Polygon to be normalized
* @returns {Object} * @returns {Object}
*/ */
// public normalizePolygonData = function ($textData) { public normalizePolygonData = function ($polygonData) {
// var $PoligonNormalized:any = {}; var $polygonNormalized:any = {};
// var $shape:any = {}; var $points = []
// $shape.text = $textData.text; for (var p of $polygonData.pts) {
// $shape.size = $textData.size; $points.push([p[0],p[1]]);
// $shape.x = $textData.x; }
// $shape.y = $textData.y; $polygonNormalized.points = $points;
// $textData.color && ($shape.fill = $textData.color); $polygonNormalized.fill = $polygonData.color;
// $textData.rot !== 'undefined' && ($shape.rotation = $textData.rot); $polygonNormalized.rotation = $polygonData.rot;
$polygonNormalized.fnType = 'points';
// $textNormalized.shape = $shape; $polygonNormalized.polylineType = 'polygon';
// $textNormalized.graphType = 'shape'; $polygonNormalized.graphType = 'polyline';
// $textNormalized.shapeType = 'text';
// return $textNormalized; return $polygonNormalized;
// } }
/** /**
* @name normalizeShapesData * @name normalizeShapesData
...@@ -622,14 +616,14 @@ export class Graph2DComponent { ...@@ -622,14 +616,14 @@ export class Graph2DComponent {
normalized.push(this.normalizeTextData(shape)); normalized.push(this.normalizeTextData(shape));
break; break;
} }
// case 'line': { case 'line': {
// normalized.push(this.normalizeLineData(shape)); normalized.push(this.normalizeLineData(shape));
// break; break;
// } }
// case 'polygon': { case 'poly': {
// normalized.push(this.normalizePolygonData(shape)); normalized.push(this.normalizePolygonData(shape));
// break; break;
// } }
} }
} }
return normalized; return normalized;
......
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