Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • graphpolaris/frontend-v2
  • rijkheere/frontend-v-2-reordering-paoh
2 results
Show changes
Showing
with 100 additions and 52 deletions
...@@ -20,7 +20,7 @@ export type MockDataI = typeof mockDataArray[number]; ...@@ -20,7 +20,7 @@ export type MockDataI = typeof mockDataArray[number];
export const loadMockData = async (fileName: MockDataI) => { export const loadMockData = async (fileName: MockDataI) => {
const json = await import(`./${fileName.replace('_', '/')}.json`); const json = await import(`./${fileName.replace('_', '/')}.json` /* @vite-ignore */);
const { nodes, edges, metaData } = graphQueryBackend2graphQuery(json.default); const { nodes, edges, metaData } = graphQueryBackend2graphQuery(json.default);
return { return {
data: { data: {
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
* © Copyright Utrecht University (Department of Information and Computing Sciences) * © Copyright Utrecht University (Department of Information and Computing Sciences)
*/ */
import { type } from 'os'; import { AllLogicStatement, AnyStatement } from './logic/general';
import { AllLogicStatement, AnyStatement, InputNodeType } from './logic/general';
import { MLTypes } from '../../data-access/store/mlSlice'; import { MLTypes } from '../../data-access/store/mlSlice';
/** JSON query format used to send a query to the backend. */ /** JSON query format used to send a query to the backend. */
......
import { SchemaAttribute } from '../../..';
import { Handles, QueryElementTypes } from '../reactflow'; import { Handles, QueryElementTypes } from '../reactflow';
import { QueryGraphEdgeAttribute, QueryGraphEdgeHandle, QueryGraphNodes } from './model'; import { QueryGraphEdgeAttribute, QueryGraphEdgeHandle, QueryGraphNodes } from './model';
......
// import { setQuerybuilderNodes, store } from '@graphpolaris/shared/lib/data-access/store'; import Graph from 'graphology';
import Graph, { MultiGraph } from 'graphology';
import { Attributes as GAttributes, Attributes, SerializedGraph } from 'graphology-types'; import { Attributes as GAttributes, Attributes, SerializedGraph } from 'graphology-types';
import { import {
EntityNodeAttributes, EntityNodeAttributes,
...@@ -232,8 +231,6 @@ export class QueryMultiGraphology extends Graph<QueryGraphNodes, QueryGraphEdges ...@@ -232,8 +231,6 @@ export class QueryMultiGraphology extends Graph<QueryGraphNodes, QueryGraphEdges
handleType: targetHandleType, handleType: targetHandleType,
}; };
// console.log('newEdge', attributes, source, target);
// Add/edit an edge to the graphology object // Add/edit an edge to the graphology object
const edgeResult = this.mergeEdge(source.id, target.id, attributes as QueryGraphEdges); const edgeResult = this.mergeEdge(source.id, target.id, attributes as QueryGraphEdges);
......
import { NodeAttribute, QueryGraphEdgeHandle, QueryGraphNodes } from './graphology'; import { NodeAttribute, QueryGraphEdgeHandle } from './graphology';
import { InputNodeType } from './logic/general'; import { InputNodeType } from './logic/general';
import { Handles, QueryElementTypes, SchemaReactflowNode } from './reactflow'; import { Handles, QueryElementTypes, SchemaReactflowNode } from './reactflow';
......
import { import {
GeneralDescription, GeneralDescription,
InputNodeType,
NumberFunctionTypes, NumberFunctionTypes,
NumberFilterTypes, NumberFilterTypes,
StringFilterTypes, StringFilterTypes,
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* © Copyright Utrecht University (Department of Information and Computing Sciences) * © Copyright Utrecht University (Department of Information and Computing Sciences)
*/ */
import { Position } from 'reactflow';
import { GeneralDescription, NumberAggregationTypes } from './general'; import { GeneralDescription, NumberAggregationTypes } from './general';
export const MathAggregations: Record<NumberAggregationTypes, GeneralDescription<NumberAggregationTypes>> = { export const MathAggregations: Record<NumberAggregationTypes, GeneralDescription<NumberAggregationTypes>> = {
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
* © Copyright Utrecht University (Department of Information and Computing Sciences) * © Copyright Utrecht University (Department of Information and Computing Sciences)
*/ */
import { Position } from 'reactflow'; import { GeneralDescription, NumberFilterTypes } from './general';
import { GeneralDescription, InputNode, NumberFilterTypes } from './general';
export const MathFilters: Record<NumberFilterTypes, GeneralDescription<NumberFilterTypes>> = { export const MathFilters: Record<NumberFilterTypes, GeneralDescription<NumberFilterTypes>> = {
[NumberFilterTypes.EQUAL]: { [NumberFilterTypes.EQUAL]: {
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* © Copyright Utrecht University (Department of Information and Computing Sciences) * © Copyright Utrecht University (Department of Information and Computing Sciences)
*/ */
import { Position } from 'reactflow';
import { GeneralDescription, NumberFunctionTypes } from './general'; import { GeneralDescription, NumberFunctionTypes } from './general';
export const NumberFunctions: Record<NumberFunctionTypes, GeneralDescription<NumberFunctionTypes>> = { export const NumberFunctions: Record<NumberFunctionTypes, GeneralDescription<NumberFunctionTypes>> = {
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* © Copyright Utrecht University (Department of Information and Computing Sciences) * © Copyright Utrecht University (Department of Information and Computing Sciences)
*/ */
import { Position } from 'reactflow';
import { GeneralDescription, StringFilterTypes } from './general'; import { GeneralDescription, StringFilterTypes } from './general';
export const StringFilters: Record<StringFilterTypes, GeneralDescription<StringFilterTypes>> = { export const StringFilters: Record<StringFilterTypes, GeneralDescription<StringFilterTypes>> = {
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* © Copyright Utrecht University (Department of Information and Computing Sciences) * © Copyright Utrecht University (Department of Information and Computing Sciences)
*/ */
import { Position } from 'reactflow';
import { GeneralDescription, StringFunctionTypes } from './general'; import { GeneralDescription, StringFunctionTypes } from './general';
export const StringFunctions: Record<StringFunctionTypes, GeneralDescription<StringFunctionTypes>> = { export const StringFunctions: Record<StringFunctionTypes, GeneralDescription<StringFunctionTypes>> = {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* Possible handles for an entity node. * Possible handles for an entity node.
*/ */
// import { FunctionArgTypes } from '../logic/graphFunctions'; // import { FunctionArgTypes } from '../logic/graphFunctions';
import { SchemaReactflowNode, QueryElementTypes } from './model';
/** Links need handles to what they are connected to (and which side) */ /** Links need handles to what they are connected to (and which side) */
export enum Handles { export enum Handles {
......
import { import {
useConfig, useConfig,
useGraphQueryResult,
useQuerybuilderGraph, useQuerybuilderGraph,
useQuerybuilderHash, useQuerybuilderHash,
useQuerybuilderSettings, useQuerybuilderSettings,
...@@ -8,7 +7,8 @@ import { ...@@ -8,7 +7,8 @@ import {
useSchemaInference, useSchemaInference,
useSearchResultQB, useSearchResultQB,
} from '@graphpolaris/shared/lib/data-access/store'; } from '@graphpolaris/shared/lib/data-access/store';
import { clearQB, setQuerybuilderGraphology, toQuerybuilderGraphology } from '@graphpolaris/shared/lib/data-access/store/querybuilderSlice'; import { useCheckPermissionPolicy } from '@graphpolaris/shared/lib/data-access';
import { setQuerybuilderGraphology, toQuerybuilderGraphology } from '@graphpolaris/shared/lib/data-access/store/querybuilderSlice';
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import ReactFlow, { import ReactFlow, {
...@@ -20,7 +20,6 @@ import ReactFlow, { ...@@ -20,7 +20,6 @@ import ReactFlow, {
NodeChange, NodeChange,
NodePositionChange, NodePositionChange,
OnConnectStartParams, OnConnectStartParams,
OnEdgesChange,
ReactFlowInstance, ReactFlowInstance,
ReactFlowProvider, ReactFlowProvider,
isNode, isNode,
...@@ -83,6 +82,28 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { ...@@ -83,6 +82,28 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => {
const searchResults = useSearchResultQB(); const searchResults = useSearchResultQB();
const reactFlowInstanceRef = useRef<ReactFlowInstance | null>(null); const reactFlowInstanceRef = useRef<ReactFlowInstance | null>(null);
const [allowZoom, setAllowZoom] = useState(true); const [allowZoom, setAllowZoom] = useState(true);
const { canRead, canWrite } = useCheckPermissionPolicy();
const [readAllowed, setReadAllowed] = useState(false);
const [writeAllowed, setWriteAllowed] = useState(false);
const resource = 'query';
const checkReadPermission = useCallback(async () => {
const result = await canRead(resource);
setReadAllowed(result);
}, [canRead]);
const checkWritePermission = useCallback(async () => {
const result = await canWrite(resource);
setWriteAllowed(result);
}, [canWrite]);
useEffect(() => {
checkReadPermission();
}, [checkReadPermission]);
useEffect(() => {
checkWritePermission();
}, [checkWritePermission]);
useEffect(() => { useEffect(() => {
const searchResultKeys = new Set([...searchResults.nodes.map((node) => node.key), ...searchResults.edges.map((edge) => edge.key)]); const searchResultKeys = new Set([...searchResults.nodes.map((node) => node.key), ...searchResults.edges.map((edge) => edge.key)]);
...@@ -120,9 +141,7 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { ...@@ -120,9 +141,7 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => {
* TODO? * TODO?
*/ */
function onNodesChange(nodes: NodeChange[]) { function onNodesChange(nodes: NodeChange[]) {
// console.log(nodes);
nodes.forEach((n) => { nodes.forEach((n) => {
// console.log(graphologyGraph.findNode((gn) => gn === n?.id));
if (n.type !== 'position') { if (n.type !== 'position') {
// updated = true; // updated = true;
// graphologyGraph.updateAttributes(n.id, n.data); // graphologyGraph.updateAttributes(n.id, n.data);
...@@ -223,6 +242,12 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { ...@@ -223,6 +242,12 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => {
* @param event Drag event. * @param event Drag event.
*/ */
const onDrop = (event: React.DragEvent<HTMLDivElement>): void => { const onDrop = (event: React.DragEvent<HTMLDivElement>): void => {
if (!writeAllowed) {
console.debug('User blocked from editing query due to being a viewer');
event.preventDefault();
return;
}
event.preventDefault(); event.preventDefault();
// The dropped element should be a valid reactflow element // The dropped element should be a valid reactflow element
...@@ -240,7 +265,6 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { ...@@ -240,7 +265,6 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => {
switch (dragData.type) { switch (dragData.type) {
case QueryElementTypes.Entity: case QueryElementTypes.Entity:
// console.log('entity drop', dragData, schema.getNodeAttribute(dragData.name, 'attributes'));
graphologyGraph.addPill2Graphology( graphologyGraph.addPill2Graphology(
{ {
type: QueryElementTypes.Entity, type: QueryElementTypes.Entity,
...@@ -347,20 +371,15 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { ...@@ -347,20 +371,15 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => {
}; };
const onNodeMouseEnter = (event: React.MouseEvent, node: Node) => { const onNodeMouseEnter = (event: React.MouseEvent, node: Node) => {
// console.log(node);
// console.log(schema.getNodeAttribute(node.type, 'attributes'));
setAllowZoom(false); setAllowZoom(false);
}; };
const onNodeMouseLeave = (event: React.MouseEvent, node: Node) => { const onNodeMouseLeave = (event: React.MouseEvent, node: Node) => {
// console.log(node);
setAllowZoom(true); setAllowZoom(true);
}; };
const onConnect = useCallback( const onConnect = useCallback(
(connection: Connection) => { (connection: Connection) => {
console.log(connection);
if (!isEdgeUpdating.current) { if (!isEdgeUpdating.current) {
isOnConnect.current = true; isOnConnect.current = true;
if (!connection.sourceHandle || !connection.targetHandle) throw new Error('Connection has no source or target'); if (!connection.sourceHandle || !connection.targetHandle) throw new Error('Connection has no source or target');
...@@ -380,7 +399,6 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { ...@@ -380,7 +399,6 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => {
const onConnectStart = useCallback( const onConnectStart = useCallback(
(event: React.MouseEvent | React.TouchEvent, params: OnConnectStartParams) => { (event: React.MouseEvent | React.TouchEvent, params: OnConnectStartParams) => {
// console.log('onConnectStart', params);
if (!params?.handleId) return; if (!params?.handleId) return;
let node = graphologyGraph.getNodeAttributes(params.nodeId); let node = graphologyGraph.getNodeAttributes(params.nodeId);
...@@ -456,10 +474,6 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => { ...@@ -456,10 +474,6 @@ export const QueryBuilderInner = (props: QueryBuilderProps) => {
[graph], [graph],
); );
const onEdgesChange = (params: OnEdgesChange) => {
console.log('edges change', params);
};
const onEdgeUpdateEnd = useCallback( const onEdgeUpdateEnd = useCallback(
(event: MouseEvent | TouchEvent, edge: Edge, handleType: HandleType) => { (event: MouseEvent | TouchEvent, edge: Edge, handleType: HandleType) => {
if (isEdgeUpdating.current) { if (isEdgeUpdating.current) {
......
import React, { createContext } from 'react'; import React, { createContext } from 'react';
import { SchemaReactflowEntityNode, SchemaReactflowLogicNode } from '../model'; import { SchemaReactflowLogicNode } from '../model';
import { OnConnectStartParams } from 'reactflow'; import { OnConnectStartParams } from 'reactflow';
export const QueryBuilderDispatcherContext = createContext<{ export const QueryBuilderDispatcherContext = createContext<{
......
import React, { useMemo, useState } from 'react'; import React, { useMemo } from 'react';
import { ControlContainer, TooltipProvider, Tooltip, TooltipTrigger, Button, TooltipContent, Input } from '../../components'; import { ControlContainer, TooltipProvider, Tooltip, TooltipTrigger, Button, TooltipContent, Input } from '../../components';
import { Popover, PopoverTrigger, PopoverContent } from '../../components/layout/Popover'; import { Popover, PopoverTrigger, PopoverContent } from '../../components/layout/Popover';
import { useAppDispatch, useGraphQueryResult, useQuerybuilderSettings, useSchemaStats } from '../../data-access'; import { useAppDispatch, useGraphQueryResult, useML, useQuerybuilderSettings } from '../../data-access';
import { clearQB, QueryBuilderSettings, setQuerybuilderSettings } from '../../data-access/store/querybuilderSlice'; import { clearQB, setQuerybuilderSettings } from '../../data-access/store/querybuilderSlice';
import { QueryMLDialog } from './querysidepanel/QueryMLDialog'; import { QueryMLDialog } from './querysidepanel/QueryMLDialog';
import { QuerySettings } from './querysidepanel/QuerySettings'; import { QuerySettings } from './querysidepanel/QuerySettings';
...@@ -22,6 +22,7 @@ export const QueryBuilderNav = (props: QueryBuilderNavProps) => { ...@@ -22,6 +22,7 @@ export const QueryBuilderNav = (props: QueryBuilderNavProps) => {
const qb = useQuerybuilderSettings(); const qb = useQuerybuilderSettings();
const result = useGraphQueryResult(); const result = useGraphQueryResult();
const resultSize = useMemo(() => (result ? result.edges.length : 0), [result]); const resultSize = useMemo(() => (result ? result.edges.length : 0), [result]);
const ml = useML();
/** /**
* Clears all nodes in the graph. * Clears all nodes in the graph.
...@@ -30,6 +31,8 @@ export const QueryBuilderNav = (props: QueryBuilderNavProps) => { ...@@ -30,6 +31,8 @@ export const QueryBuilderNav = (props: QueryBuilderNavProps) => {
dispatch(clearQB()); dispatch(clearQB());
} }
const mlEnabled = ml.linkPrediction.enabled || ml.centrality.enabled || ml.communityDetection.enabled || ml.shortestPath.enabled;
return ( return (
<div className="sticky shrink-0 top-0 flex items-stretch justify-between h-7 bg-secondary-100 border-b border-secondary-200 max-w-full"> <div className="sticky shrink-0 top-0 flex items-stretch justify-between h-7 bg-secondary-100 border-b border-secondary-200 max-w-full">
<div className="flex items-center"> <div className="flex items-center">
...@@ -147,10 +150,58 @@ export const QueryBuilderNav = (props: QueryBuilderNavProps) => { ...@@ -147,10 +150,58 @@ export const QueryBuilderNav = (props: QueryBuilderNavProps) => {
<PopoverTrigger> <PopoverTrigger>
<Tooltip> <Tooltip>
<TooltipTrigger> <TooltipTrigger>
<Button variantType="secondary" variant="ghost" size="xs" iconComponent="icon-[ic--baseline-lightbulb]" /> <Button
variantType={mlEnabled ? 'primary' : 'secondary'}
variant="ghost"
size="xs"
iconComponent="icon-[ic--baseline-lightbulb]"
className={mlEnabled ? 'border-primary-600' : ''}
/>
</TooltipTrigger> </TooltipTrigger>
<TooltipContent disabled={props.toggleSettings === 'ml'}> <TooltipContent disabled={props.toggleSettings === 'ml'}>
<p>Machine learning</p> {mlEnabled ? (
<>
<p className="font-bold text-base">Machine learning</p>
<p className="mb-2">Algorithms detected the following results:</p>
{ml.linkPrediction.enabled && ml.linkPrediction.result && (
<>
<p className="mt-2 font-semibold">Link prediction</p>
<p>{ml.linkPrediction.result.length} links</p>{' '}
</>
)}
{ml.centrality.enabled && Object.values(ml.centrality.result).length > 0 && (
<>
<p className="mt-2 font-semibold">Centrality</p>
<p>
{Object.values(ml.centrality.result)
.reduce((a, b) => b + a)
.toFixed(2)}{' '}
sum of centers
</p>
</>
)}
{ml.communityDetection.enabled && ml.communityDetection.result && (
<>
<p className="mt-2 font-semibold">Community detection</p>
<p>{ml.communityDetection.result.length} communities</p>
</>
)}
{ml.shortestPath.enabled && (
<>
<p className="mt-2 font-semibold">Shortest path</p>
{ml.shortestPath.result?.length > 0 && <p># of hops: {ml.shortestPath.result.length}</p>}
{!ml.shortestPath.srcNode ? (
<p>Please select source node</p>
) : (
!ml.shortestPath.trtNode && <p>Please select target node</p>
)}
</>
)}
</>
) : (
<p>Machine learning</p>
)}
</TooltipContent> </TooltipContent>
</Tooltip> </Tooltip>
</PopoverTrigger> </PopoverTrigger>
...@@ -177,18 +228,18 @@ export const QueryBuilderNav = (props: QueryBuilderNavProps) => { ...@@ -177,18 +228,18 @@ export const QueryBuilderNav = (props: QueryBuilderNavProps) => {
<Tooltip> <Tooltip>
<TooltipTrigger> <TooltipTrigger>
<Button <Button
variantType={qb.limit <= resultSize ? 'danger' : 'secondary'} variantType={qb.limit <= resultSize ? 'primary' : 'secondary'}
variant="ghost" variant="ghost"
size="xs" size="xs"
iconComponent="icon-[ic--baseline-filter-alt]" iconComponent="icon-[ic--baseline-filter-alt]"
className={qb.limit <= resultSize ? 'border-danger-600' : ''} className={qb.limit <= resultSize ? 'border-primary-600' : ''}
/> />
</TooltipTrigger> </TooltipTrigger>
<TooltipContent disabled={props.toggleSettings === 'ml'}> <TooltipContent disabled={props.toggleSettings === 'ml'}>
<p className="font-bold text-base">Limit</p> <p className="font-bold text-base">Limit</p>
<p>Limits the number of edges retrieved from the database.</p> <p>Limits the number of edges retrieved from the database.</p>
<p>Required to manage performance.</p> <p>Required to manage performance.</p>
<p className={`font-semibold${qb.limit <= resultSize ? ' text-danger-800' : ''}`}> <p className={`font-semibold${qb.limit <= resultSize ? ' text-primary-800' : ''}`}>
Fetched {resultSize} of a maximum of {qb.limit} edges Fetched {resultSize} of a maximum of {qb.limit} edges
</p> </p>
</TooltipContent> </TooltipContent>
......
...@@ -5,8 +5,7 @@ import { useQuerybuilderGraph, useQuerybuilderSettings, useSchemaGraph } from '@ ...@@ -5,8 +5,7 @@ import { useQuerybuilderGraph, useQuerybuilderSettings, useSchemaGraph } from '@
import { toQuerybuilderGraphology, setQuerybuilderGraphology } from '@graphpolaris/shared/lib/data-access/store/querybuilderSlice'; import { toQuerybuilderGraphology, setQuerybuilderGraphology } from '@graphpolaris/shared/lib/data-access/store/querybuilderSlice';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { toSchemaGraphology } from '@graphpolaris/shared/lib/data-access/store/schemaSlice'; import { toSchemaGraphology } from '@graphpolaris/shared/lib/data-access/store/schemaSlice';
import { SchemaAttribute, SchemaEdge, SchemaNode } from '@graphpolaris/shared/lib/schema'; import { SchemaEdge, SchemaNode } from '@graphpolaris/shared/lib/schema';
import { schemaExpandRelation } from '@graphpolaris/shared/lib/schema/schema-utils';
export const QueryBuilderRelatedNodesPanel = (props: { export const QueryBuilderRelatedNodesPanel = (props: {
reactFlowWrapper: HTMLDivElement | null; reactFlowWrapper: HTMLDivElement | null;
......
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
setLinkPredictionEnabled, setLinkPredictionEnabled,
setShortestPathEnabled, setShortestPathEnabled,
} from '@graphpolaris/shared/lib/data-access/store/mlSlice'; } from '@graphpolaris/shared/lib/data-access/store/mlSlice';
import { FormDiv, FormCard, FormBody, FormTitle, FormHBar } from '@graphpolaris/shared/lib/components/forms'; import { FormCard, FormBody, FormTitle, FormHBar } from '@graphpolaris/shared/lib/components/forms';
import { Input } from '@graphpolaris/shared/lib/components/inputs'; import { Input } from '@graphpolaris/shared/lib/components/inputs';
export const QueryMLDialog = () => { export const QueryMLDialog = () => {
......
...@@ -3,7 +3,7 @@ import React from 'react'; ...@@ -3,7 +3,7 @@ import React from 'react';
import { useAppDispatch, useQuerybuilderSettings } from '../../../data-access'; import { useAppDispatch, useQuerybuilderSettings } from '../../../data-access';
import { QueryBuilderSettings, setQuerybuilderSettings } from '../../../data-access/store/querybuilderSlice'; import { QueryBuilderSettings, setQuerybuilderSettings } from '../../../data-access/store/querybuilderSlice';
import { addWarning } from '../../../data-access/store/configSlice'; import { addWarning } from '../../../data-access/store/configSlice';
import { FormActions, FormBody, FormCard, FormControl, FormDiv, FormHBar, FormTitle } from '../../../components/forms'; import { FormActions } from '../../../components/forms';
import { Layouts } from '@graphpolaris/shared/lib/graph-layout'; import { Layouts } from '@graphpolaris/shared/lib/graph-layout';
import { Input } from '@graphpolaris/shared/lib/components/inputs'; import { Input } from '@graphpolaris/shared/lib/components/inputs';
......
...@@ -2,7 +2,6 @@ import React from 'react'; ...@@ -2,7 +2,6 @@ import React from 'react';
import { Meta } from '@storybook/react'; import { Meta } from '@storybook/react';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { setQuerybuilderGraph, setSchema, store } from '@graphpolaris/shared/lib/data-access/store'; import { setQuerybuilderGraph, setSchema, store } from '@graphpolaris/shared/lib/data-access/store';
import { SchemaUtils } from '@graphpolaris/shared/lib/schema/schema-utils'; import { SchemaUtils } from '@graphpolaris/shared/lib/schema/schema-utils';
import { Schema } from '@graphpolaris/shared/lib/schema/panel'; import { Schema } from '@graphpolaris/shared/lib/schema/panel';
import { movieSchemaRaw } from '@graphpolaris/shared/lib/mock-data'; import { movieSchemaRaw } from '@graphpolaris/shared/lib/mock-data';
......
import React from 'react'; import React from 'react';
import { querybuilderSlice, setQuerybuilderGraph, setSchema, store } from '@graphpolaris/shared/lib/data-access/store'; import { setQuerybuilderGraph, setSchema, store } from '@graphpolaris/shared/lib/data-access/store';
import { configureStore } from '@reduxjs/toolkit';
import { Meta } from '@storybook/react'; import { Meta } from '@storybook/react';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import QueryBuilder from '../QueryBuilder'; import QueryBuilder from '../QueryBuilder';
import { Handles, NodeAttribute, QueryElementTypes, QueryMultiGraphology } from '../../model'; import { QueryElementTypes, QueryMultiGraphology } from '../../model';
import { SchemaUtils } from '../../../schema/schema-utils'; import { SchemaUtils } from '../../../schema/schema-utils';
const Component: Meta<typeof QueryBuilder> = { const Component: Meta<typeof QueryBuilder> = {
...@@ -137,7 +135,6 @@ export const Simple = { ...@@ -137,7 +135,6 @@ export const Simple = {
// ); // );
graph.addEdge2Graphology(entity1, relation1); graph.addEdge2Graphology(entity1, relation1);
graph.addEdge2Graphology(relation1, entity2); graph.addEdge2Graphology(relation1, entity2);
// console.log(graph.getNodeAttributes('2'));
// graph.addEdge('2', '1', { type: 'attribute_connection' }); // graph.addEdge('2', '1', { type: 'attribute_connection' });
// graph.addEdge('3', '1', { type: 'attribute_connection' }); // graph.addEdge('3', '1', { type: 'attribute_connection' });
// graph.addEdge('4', '0', { type: 'attribute_connection' }); // graph.addEdge('4', '0', { type: 'attribute_connection' });
......