Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Fractalis
fractal.js
Commits
c9ce84cd
Commit
c9ce84cd
authored
Jul 12, 2017
by
Sascha Herzinger
Browse files
Fixed some scaling issues for very small boxplots
parent
3b9b9ee3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/vue/charts/Boxplot.vue
View file @
c9ce84cd
...
...
@@ -71,7 +71,7 @@
</line>
<rect
class=
"fjs-above-median-box"
:x=
"- boxplotWidth / 2"
:y=
"scales.y(results.statistics[label].u_qrt)
+ 1
"
:y=
"scales.y(results.statistics[label].u_qrt)"
:width=
"boxplotWidth"
:height=
"scales.y(results.statistics[label].median) - scales.y(results.statistics[label].u_qrt)"
>
</rect>
...
...
@@ -79,12 +79,13 @@
:x=
"- boxplotWidth / 2"
:y=
"scales.y(results.statistics[label].median)"
:width=
"boxplotWidth"
:height=
"scales.y(results.statistics[label].l_qrt) - scales.y(results.statistics[label].median)
- 1
"
>
:height=
"scales.y(results.statistics[label].l_qrt) - scales.y(results.statistics[label].median)"
>
</rect>
</g>
</g>
</svg>
</div>
<task-view></task-view>
</div>
</
template
>
...
...
@@ -141,8 +142,10 @@
},
boxplotWidth
()
{
const
maxBoxplotWidth
=
this
.
padded
.
width
/
4
const
minBoxplotWidth
=
10
let
boxplotWidth
=
this
.
padded
.
width
/
this
.
numOfBoxplots
-
this
.
padded
.
width
*
0.05
boxplotWidth
=
boxplotWidth
>
maxBoxplotWidth
?
maxBoxplotWidth
:
boxplotWidth
boxplotWidth
=
boxplotWidth
<
minBoxplotWidth
?
minBoxplotWidth
:
boxplotWidth
return
boxplotWidth
},
scales
()
{
...
...
@@ -153,7 +156,7 @@
const
x
=
d3
.
scalePoint
()
.
domain
(
Object
.
keys
(
this
.
results
.
statistics
))
.
range
([
0
,
this
.
padded
.
height
])
.
padding
(
1
)
.
padding
(
0.5
)
const
y
=
d3
.
scaleLinear
()
.
domain
([
extent
[
0
]
-
padding
,
extent
[
1
]
+
padding
])
.
range
([
this
.
padded
.
width
,
0
])
...
...
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