assets/js/index.js
// precondition: address is in one of the components
address is in one of the components
address is in one of the components
function filterGraphByAddress(components, address) {
    const component = components.filter(c => c.has(address))[0];
    return {
      nodes: data.nodes.filter(({ id }) => component.has(id)),
      edges: data.edges.filter(({ source, target }) => {
        return component.has(source) && component.has(target);
      }),
    };
  }
function filterGraphByAddress ( components , address ) { const component = components . filter ( c => c . has ( address ) ) [ 0 ] ; return { nodes : data . nodes . filter ( ( { id } ) => component . has ( id ) ) , edges : data . edges . filter ( ( { source , target } ) => { return component . has ( source ) && component . has ( target ) ; } ) , } ; }
precondition: address is in one of the components
precondition : address is in one of the components
// locate the address // filter nodes and edges by the address