2 * Created by onvelocity on 2/23/16.
7 import _isArray
from 'lodash/isArray'
11 * Add CSS classes to Rendered Service Paths (Record Service Path in code) so they hightlight.
13 export default class HighlightRecordServicePaths
{
15 static removeHighlighting() {
16 Array
.from(document
.querySelectorAll(`svg .forwarding-graph-paths`)).forEach(d
=> {
17 d3
.select(d
).classed('-is-highlighting', false);
19 Array
.from(document
.querySelectorAll('.rsp-path')).forEach(d
=> {
20 d3
.select(d
).classed('-is-highlighted', false);
24 static highlightPaths(rsp
) {
25 HighlightRecordServicePaths
.removeHighlighting();
26 Array
.from(document
.querySelectorAll(`svg .forwarding-graph-paths`)).forEach(d
=> {
27 d3
.select(d
).classed('-is-highlighting', true);
29 const list
= _isArray(rsp
) ? rsp
: [rsp
];
31 Array
.from(document
.querySelectorAll(`[data-id="${rsp.id}"]`)).forEach(d
=> {
32 d
.parentNode
.appendChild(d
);
33 d3
.select(d
).classed('-is-highlighted', true);