Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
Jérome Perrin
gitlab-ce
Commits
b69bb08b
Commit
b69bb08b
authored
May 05, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tooltips to user contrib graph key
parent
6ce1df41
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
app/assets/javascripts/users/calendar.js
app/assets/javascripts/users/calendar.js
+17
-9
No files found.
app/assets/javascripts/users/calendar.js
View file @
b69bb08b
...
...
@@ -168,15 +168,23 @@ import d3 from 'd3';
};
Calendar
.
prototype
.
renderKey
=
function
()
{
var
keyColors
;
keyColors
=
[
'
#ededed
'
,
this
.
colorKey
(
0
),
this
.
colorKey
(
1
),
this
.
colorKey
(
2
),
this
.
colorKey
(
3
)];
return
this
.
svg
.
append
(
'
g
'
).
attr
(
'
transform
'
,
"
translate(18,
"
+
(
this
.
daySizeWithSpace
*
8
+
16
)
+
"
)
"
).
selectAll
(
'
rect
'
).
data
(
keyColors
).
enter
().
append
(
'
rect
'
).
attr
(
'
width
'
,
this
.
daySize
).
attr
(
'
height
'
,
this
.
daySize
).
attr
(
'
x
'
,
(
function
(
_this
)
{
return
function
(
color
,
i
)
{
return
_this
.
daySizeWithSpace
*
i
;
};
})(
this
)).
attr
(
'
y
'
,
0
).
attr
(
'
fill
'
,
function
(
color
)
{
return
color
;
});
const
keyValues
=
[
'
no contributions
'
,
'
1-9 contributions
'
,
'
10-19 contributions
'
,
'
20-29 contributions
'
,
'
30+ contributions
'
];
const
keyColors
=
[
'
#ededed
'
,
this
.
colorKey
(
0
),
this
.
colorKey
(
1
),
this
.
colorKey
(
2
),
this
.
colorKey
(
3
)];
this
.
svg
.
append
(
'
g
'
)
.
attr
(
'
transform
'
,
`translate(18,
${
this
.
daySizeWithSpace
*
8
+
16
}
)`
)
.
selectAll
(
'
rect
'
)
.
data
(
keyColors
)
.
enter
()
.
append
(
'
rect
'
)
.
attr
(
'
width
'
,
this
.
daySize
)
.
attr
(
'
height
'
,
this
.
daySize
)
.
attr
(
'
x
'
,
(
color
,
i
)
=>
this
.
daySizeWithSpace
*
i
)
.
attr
(
'
y
'
,
0
)
.
attr
(
'
fill
'
,
color
=>
color
)
.
attr
(
'
class
'
,
'
js-tooltip
'
)
.
attr
(
'
title
'
,
(
color
,
i
)
=>
keyValues
[
i
])
.
attr
(
'
data-container
'
,
'
body
'
);
};
Calendar
.
prototype
.
initColor
=
function
()
{
...
...
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