Apply suggestions from code review

Co-Authored-By: Shivam Mishra <scmmishra@users.noreply.github.com>
This commit is contained in:
nniclas 2019-08-30 12:54:30 +02:00 committed by GitHub
parent 2edc1dc2c0
commit 2382c4d273
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -14,7 +14,7 @@
], ],
"linebreak-style": [ "linebreak-style": [
"error", "error",
"windows" "unix"
], ],
"semi": [ "semi": [
"error", "error",

View File

@ -1,4 +1,4 @@
import { getBarHeightAndYAttr, createSplineCurve } from './draw-utils'; import { getBarHeightAndYAttr, getSplineCurvePointsStr } from './draw-utils';
export const UNIT_ANIM_DUR = 350; export const UNIT_ANIM_DUR = 350;
export const PATH_ANIM_DUR = 350; export const PATH_ANIM_DUR = 350;

View File

@ -55,7 +55,7 @@ export function shortenLargeNumber(label) {
} }
// cubic bezier curve calculation (from example by François Romain) // cubic bezier curve calculation (from example by François Romain)
export function createSplineCurve(xList, yList) { export function getSplineCurvePointsStr(xList, yList) {
let points=[]; let points=[];
for(let i=0;i<xList.length;i++){ for(let i=0;i<xList.length;i++){

View File

@ -1,4 +1,4 @@
import { getBarHeightAndYAttr, truncateString, shortenLargeNumber, createSplineCurve } from './draw-utils'; import { getBarHeightAndYAttr, truncateString, shortenLargeNumber, getSplineCurvePointsStr } from './draw-utils';
import { getStringWidth } from './helpers'; import { getStringWidth } from './helpers';
import { DOT_OVERLAY_SIZE_INCR, PERCENTAGE_BAR_DEFAULT_DEPTH } from './constants'; import { DOT_OVERLAY_SIZE_INCR, PERCENTAGE_BAR_DEFAULT_DEPTH } from './constants';
import { lightenDarkenColor } from './colors'; import { lightenDarkenColor } from './colors';
@ -580,7 +580,7 @@ export function getPaths(xList, yList, color, options={}, meta={}) {
// Spline // Spline
if (options.spline) if (options.spline)
pointsStr = createSplineCurve(xList, yList); pointsStr = getSplineCurvePointsStr(xList, yList);
let path = makePath("M"+pointsStr, 'line-graph-path', color); let path = makePath("M"+pointsStr, 'line-graph-path', color);