Commit 7b944e01 authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'contrib-calendar-colors' into 'master'

Fixed issue with user calendar colors

## What does this MR do?

Fixes an issue with the colors added onto the user contrib calendar. The calendar was change recently to remove a library which affected how the colors where generated.

## What are the relevant issue numbers?

Closes #18505 

## Screenshots (if relevant)


See merge request !4614
parents 6c292e90 f1a0e882
......@@ -6,12 +6,6 @@ class @Calendar
@daySizeWithSpace = @daySize + (@daySpace * 2)
@monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
@months = []
@highestValue = 0
# Get the highest value from the timestampes
_.each timestamps, (count) =>
if count > @highestValue
@highestValue = count
# Loop through the timestamps to create a group of objects
# The group of objects will be grouped based on the day of the week they are
......@@ -39,8 +33,8 @@ class @Calendar
# Init color functions
@color = @initColor()
@colorKey = @initColorKey()
@color = @initColor()
# Init the svg element
......@@ -104,7 +98,7 @@ class @Calendar
.attr 'class', 'user-contrib-cell js-tooltip'
.attr 'fill', (stamp) =>
if stamp.count isnt 0
@color(Math.min(stamp.count, 40))
.attr 'data-container', 'body'
......@@ -164,10 +158,11 @@ class @Calendar
initColor: ->
colorRange = ['#ededed', @colorKey(0), @colorKey(1), @colorKey(2), @colorKey(3)]
.range(['#acd5f2', '#254e77'])
.domain([0, @highestValue])
.domain([0, 10, 20, 30])
initColorKey: ->
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment