Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
dde4a291
Commit
dde4a291
authored
Oct 04, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change depth for area normal charts
parent
122efbe7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
common/Charts/3DTransformation.js
common/Charts/3DTransformation.js
+17
-10
No files found.
common/Charts/3DTransformation.js
View file @
dde4a291
...
@@ -81,6 +81,12 @@ function Processor3D(width, height, left, right, bottom, top, chartSpace, charts
...
@@ -81,6 +81,12 @@ function Processor3D(width, height, left, right, bottom, top, chartSpace, charts
this
.
angleOy
=
this
.
view3D
&&
this
.
view3D
.
rotY
?
(
-
this
.
view3D
.
rotY
/
360
)
*
(
Math
.
PI
*
2
)
:
0
;
this
.
angleOy
=
this
.
view3D
&&
this
.
view3D
.
rotY
?
(
-
this
.
view3D
.
rotY
/
360
)
*
(
Math
.
PI
*
2
)
:
0
;
this
.
angleOz
=
this
.
view3D
&&
this
.
view3D
.
rotZ
?
(
-
this
.
view3D
.
rotZ
/
360
)
*
(
Math
.
PI
*
2
)
:
0
;
this
.
angleOz
=
this
.
view3D
&&
this
.
view3D
.
rotZ
?
(
-
this
.
view3D
.
rotZ
/
360
)
*
(
Math
.
PI
*
2
)
:
0
;
/*if(this.view3D.rAngAx && this.view3D.rotX < 0)
{
this.angleOx = - this.angleOx;
this.angleOy = - this.angleOy;
}*/
this
.
orientationCatAx
=
null
;
this
.
orientationCatAx
=
null
;
this
.
orientationValAx
=
null
;
this
.
orientationValAx
=
null
;
}
}
...
@@ -181,16 +187,18 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
...
@@ -181,16 +187,18 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
//TODO протестировать, и если не будет проблем, то убрать if-else
//TODO протестировать, и если не будет проблем, то убрать if-else
if
(
this
.
angleOy
!=
0
)
if
(
this
.
angleOy
!=
0
)
{
{
if
(
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
)
+
((
this
.
widthCanvas
-
(
this
.
left
+
this
.
right
))
/
this
.
aspectRatioX
)
/
this
.
scaleX
<=
widthLine
)
//
if(this.depthPerspective * Math.sin(-this.angleOy) + ((this.widthCanvas - (this.left + this.right)) / this.aspectRatioX) / this.scaleX <= widthLine)
return
;
//
return;
//рассчитываем параметры диаграммы при оптимальной ширине
//рассчитываем параметры диаграммы при оптимальной ширине
this
.
widthCanvas
=
optimalWidth
+
(
this
.
left
+
this
.
right
);
this
.
widthCanvas
=
optimalWidth
+
(
this
.
left
+
this
.
right
);
this
.
calaculate3DProperties
(
null
,
null
,
true
);
this
.
calaculate3DProperties
(
null
,
null
,
true
);
optimalWidthLine
=
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
)
+
((
this
.
widthCanvas
-
(
this
.
left
+
this
.
right
))
/
this
.
aspectRatioX
)
/
this
.
scaleX
;
var
newDepth
=
Math
.
abs
(
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
));
optimalWidthLine
=
newDepth
+
((
this
.
widthCanvas
-
(
this
.
left
+
this
.
right
))
/
this
.
aspectRatioX
)
/
this
.
scaleX
;
kF
=
optimalWidthLine
/
widthLine
;
kF
=
optimalWidthLine
/
widthLine
;
this
.
aspectRatioX
=
widthLine
/
((
optimalWidthLine
-
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
))
/
kF
);
this
.
aspectRatioX
=
widthLine
/
((
optimalWidthLine
-
newDepth
)
/
kF
);
this
.
scaleY
=
this
.
scaleY
*
kF
;
this
.
scaleY
=
this
.
scaleY
*
kF
;
this
.
scaleZ
=
this
.
scaleZ
*
kF
;
this
.
scaleZ
=
this
.
scaleZ
*
kF
;
...
@@ -886,7 +894,7 @@ Processor3D.prototype._calculateDepth = function()
...
@@ -886,7 +894,7 @@ Processor3D.prototype._calculateDepth = function()
depth
=
depth
*
Math
.
sin
(
-
this
.
angleOx
);
depth
=
depth
*
Math
.
sin
(
-
this
.
angleOx
);
}
}
return
sinOx
!==
0
?
depth
/
sinOx
:
depth
;
return
sinOx
!==
0
?
Math
.
abs
(
depth
/
sinOx
)
:
Math
.
abs
(
depth
)
;
};
};
Processor3D
.
prototype
.
_calculateDepthPerspective
=
function
()
Processor3D
.
prototype
.
_calculateDepthPerspective
=
function
()
...
@@ -960,8 +968,7 @@ Processor3D.prototype._calculateScaleFromDepth = function (/*isSkip*/)
...
@@ -960,8 +968,7 @@ Processor3D.prototype._calculateScaleFromDepth = function (/*isSkip*/)
var
heightCanvas
=
this
.
heightCanvas
;
var
heightCanvas
=
this
.
heightCanvas
;
var
heightChart
=
heightCanvas
-
this
.
top
-
this
.
bottom
;
var
heightChart
=
heightCanvas
-
this
.
top
-
this
.
bottom
;
this
.
scaleY
=
heightChart
/
(
this
.
depthPerspective
*
Math
.
sin
(
this
.
angleOx
)
+
heightChart
);
this
.
scaleY
=
heightChart
/
(
-
this
.
depthPerspective
*
Math
.
sin
(
Math
.
abs
(
this
.
angleOx
))
+
heightChart
);
//меняется ширина в зависимости от количества значений
//меняется ширина в зависимости от количества значений
//if(this.chartsDrawer.calcProp.subType == "standard")
//if(this.chartsDrawer.calcProp.subType == "standard")
//this.scaleX += parseInt((this.chartsDrawer.calcProp.seriesCount + 1) / 2) - 1;
//this.scaleX += parseInt((this.chartsDrawer.calcProp.seriesCount + 1) / 2) - 1;
...
@@ -1026,9 +1033,9 @@ Processor3D.prototype._calculateCameraDiff = function (/*isSkip*/)
...
@@ -1026,9 +1033,9 @@ Processor3D.prototype._calculateCameraDiff = function (/*isSkip*/)
var
minMaxOx
=
this
.
_getMinMaxOx
(
points
,
faces
);
var
minMaxOx
=
this
.
_getMinMaxOx
(
points
,
faces
);
this
.
_calculateCameraDiffX
(
minMaxOx
);
this
.
_calculateCameraDiffX
(
minMaxOx
);
//***Calculate cameraDiffY***
//***Calculate cameraDiffY***
var
minMaxOy
=
this
.
_getMinMaxOy
(
points
,
faces
);
var
minMaxOy
=
this
.
_getMinMaxOy
(
points
,
faces
);
this
.
_calculateCameraDiffY
(
minMaxOy
.
top
,
minMaxOy
.
bottom
);
this
.
_calculateCameraDiffY
(
minMaxOy
.
top
,
minMaxOy
.
bottom
);
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment