8000 learn restructuring by omesome · Pull Request #886 · xyflow/web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

learn restructuring #886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"printWidth": 90
"printWidth": 90,
"proseWrap": "always"
}
2 changes: 1 addition & 1 deletion apps/example-apps/react/learn/background/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Flow() {

return (
<ReactFlow defaultNodes={defaultNodes} defaultEdges={defaultEdges} fitView>
<Background color="#ccc" variant={variant} />
<Background color="skyblue" variant={variant} />
<Panel>
<div>variant:</div>
<button => setVariant('dots')}>dots</button>
Expand Down
4 changes: 1 addition & 3 deletions apps/example-apps/react/learn/basic-terms/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,11 @@ function ViewportWithAnnotation() {

return (
<>
<NodeWrapper bottom={100} left={0} width={420}>
<NodeWrapper bottom={0} left={90} width={420}>
<AnnotationNode
data={{
label:
'The viewport is defined by x, y and zoom, which is the transform & scale applied to the flow.',
arrowStyle:
'left: 0; bottom: 0; transform: translate(-25px, -15px) rotate(70deg) scale(1, 1);',
}}
/>
</NodeWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React Flow Example</title>
<style>
html,
body {
margin: 0;
font-family: sans-serif;
}

#app {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="app"></div>
<script type="module" src="./index.jsx"></script>
</body>
</html>

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { createRoot } from 'react-dom/client';
import App from './App';

import './index.css';

const container = document.querySelector('#app');
const root = createRoot(container);

root.render(<App />);
root.render(<App />);
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { ReactFlow, Controls, Background } from '@xyflow/react';
import '@xyflow/react/dist/style.css';

const nodes = [
const initialNodes = [
{
id: '1',
data: { label: 'Hello' },
id: 'n1',
data: { label: 'Node 1' },
position: { x: 0, y: 0 },
type: 'input',
},
{
id: '2',
data: { label: 'World' },
id: 'n2',
data: { label: 'Node 2' },
position: { x: 100, y: 100 },
},
];

function Flow() {
return (
<div style={{ height: '100%' }}>
<ReactFlow nodes={nodes}>
<ReactFlow nodes={initialNodes} fitView>
<Background />
<Controls />
</ReactFlow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React Flow Example</title>
<style>
html,
body {
margin: 0;
font-family: sans-serif;
}

#app {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="app"></div>
<script type="module" src="./index.jsx"></script>
</body>
</html>

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { createRoot } from 'react-dom/client';
import App from './App';

import './index.css';

const container = document.querySelector('#app');
const root = createRoot(container);

root.render(<App />);
root.render(<App />);
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import { ReactFlow, Controls, Background } from '@xyflow/react';
import '@xyflow/react/dist/style.css';

const edges = [{ id: '1-2', source: '1', target: '2' }];

const nodes = [
const initialNodes = [
{
id: '1',
data: { label: 'Hello' },
id: 'n1',
data: { label: 'Node 1' },
position: { x: 0, y: 0 },
type: 'input',
},
{
id: '2',
data: { label: 'World' },
id: 'n2',
data: { label: 'Node 2' },
position: { x: 100, y: 100 },
},
];
const initialEdges = [{ id: 'n1-n2', source: 'n1', target: 'n2' }];

function Flow() {
return (
<div style={{ height: '100%' }}>
<ReactFlow nodes={nodes} edges={edges}>
<ReactFlow nodes={initialNodes} edges={initialEdges} fitView>
<Background />
<Controls />
</ReactFlow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React Flow Example</title>
<style>
html,
body {
margin: 0;
font-family: sans-serif;
}

#app {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="app"></div>
<script type="module" src="./index.jsx"></script>
</body>
</html>

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { createRoot } from 'react-dom/client';
import App from './App';

import './index.css';

const container = document.querySelector('#app');
const root = createRoot(container);

root.render(<App />);
root.render(<App />);
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
import { ReactFlow, Controls, Background } from '@xyflow/react';
import '@xyflow/react/dist/style.css';

const edges = [
{ id: '1-2', source: '1', target: '2', label: 'to the', type: 'step' },
];

const nodes = [
const initialNodes = [
{
id: '1',
data: { label: 'Hello' },
id: 'n1',
data: { label: 'Node 1' },
position: { x: 0, y: 0 },
type: 'input',
},
{
id: '2',
data: { label: 'World' },
id: 'n2',
data: { label: 'Node 2' },
position: { x: 100, y: 100 },
},
];
const initialEdges = [
{ id: 'n1-n2', source: 'n1', target: 'n2', label: 'connects with', type: 'step' },
];

function Flow() {
return (
<div style={{ height: '100%' }}>
<ReactFlow nodes={nodes} edges={edges}>
<ReactFlow nodes={initialNodes} edges={initialEdges} fitView>
<Background />
<Controls />
</ReactFlow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React Flow Example</title>
<style>
html,
body {
margin: 0;
font-family: sans-serif;
}

#app {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="app"></div>
<script type="module" src="./index.jsx"></script>
</body>
</html>

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { createRoot } from 'react-dom/client';
import App from './App';

import './index.css';

const container = document.querySelector('#app');
const root = createRoot(container);

root.render(<App />);
root.render(<App />);
11 changes: 0 additions & 11 deletions apps/example-apps/react/learn/getting-started-1/index.css

This file was deleted.

23 changes: 0 additions & 23 deletions apps/example-apps/react/learn/getting-started-2/App.jsx

This file was deleted.

11 changes: 0 additions & 11 deletions apps/example-apps/react/learn/getting-started-2/index.css

This file was deleted.

Binary file not shown.
11 changes: 0 additions & 11 deletions apps/example-apps/react/learn/getting-started-3/index.css

This file was deleted.

11 changes: 0 additions & 11 deletions apps/example-apps/react/learn/getting-started-4/index.css
Load diff

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions apps/example-apps/react/learn/getting-started-5/index.css

This file was deleted.

13 changes: 0 additions & 13 deletions apps/example-apps/react/learn/getting-started-5/index.html

This file was deleted.

9 changes: 0 additions & 9 deletions apps/example-apps/react/learn/getting-started-5/index.jsx

This file was deleted.

Loading
0