From 4c46d2c4d68eb446901fd93ad940089e7a9e70a1 Mon Sep 17 00:00:00 2001 From: Sjoerd <svink@graphpolaris.com> Date: Tue, 17 Sep 2024 08:07:23 +0000 Subject: [PATCH] chore: remove console logs --- .../charts/colorLegendSeqDiv/index.tsx | 3 --- .../charts/scatterplot_pixi/index.tsx | 3 --- .../shared/lib/data-access/broker/wsState.tsx | 1 - .../lib/graph-layout/cytoscape-layouts.ts | 8 ++---- .../lib/graph-layout/graphology-layouts.ts | 5 ++-- libs/shared/lib/graph-layout/layout.ts | 1 - .../querybuilder/model/graphology/utils.ts | 2 -- .../lib/querybuilder/panel/QueryBuilder.tsx | 13 ---------- .../stories/querybuilder-simple.stories.tsx | 1 - .../query-utils/query2backend.spec.ts | 18 ------------- .../querybuilder/query-utils/query2backend.ts | 16 ------------ .../relation/SchemaRelationshipPopup.tsx | 6 +---- .../schema-utils/schema-usecases.spec.ts | 2 -- .../schema/schema-utils/schema-usecases.ts | 6 +---- .../lib/schema/schema-utils/schema-utils.ts | 1 - .../matrixvis/components/ColumnLabelTrack.tsx | 3 --- .../matrixvis/components/MatrixPixi.tsx | 25 ------------------ .../components/ReorderingManager.tsx | 2 -- .../nodelinkvis/components/NLPixi.tsx | 1 - .../paohvis/utils/dataProcessing.tsx | 4 --- .../visualizations/paohvis/utils/utils.tsx | 16 ------------ .../components/Scatterplot.tsx | 7 ----- .../semanticsubstratesvis.tsx | 26 ++----------------- 23 files changed, 8 insertions(+), 162 deletions(-) diff --git a/libs/shared/lib/components/charts/colorLegendSeqDiv/index.tsx b/libs/shared/lib/components/charts/colorLegendSeqDiv/index.tsx index 02c04e0b7..34d846d4d 100644 --- a/libs/shared/lib/components/charts/colorLegendSeqDiv/index.tsx +++ b/libs/shared/lib/components/charts/colorLegendSeqDiv/index.tsx @@ -15,9 +15,6 @@ export const ColorLegendSeqDiv = ({ colors, data, tickCount = 5, name }: ColorLe useEffect(() => { if (!svgRef.current) return; - console.log(colors); - //console.log(divergenceColors.blueRed); - const widthSVG: number = +svgRef.current.clientWidth; const heightSVG: number = +svgRef.current.clientHeight; diff --git a/libs/shared/lib/components/charts/scatterplot_pixi/index.tsx b/libs/shared/lib/components/charts/scatterplot_pixi/index.tsx index 6253e57b5..99a02ea89 100644 --- a/libs/shared/lib/components/charts/scatterplot_pixi/index.tsx +++ b/libs/shared/lib/components/charts/scatterplot_pixi/index.tsx @@ -69,7 +69,6 @@ const Scatterplot: React.FC<ScatterplotProps> = ({ data, visualConfig, xScale, o const yScale = d3.scaleLinear().domain([-1, 1]).range([visualConfig.heightMargin, 0]); - console.log(visualConfig); // PIXI const app = new PIXI.Application({ width: visualConfig.width, @@ -103,8 +102,6 @@ const Scatterplot: React.FC<ScatterplotProps> = ({ data, visualConfig, xScale, o d.gfx = graphics; }); - console.log('DONE SIMULATION'); - const svg = d3 .select(svgRef.current) .attr('width', visualConfig.width) diff --git a/libs/shared/lib/data-access/broker/wsState.tsx b/libs/shared/lib/data-access/broker/wsState.tsx index bc302e7cb..477121dff 100644 --- a/libs/shared/lib/data-access/broker/wsState.tsx +++ b/libs/shared/lib/data-access/broker/wsState.tsx @@ -147,7 +147,6 @@ export function wsTestSaveStateConnectionSubscription(callback: TestSaveStateCon } export function wsUpdateState(request: SaveStateI, callback?: GetStateResponse) { - //console.log('wsUpdateState', request); Broker.instance().sendMessage( { key: 'state', diff --git a/libs/shared/lib/graph-layout/cytoscape-layouts.ts b/libs/shared/lib/graph-layout/cytoscape-layouts.ts index 9eb00e176..50a369d8b 100644 --- a/libs/shared/lib/graph-layout/cytoscape-layouts.ts +++ b/libs/shared/lib/graph-layout/cytoscape-layouts.ts @@ -80,11 +80,8 @@ export abstract class CytoscapeLayout extends Layout<CytoscapeProvider> { protected defaultLayoutSettings = { animate: false, animationDuration: 5000, - ready: function () { - // console.info('Layout.ready'); - }, // on layoutready + ready: function () {}, // on layoutready stop: () => { - // console.log('Layout.stop'); this.updateNodePositions(); }, // on layoutstop }; @@ -412,7 +409,6 @@ class CytoscapeCoseBilkent extends CytoscapeLayout { // const node = event.target; // // The node's position has changed // // You can access the new position with node.position() - // console.log(node, event.target.position()); // this.updateNodePositions(); // }); } @@ -585,7 +581,7 @@ class CytoscapeBreathFirst extends CytoscapeLayout { name: 'breadthfirst', } as any); - // console.log('CytoscapeBreathFirst.layout', layout); + layout.run(); this.updateNodePositions(); diff --git a/libs/shared/lib/graph-layout/graphology-layouts.ts b/libs/shared/lib/graph-layout/graphology-layouts.ts index bd0e4caff..f63e67dc1 100644 --- a/libs/shared/lib/graph-layout/graphology-layouts.ts +++ b/libs/shared/lib/graph-layout/graphology-layouts.ts @@ -55,7 +55,6 @@ export abstract class GraphologyLayout extends Layout<GraphologyProvider> { throw new Error('The graph is not set.'); } - // console.log('Getting position for node:', nodeId, this.graph.getNodeAttributes(nodeId)); return this.graph.getNodeAttributes(nodeId); } } @@ -207,7 +206,7 @@ export class GraphologyForceAtlas2Webworker extends GraphologyLayout { let settings = { ...this.defaultLayoutSettings, ...sensibleSettings, - adjustSizes: graph.order < 300 ? true : false + adjustSizes: graph.order < 300 ? true : false, }; if (graph.order > 5000) { @@ -215,7 +214,7 @@ export class GraphologyForceAtlas2Webworker extends GraphologyLayout { ...settings, barnesHutOptimize: true, barnesHutTheta: 0.75, - slowDown: 0.75 + slowDown: 0.75, }; } diff --git a/libs/shared/lib/graph-layout/layout.ts b/libs/shared/lib/graph-layout/layout.ts index 8c9b863d6..43825fa0c 100644 --- a/libs/shared/lib/graph-layout/layout.ts +++ b/libs/shared/lib/graph-layout/layout.ts @@ -23,7 +23,6 @@ export abstract class Layout<provider extends Providers> { if (boundingBox !== undefined) { this.boundingBox = boundingBox; - // console.log(`Setting bounding box to ${JSON.stringify(this.boundingBox)}`); } if (this.verbose) { diff --git a/libs/shared/lib/querybuilder/model/graphology/utils.ts b/libs/shared/lib/querybuilder/model/graphology/utils.ts index cf85cc7ce..4d2db5ef1 100644 --- a/libs/shared/lib/querybuilder/model/graphology/utils.ts +++ b/libs/shared/lib/querybuilder/model/graphology/utils.ts @@ -232,8 +232,6 @@ export class QueryMultiGraphology extends Graph<QueryGraphNodes, QueryGraphEdges handleType: targetHandleType, }; - // console.log('newEdge', attributes, source, target); - // Add/edit an edge to the graphology object const edgeResult = this.mergeEdge(source.id, target.id, attributes as QueryGraphEdges); diff --git a/libs/shared/lib/querybuilder/panel/QueryBuilder.tsx b/libs/shared/lib/querybuilder/panel/QueryBuilder.tsx index 645bea816..0e13ee1ae 100644 --- a/libs/shared/lib/querybuilder/panel/QueryBuilder.tsx +++ b/libs/shared/lib/querybuilder/panel/QueryBuilder.tsx @@ -143,9 +143,7 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { * TODO? */ function onNodesChange(nodes: NodeChange[]) { - // console.log(nodes); nodes.forEach((n) => { - // console.log(graphologyGraph.findNode((gn) => gn === n?.id)); if (n.type !== 'position') { // updated = true; // graphologyGraph.updateAttributes(n.id, n.data); @@ -269,7 +267,6 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { switch (dragData.type) { case QueryElementTypes.Entity: - // console.log('entity drop', dragData, schema.getNodeAttribute(dragData.name, 'attributes')); graphologyGraph.addPill2Graphology( { type: QueryElementTypes.Entity, @@ -376,20 +373,15 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { }; const onNodeMouseEnter = (event: React.MouseEvent, node: Node) => { - // console.log(node); - // console.log(schema.getNodeAttribute(node.type, 'attributes')); setAllowZoom(false); }; const onNodeMouseLeave = (event: React.MouseEvent, node: Node) => { - // console.log(node); setAllowZoom(true); }; const onConnect = useCallback( (connection: Connection) => { - console.log(connection); - if (!isEdgeUpdating.current) { isOnConnect.current = true; if (!connection.sourceHandle || !connection.targetHandle) throw new Error('Connection has no source or target'); @@ -409,7 +401,6 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { const onConnectStart = useCallback( (event: React.MouseEvent | React.TouchEvent, params: OnConnectStartParams) => { - // console.log('onConnectStart', params); if (!params?.handleId) return; let node = graphologyGraph.getNodeAttributes(params.nodeId); @@ -485,10 +476,6 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { [graph], ); - const onEdgesChange = (params: OnEdgesChange) => { - console.log('edges change', params); - }; - const onEdgeUpdateEnd = useCallback( (event: MouseEvent | TouchEvent, edge: Edge, handleType: HandleType) => { if (isEdgeUpdating.current) { diff --git a/libs/shared/lib/querybuilder/panel/stories/querybuilder-simple.stories.tsx b/libs/shared/lib/querybuilder/panel/stories/querybuilder-simple.stories.tsx index e2f12695f..c30c72c71 100644 --- a/libs/shared/lib/querybuilder/panel/stories/querybuilder-simple.stories.tsx +++ b/libs/shared/lib/querybuilder/panel/stories/querybuilder-simple.stories.tsx @@ -137,7 +137,6 @@ export const Simple = { // ); graph.addEdge2Graphology(entity1, relation1); graph.addEdge2Graphology(relation1, entity2); - // console.log(graph.getNodeAttributes('2')); // graph.addEdge('2', '1', { type: 'attribute_connection' }); // graph.addEdge('3', '1', { type: 'attribute_connection' }); // graph.addEdge('4', '0', { type: 'attribute_connection' }); diff --git a/libs/shared/lib/querybuilder/query-utils/query2backend.spec.ts b/libs/shared/lib/querybuilder/query-utils/query2backend.spec.ts index 8b35dba94..f0bc76953 100644 --- a/libs/shared/lib/querybuilder/query-utils/query2backend.spec.ts +++ b/libs/shared/lib/querybuilder/query-utils/query2backend.spec.ts @@ -235,7 +235,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -277,7 +276,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -329,7 +327,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -365,7 +362,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -399,7 +395,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -458,7 +453,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -495,7 +489,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -547,7 +540,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -594,7 +586,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -620,7 +611,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -668,7 +658,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -703,7 +692,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -724,7 +712,6 @@ describe('QueryUtils Entity and Relations', () => { ], }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); }); @@ -761,7 +748,6 @@ describe('QueryUtils calculateQueryLogic', () => { let logics = graphExport.nodes.filter((n) => n?.attributes?.type === QueryElementTypes.Logic) as SerializedNode<LogicNodeAttributes>[]; const ret = calculateQueryLogic(logics[0], graphExport, logics); - // console.log(ret); }); }); @@ -811,7 +797,6 @@ describe('QueryUtils with Logic', () => { }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -893,7 +878,6 @@ describe('QueryUtils with Logic', () => { }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -954,7 +938,6 @@ describe('QueryUtils with Logic', () => { }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); @@ -1006,7 +989,6 @@ describe('QueryUtils with Logic', () => { }; let ret = Query2BackendQuery('database', graph.export(), defaultSettings); - // console.log(JSON.stringify(ret, null, 2)); expect(ret).toMatchObject(expected); }); }); diff --git a/libs/shared/lib/querybuilder/query-utils/query2backend.ts b/libs/shared/lib/querybuilder/query-utils/query2backend.ts index f04b9f1cf..4e7a6dd86 100644 --- a/libs/shared/lib/querybuilder/query-utils/query2backend.ts +++ b/libs/shared/lib/querybuilder/query-utils/query2backend.ts @@ -25,10 +25,8 @@ const traverseEntityRelationPaths = ( settings: QueryBuilderSettings, ): number => { if (!node?.attributes) throw Error('Malformed Graph! Node has no attributes'); - // console.log(paths); if (!paths?.[currentIdx]) { - // console.log('new path'); paths.push([]); if (node.attributes.type === QueryElementTypes.Relation) { paths[currentIdx].push({ type: QueryElementTypes.Entity, x: node.attributes.x, y: node.attributes.y, attributes: [] }); @@ -65,15 +63,12 @@ const traverseEntityRelationPaths = ( } return 0; } - // console.log('connections', connections); const nodesToRight = connections .map((c, i) => { const rightNodeHandleData = c.attributes?.targetHandleData; if (!rightNodeHandleData) throw Error('Malformed Graph! One or more edges of a relation node do not exist'); - // console.log('nodesToRight', c); - // console.log('entities', entities); if (paths[currentIdx].length > 10 || currentIdx > 10) throw Error('Malformed Graph! One or more edges of a relation node do not exist'); const rightNode = @@ -130,7 +125,6 @@ export function calculateQueryLogic( val = `\".*\"`; // Empty means allow anything } } - // console.log('val', val, inputRef, node); return val; } else if (connectionToInputRef.attributes?.sourceHandleData.nodeType === QueryElementTypes.Logic) { // Is connected to another logic node @@ -249,16 +243,6 @@ export function Query2BackendQuery( let graphLogicChunks = logicsRightHandleFinal.map((node) => calculateQueryLogic(node, graph, logics)); query.logic = queryLogicUnion(graphLogicChunks); - // Logic pathways extraction: now traverse the graph again though the logic components to construct the logic chunks - - // console.log('logics', logics); - // console.log('entitiesEmptyLeftHandle', entitiesEmptyLeftHandle); - // console.log('relationsEmptyLeftHandle', relationsEmptyLeftHandle); - // console.log('graphSequenceChunks', graphSequenceChunks); - // console.log('graphLogicChunks', graphLogicChunks); - // console.log('logicsRightHandleConnectedOutside', logicsRightHandleConnectedOutside); - // console.log('logicsRightHandleFinal', logicsRightHandleFinal); - // console.log('graphSequenceChunksIdMap', graphSequenceChunksIdMap); if (!graphSequenceChunks || graphSequenceChunks.length === 0 || graphSequenceChunks?.[0].length === 0) return query; const processConnection = (chunk: QueryGraphNodes[], position: number): RelationStruct | NodeStruct => { diff --git a/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationshipPopup.tsx b/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationshipPopup.tsx index 81767e432..63f2d63c0 100644 --- a/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationshipPopup.tsx +++ b/libs/shared/lib/schema/pills/nodes/relation/SchemaRelationshipPopup.tsx @@ -27,7 +27,6 @@ export const SchemaRelationshipPopup = (props: SchemaRelationshipPopupProps) => // dispatch(setSchemaSettings(state)); } - console.log('data relation popup', props); return ( <> <FormCard> @@ -37,10 +36,7 @@ export const SchemaRelationshipPopup = (props: SchemaRelationshipPopupProps) => submit(); }} > - <FormTitle - title="Edge Statistics" - onClose={props.onClose} - /> + <FormTitle title="Edge Statistics" onClose={props.onClose} /> <FormHBar /> <span className="px-5"> diff --git a/libs/shared/lib/schema/schema-utils/schema-usecases.spec.ts b/libs/shared/lib/schema/schema-utils/schema-usecases.spec.ts index f2a17761f..262439421 100644 --- a/libs/shared/lib/schema/schema-utils/schema-usecases.spec.ts +++ b/libs/shared/lib/schema/schema-utils/schema-usecases.spec.ts @@ -7,8 +7,6 @@ describe('SchemaUsecases', () => { test.each([{ data: simpleSchemaRaw }, { data: movieSchemaRaw }, { data: northwindSchemaRaw }, { data: twitterSchemaRaw }])( 'parseSchemaFromBackend parsing should work', ({ data }: any) => { - // console.log('testinput', input); - const parsed = SchemaUtils.schemaBackend2Graphology(data as SchemaFromBackend); expect(parsed).toBeDefined(); }, diff --git a/libs/shared/lib/schema/schema-utils/schema-usecases.ts b/libs/shared/lib/schema/schema-utils/schema-usecases.ts index f544f0ad7..390d0e83f 100644 --- a/libs/shared/lib/schema/schema-utils/schema-usecases.ts +++ b/libs/shared/lib/schema/schema-utils/schema-usecases.ts @@ -12,14 +12,12 @@ export function schemaExpandRelation(graph: SchemaGraphology): SchemaGraphology const newGraph = graph.copy(); newGraph.forEachNode((node, attributes) => { - // console.log(node, attributes); newGraph.mergeNodeAttributes(node, { type: QueryElementTypes.Entity }); }); //makeNewRelationNodes graph.forEachEdge((edge, attributes, source, target): void => { const newID = 'RelationNode:' + edge; - // console.log('making relationnode', edge, attributes, source, target, newID); newGraph.addNode(newID, { ...attributes, name: edge, @@ -36,7 +34,6 @@ export function schemaExpandRelation(graph: SchemaGraphology): SchemaGraphology }); const id2 = 'RelationEdge' + newID + '->' + target; - // console.log('making newEdgeOutgoing', edge, attributes, source, target, id); newGraph.addDirectedEdgeWithKey(id2, newID, target, {}); newGraph.dropEdge(edge); @@ -49,7 +46,7 @@ export function schemaExpandRelation(graph: SchemaGraphology): SchemaGraphology export function schemaGraphology2Reactflow( graph: Graph, defaultEdgeType: string, - animatedEdges = false + animatedEdges = false, ): { nodes: Array<Node<SchemaReactflowNodeWithFunctions | SchemaReactflowRelationWithFunctions>>; edges: Array<Edge>; @@ -86,7 +83,6 @@ export function createReactFlowEdges(graph: Graph, defaultEdgeType: string, anim const edgeElements: Array<Edge> = []; graph.forEachEdge((edge, attributes, source, target): void => { - // console.log('edges', attributes, edge); const newEdge: Edge = { id: edge, source: source, diff --git a/libs/shared/lib/schema/schema-utils/schema-utils.ts b/libs/shared/lib/schema/schema-utils/schema-utils.ts index e6a632d0e..214fbf149 100644 --- a/libs/shared/lib/schema/schema-utils/schema-utils.ts +++ b/libs/shared/lib/schema/schema-utils/schema-utils.ts @@ -14,7 +14,6 @@ export class SchemaUtils { // Instantiate a directed graph that allows self loops and parallel edges const schemaGraphology = new SchemaGraphology({ allowSelfLoops: true }); - // console.log('parsing schema'); // The graph schema needs a node for each node AND edge. These need then be connected if (!nodes || !edges) return schemaGraphology; diff --git a/libs/shared/lib/vis/visualizations/matrixvis/components/ColumnLabelTrack.tsx b/libs/shared/lib/vis/visualizations/matrixvis/components/ColumnLabelTrack.tsx index c0c00410d..dd617fa10 100644 --- a/libs/shared/lib/vis/visualizations/matrixvis/components/ColumnLabelTrack.tsx +++ b/libs/shared/lib/vis/visualizations/matrixvis/components/ColumnLabelTrack.tsx @@ -1,13 +1,10 @@ import { useEffect } from 'react'; export const ColumnLabelTrack = ({ columnLabels, config }: { columnLabels: string[]; config: any }) => { - // console.log('ColumnLabelTrack', columnLabels); - return ( <> <div className="grid grid-flow-col auto-cols-max h-80"> {columnLabels.map((label, index) => { - // console.log('columnlabeltrack', label); return ( <div className="-rotate-90 font-mono text-sm w-4" key={index}> {label} diff --git a/libs/shared/lib/vis/visualizations/matrixvis/components/MatrixPixi.tsx b/libs/shared/lib/vis/visualizations/matrixvis/components/MatrixPixi.tsx index 489596fd8..2be88bd8c 100644 --- a/libs/shared/lib/vis/visualizations/matrixvis/components/MatrixPixi.tsx +++ b/libs/shared/lib/vis/visualizations/matrixvis/components/MatrixPixi.tsx @@ -156,7 +156,6 @@ export const MatrixPixi = forwardRef((props: Props, refExternal) => { } useEffect(() => { - // console.log('graph changed', props.graph, ref.current, ref.current.children.length > 0, imperative.current); if (props.graph && internalRef.current && internalRef.current.children.length > 0) { if (!isSetup.current) setup(); else update(); @@ -164,7 +163,6 @@ export const MatrixPixi = forwardRef((props: Props, refExternal) => { }, [props.graph]); useEffect(() => { - // console.log('graph changed', props.graph, ref.current, ref.current.children.length > 0, imperative.current); if (props.graph && internalRef.current && internalRef.current.children.length > 0) { setup(); } @@ -458,29 +456,6 @@ export const MatrixPixi = forwardRef((props: Props, refExternal) => { }, }); - // make label - // const labels = props.graph.edges.map((edge: Edge) => { - // return edge.label; - // }); - // const tailwindColorsArray = Object.values(tailwindColors.entity).slice(0, labels.length); - // const scale = scaleOrdinal(tailwindColorsArray.reverse()); - // scale.domain(Array.from(labels)); - // console.log('labels', labels, props.graph.edges); - // visMapping.push({ attribute: 'label', encoding: 'rect', colorScale: scale }); - - // make value - // const values = props.graph.edges.map((edge: Edge) => { - // return edge?.attributes?.Distance as number; - // }); - - // const extent = extent(values); - // if (extent[0] === undefined || extent[1] === undefined) throw new Error('Extent is undefined'); - // console.log('labels', values, extent, props.graph.edges); - - // const scale = scaleLinear(['red', 'blue']); - // scale.domain(extent as [number, number]); - // visMapping.push({ attribute: 'attributes.Distance', encoding: 'rect', colorScale: scale }); - config.visMapping = visMapping; }; diff --git a/libs/shared/lib/vis/visualizations/matrixvis/components/ReorderingManager.tsx b/libs/shared/lib/vis/visualizations/matrixvis/components/ReorderingManager.tsx index aa3146884..88eb9a4e8 100644 --- a/libs/shared/lib/vis/visualizations/matrixvis/components/ReorderingManager.tsx +++ b/libs/shared/lib/vis/visualizations/matrixvis/components/ReorderingManager.tsx @@ -102,8 +102,6 @@ export class ReorderingManager { private getReorderJSGraph = (graph: GraphQueryResult, columnOrder: string[], rowOrder: string[]) => { const reorderAny = reorder as any; - // console.log('getReorderJSGraph', graph, columnOrder, rowOrder); - const nodesTemp = graph.nodes.map( (node) => ({ diff --git a/libs/shared/lib/vis/visualizations/nodelinkvis/components/NLPixi.tsx b/libs/shared/lib/vis/visualizations/nodelinkvis/components/NLPixi.tsx index c0434d43d..af95f3a34 100644 --- a/libs/shared/lib/vis/visualizations/nodelinkvis/components/NLPixi.tsx +++ b/libs/shared/lib/vis/visualizations/nodelinkvis/components/NLPixi.tsx @@ -871,7 +871,6 @@ export const NLPixi = forwardRef((props: Props, refExternal) => { // } // } // }); - // console.log(nodes.children); // force.startSimulation(props.graph, ref.current.getBoundingClientRect()); // force.simulation.on('tick', () => {}); diff --git a/libs/shared/lib/vis/visualizations/paohvis/utils/dataProcessing.tsx b/libs/shared/lib/vis/visualizations/paohvis/utils/dataProcessing.tsx index ba4501091..dc0191887 100644 --- a/libs/shared/lib/vis/visualizations/paohvis/utils/dataProcessing.tsx +++ b/libs/shared/lib/vis/visualizations/paohvis/utils/dataProcessing.tsx @@ -57,8 +57,6 @@ function parseHyperEdgeRanges( const toOrFrom = relationTo == columnNode ? 'to' : 'from'; const toOrFromOpposite = toOrFrom == 'to' ? 'from' : 'to'; - //console.log(relationTo, columnNode, relationTo == columnNode); - // loop through all edges - and creates hyperedge structure (column order/x) for (let i = 0; i < filteredData.edges.length; i++) { const edge = filteredData.edges[i]; @@ -74,9 +72,7 @@ function parseHyperEdgeRanges( // Sequential order in indices and count degree ( remove undefined = nodes without connection ) resultHyperEdgeRanges.forEach((element) => { element.degree = element.hyperEdges.indices.filter((num) => { - //console.log(num, typeof num); if (typeof num !== 'number') { - //console.log('Filtered out:', num); } return typeof num === 'number'; }).length; diff --git a/libs/shared/lib/vis/visualizations/paohvis/utils/utils.tsx b/libs/shared/lib/vis/visualizations/paohvis/utils/utils.tsx index 7ecea0a2d..f5be1e390 100644 --- a/libs/shared/lib/vis/visualizations/paohvis/utils/utils.tsx +++ b/libs/shared/lib/vis/visualizations/paohvis/utils/utils.tsx @@ -41,7 +41,6 @@ export function calculateAttributes(schemaResult: SchemaGraph): Record<string, A // Go through each entity. schemaResult.nodes.forEach((node) => { if (node?.attributes?.name === undefined) { - console.error('ERROR: Node has no name attribute or name.', node); return; } @@ -75,7 +74,6 @@ export function calculateRelations(schemaResult: SchemaGraph): Record<string, st const relationsPerEntity: Record<string, string[]> = {}; schemaResult.edges.forEach((edge) => { if (edge?.attributes === undefined) { - console.error('ERROR: Edge has no attribute.', edge); return; } @@ -102,7 +100,6 @@ export function calculateAttributesFromRelation(schemaResult: SchemaGraph): Rela // Go through each relation. schemaResult.edges.forEach((edge) => { if (edge?.attributes === undefined) { - console.error('ERROR: Edge has no attribute.', edge); return; } @@ -220,7 +217,6 @@ export function calcTextWidthAndStringText2( labels.forEach((rowLabel, index) => { let truncatedText = rowLabel; let truncatedWidth = 0; - //console.log('rowLabel ', rowLabel); while (truncatedText.length > 0) { const tempElement = document.createElement('span'); tempElement.style.position = 'absolute'; @@ -235,7 +231,6 @@ export function calcTextWidthAndStringText2( document.body.appendChild(tempElement); truncatedWidth = tempElement.getBoundingClientRect().width; document.body.removeChild(tempElement); - //console.log(tempElement.textContent, truncatedWidth, maxLengthAllowed); if (truncatedWidth <= maxLengthAllowed) { break; @@ -247,8 +242,6 @@ export function calcTextWidthAndStringText2( maxWidth = truncatedWidth; } - //console.log('maxWidthArray ', maxWidth); - if (truncatedText !== rowLabel) { truncatedLabels.push(truncatedText + '...'); } else { @@ -282,7 +275,6 @@ export function calcTextWidthAndStringText( labels.forEach((rowLabel, index) => { let truncatedText = rowLabel; let truncatedWidth = 0; - //console.log('rowLabel ', rowLabel); while (truncatedText.length > 0) { /* const tempElement = document.createElement('span'); @@ -298,7 +290,6 @@ export function calcTextWidthAndStringText( document.body.appendChild(tempElement); truncatedWidth = tempElement.getBoundingClientRect().width; document.body.removeChild(tempElement); - //console.log(tempElement.textContent, truncatedWidth, maxLengthAllowed); if (truncatedWidth <= maxLengthAllowed) { break; @@ -310,8 +301,6 @@ export function calcTextWidthAndStringText( maxWidth = truncatedWidth; } - //console.log('maxWidthArray ', maxWidth); - if (truncatedText !== rowLabel) { truncatedLabels.push(truncatedText + '...'); } else { @@ -543,30 +532,25 @@ export function intersectionElements(array: number[], indices: number[]): { y0: const moreAbove = areMoreElements(array, indices, 'above'); const moreBelow = areMoreElements(array, indices, 'below'); const pointsInside = indices.filter((index) => index >= array[0] && index < array[1]); - //console.log(indices, array); if (moreAbove == false && moreBelow == false) { - //console.log('case A ', pointsInside.length); if (pointsInside.length == 0 || pointsInside.length == 1) { return { y0: 0, y1: 0, valid: false }; } else { return { y0: pointsInside[0], y1: pointsInside[pointsInside.length - 1], valid: true }; } } else if (moreAbove == false && moreBelow == true) { - //console.log('case B ', pointsInside.length, pointsInside, pointsInside[0], pointsInside[pointsInside.length - 1]); if (pointsInside.length == 0) { return { y0: 0, y1: 0, valid: false }; } else { return { y0: pointsInside[0], y1: array[1] - 0.5, valid: true }; } } else if (moreAbove == true && moreBelow == false) { - //console.log('case D ', pointsInside.length); if (pointsInside.length == 0) { return { y0: 0, y1: 0, valid: false }; } else { return { y0: array[0] - 0.5, y1: pointsInside[pointsInside.length - 1], valid: true }; } } else if (moreAbove == true && moreBelow == true) { - //console.log('case E ', pointsInside, array); return { y0: array[0] - 0.5, y1: array[1] - 0.5, valid: true }; } // to return something diff --git a/libs/shared/lib/vis/visualizations/semanticsubstratesvis/components/Scatterplot.tsx b/libs/shared/lib/vis/visualizations/semanticsubstratesvis/components/Scatterplot.tsx index 6d8aeb062..f9668d67e 100644 --- a/libs/shared/lib/vis/visualizations/semanticsubstratesvis/components/Scatterplot.tsx +++ b/libs/shared/lib/vis/visualizations/semanticsubstratesvis/components/Scatterplot.tsx @@ -128,8 +128,6 @@ export const Scatterplot: React.FC<ScatterplotProps> = ({ } if (!data.xAxisName && !data.yAxisName) { - //console.log('case1 ', data.xAxisName, data.yAxisName); - dataCirclesXtemp = Array(data.xData.length).fill(visualConfig.widthMargin * 0.5); // place dots at the center of the svg dataCirclesYtemp = Array(data.yData.length).fill(visualConfig.heightMargin * 0.5); dataCircles = data.xData.map((value, index) => ({ x: dataCirclesXtemp[index], y: dataCirclesYtemp[index] })); @@ -191,8 +189,6 @@ export const Scatterplot: React.FC<ScatterplotProps> = ({ yAxisGroup.call(yAxis); xAxisGroup.attr('transform', 'translate(0,' + visualConfig.heightMargin + ')').call(xAxis); } else if (!!data.xAxisName && !!data.yAxisName) { - //console.log('case2 ', data.xAxisName, data.yAxisName); - if (typeof data.xData[0] != 'number') { xScaleTemp = scaleBand<string>() .domain(xScaleRange as string[]) @@ -332,8 +328,6 @@ export const Scatterplot: React.FC<ScatterplotProps> = ({ onResultJitter(dataSimulation, idScatterplot); } else if (!!data.yAxisName) { - //console.log('case3 ', data.xAxisName, data.yAxisName); - if (typeof data.yData[0] != 'number') { yScaleTemp = scaleBand<string>() .domain(yScaleRange as string[]) @@ -437,7 +431,6 @@ export const Scatterplot: React.FC<ScatterplotProps> = ({ xAxis = axisBottom(xScaleTemp).tickValues([]); xAxisGroup.attr('transform', 'translate(0,' + visualConfig.heightMargin + ')').call(xAxis); } else if (!!data.xAxisName) { - //console.log('case4 ', data.xAxisName, data.yAxisName); if (typeof data.xData[0] != 'number') { xScaleTemp = scaleBand<string>() .domain(xScaleRange as string[]) diff --git a/libs/shared/lib/vis/visualizations/semanticsubstratesvis/semanticsubstratesvis.tsx b/libs/shared/lib/vis/visualizations/semanticsubstratesvis/semanticsubstratesvis.tsx index 4fbd594bb..32a2ff717 100644 --- a/libs/shared/lib/vis/visualizations/semanticsubstratesvis/semanticsubstratesvis.tsx +++ b/libs/shared/lib/vis/visualizations/semanticsubstratesvis/semanticsubstratesvis.tsx @@ -302,7 +302,6 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat }, []); const handleResultJitter = (data: DataPoint[], idScatterplot: number) => { - //console.log('DONE JITTER ', idScatterplot); if (idScatterplot == IDScatterplotR0.current) { setComputedData((prevData) => ({ ...prevData, @@ -341,12 +340,10 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat // manages the addition of edges elements useEffect(() => { - //console.log('computedData', computedData.region1.length > 0 && computedData.region2.length > 0, computedData, newScatterplotIs.current); if (computedData.region1.length > 0 && computedData.region2.length > 0) { if (newScatterplotIs.current === 'add' || !stateEdges.edgePlotted[IDEdgeUpdating.current]) { // !FIXME !stateEdges.edgePlotted[IDEdgeUpdating.current] was added to solve bug, but now only last scatter shows edges - //console.log('ADD EDGES '); const temporalConfigVisualEdges: VisualEdgesConfig = { ...configVisualEdges.current, height: configVisualRegion.height * appState.scatterplots.length, @@ -365,14 +362,12 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat nameEdges: informationEdges.current.nameEdges[indexNewEdge.current - 1], }; - //console.log('newEdgePlot', newEdgePlot); setStateEdges({ edgePlotted: [...stateEdges.edgePlotted, newEdgePlot], }); // update edges } else if (IDScatterplotUpdating.current === IDScatterplotR0.current) { - //console.log('UPDATE EDGES of R0 '); const stateEdgesTemporal = cloneDeep(stateEdges.edgePlotted); const modifiedStateEdges = stateEdgesTemporal.map((obj, index) => { @@ -399,13 +394,8 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat edgePlotted: modifiedStateEdges, }); } else if (stateEdges.edgePlotted[IDEdgeUpdating.current]) { - //console.log('UPDATE EDGES NO R0'); - - //console.log('informationEdges.current.nameEdges ', informationEdges.current.nameEdges); - const stateEdgesTemporal = cloneDeep(stateEdges.edgePlotted); - //console.log('IDEdgeUpdating', IDEdgeUpdating.current, stateEdges.edgePlotted, stateEdgesTemporal[IDEdgeUpdating.current]); stateEdgesTemporal[IDEdgeUpdating.current].data1 = computedData.region1; // necessary ? stateEdgesTemporal[IDEdgeUpdating.current].data2 = computedData.region2; stateEdgesTemporal[IDEdgeUpdating.current].dataConnections = arrayConnections.current[IDEdgeUpdating.current]; @@ -419,10 +409,8 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat }, [computedData.region2, computedData.region1]); function createNewScatterplot(newPanel: DataFromPanel) { - //console.log('createNewScatterplot:', newPanel, 'IDScatterplotR0: ', IDScatterplotR0.current); if (idScatterplotsFromConfig.current.length === 0 && !IDScatterplotR0.current) { IDScatterplotR0.current = newPanel.id; - //console.log('newPanel ', newPanel); } idScatterplotsFromConfig.current.push(newPanel.id); @@ -495,15 +483,10 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat function updateScatterplot(updatedPanel?: DataFromPanel) { if (updatedPanel) { - //console.log('updatedPanel', updatedPanel, appState.scatterplots); - const idScatterplotUpdate = appState.scatterplots.findIndex((item) => item.key === updatedPanel.id); newScatterplotIs.current = 'update'; if (idScatterplotUpdate !== -1) { - //handleBrushClear(`region_${indexOnState}`); - if (!updatedPanel.data.entitySelected) return; - //console.log('UPDATE: appState ', idScatterplotUpdate); const regionUserSelection: UserSelection = { name: appState.dataRegions[idScatterplotUpdate].name, @@ -592,7 +575,6 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat // modify edge layer const arrayIDs = regionDataUser.idData.map((item) => item); IDScatterplotUpdating.current = idScatterplotUpdate; - //console.log('IDScatterplotUpdating', IDScatterplotUpdating.current, IDScatterplotR0.current, idScatterplotUpdate); if (idScatterplotUpdate === IDScatterplotR0.current) { const stateEdgesTemporal = cloneDeep(stateEdges.edgePlotted); @@ -617,7 +599,7 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat const indexEdgeInvolved = informationEdges.current.nameEdges.findIndex( (name) => name === `edge_region0_to_region_${idScatterplotUpdate}`, ); - //console.log('edge involved: ', IDEdgeBasedOnIDscatterplot, indexEdgeInvolved); + // modify data structures const [connectedD, connectedD2] = findConnectionsNodes( arrayIDs, @@ -645,7 +627,6 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat if (currentDataPanels.length > prevDataPanels.length) { // Element added - //console.log('ADD SCATTERPLOT'); const newPanel = currentDataPanels.filter( (panel: DataFromPanel) => !prevDataPanels.some((prevPanel) => prevPanel.id === panel.id), ); @@ -666,8 +647,6 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat (prevPanel) => !currentDataPanels.some((panel: DataFromPanel) => panel.id === prevPanel.id), ); - //console.log('DELETE SCATTERPLOT: ', deletedPanel); - removeScatterplot(deletedPanel); } else { // Element updated @@ -675,7 +654,7 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat const prevPanel = prevDataPanels.find((prevPanel) => prevPanel.id === panel.id); return prevPanel && !isEqual(prevPanel.data, panel.data); }); - //console.log('UPDATE SCATTERPLOT: ', updatedPanel); + if (updatedPanel !== undefined) { updateScatterplot(updatedPanel); } @@ -796,7 +775,6 @@ const VisSemanticSubstrates = forwardRef<VisSemanticSubstratesHandle, Visualizat ); informationEdges.current.nameEdges.push(`edge_region0_to_${regionUserSelection.name}`); - //console.log('informationEdges ', informationEdges.current.nameEdges); informationEdges.current.idEdges.push(connectedD2); arrayConnections.current.push(connectedD); indexNewEdge.current++; -- GitLab