diff --git a/demos/demo13/index.tsx b/demos/demo-cloning/index.tsx similarity index 100% rename from demos/demo13/index.tsx rename to demos/demo-cloning/index.tsx diff --git a/demos/demo12/index.tsx b/demos/demo-custom-link1/index.tsx similarity index 100% rename from demos/demo12/index.tsx rename to demos/demo-custom-link1/index.tsx diff --git a/demos/demo3/DiamondInstanceFactories.ts b/demos/demo-custom-node1/DiamondInstanceFactories.ts similarity index 100% rename from demos/demo3/DiamondInstanceFactories.ts rename to demos/demo-custom-node1/DiamondInstanceFactories.ts diff --git a/demos/demo3/DiamondNodeModel.ts b/demos/demo-custom-node1/DiamondNodeModel.ts similarity index 100% rename from demos/demo3/DiamondNodeModel.ts rename to demos/demo-custom-node1/DiamondNodeModel.ts diff --git a/demos/demo3/DiamondNodeWidget.tsx b/demos/demo-custom-node1/DiamondNodeWidget.tsx similarity index 100% rename from demos/demo3/DiamondNodeWidget.tsx rename to demos/demo-custom-node1/DiamondNodeWidget.tsx diff --git a/demos/demo3/DiamondPortModel.ts b/demos/demo-custom-node1/DiamondPortModel.ts similarity index 100% rename from demos/demo3/DiamondPortModel.ts rename to demos/demo-custom-node1/DiamondPortModel.ts diff --git a/demos/demo3/DiamondWidgetFactory.ts b/demos/demo-custom-node1/DiamondWidgetFactory.ts similarity index 100% rename from demos/demo3/DiamondWidgetFactory.ts rename to demos/demo-custom-node1/DiamondWidgetFactory.ts diff --git a/demos/demo3/index.tsx b/demos/demo-custom-node1/index.tsx similarity index 100% rename from demos/demo3/index.tsx rename to demos/demo-custom-node1/index.tsx diff --git a/demos/demo5/Application.ts b/demos/demo-drag-and-drop/Application.ts similarity index 100% rename from demos/demo5/Application.ts rename to demos/demo-drag-and-drop/Application.ts diff --git a/demos/demo5/components/BodyWidget.tsx b/demos/demo-drag-and-drop/components/BodyWidget.tsx similarity index 100% rename from demos/demo5/components/BodyWidget.tsx rename to demos/demo-drag-and-drop/components/BodyWidget.tsx diff --git a/demos/demo5/components/TrayItemWidget.tsx b/demos/demo-drag-and-drop/components/TrayItemWidget.tsx similarity index 100% rename from demos/demo5/components/TrayItemWidget.tsx rename to demos/demo-drag-and-drop/components/TrayItemWidget.tsx diff --git a/demos/demo5/components/TrayWidget.tsx b/demos/demo-drag-and-drop/components/TrayWidget.tsx similarity index 100% rename from demos/demo5/components/TrayWidget.tsx rename to demos/demo-drag-and-drop/components/TrayWidget.tsx diff --git a/demos/demo5/index.tsx b/demos/demo-drag-and-drop/index.tsx similarity index 100% rename from demos/demo5/index.tsx rename to demos/demo-drag-and-drop/index.tsx diff --git a/demos/demo5/sass/main.scss b/demos/demo-drag-and-drop/sass/main.scss similarity index 100% rename from demos/demo5/sass/main.scss rename to demos/demo-drag-and-drop/sass/main.scss diff --git a/demos/demo7/index.tsx b/demos/demo-grid/index.tsx similarity index 100% rename from demos/demo7/index.tsx rename to demos/demo-grid/index.tsx diff --git a/demos/demo8/index.tsx b/demos/demo-limit-points/index.tsx similarity index 100% rename from demos/demo8/index.tsx rename to demos/demo-limit-points/index.tsx diff --git a/demos/demo9/index.tsx b/demos/demo-listeners/index.tsx similarity index 100% rename from demos/demo9/index.tsx rename to demos/demo-listeners/index.tsx diff --git a/demos/demo4/index.tsx b/demos/demo-locks/index.tsx similarity index 100% rename from demos/demo4/index.tsx rename to demos/demo-locks/index.tsx diff --git a/demos/demo10/index.tsx b/demos/demo-mutate-graph/index.tsx similarity index 100% rename from demos/demo10/index.tsx rename to demos/demo-mutate-graph/index.tsx diff --git a/demos/demo2/index.tsx b/demos/demo-performance/index.tsx similarity index 100% rename from demos/demo2/index.tsx rename to demos/demo-performance/index.tsx diff --git a/demos/demo6/index.tsx b/demos/demo-serializing/index.tsx similarity index 100% rename from demos/demo6/index.tsx rename to demos/demo-serializing/index.tsx diff --git a/demos/demo1/index.tsx b/demos/demo-simple/index.tsx similarity index 100% rename from demos/demo1/index.tsx rename to demos/demo-simple/index.tsx diff --git a/demos/demo11/index.tsx b/demos/demo-zoom-to-fit/index.tsx similarity index 100% rename from demos/demo11/index.tsx rename to demos/demo-zoom-to-fit/index.tsx diff --git a/demos/demo1/index.d.ts b/demos/demo1/index.d.ts deleted file mode 100644 index a784f63..0000000 --- a/demos/demo1/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -export default function render(): JSX.Element; diff --git a/demos/index.tsx b/demos/index.tsx index e01c58c..7d78fa3 100644 --- a/demos/index.tsx +++ b/demos/index.tsx @@ -3,20 +3,21 @@ import { storiesOf } from "@storybook/react"; import { action } from "@storybook/addon-actions"; import { Toolkit } from "../src/Toolkit"; -import demo1 from "./demo1/index"; -import demo2 from "./demo2/index"; -import demo3 from "./demo3/index"; -import demo4 from "./demo4/index"; -import demo5 from "./demo5/index"; -import demo6 from "./demo6/index"; -import demo7 from "./demo7/index"; -import demo8 from "./demo8/index"; -import demo9 from "./demo9/index"; -import demo10 from "./demo10/index"; -import demo11 from "./demo11/index"; -import demo12 from "./demo12/index"; -import demo13 from "./demo13/index"; -import demoDagre from "./demo-dagre/index"; +import demo_simple from "./demo-simple/index"; +import demo_performance from "./demo-performance/index"; +import demo_custom_node1 from "./demo-custom-node1/index"; +import demo_locks from "./demo-locks/index"; +import demo_drag_and_drop from "./demo-drag-and-drop/index"; +import demo_serializing from "./demo-serializing/index"; +import demo_grid from "./demo-grid/index"; +import demo_limit_points from "./demo-limit-points/index"; +import demo_listeners from "./demo-listeners/index"; +import demo_mutate_graph from "./demo-mutate-graph/index"; +import demo_zoom_to_fit from "./demo-zoom-to-fit/index"; +import demo_custom_link1 from "./demo-custom-link1/index"; +import demo_cloning from "./demo-cloning/index"; +import demo_dagre from "./demo-dagre/index"; + import { Helper } from "./Helper"; require("./test.scss"); @@ -24,49 +25,55 @@ require("./test.scss"); // make tests deterministic Toolkit.TESTING_MODE = true; -storiesOf("React Diagrams", module) - .add("Simple Example", () => { - return demo1(); +storiesOf("Simple Usage", module) + .add("Simple example", () => { + return demo_simple(); }) - .add("Performance Test", () => { - return demo2(); + .add("Performance demo", () => { + return demo_performance(); }) - .add("Custom Diamond Widget", () => { - return demo3(); + .add("Locked widget", () => { + return demo_locks(); }) - .add("Locked Widget", () => { - return demo4(); - }) - .add("Embedded diagram", () => { - return demo5(); - }) - .add("Serializing and Deserializing", () => { - return demo6(); - }) - .add("Grid Size", () => { - return demo7(); - }) - .add("Auto distribute", () => { - return demoDagre(); + .add("Grid size", () => { + return demo_grid(); }) .add("Limiting number of points", () => { - return demo8(); + return demo_limit_points(); }) - .add("Events", () => { - return demo9(); - }) - .add("Programatically move nodes", () => { - return demo10(); + .add("Events and listeners", () => { + return demo_listeners(); }) .add("Zoom to fit", () => { - return demo11(); - }) - .add("Link types", () => { - return demo12(); + return demo_zoom_to_fit(); }) + +storiesOf("Advanced Techniques", module) .add("Clone selected", () => { - return demo13(); - }); + return demo_cloning(); + }) + .add("Serializing and deserializing", () => { + return demo_serializing(); + }) + .add("Programatically modify graph", () => { + return demo_mutate_graph(); + }) + .add("Large application example", () => { + return demo_drag_and_drop(); + }) + +storiesOf("Custom Models", module) + .add("Custom diamond node", () => { + return demo_custom_node1(); + }) + .add("Custom links", () => { + return demo_custom_link1(); + }) + +storiesOf("3rd party libraries", module) + .add("Auto distribute - Dagre", () => { + return demo_dagre(); + }) // enable this to log mouse location when writing new puppeteer tests //Helper.logMousePosition() diff --git a/package.json b/package.json index cb69e60..4ae4fd7 100644 --- a/package.json +++ b/package.json @@ -41,9 +41,9 @@ "@storybook/storybook-deployer": "^2.2.0", "@types/jest": "^22.0.0", "@types/lodash": "^4.14.91", - "@types/node": "^8.5.2", + "@types/node": "^8.5.5", "@types/puppeteer": "^0.13.9", - "@types/react": "^16.0.31", + "@types/react": "^16.0.34", "awesome-typescript-loader": "^3.4.1", "css-loader": "^0.28.7", "dagre": "^0.8.1", diff --git a/yarn.lock b/yarn.lock index 5080e8e..2595d5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -233,10 +233,14 @@ version "4.14.91" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.91.tgz#794611b28056d16b5436059c6d800b39d573cd3a" -"@types/node@*", "@types/node@^8.5.2": +"@types/node@*": version "8.5.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.2.tgz#83b8103fa9a2c2e83d78f701a9aa7c9539739aa5" +"@types/node@^8.5.5": + version "8.5.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.5.tgz#6f9e8164ae1a55a9beb1d2571cfb7acf9d720c61" + "@types/puppeteer@^0.13.9": version "0.13.9" resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-0.13.9.tgz#2448ebddb91e5336bb2f771d76401c70b43a7fe6" @@ -244,10 +248,14 @@ "@types/events" "*" "@types/node" "*" -"@types/react@^16.0.18", "@types/react@^16.0.20", "@types/react@^16.0.31": +"@types/react@^16.0.18", "@types/react@^16.0.20": version "16.0.31" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.31.tgz#5285da62f3ac62b797f6d0729a1d6181f3180c3e" +"@types/react@^16.0.34": + version "16.0.34" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.34.tgz#7a8f795afd8a404a9c4af9539b24c75d3996914e" + abab@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e"