Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonestla committed Oct 3, 2023
1 parent 9e061cb commit f19d827
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions client/src/layout/Graph.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function GraphEvents({ onNodeClick, onStageClick }) {
}

const highlightGraph = (graph, selectedNode) => {
console.log("Node selected :", selectedNode.id)
graph.updateEachNodeAttributes((node, attr) => {
return {
...attr,
Expand Down
4 changes: 3 additions & 1 deletion server/src/routes/openalex/open-alex-to-graphology.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ function getEdgesFromPublicationList(publicationList) {

export function openAlexToGraphology(publicationList) {

console.log('Publications count : ', publicationList.length);
console.log('Publications count :', publicationList.length);

const publicationListWithoutTooManyAuthors = publicationList.filter(({ authors = [] }) => authors.length <= MAX_NUMBER_OF_AUTHORS);
const nodes = getNodesFromPublicationList(publicationListWithoutTooManyAuthors);
const edges = getEdgesFromPublicationList(publicationListWithoutTooManyAuthors);

console.log('Publications with less than', MAX_NUMBER_OF_AUTHORS, 'authors :', nodes.length);

// Create graph
return dataToGraphology(nodes, edges);
}
5 changes: 4 additions & 1 deletion server/src/routes/scanr/scanr-to-graphology.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ function getEdgesFromPublicationList(publicationList) {

export function scanrToGraphology(publicationList) {

console.log('Publications count : ', publicationList.length);
console.log('Publications count :', publicationList.length);

const publicationListWithoutTooManyAuthors = publicationList.filter(({ authors = [] }) => authors.length <= MAX_NUMBER_OF_AUTHORS);
const nodes = getNodesFromPublicationList(publicationListWithoutTooManyAuthors);
const edges = getEdgesFromPublicationList(publicationListWithoutTooManyAuthors);

console.log('Publications with less than', MAX_NUMBER_OF_AUTHORS, 'authors :', nodes.length);

// Create graph
return dataToGraphology(nodes, edges);
}

0 comments on commit f19d827

Please sign in to comment.