Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vidjil
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1,696
Issues
1,696
List
Boards
Labels
Service Desk
Milestones
Merge Requests
89
Merge Requests
89
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vidjil
vidjil
Commits
d1b67696
Commit
d1b67696
authored
Aug 14, 2018
by
Mathieu Giraud
1
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-c/3438-bar-width' into 'dev'
Improve width of numerical bar plots See merge request
!278
parents
1be18090
ffa31b6d
Pipeline
#37904
passed with stage
in 7 seconds
Changes
1
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
browser/js/numerical_axis.js
browser/js/numerical_axis.js
+30
-5
No files found.
browser/js/numerical_axis.js
View file @
d1b67696
...
...
@@ -161,19 +161,44 @@ NumericalAxis.prototype = Object.create(GenericAxis.prototype);
return
{
'
pos
'
:
pos
};
}
NumericalAxis
.
prototype
.
compute_min_key_diff
=
function
()
{
// var keys = Object.keys(this.value_mapping).sort()
var
prev_key
this
.
min_key_diff
=
this
.
max
-
this
.
min
for
(
var
key
in
this
.
value_mapping
){
//key = keys[key_pos]
//temp[key] = this.value_mapping[key]
if
(
prev_key
!=
undefined
)
{
var
key_diff
=
key
-
prev_key
if
(
this
.
min_key_diff
==
undefined
||
(
key_diff
<
this
.
min_key_diff
&&
key_diff
>
0
))
this
.
min_key_diff
=
key_diff
}
prev_key
=
key
}
}
/**
* This function allow to insert all the values getted into the value_mapping object.
*/
NumericalAxis
.
prototype
.
insert_values
=
function
()
{
this
.
step_bar
=
nice_1_2_5_ceil
((
this
.
max
-
this
.
min
)
/
this
.
MAX_NB_BARS_IN_AXIS
)
// Init value_mapping
for
(
var
m
=
this
.
min
;
m
<
this
.
max
;
m
+=
this
.
step_bar
)
this
.
value_mapping
[
nice_ceil
(
m
,
this
.
step_bar
)]
=
[]
// Fill value_mapping
// Fill actual value_mapping
this
.
populateValueMapping
(
this
.
step_bar
)
this
.
sortValueMapping
()
this
.
compute_min_key_diff
()
// Fill remaining value_mapping, but only with necessary step (.min_key_diff) to tell apart different values
for
(
var
m
=
this
.
min
;
m
<
this
.
max
*
1.0001
;
m
+=
this
.
min_key_diff
)
{
var
x
=
nice_ceil
(
m
,
this
.
step_bar
)
this
.
value_mapping
[
x
]
=
this
.
value_mapping
[
x
]
||
[]
}
this
.
sortValueMapping
()
}
...
...
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