Skip to content
Snippets Groups Projects

feat(mlResults): added indication for ML results to QB

Merged Vink, S.A. (Sjoerd) requested to merge feat/mlResults into main
2 files
+ 23
5
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -31,6 +31,8 @@ export const QueryMLDialog = () => {
value={ml.linkPrediction.enabled}
onChange={() => dispatch(setLinkPredictionEnabled(!ml.linkPrediction.enabled))}
/>
{ml.linkPrediction.enabled && ml.linkPrediction.result && <span># of predictions: {ml.linkPrediction.result.length}</span>}
{ml.linkPrediction.enabled && !ml.linkPrediction.result && <span>Loading...</span>}
<Input
type="boolean"
@@ -38,6 +40,15 @@ export const QueryMLDialog = () => {
value={ml.centrality.enabled}
onChange={() => dispatch(setCentralityEnabled(!ml.centrality.enabled))}
/>
{ml.centrality.enabled && Object.values(ml.centrality.result).length > 0 && (
<span>
sum of centers:
{Object.values(ml.centrality.result)
.reduce((a, b) => b + a)
.toFixed(2)}
</span>
)}
{ml.centrality.enabled && Object.values(ml.centrality.result).length === 0 && <span>No Centers Found</span>}
<Input
type="boolean"
@@ -45,6 +56,10 @@ export const QueryMLDialog = () => {
value={ml.communityDetection.enabled}
onChange={() => dispatch(setCommunityDetectionEnabled(!ml.communityDetection.enabled))}
/>
{ml.communityDetection.enabled && ml.communityDetection.result && (
<span># of communities: {ml.communityDetection.result.length}</span>
)}
{ml.communityDetection.enabled && !ml.communityDetection.result && <span>Loading...</span>}
<Input
type="boolean"
@@ -52,6 +67,9 @@ export const QueryMLDialog = () => {
value={ml.shortestPath.enabled}
onChange={() => dispatch(setShortestPathEnabled(!ml.shortestPath.enabled))}
/>
{ml.shortestPath.enabled && ml.shortestPath.result?.length > 0 && <span># of hops: {ml.shortestPath.result.length}</span>}
{ml.shortestPath.enabled && !ml.shortestPath.srcNode && <span>Please select source node</span>}
{ml.shortestPath.enabled && ml.shortestPath.srcNode && !ml.shortestPath.trtNode && <span>Please select target node</span>}
</div>
</FormBody>
</FormCard>
Loading