Pārlūkot izejas kodu

Apply suggestions from code review

Co-Authored-By: Shivam Mishra <scmmishra@users.noreply.github.com>
tags/1.3.0
nniclas pirms 5 gadiem
committed by GitHub
vecāks
revīzija
2382c4d273
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
4 mainītis faili ar 8 papildinājumiem un 8 dzēšanām
  1. +2
    -2
      .eslintrc.json
  2. +2
    -2
      src/js/utils/animate.js
  3. +2
    -2
      src/js/utils/draw-utils.js
  4. +2
    -2
      src/js/utils/draw.js

+ 2
- 2
.eslintrc.json Parādīt failu

@@ -14,7 +14,7 @@
],
"linebreak-style": [
"error",
"windows"
"unix"
],
"semi": [
"error",
@@ -30,4 +30,4 @@
"globals": {
"ENV": true
}
}
}

+ 2
- 2
src/js/utils/animate.js Parādīt failu

@@ -1,4 +1,4 @@
import { getBarHeightAndYAttr, createSplineCurve } from './draw-utils';
import { getBarHeightAndYAttr, getSplineCurvePointsStr } from './draw-utils';

export const UNIT_ANIM_DUR = 350;
export const PATH_ANIM_DUR = 350;
@@ -102,4 +102,4 @@ export function animatePath(paths, newXList, newYList, zeroLine, spline) {

export function animatePathStr(oldPath, pathStr) {
return [oldPath, {d: pathStr}, UNIT_ANIM_DUR, STD_EASING];
}
}

+ 2
- 2
src/js/utils/draw-utils.js Parādīt failu

@@ -55,7 +55,7 @@ export function shortenLargeNumber(label) {
}

// cubic bezier curve calculation (from example by François Romain)
export function createSplineCurve(xList, yList) {
export function getSplineCurvePointsStr(xList, yList) {

let points=[];
for(let i=0;i<xList.length;i++){
@@ -96,4 +96,4 @@ export function createSplineCurve(xList, yList) {
};
return pointStr(points, bezierCommand);
}
}

+ 2
- 2
src/js/utils/draw.js Parādīt failu

@@ -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 { DOT_OVERLAY_SIZE_INCR, PERCENTAGE_BAR_DEFAULT_DEPTH } from './constants';
import { lightenDarkenColor } from './colors';
@@ -580,7 +580,7 @@ export function getPaths(xList, yList, color, options={}, meta={}) {

// Spline
if (options.spline)
pointsStr = createSplineCurve(xList, yList);
pointsStr = getSplineCurvePointsStr(xList, yList);
let path = makePath("M"+pointsStr, 'line-graph-path', color);



Notiek ielāde…
Atcelt
Saglabāt