You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Write a proper "concept" pages for graph model, data provider,
event system, command history and workspace context;
* Add "concept" pages for the design system and i18n;
* Provide info on styling in the "component" doc pages;
* Add example for getting a `CanvasApi` instance;
* Add example for opening the `ConnectionsMenu``;
* Add example for the `InstancesSearch``;
* Add example for the `Navigator``;
* Add example for custom search section for `UnifiedSearch`;
* Separate `Rdf` playground into `RDF Explorer` and `Graph Authoring`;
* Fix styles for layout panels;
* Change docs status sign from alpha to beta;
* Update `ExampleMetadata` for the next version;
* Use "reactodia.github.io" to fetch example graph (org ontology);
* Use source map loader to include resolve Reactodia source in the debugger;
* Update dependency to @reactodia/[email protected].
Copy file name to clipboardexpand all lines: docs/components/canvas.md
+57-8
Original file line number
Diff line number
Diff line change
@@ -2,31 +2,63 @@
2
2
title: Canvas
3
3
---
4
4
5
-
# Canvas Components
5
+
# Canvas and widgets
6
6
7
7
[Canvas](/docs/api/workspace/functions/Canvas) is a main component to display a scrollable canvas for the diagram with [elements](/docs/concepts/graph-model.md), [links](/docs/concepts/graph-model.md) and additional widgets.
8
8
9
-
## Hooks
9
+
## Getting the canvas instance
10
10
11
-
[useCanvas()](/docs/api/workspace/functions/useCanvas) hook called from a canvas widget, [SharedCanvasState.findAnyCanvas()](/docs/api/workspace/classes/SharedCanvasState.md#findanycanvas) or [SharedCanvasState.findAllCanvases()](/docs/api/workspace/classes/SharedCanvasState.md#findallcanvases) methods can be used to get the [CanvasApi](/docs/api/workspace/interfaces/CanvasApi) instance to read or subscribe to the canvas state or perform viewport-related effects.
11
+
[useCanvas()](/docs/api/workspace/functions/useCanvas) hook called from a canvas widget can be used to get the [CanvasApi](/docs/api/workspace/interfaces/CanvasApi) instance from a context to read or subscribe to the canvas state or perform viewport-related effects:
12
+
13
+
```ts
14
+
function MyWidget() {
15
+
const {canvas} =Reactodia.useCanvas();
16
+
// Use canvas here
17
+
}
18
+
```
19
+
20
+
Alternatively, with [SharedCanvasState.findAnyCanvas()](/docs/api/workspace/classes/SharedCanvasState.md#findanycanvas) or [SharedCanvasState.findAllCanvases()](/docs/api/workspace/classes/SharedCanvasState.md#findallcanvases) methods it is possible to get canvas instance outside the canvas component:
21
+
22
+
```ts
23
+
function NonWidgetComponent {
24
+
const {view} =React.useWorkspace();
25
+
26
+
const canvas =view.findAnyCanvas();
27
+
if (canvas) {
28
+
// Use canvas here (could be any if there are several of them)
29
+
}
30
+
31
+
for (const canvas ofview.findAllCanvases()) {
32
+
// Use each canvas mounted in the workspace
33
+
}
34
+
}
35
+
```
12
36
13
37
## Canvas widgets
14
38
15
-
To define a custom canvas widget, the target React component should be marked by [defineCanvasWidget()](/docs/api/workspace/functions/defineCanvasWidget) function to define its attachment layer.
39
+
Canvas widget is an instance of any React component type which is marked by [defineCanvasWidget()](/docs/api/workspace/functions/defineCanvasWidget) function with metadata such as its attachment layer i.e. where the component should be displayed in relation to other canvas content.
40
+
41
+
There are multiple canvas layers to place widgets on, from top one to the bottom:
42
+
43
+
| Layer name |[Coordinate type](/docs/concepts/canvas-coordinates.md)| Description |
Copy file name to clipboardexpand all lines: docs/components/class-tree.md
+12-5
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,12 @@ Element type graph is loaded from [data provider](/docs/concepts/data-provider.m
7
7
In [graph authoring](/docs/concepts/graph-authoring.md) mode, the class tree can be used to create entity elements that are instances of the displayed types.
8
8
9
9
:::tip
10
-
11
10
The same functionality is also available as `SearchSectionElementTypes`[unified search section](/docs/components/unified-search.md).
[ConnectionsMenu](/docs/api/workspace/functions/ConnectionsMenu) component is a [canvas widget](/docs/components/canvas.md) to explore and navigate the graph by adding connected entities to the diagram.
Copy file name to clipboardexpand all lines: docs/components/dialog.md
+12
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ title: Dialog
6
6
7
7
It is possible to show a dialog either attached to target [element](/docs/concepts/graph-model.md), [link](/docs/concepts/graph-model.md) or as a modal over the canvas viewport itself.
8
8
9
+
## Showing a dialog
10
+
9
11
The following methods and properties from [OverlayController](/docs/api/workspace/classes/OverlayController) (accessible from [workspace context](/docs/concepts/workspace-context.md)) provide means to interact with the dialogs:
10
12
11
13
| Method or property | Description |
@@ -53,3 +55,13 @@ function Example() {
53
55
);
54
56
}
55
57
```
58
+
59
+
## Styles
60
+
61
+
The component look can be customized using the following CSS properties (see [design system](/docs/concepts/design-system.mdx) for more information):
62
+
63
+
| Property | Description |
64
+
|----------|-------------|
65
+
|`--reactodia-dialog-border-color`| Border color for the dialog (uses the base border color if not set). |
66
+
|`--reactodia-dialog-border-radius`| Border radius for the dialog (uses the base border radius if not set). |
67
+
|`--reactodia-dialog-border-width`| Border width for the dialog (uses the base border width if not set). |
[DropOnCanvas](/docs/api/workspace/functions/DropOnCanvas) component is a [canvas widget](/docs/components/canvas.md) to allow creating entity elements on the diagram by dragging then dropping a URL (IRI) to the canvas.
3
+
[DropOnCanvas](/docs/api/workspace/functions/DropOnCanvas) component is a [canvas widget](/docs/components/canvas.md) to allow creating entity elements on the diagram by dragging then dropping a [URL (IRI)](/docs/concepts/data-provider.md#iri-and-rdf) to the canvas.
Copy file name to clipboardexpand all lines: docs/components/instances-search.md
+40-2
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,45 @@
3
3
[InstancesSearch](/docs/api/workspace/functions/InstancesSearch.md) is a component to search for entities by various filter criteria using [data provider lookup](/docs/concepts/data-provider.md) and add them as elements to the diagram.
4
4
5
5
:::tip
6
-
7
6
The same functionality is also available as `SearchSectionEntities`[unified search section](/docs/components/unified-search.md).
Copy file name to clipboardexpand all lines: docs/components/link-types-toolbox.md
-2
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,5 @@
3
3
[LinkTypesToolbox](/docs/api/workspace/functions/LinkTypesToolbox.md) is a component to display incoming and outgoing [link types](/docs/api/workspace/type-aliases/LinkTypeIri.md) from selected elements, toggle their visibility and initiate the [lookup](/docs/components/instances-search.md) for connected entities.
4
4
5
5
:::tip
6
-
7
6
The same functionality is also available as `SearchSectionLinkTypes`[unified search section](/docs/components/unified-search.md).
[Navigator](/docs/api/workspace/functions/Navigator) component is a [canvas widget](/docs/components/canvas.md) to display a minimap of the diagram contents.
The component look can be customized using the following CSS properties (see [design system](/docs/concepts/design-system.mdx) for more information):
52
+
53
+
| Property | Description |
54
+
|----------|-------------|
55
+
|`--reactodia-navigator-background-fill`| Background color on the minimap outside the scrollable pane area. |
56
+
|`--reactodia-navigator-scrollable-pane-fill`| Background color on the minimap for the scrollable pane area. |
57
+
|`--reactodia-navigator-viewport-fill`| Background color on the minimap for the viewport area. |
58
+
|`--reactodia-navigator-viewport-stroke-color`| Stroke color for the viewport area border. |
59
+
|`--reactodia-navigator-viewport-stroke-width`| Stroke width for the viewport area border. |
60
+
|`--reactodia-navigator-viewport-stroke-dash`| Stroke dash for the viewport area border. |
61
+
|`--reactodia-navigator-overflow-stroke-color`| Stroke color for the viewport area overflow border (displayed when the viewport is cutoff at the minimap border). |
62
+
|`--reactodia-navigator-overflow-stroke-width`| Stroke width for the viewport area overflow border (displayed when the viewport is cutoff at the minimap border). |
63
+
|`--reactodia-navigator-overflow-stroke-dash`| Stroke dash for the viewport area overflow border (displayed when the viewport is cutoff at the minimap border). |
|[LinkActionMoveEndpoint](/docs/api/workspace/functions/LinkActionMoveEndpoint.md)| Displays a handle which allows to [change the relation](/docs/concepts/graph-authoring.md) by moving its endpoint (source or target) to another entity. |
38
38
|[LinkActionRename](/docs/api/workspace/functions/LinkActionRename.md)| Starts [renaming a link](/docs/api/workspace/interfaces/RenameLinkProvider.md) (change the label on the diagram only). |
39
+
40
+
## Styles
41
+
42
+
The component look can be customized using the following CSS properties (see [design system](/docs/concepts/design-system.mdx) for more information):
43
+
44
+
| Property | Description |
45
+
|----------|-------------|
46
+
|`--reactodia-selection-icon-filter`|[CSS filter](https://developer.mozilla.org/en-US/docs/Web/CSS/filter) for the element selection action icons. |
47
+
|`--reactodia-selection-multiple-box-shadow`| Box shadow for the selection rectangle with multiple elements. |
48
+
|`--reactodia-selection-single-box-shadow`| Box shadow for the selection rectangle with a single element. |
Copy file name to clipboardexpand all lines: docs/components/toolbar.md
+10
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
[Toolbar](/docs/api/workspace/functions/Toolbar) component is a [canvas widget](/docs/components/canvas.md) to display a simple toolbar with a an optional dropdown menu.
4
4
5
+
## Toolbar actions
6
+
5
7
There are several built-in toolbar actions that can be displayed as menu items or quick action buttons:
6
8
| Action component | Description |
7
9
|------------------|-------------|
@@ -14,3 +16,11 @@ There are several built-in toolbar actions that can be displayed as menu items o
14
16
|[ToolbarActionRedo](/docs/api/workspace/functions/ToolbarActionRedo.md)| Performs a [redo](/docs/api/workspace/interfaces/CommandHistory.md#redo) for a command from the [command history](/docs/concepts/command-history.md). |
15
17
|[ToolbarActionLayout](/docs/api/workspace/functions/ToolbarActionLayout.md)| Performs the default [graph layout algorithm](/docs/concepts/layout-workers.md) on the diagram content. |
16
18
|[ToolbarLanguageSelector](/docs/api/workspace/functions/ToolbarLanguageSelector.md)| Displays a [data language](/docs/api/workspace/classes/DiagramModel.md#language) selector for the workspace. |
19
+
20
+
## Styles
21
+
22
+
The component look can be customized using the following CSS properties (see [design system](/docs/concepts/design-system.mdx) for more information):
23
+
24
+
| Property | Description |
25
+
|----------|-------------|
26
+
|`--reactodia-toolbar-height`| Default height for the toolbar and the menu toggle. |
0 commit comments