Skip to content

Commit

Permalink
Merge pull request #3 from clarkmcc/qol-improvements
Browse files Browse the repository at this point in the history
Quality-of-life improvements
  • Loading branch information
clarkmcc authored Jan 13, 2024
2 parents a385214 + 8bcd746 commit 215308a
Show file tree
Hide file tree
Showing 18 changed files with 121 additions and 100 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
dist
.babelrc
.storybook
.gitignore
.prettierrc
rollup.config.mjs
tsconfig.json
src
lib
68 changes: 25 additions & 43 deletions lib/NodeGraphEditor.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ const simpleConfig: IGraphConfig = {
inputs: [
{
name: 'Value',
identifier: 'value',
id: 'value',
valueType: 'string',
},
],
outputs: [
{
name: 'Value',
identifier: 'value',
id: 'value',
valueType: 'string',
},
],
Expand Down Expand Up @@ -80,9 +80,6 @@ export const Simple: Story = {
sourceHandle: 'value',
target: '2',
targetHandle: 'value',
data: {
targetHandleType: 'string',
},
},
],
config: simpleConfig,
Expand Down Expand Up @@ -154,34 +151,34 @@ export const InputFields: Story = {
inputs: [
{
name: 'Value',
identifier: 'value',
id: 'value',
valueType: 'string',
},
{
name: 'Constant',
identifier: 'constant',
id: 'constant',
valueType: 'string',
isConstant: true,
},
{
name: 'Array',
identifier: 'array',
id: 'array',
valueType: 'string',
isArray: true,
},
{
name: 'Options',
identifier: 'options',
id: 'options',
valueType: 'httpMethod',
},
{
name: 'Button Group',
identifier: 'buttonGroup',
id: 'buttonGroup',
valueType: 'httpProtocol',
},
{
name: 'Checkbox',
identifier: 'checkbox',
id: 'checkbox',
valueType: 'boolean',
},
],
Expand Down Expand Up @@ -230,29 +227,20 @@ export const SelectedEdgeHighlighting: Story = {
sourceHandle: 'vector',
target: '2',
targetHandle: 'position',
data: {
targetHandleType: 'vector',
},
},
{
id: 'e2',
source: '2',
sourceHandle: 'geometry',
target: '3',
targetHandle: 'geometry',
data: {
targetHandleType: 'geometry',
},
},
{
id: 'e3',
source: '2',
sourceHandle: 'geometry',
target: '4',
targetHandle: 'geometry',
data: {
targetHandleType: 'geometry',
},
},
],
config: {
Expand Down Expand Up @@ -287,24 +275,24 @@ export const SelectedEdgeHighlighting: Story = {
inputs: [
{
name: 'X',
identifier: 'x',
id: 'x',
valueType: 'number',
},
{
name: 'Y',
identifier: 'y',
id: 'y',
valueType: 'number',
},
{
name: 'Z',
identifier: 'z',
id: 'z',
valueType: 'number',
},
],
outputs: [
{
name: 'Vector',
identifier: 'vector',
id: 'vector',
valueType: 'vector',
},
],
Expand All @@ -315,24 +303,24 @@ export const SelectedEdgeHighlighting: Story = {
inputs: [
{
name: 'Count',
identifier: 'count',
id: 'count',
valueType: 'number',
},
{
name: 'Radius',
identifier: 'radius',
id: 'radius',
valueType: 'number',
},
{
name: 'Position',
identifier: 'position',
id: 'position',
valueType: 'vector',
},
],
outputs: [
{
name: 'Geometry',
identifier: 'geometry',
id: 'geometry',
valueType: 'geometry',
},
],
Expand All @@ -343,7 +331,7 @@ export const SelectedEdgeHighlighting: Story = {
inputs: [
{
name: 'Geometry',
identifier: 'geometry',
id: 'geometry',
valueType: 'geometry',
},
],
Expand Down Expand Up @@ -385,19 +373,13 @@ export const ArrayInputs: Story = {
sourceHandle: 'vector',
target: '3',
targetHandle: 'vectors',
data: {
targetHandleType: 'vector',
},
},
{
id: 'e2',
source: '2',
sourceHandle: 'vector',
target: '3',
targetHandle: 'vectors',
data: {
targetHandleType: 'vector',
},
},
],
config: {
Expand Down Expand Up @@ -432,24 +414,24 @@ export const ArrayInputs: Story = {
inputs: [
{
name: 'X',
identifier: 'x',
id: 'x',
valueType: 'number',
},
{
name: 'Y',
identifier: 'y',
id: 'y',
valueType: 'number',
},
{
name: 'Z',
identifier: 'z',
id: 'z',
valueType: 'number',
},
],
outputs: [
{
name: 'Vector',
identifier: 'vector',
id: 'vector',
valueType: 'vector',
},
],
Expand All @@ -460,7 +442,7 @@ export const ArrayInputs: Story = {
inputs: [
{
name: 'Vectors',
identifier: 'vectors',
id: 'vectors',
valueType: 'vector',
isArray: true,
},
Expand Down Expand Up @@ -520,17 +502,17 @@ export const HandleSymbols: Story = {
outputs: [
{
name: 'Circle',
identifier: 'circle',
id: 'circle',
valueType: 'circle',
},
{
name: 'Diamond',
identifier: 'diamond',
id: 'diamond',
valueType: 'diamond',
},
{
name: 'Diamond Dot',
identifier: 'diamondDot',
id: 'diamondDot',
valueType: 'diamondDot',
},
],
Expand Down
10 changes: 5 additions & 5 deletions lib/NodeGraphEditorCustomInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const meta = {
}}
>
{Handle && <Handle />}
<NodeInputField {...config} name="X" identifier="x" />
<NodeInputField {...config} name="Y" identifier="y" />
<NodeInputField {...config} name="Z" identifier="z" />
<NodeInputField {...config} name="X" id="x" />
<NodeInputField {...config} name="Y" id="y" />
<NodeInputField {...config} name="Z" id="z" />
</div>
)
}
Expand All @@ -49,14 +49,14 @@ const meta = {
inputs: [
{
name: 'Value',
identifier: 'value',
id: 'value',
valueType: 'vector',
},
],
outputs: [
{
name: 'Value',
identifier: 'value',
id: 'value',
valueType: 'vector',
},
],
Expand Down
4 changes: 2 additions & 2 deletions lib/NodeGraphEditorCustomNode.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const meta = {
onBlur={onBlur}
/>
<Handle
identifier="value"
id="value"
position={Position.Right}
handleType="source"
shape="circle"
Expand Down Expand Up @@ -65,7 +65,7 @@ const meta = {
'custom',
CustomNode,
[],
[{ name: 'Value', identifier: 'value', valueType: 'string' }],
[{ name: 'Value', id: 'value', valueType: 'string' }],
)
return config.validate()
}, [])
Expand Down
10 changes: 2 additions & 8 deletions lib/NodeGraphEditorLayout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,47 +85,41 @@ export const DagreLayout: Story = {
target: '2',
sourceHandle: 'value',
targetHandle: 'value',
data: { targetHandleType: 'string' },
},
{
id: '2',
source: '1',
target: '3',
sourceHandle: 'value',
targetHandle: 'value',
data: { targetHandleType: 'string' },
},
{
id: '3',
source: '2',
target: '4',
sourceHandle: 'value',
targetHandle: 'value',
data: { targetHandleType: 'string' },
},
{
id: '4',
source: '3',
target: '4',
sourceHandle: 'value',
targetHandle: 'value',
data: { targetHandleType: 'string' },
},
{
id: '5',
source: '4',
target: '5',
sourceHandle: 'value',
targetHandle: 'value',
data: { targetHandleType: 'string' },
},
{
id: '6',
source: '4',
target: '6',
sourceHandle: 'value',
targetHandle: 'value',
data: { targetHandleType: 'string' },
},
],
config: {
Expand All @@ -150,14 +144,14 @@ export const DagreLayout: Story = {
inputs: [
{
name: 'Value',
identifier: 'value',
id: 'value',
valueType: 'string',
},
],
outputs: [
{
name: 'Value',
identifier: 'value',
id: 'value',
valueType: 'string',
},
],
Expand Down
Loading

0 comments on commit 215308a

Please sign in to comment.