Remove common prefix from networks to increase color separation

This commit is contained in:
David Kaltschmidt
2016-05-25 11:26:31 +02:00
committed by Simon Howe
parent e95f46bfd8
commit 478a4a6d66
5 changed files with 33 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
import React from 'react';
import filesize from 'filesize';
import d3 from 'd3';
import LCP from 'lcp';
const formatLargeValue = d3.format('s');
@@ -69,3 +69,7 @@ const CLEAN_LABEL_REGEX = /\W/g;
export function slugify(label) {
return label.replace(CLEAN_LABEL_REGEX, '').toLowerCase();
}
export function longestCommonPrefix(strArr) {
return (new LCP(strArr)).lcp();
}