mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 18:51:17 +00:00
Remove common prefix from networks to increase color separation
This commit is contained in:
committed by
Simon Howe
parent
e95f46bfd8
commit
478a4a6d66
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user