Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Frontend V2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GraphPolaris
Frontend V2
Commits
11bb0ba4
Commit
11bb0ba4
authored
3 years ago
by
Behrisch, M. (Michael)
Browse files
Options
Downloads
Patches
Plain Diff
fix(vis-schema): catching up with develop
parent
1615de14
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
merge develop into main
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/web-graphpolaris/src/components/schema/schema.stories.tsx
+107
-3
107 additions, 3 deletions
...web-graphpolaris/src/components/schema/schema.stories.tsx
apps/web-graphpolaris/src/components/schema/schema.tsx
+12
-8
12 additions, 8 deletions
apps/web-graphpolaris/src/components/schema/schema.tsx
with
119 additions
and
11 deletions
apps/web-graphpolaris/src/components/schema/schema.stories.tsx
+
107
−
3
View file @
11bb0ba4
...
...
@@ -3,7 +3,6 @@ import {
SchemaFromBackend
,
schemaSlice
,
setSchema
,
store
,
}
from
'
@graphpolaris/shared/data-access/store
'
;
import
{
movieSchema
,
...
...
@@ -44,6 +43,111 @@ const Mockstore = configureStore({
export
const
TestWithSchema
=
Template
.
bind
({});
TestWithSchema
.
play
=
async
()
=>
{
const
parsed
=
parseSchemaFromBackend
(
twitterSchema
as
SchemaFromBackend
);
Mockstore
.
dispatch
(
setSchema
(
parsed
.
export
()));
const
dispatch
=
Mockstore
.
dispatch
;
const
schema
=
SchemaUtils
.
ParseSchemaFromBackend
({
nodes
:
[
{
name
:
'
Thijs
'
,
attributes
:
[],
},
{
name
:
'
Airport
'
,
attributes
:
[
{
name
:
'
city
'
,
type
:
'
string
'
},
{
name
:
'
vip
'
,
type
:
'
bool
'
},
{
name
:
'
state
'
,
type
:
'
string
'
},
],
},
{
name
:
'
Airport2
'
,
attributes
:
[
{
name
:
'
city
'
,
type
:
'
string
'
},
{
name
:
'
vip
'
,
type
:
'
bool
'
},
{
name
:
'
state
'
,
type
:
'
string
'
},
],
},
{
name
:
'
Plane
'
,
attributes
:
[
{
name
:
'
type
'
,
type
:
'
string
'
},
{
name
:
'
maxFuelCapacity
'
,
type
:
'
int
'
},
],
},
{
name
:
'
Staff
'
,
attributes
:
[]
},
],
edges
:
[
{
name
:
'
Airport2:Airport
'
,
from
:
'
Airport2
'
,
to
:
'
Airport
'
,
collection
:
'
flights
'
,
attributes
:
[
{
name
:
'
arrivalTime
'
,
type
:
'
int
'
},
{
name
:
'
departureTime
'
,
type
:
'
int
'
},
],
},
{
name
:
'
Airport:Staff
'
,
from
:
'
Airport
'
,
to
:
'
Staff
'
,
collection
:
'
flights
'
,
attributes
:
[{
name
:
'
salary
'
,
type
:
'
int
'
}],
},
{
name
:
'
Plane:Airport
'
,
from
:
'
Plane
'
,
to
:
'
Airport
'
,
collection
:
'
flights
'
,
attributes
:
[],
},
{
name
:
'
Airport:Thijs
'
,
from
:
'
Airport
'
,
to
:
'
Thijs
'
,
collection
:
'
flights
'
,
attributes
:
[{
name
:
'
hallo
'
,
type
:
'
string
'
}],
},
{
name
:
'
Thijs:Airport
'
,
from
:
'
Thijs
'
,
to
:
'
Airport
'
,
collection
:
'
flights
'
,
attributes
:
[{
name
:
'
hallo
'
,
type
:
'
string
'
}],
},
{
name
:
'
Staff:Plane
'
,
from
:
'
Staff
'
,
to
:
'
Plane
'
,
collection
:
'
flights
'
,
attributes
:
[{
name
:
'
hallo
'
,
type
:
'
string
'
}],
},
{
name
:
'
Staff:Airport2
'
,
from
:
'
Staff
'
,
to
:
'
Airport2
'
,
collection
:
'
flights
'
,
attributes
:
[{
name
:
'
hallo
'
,
type
:
'
string
'
}],
},
{
name
:
'
Airport2:Plane
'
,
from
:
'
Airport2
'
,
to
:
'
Plane
'
,
collection
:
'
flights
'
,
attributes
:
[{
name
:
'
hallo
'
,
type
:
'
string
'
}],
},
{
name
:
'
Airport:Airport
'
,
from
:
'
Airport
'
,
to
:
'
Airport
'
,
collection
:
'
flights
'
,
attributes
:
[{
name
:
'
test
'
,
type
:
'
string
'
}],
},
],
});
console
.
info
(
'
dispatch dummy schema
'
,
schema
.
order
);
dispatch
(
setSchema
(
schema
.
export
()));
// handleSchemaLayout(schema);
};
This diff is collapsed.
Click to expand it.
apps/web-graphpolaris/src/components/schema/schema.tsx
+
12
−
8
View file @
11bb0ba4
import
{
createReactFlowElements
}
from
'
@graphpolaris/schema/schema-usecases
'
;
import
{
AllLayoutAlgorithms
,
LayoutFactory
}
from
'
@graphpolaris/graph-layout
'
;
import
{
createReactFlowElements
}
from
'
@graphpolaris/schema/usecases
'
;
import
{
useSchema
,
useSchemaLayout
,
}
from
'
@graphpolaris/shared/data-access/store
'
;
import
{
AllLayoutAlgorithms
,
LayoutFactory
,
}
from
'
@graphpolaris/shared/graph-layout
'
;
import
{
Attributes
}
from
'
graphology-types
'
;
import
{
MultiGraph
}
from
'
graphology
'
;
// import { AllLayoutAlgorithms, LayoutFactory } from '@graphpolaris/graph-layout';
import
{
useEffect
,
useState
}
from
'
react
'
;
import
ReactFlow
,
{
Node
,
...
...
@@ -32,9 +30,15 @@ const Schema = (props: Props) => {
const
schemaLayout
=
useSchemaLayout
();
useEffect
(()
=>
{
const
layoutFactory
=
new
LayoutFactory
();
console
.
log
(
'
dbSchema
'
,
dbschema
,
dbschema
.
order
);
},
[
dbschema
]);
// console.log('schema Layout', schemaLayout);
useEffect
(()
=>
{
if
(
dbschema
==
undefined
||
dbschema
.
order
==
0
)
{
return
;
}
const
layoutFactory
=
new
LayoutFactory
();
console
.
log
(
'
schema Layout
'
,
schemaLayout
,
'
order
'
,
dbschema
.
order
);
const
layout
=
layoutFactory
.
createLayout
(
// schemaLayout as AllLayoutAlgorithms
'
Graphology_noverlap
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment