FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: display documentation with some stories by tbouffard · Pull Request #816 · maxGraph/maxGraph · GitHub

forked from jgraph/mxgraph
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) .mdx  (8) .ts  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 5 additions & 1 deletion packages/html/.storybook/main.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ limitations under the License.

import type { StorybookConfig } from '@storybook/html-vite';
const config: StorybookConfig = {
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
stories: [
'../stories/**/Introduction.mdx',
'../stories/**/*.stories.@(js|jsx|ts|tsx)',
'../stories/**/*.mdx',
],
core: {
disableTelemetry: true,
},
Expand Down
8 changes: 8 additions & 0 deletions packages/html/stories/Anchors.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Meta } from '@storybook/blocks';
import * as story from './Anchors.stories';

<Meta of={story} />

# Anchors

This example demonstrates defining fixed connection points for all shapes.
8 changes: 8 additions & 0 deletions packages/html/stories/Animation.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Meta } from '@storybook/blocks';
import * as story from './Animation.stories';

<Meta of={story} />

# Animation

This example demonstrates using SVG animations on edges to visualize the flow in a pipe.
8 changes: 8 additions & 0 deletions packages/html/stories/AutoLayout.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Meta } from '@storybook/blocks';
import * as story from './AutoLayout.stories';

<Meta of={story} />

# AutoLayout

This example demonstrates running and animating a layout algorithm after every change to a graph.
11 changes: 11 additions & 0 deletions packages/html/stories/Boundary.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { ArgTypes, Canvas, Controls, Meta, Story } from '@storybook/blocks';
import * as story from './Boundary.stories';

<Meta of={story} />

# Boundary

This example demonstrates implementing boundary events in BPMN diagrams.

<Canvas/>
<Controls />
4 changes: 0 additions & 4 deletions packages/html/stories/Introduction.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { Meta } from '@storybook/blocks';

<Meta title="Home/Introduction" />

<style>
{`
.tip {
Expand Down
40 changes: 40 additions & 0 deletions packages/html/stories/Wires.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Meta } from '@storybook/blocks';
import * as story from './Wires.stories';

<Meta of={story} />

# Wires

## Edge-to-edge connections

We store the point where the mouse was released in the terminal points of the edge geometry
and use that point to find the nearest segment on the target edge
and the connection point between the two edges in `GraphView.updateFixedTerminalPoint`.


## Orthogonal router

The orthogonal router, which is implemented as an edge style,
computes its result based on the output of `GraphView.updateFixedTerminalPoint`,
which computes all connection points for edge-to-edge connections
and constrained ports and vertices and stores them in state.absolutePoints.


## Routing directions

Routing directions are stored in the 'portConstraint' style.
Possible values for this style are "horizontal" and "vertical".
Note that this may have other values depending on the edge style.

For edge-to-edge connections, a 'source-/targetConstraint' style is added in `GraphView.updateFixedTerminalPoint` that contains the
orientation of the segment that the edge connects to.
Possible values are "horizontal" and "vertical".


## Alternative solution for connection points

An alternative solution for connection points via connection constraints is demonstrated.
In this setup, the edge is connected to the parent cell directly.
There are no child cells that act as "ports".
Instead, the connection information is stored as a relative point in the connecting edge.
See also the `PortRefs` story for storing references to ports.
35 changes: 0 additions & 35 deletions packages/html/stories/Wires.stories.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

/*
====================
README
====================

- Edge-to-edge connections: We store the point where the mouse
was released in the terminal points of the edge geometry and
use that point to find the nearest segment on the target edge
and the connection point between the two edges in
mxGraphView.updateFixedTerminalPoint.

- The orthogonal router, which is implemented as an edge style,
computes its result based on the output of mxGraphView.
updateFixedTerminalPoint, which computes all connection points
for edge-to-edge connections and constrained ports and vertices
and stores them in state.absolutePoints.

- Routing directions are stored in the 'portConstraint' style.
Possible values for this style horizontal and vertical. Note
that this may have other values depending on the edge style.

- For edge-to-edge connections, a 'source-/targetConstraint'
style is added in updateFixedTerminalPoint that contains the
orientation of the segment that the edge connects to. Possible
values are horizontal, vertical.

- An alternative solution for connection points via connection
constraints is demonstrated. In this setup, the edge is connected
to the parent cell directly. There are no child cells that act
as "ports". Instead, the connection information is stored as a
relative point in the connecting edge. (See also: portrefs.html
for storing references to ports.)

*/

import {
domUtils,
styleUtils,
Expand Down
8 changes: 8 additions & 0 deletions packages/html/stories/Wrapping.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Meta } from '@storybook/blocks';
import * as story from './Wrapping.stories';

<Meta of={story} />

# Wrapping

This example demonstrates using HTML markup and word-wrapping in vertex and edge labels.
10 changes: 10 additions & 0 deletions packages/html/stories/ZoomAndFit.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Meta } from '@storybook/blocks';
import * as story from './ZoomAndFit.stories';

<Meta of={story} />

# Zoom and Fit

This example demonstrates how to use:
- zoom in and zoom out
- fit center, horizontal, and vertical

Back | FazBrowse Home | New Git URL