src/common/idb.js
function newNetwork(instance, nodesID, nodesName, response) {
  const viewID = misc.uuidv4().slice(0, 8);
  const edgesID = response.workflowID.slice(0, 8);
  return updateItem(instance, item => {
    item.views.push({
      $schema: "https://mojaie.github.io/kiwiii/specs/network_v1.0.json",
      viewID: viewID,
      name: `${nodesName}_${response.name}`,
      viewType: 'network',
      nodes: nodesID,
      edges: edgesID,
      minConnThld: response.query.params.threshold
    });
    item.dataset.push({
      $schema: "https://mojaie.github.io/kiwiii/specs/collection_v1.0.json",
      collectionID: edgesID,
      name: response.name,
      contents: [response]
    });
  }).then(() => viewID);
}
function newNetwork(instance, nodesID, nodesName, response) {
  const viewID = misc.uuidv4().slice(0, 8);
  const edgesID = response.workflowID.slice(0, 8);
  return updateItem(instance, item => {
    item.views.push({
      $schema: "https://mojaie.github.io/kiwiii/specs/network_v1.0.json",
      viewID: viewID,
      name: `${nodesName}_${response.name}`,
      viewType: 'network',
      nodes: nodesID,
      edges: edgesID,
      minConnThld: response.query.params.threshold
    });
    item.dataset.push({
      $schema: "https://mojaie.github.io/kiwiii/specs/collection_v1.0.json",
      collectionID: edgesID,
      name: response.name,
      contents: [response]
    });
  }).then(() => viewID);
}
function newNetwork ( instance , nodesID , nodesName , response ) { const viewID = misc . uuidv4 ( ) . slice ( 0 , 8 ) ; const edgesID = response . workflowID . slice ( 0 , 8 ) ; return updateItem ( instance , item => { item . views . push ( { $schema : "https://mojaie.github.io/kiwiii/specs/network_v1.0.json" , viewID : viewID , name : ` ${ nodesName } ${ response . name } ` , viewType : 'network' , nodes : nodesID , edges : edgesID , minConnThld : response . query . params . threshold } ) ; item . dataset . push ( { $schema : "https://mojaie.github.io/kiwiii/specs/collection_v1.0.json" , collectionID : edgesID , name : response . name , contents : [ response ] } ) ; } ) . then ( ( ) => viewID ) ; }
Store new network view
@param {string} instance - Package instance ID
@param {string} nodesID - ID of nodes collection
@param {string} nodesName - Name of nodes collection
@param {object} response - Response object
Store new network view