Skip to content

Commit ab114f8

Browse files
committed
Update color-parse for case-insensitive fix. Lint.
1 parent be70669 commit ab114f8

File tree

3 files changed

+49
-17
lines changed

3 files changed

+49
-17
lines changed

package-lock.json

Lines changed: 45 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"canvas-fit": "^1.5.0",
8080
"color-alpha": "1.0.4",
8181
"color-normalize": "1.5.0",
82-
"color-parse": "1.3.8",
82+
"color-parse": "2.0.0",
8383
"color-rgba": "2.1.1",
8484
"country-regex": "^1.1.0",
8585
"d3-force": "^1.2.1",

src/components/legend/draw.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ module.exports = function draw(gd, opts) {
5454
}
5555
};
5656

57-
//After legend dimensions are calculated the title can be aligned horizontally left, center, right
57+
// After legend dimensions are calculated the title can be aligned horizontally left, center, right
5858
function horizontalAlignTitle(titleEl, legendObj, bw) {
59-
if ((legendObj.title.side !== 'top center') && (legendObj.title.side !== 'top right')) return;
59+
if((legendObj.title.side !== 'top center') && (legendObj.title.side !== 'top right')) return;
6060

6161
var font = legendObj.title.font;
6262
var lineHeight = font.size * LINE_SPACING;
6363
var titleOffset = 0;
6464
var textNode = titleEl.node();
6565

66-
var width = Drawing.bBox(textNode).width; //width of the title text
66+
var width = Drawing.bBox(textNode).width; // width of the title text
6767

6868
if(legendObj.title.side === 'top center') {
6969
titleOffset = 0.5 * (legendObj._width - 2 * bw - 2 * constants.titlePad - width);

0 commit comments

Comments
 (0)