From 3afdb19f85865019ca22abb1f70e33b089c9dcea Mon Sep 17 00:00:00 2001 From: Dario Del Piano Date: Sun, 6 Nov 2022 01:51:13 +0000 Subject: [PATCH] #9 adding installation script for the example application, use yalc for the example --- example/index.tsx | 11 +- example/installation.sh | 15 + example/package.json | 7 +- example/yarn.lock | 688 ++++++++++++++++++++++++++++++++-------- 4 files changed, 578 insertions(+), 143 deletions(-) create mode 100755 example/installation.sh diff --git a/example/index.tsx b/example/index.tsx index 6a6ab0f..85318fb 100644 --- a/example/index.tsx +++ b/example/index.tsx @@ -1,7 +1,7 @@ import 'react-app-polyfill/ie11'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import MetaDiagram, { MetaNode, Position, ComponentsMap, MetaLink, MetaPort, PortTypes } from './..'; +import MetaDiagram, { MetaNode, Position, ComponentsMap, MetaLink, MetaPort, PortTypes } from '@metacell/meta-diagram'; // import {makeStyles} from "@material-ui/core"; import CustomLinkWidget from './components/widgets/CustomLinkWidget'; import BG from './components/assets/svg/bg-dotted.svg'; @@ -34,6 +34,7 @@ const App = () => { 'node-red', null, [new MetaPort('in', 'in', PortTypes.INPUT_PORT, undefined, undefined), new MetaPort('out', 'out', PortTypes.OUTPUT_PORT, undefined, undefined)], + [], new Map(Object.entries({ color: 'rgb(0,255,0)' })) ); @@ -45,6 +46,7 @@ const App = () => { 'node-blue', grandparent, [new MetaPort('in', 'in', PortTypes.INPUT_PORT, undefined, undefined), new MetaPort('out', 'out', PortTypes.OUTPUT_PORT, undefined, undefined)], + [], new Map(Object.entries({ color: 'rgb(255,0,0)' })) ); @@ -56,6 +58,7 @@ const App = () => { 'node-red', parent, [new MetaPort('in', 'in', PortTypes.INPUT_PORT, undefined, undefined), new MetaPort('out', 'out', PortTypes.OUTPUT_PORT, undefined, undefined)], + [], new Map(Object.entries({ color: 'rgb(0,192,255)' })) ); @@ -67,6 +70,7 @@ const App = () => { 'node-blue', parent, [new MetaPort('in', 'in', PortTypes.INPUT_PORT, undefined, undefined), new MetaPort('out', 'out', PortTypes.OUTPUT_PORT, undefined, undefined)], + [], new Map(Object.entries({ color: 'rgb(255,255,0)' })) ); @@ -87,12 +91,15 @@ const App = () => { new Map(Object.entries({ default: CustomLinkWidget })) ); + const nodes = [node1, node2, parent, grandparent]; + const metaNodes = nodes.map((item:MetaNode) => item.toModel()); + return (