mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
Applied a couple of simpler rules
This commit is contained in:
@@ -17,7 +17,7 @@ const letterRange = endLetterRange - startLetterRange;
|
||||
export function text2degree(text) {
|
||||
const input = text.substr(0, 2).toUpperCase();
|
||||
let num = 0;
|
||||
for (let i = 0; i < input.length; i++) {
|
||||
for (let i = 0; i < input.length; i += 1) {
|
||||
const charCode = Math.max(Math.min(input[i].charCodeAt(), endLetterRange), startLetterRange);
|
||||
num += Math.pow(letterRange, input.length - i - 1) * (charCode - startLetterRange);
|
||||
}
|
||||
|
||||
@@ -55,8 +55,7 @@ function setInlineStyles(svg, target, emptySvgDeclarationComputed) {
|
||||
// hardcode computed css styles inside svg
|
||||
const allElements = traverse(svg);
|
||||
const allTargetElements = traverse(target);
|
||||
let i = allElements.length;
|
||||
while (i--) {
|
||||
for (let i = allElements.length - 1; i >= 0; i -= 1) {
|
||||
explicitlySetStyle(allElements[i], allTargetElements[i]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { includes } from 'lodash';
|
||||
import { scaleLog } from 'd3-scale';
|
||||
import { formatMetricSvg } from './string-utils';
|
||||
import { colors } from './color-utils';
|
||||
import React from 'react';
|
||||
|
||||
import { formatMetricSvg } from './string-utils';
|
||||
import { colors } from './color-utils';
|
||||
|
||||
export function getClipPathDefinition(clipId, size, height,
|
||||
x = -size * 0.5, y = size * 0.5 - height) {
|
||||
|
||||
Reference in New Issue
Block a user