Commit c77194bb authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/Charts/ChartsDrawer to function-closure

parent af852eb9
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
"../common/Charts/charts.js", "../common/Charts/charts.js",
"../common/Charts/DrawingArea.js", "../common/Charts/DrawingArea.js",
"../common/Charts/DrawingObjects.js", "../common/Charts/DrawingObjects.js",
"../common/Charts/ChartsDrawer.js",
"../common/scroll.js", "../common/scroll.js",
"../cell/view/iscroll.js", "../cell/view/iscroll.js",
...@@ -34,7 +35,6 @@ ...@@ -34,7 +35,6 @@
"../common/wordcopypaste.js", "../common/wordcopypaste.js",
"../cell/apiDefines.js", "../cell/apiDefines.js",
"../common/Charts/ChartsDrawer.js",
"../common/Charts/3DTransformation.js", "../common/Charts/3DTransformation.js",
"../common/FontsFreeType/font_engine.js", "../common/FontsFreeType/font_engine.js",
"../common/FontsFreeType/FontFile.js", "../common/FontsFreeType/FontFile.js",
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
"../common/Charts/charts.js", "../common/Charts/charts.js",
"../common/Charts/DrawingArea.js", "../common/Charts/DrawingArea.js",
"../common/Charts/DrawingObjects.js", "../common/Charts/DrawingObjects.js",
"../common/Charts/ChartsDrawer.js",
"../common/scroll.js", "../common/scroll.js",
...@@ -42,7 +43,6 @@ ...@@ -42,7 +43,6 @@
"../slide/Drawing/ThemeLoader.js", "../slide/Drawing/ThemeLoader.js",
"../common/SerializeCommonWordExcel.js", "../common/SerializeCommonWordExcel.js",
"../common/SerializeChart.js", "../common/SerializeChart.js",
"../common/Charts/ChartsDrawer.js",
"../common/Charts/3DTransformation.js", "../common/Charts/3DTransformation.js",
"../word/Editor/Serialize2.js", "../word/Editor/Serialize2.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
"../common/Charts/charts.js", "../common/Charts/charts.js",
"../common/Charts/DrawingArea.js", "../common/Charts/DrawingArea.js",
"../common/Charts/DrawingObjects.js", "../common/Charts/DrawingObjects.js",
"../common/Charts/ChartsDrawer.js",
"../common/scroll.js", "../common/scroll.js",
"../common/Scrolls/iscroll.js", "../common/Scrolls/iscroll.js",
...@@ -48,7 +49,6 @@ ...@@ -48,7 +49,6 @@
"../word/Drawing/Externals.js", "../word/Drawing/Externals.js",
"../common/GlobalLoaders.js", "../common/GlobalLoaders.js",
"../word/Drawing/translations.js", "../word/Drawing/translations.js",
"../common/Charts/ChartsDrawer.js",
"../common/Charts/3DTransformation.js", "../common/Charts/3DTransformation.js",
"../common/Drawings/TrackObjects/AdjustmentTracks.js", "../common/Drawings/TrackObjects/AdjustmentTracks.js",
"../common/Drawings/TrackObjects/MoveTracks.js", "../common/Drawings/TrackObjects/MoveTracks.js",
......
...@@ -220,7 +220,7 @@ CChartSpace.prototype.recalculateTransform = CShape.prototype.recalculateTransfo ...@@ -220,7 +220,7 @@ CChartSpace.prototype.recalculateTransform = CShape.prototype.recalculateTransfo
CChartSpace.prototype.recalculateChart = function() CChartSpace.prototype.recalculateChart = function()
{ {
if(this.chartObj == null) if(this.chartObj == null)
this.chartObj = new CChartsDrawer(); this.chartObj = new AscFormat.CChartsDrawer();
this.chartObj.reCalculate(this); this.chartObj.reCalculate(this);
}; };
CChartSpace.prototype.canResize = CShape.prototype.canResize; CChartSpace.prototype.canResize = CShape.prototype.canResize;
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
// Import // Import
var ORIENTATION_MIN_MAX = AscFormat.ORIENTATION_MIN_MAX; var ORIENTATION_MIN_MAX = AscFormat.ORIENTATION_MIN_MAX;
var globalBasePercent = 100;
var global3DPersperctive = 30; // ToDo а нужна ли она в ChartsDrawer ?
/** @constructor */ /** @constructor */
function Processor3D(width, height, left, right, bottom, top, chartSpace, chartsDrawer) { function Processor3D(width, height, left, right, bottom, top, chartSpace, chartsDrawer) {
this.widthCanvas = width; this.widthCanvas = width;
......
...@@ -24,6 +24,13 @@ ...@@ -24,6 +24,13 @@
*/ */
"use strict"; "use strict";
(
/**
* @param {Window} window
* @param {undefined} undefined
*/
function (window, undefined) {
// Import // Import
var cToDeg = AscFormat.cToDeg; var cToDeg = AscFormat.cToDeg;
var Path = AscFormat.Path; var Path = AscFormat.Path;
...@@ -32,8 +39,6 @@ var ORIENTATION_MIN_MAX = AscFormat.ORIENTATION_MIN_MAX; ...@@ -32,8 +39,6 @@ var ORIENTATION_MIN_MAX = AscFormat.ORIENTATION_MIN_MAX;
var c_oAscTickMark = Asc.c_oAscTickMark; var c_oAscTickMark = Asc.c_oAscTickMark;
var c_oAscChartDataLabelsPos = Asc.c_oAscChartDataLabelsPos; var c_oAscChartDataLabelsPos = Asc.c_oAscChartDataLabelsPos;
var global3DPersperctive = 30;
var globalBasePercent = 100;
var globalGapDepth = 150; var globalGapDepth = 150;
var isTurnOn3DCharts = true; var isTurnOn3DCharts = true;
var standartMarginForCharts = 13; var standartMarginForCharts = 13;
...@@ -2635,7 +2640,7 @@ CChartsDrawer.prototype = ...@@ -2635,7 +2640,7 @@ CChartsDrawer.prototype =
//*****BAR CHART***** /** @constructor */
function drawBarChart() function drawBarChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -3244,11 +3249,11 @@ drawBarChart.prototype = ...@@ -3244,11 +3249,11 @@ drawBarChart.prototype =
return {paths: paths, x: point1.x, y: point1.y, zIndex: point1.z, sortPaths: sortPaths}; return {paths: paths, x: point1.x, y: point1.y, zIndex: point1.z, sortPaths: sortPaths};
} }
} };
//*****LINE CHART***** /** @constructor */
function drawLineChart() function drawLineChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -3779,7 +3784,7 @@ drawLineChart.prototype = ...@@ -3779,7 +3784,7 @@ drawLineChart.prototype =
//*****AREA CHART***** /** @constructor */
function drawAreaChart() function drawAreaChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -5853,7 +5858,7 @@ drawAreaChart.prototype = ...@@ -5853,7 +5858,7 @@ drawAreaChart.prototype =
//*****HBAR CHART***** /** @constructor */
function drawHBarChart() function drawHBarChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -6554,7 +6559,7 @@ drawHBarChart.prototype = ...@@ -6554,7 +6559,7 @@ drawHBarChart.prototype =
//*****PIE CHART***** /** @constructor */
function drawPieChart() function drawPieChart()
{ {
this.tempAngle = null; this.tempAngle = null;
...@@ -7476,7 +7481,7 @@ drawPieChart.prototype = ...@@ -7476,7 +7481,7 @@ drawPieChart.prototype =
}; };
//*****Doughnut CHART***** /** @constructor */
function drawDoughnutChart() function drawDoughnutChart()
{ {
this.tempAngle = null; this.tempAngle = null;
...@@ -7702,7 +7707,7 @@ drawDoughnutChart.prototype = ...@@ -7702,7 +7707,7 @@ drawDoughnutChart.prototype =
}; };
//*****RADAR CHART***** /** @constructor */
function drawRadarChart() function drawRadarChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -8064,7 +8069,7 @@ drawRadarChart.prototype = ...@@ -8064,7 +8069,7 @@ drawRadarChart.prototype =
//*****Scatter CHART***** /** @constructor */
function drawScatterChart() function drawScatterChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -8536,7 +8541,7 @@ drawScatterChart.prototype = ...@@ -8536,7 +8541,7 @@ drawScatterChart.prototype =
}; };
//*****Stock CHART***** /** @constructor */
function drawStockChart() function drawStockChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -8831,7 +8836,7 @@ drawStockChart.prototype = ...@@ -8831,7 +8836,7 @@ drawStockChart.prototype =
} }
}; };
/** @constructor */
function drawBubbleChart() function drawBubbleChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -9125,7 +9130,7 @@ drawBubbleChart.prototype = ...@@ -9125,7 +9130,7 @@ drawBubbleChart.prototype =
//*****GRID***** /** @constructor */
function gridChart() function gridChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -9616,9 +9621,9 @@ gridChart.prototype = ...@@ -9616,9 +9621,9 @@ gridChart.prototype =
} }
} }
}; };
//*****Category axis*****
/** @constructor */
function catAxisChart() function catAxisChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -9971,7 +9976,7 @@ catAxisChart.prototype = ...@@ -9971,7 +9976,7 @@ catAxisChart.prototype =
}; };
//*****value axis***** /** @constructor */
function valAxisChart() function valAxisChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -10239,7 +10244,7 @@ valAxisChart.prototype = ...@@ -10239,7 +10244,7 @@ valAxisChart.prototype =
} }
}; };
/** @constructor */
function serAxisChart() function serAxisChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -10428,6 +10433,7 @@ serAxisChart.prototype = ...@@ -10428,6 +10433,7 @@ serAxisChart.prototype =
} }
}; };
/** @constructor */
function floor3DChart() function floor3DChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -10519,7 +10525,7 @@ floor3DChart.prototype = ...@@ -10519,7 +10525,7 @@ floor3DChart.prototype =
}; };
/** @constructor */
function sideWall3DChart() function sideWall3DChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -10610,7 +10616,7 @@ sideWall3DChart.prototype = ...@@ -10610,7 +10616,7 @@ sideWall3DChart.prototype =
} }
}; };
/** @constructor */
function backWall3DChart() function backWall3DChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -10702,7 +10708,7 @@ backWall3DChart.prototype = ...@@ -10702,7 +10708,7 @@ backWall3DChart.prototype =
}; };
//*****all area of chart***** /** @constructor */
function allAreaChart() function allAreaChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -10767,8 +10773,8 @@ allAreaChart.prototype = ...@@ -10767,8 +10773,8 @@ allAreaChart.prototype =
this.cChartDrawer.drawPath(this.paths, pen, brush); this.cChartDrawer.drawPath(this.paths, pen, brush);
} }
}; };
//*****Area of chart***** /** @constructor */
function areaChart() function areaChart()
{ {
this.chartProp = null; this.chartProp = null;
...@@ -10901,8 +10907,8 @@ areaChart.prototype = ...@@ -10901,8 +10907,8 @@ areaChart.prototype =
this.cChartDrawer.drawPath(this.paths, pen, brush); this.cChartDrawer.drawPath(this.paths, pen, brush);
} }
}; };
//****another functions and classes*** /** @constructor */
function CGeometry2() function CGeometry2()
{ {
this.pathLst = []; this.pathLst = [];
...@@ -10961,7 +10967,7 @@ CGeometry2.prototype = ...@@ -10961,7 +10967,7 @@ CGeometry2.prototype =
} }
}; };
/** @constructor */
function CColorObj(pen, brush, geometry) function CColorObj(pen, brush, geometry)
{ {
this.pen = pen; this.pen = pen;
...@@ -11089,9 +11095,9 @@ TEST3D2.prototype = ...@@ -11089,9 +11095,9 @@ TEST3D2.prototype =
var point6 = new Point3D(left + widthChart, heightChart + top, depthChart, this.cChartDrawer); var point6 = new Point3D(left + widthChart, heightChart + top, depthChart, this.cChartDrawer);
var point7 = new Point3D(left + widthChart, top, depthChart, this.cChartDrawer); var point7 = new Point3D(left + widthChart, top, depthChart, this.cChartDrawer);
var point8 = new Point3D(left + widthChart, top, 0, this.cChartDrawer); var point8 = new Point3D(left + widthChart, top, 0, this.cChartDrawer);
// ToDo а нужна ли global3DPersperctive в ChartsDrawer ?
var perspective = this.cChartSpace.chart.view3D && this.cChartSpace.chart.view3D.perspective ? this.cChartSpace.chart.view3D.perspective : global3DPersperctive; var perspective = this.cChartSpace.chart.view3D && this.cChartSpace.chart.view3D.perspective ? this.cChartSpace.chart.view3D.perspective : global3DPersperctive;
var alpha = perspective / 2; var alpha = perspective / 2;
...@@ -11493,3 +11499,6 @@ TEST3D.prototype = ...@@ -11493,3 +11499,6 @@ TEST3D.prototype =
} }
}; };
window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].CChartsDrawer = CChartsDrawer;
})(window);
...@@ -3909,6 +3909,7 @@ function CoordsManager(ws) { ...@@ -3909,6 +3909,7 @@ function CoordsManager(ws) {
//--------------------------------------------------------export---------------------------------------------------- //--------------------------------------------------------export----------------------------------------------------
var prot; var prot;
window['AscFormat'] = window['AscFormat'] || {}; window['AscFormat'] = window['AscFormat'] || {};
window['Asc'] = window['Asc'] || {};
window['AscFormat'].isObject = isObject; window['AscFormat'].isObject = isObject;
window['AscFormat'].CCellObjectInfo = CCellObjectInfo; window['AscFormat'].CCellObjectInfo = CCellObjectInfo;
......
...@@ -2733,7 +2733,7 @@ CChartSpace.prototype = ...@@ -2733,7 +2733,7 @@ CChartSpace.prototype =
{ {
if(!this.chartObj) if(!this.chartObj)
{ {
this.chartObj = new CChartsDrawer(); this.chartObj = new AscFormat.CChartsDrawer();
} }
return this.chartObj.calculatePositionLabelsCatAxFromAngle(this); return this.chartObj.calculatePositionLabelsCatAxFromAngle(this);
}, },
...@@ -7243,7 +7243,7 @@ CChartSpace.prototype = ...@@ -7243,7 +7243,7 @@ CChartSpace.prototype =
getChartSizes: function() getChartSizes: function()
{ {
if(!this.chartObj) if(!this.chartObj)
this.chartObj = new CChartsDrawer(); this.chartObj = new AscFormat.CChartsDrawer();
return this.chartObj.calculateSizePlotArea(this); return this.chartObj.calculateSizePlotArea(this);
}, },
...@@ -7404,7 +7404,7 @@ CChartSpace.prototype = ...@@ -7404,7 +7404,7 @@ CChartSpace.prototype =
{ {
if(!this.chartObj) if(!this.chartObj)
{ {
this.chartObj = new CChartsDrawer() this.chartObj = new AscFormat.CChartsDrawer()
} }
this.chartObj.preCalculateData(this); this.chartObj.preCalculateData(this);
return [].concat(this.chartObj.calcProp.xScale); return [].concat(this.chartObj.calcProp.xScale);
...@@ -7415,7 +7415,7 @@ CChartSpace.prototype = ...@@ -7415,7 +7415,7 @@ CChartSpace.prototype =
{ {
if(!this.chartObj) if(!this.chartObj)
{ {
this.chartObj = new CChartsDrawer() this.chartObj = new AscFormat.CChartsDrawer()
} }
this.chartObj.preCalculateData(this); this.chartObj.preCalculateData(this);
return [].concat(this.chartObj.calcProp.scale); return [].concat(this.chartObj.calcProp.scale);
...@@ -7425,7 +7425,7 @@ CChartSpace.prototype = ...@@ -7425,7 +7425,7 @@ CChartSpace.prototype =
{ {
if(!this.chartObj) if(!this.chartObj)
{ {
this.chartObj = new CChartsDrawer() this.chartObj = new AscFormat.CChartsDrawer()
} }
this.chartObj.preCalculateData(this); this.chartObj.preCalculateData(this);
return this.chartObj.calcProp; return this.chartObj.calcProp;
...@@ -8533,7 +8533,7 @@ CChartSpace.prototype = ...@@ -8533,7 +8533,7 @@ CChartSpace.prototype =
recalculateChart: function() recalculateChart: function()
{ {
if(this.chartObj == null) if(this.chartObj == null)
this.chartObj = new CChartsDrawer(); this.chartObj = new AscFormat.CChartsDrawer();
this.chartObj.reCalculate(this); this.chartObj.reCalculate(this);
}, },
......
...@@ -317,7 +317,7 @@ CChartSpace.prototype.recalculateTransform = CShape.prototype.recalculateTransfo ...@@ -317,7 +317,7 @@ CChartSpace.prototype.recalculateTransform = CShape.prototype.recalculateTransfo
CChartSpace.prototype.recalculateChart = function() CChartSpace.prototype.recalculateChart = function()
{ {
if(this.chartObj == null) if(this.chartObj == null)
this.chartObj = new CChartsDrawer(); this.chartObj = new AscFormat.CChartsDrawer();
this.chartObj.reCalculate(this); this.chartObj.reCalculate(this);
}; };
CChartSpace.prototype.canResize = CShape.prototype.canResize; CChartSpace.prototype.canResize = CShape.prototype.canResize;
......
...@@ -220,7 +220,7 @@ CChartSpace.prototype.recalculateTransform = CShape.prototype.recalculateTransfo ...@@ -220,7 +220,7 @@ CChartSpace.prototype.recalculateTransform = CShape.prototype.recalculateTransfo
CChartSpace.prototype.recalculateChart = function() CChartSpace.prototype.recalculateChart = function()
{ {
if(this.chartObj == null) if(this.chartObj == null)
this.chartObj = new CChartsDrawer(); this.chartObj = new AscFormat.CChartsDrawer();
this.chartObj.reCalculate(this); this.chartObj.reCalculate(this);
}; };
CChartSpace.prototype.canResize = CShape.prototype.canResize; CChartSpace.prototype.canResize = CShape.prototype.canResize;
......
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