Skip to content

Commit 2dcc5d9

Browse files
committed
Built actual app code in docs folder
1 parent 05f3629 commit 2dcc5d9

28 files changed

+665422
-0
lines changed

docs/hello-world/main.js

Lines changed: 58123 additions & 0 deletions
Large diffs are not rendered by default.

docs/hello-world/remoteEntry.js

Lines changed: 656 additions & 0 deletions
Large diffs are not rendered by default.

docs/hello-world/src_HelloApp_tsx.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"use strict";
2+
(self["webpackChunkhello_cy_web"] = self["webpackChunkhello_cy_web"] || []).push([["src_HelloApp_tsx"],{
3+
4+
/***/ "./src/HelloApp.tsx":
5+
/*!**************************!*\
6+
!*** ./src/HelloApp.tsx ***!
7+
\**************************/
8+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9+
10+
__webpack_require__.r(__webpack_exports__);
11+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12+
/* harmony export */ HelloApp: () => (/* binding */ HelloApp)
13+
/* harmony export */ });
14+
/* harmony import */ var _cytoscape_web_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cytoscape-web/types */ "../node_modules/@cytoscape-web/types/dist/index.js");
15+
/* harmony import */ var _cytoscape_web_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_cytoscape_web_types__WEBPACK_IMPORTED_MODULE_0__);
16+
17+
const HelloApp = {
18+
id: 'hello',
19+
name: 'Hello Cy World App',
20+
description: 'Hello-world example app for Cytoscape Web',
21+
components: [
22+
{
23+
id: 'MenuExample',
24+
type: _cytoscape_web_types__WEBPACK_IMPORTED_MODULE_0__.ComponentType.Menu,
25+
},
26+
{
27+
id: 'HelloPanel',
28+
type: _cytoscape_web_types__WEBPACK_IMPORTED_MODULE_0__.ComponentType.Panel,
29+
},
30+
],
31+
};
32+
33+
34+
/***/ })
35+
36+
}]);
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"use strict";
2+
(self["webpackChunkhello_cy_web"] = self["webpackChunkhello_cy_web"] || []).push([["src_components_HelloPanel_tsx"],{
3+
4+
/***/ "./src/components/HelloPanel.tsx":
5+
/*!***************************************!*\
6+
!*** ./src/components/HelloPanel.tsx ***!
7+
\***************************************/
8+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9+
10+
__webpack_require__.r(__webpack_exports__);
11+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13+
/* harmony export */ });
14+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
15+
/* harmony import */ var cyweb_WorkspaceStore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! cyweb/WorkspaceStore */ "webpack/container/remote/cyweb/WorkspaceStore");
16+
/* harmony import */ var cyweb_WorkspaceStore__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(cyweb_WorkspaceStore__WEBPACK_IMPORTED_MODULE_1__);
17+
/* harmony import */ var _mui_material__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @mui/material */ "webpack/sharing/consume/default/@mui/material/@mui/material");
18+
/* harmony import */ var _mui_material__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_mui_material__WEBPACK_IMPORTED_MODULE_2__);
19+
20+
// Dynamic import from the host app
21+
22+
23+
const HelloPanel = ({ message }) => {
24+
const workspace = (0,cyweb_WorkspaceStore__WEBPACK_IMPORTED_MODULE_1__.useWorkspaceStore)((state) => state.workspace);
25+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_2__.Box, { sx: {
26+
width: '100%',
27+
height: '100%',
28+
display: 'flex',
29+
flexDirection: 'column',
30+
justifyContent: 'center',
31+
alignItems: 'center',
32+
padding: '1em',
33+
}, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_2__.Typography, { variant: "h5", children: ["Hello, Cytoscape (from external app!) ", message] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mui_material__WEBPACK_IMPORTED_MODULE_2__.Typography, { variant: "subtitle1", children: ["Current Network ID: ", workspace.currentNetworkId] })] }));
34+
};
35+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HelloPanel);
36+
37+
38+
/***/ })
39+
40+
}]);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"use strict";
2+
(self["webpackChunkhello_cy_web"] = self["webpackChunkhello_cy_web"] || []).push([["src_components_MenuExample_tsx"],{
3+
4+
/***/ "./src/components/MenuExample.tsx":
5+
/*!****************************************!*\
6+
!*** ./src/components/MenuExample.tsx ***!
7+
\****************************************/
8+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9+
10+
__webpack_require__.r(__webpack_exports__);
11+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13+
/* harmony export */ });
14+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
15+
/* harmony import */ var _mui_material__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @mui/material */ "webpack/sharing/consume/default/@mui/material/@mui/material");
16+
/* harmony import */ var _mui_material__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_mui_material__WEBPACK_IMPORTED_MODULE_1__);
17+
/* harmony import */ var cyweb_CreateNetwork__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! cyweb/CreateNetwork */ "webpack/container/remote/cyweb/CreateNetwork");
18+
/* harmony import */ var cyweb_CreateNetwork__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(cyweb_CreateNetwork__WEBPACK_IMPORTED_MODULE_2__);
19+
20+
21+
22+
const MenuExample = ({ handleClose }) => {
23+
// Get the function to create a network with a view
24+
const createNetworkWithView = (0,cyweb_CreateNetwork__WEBPACK_IMPORTED_MODULE_2__.useCreateNetworkWithView)();
25+
const handleClick = () => {
26+
const newNetwork = createNetworkWithView({
27+
name: 'Empty Network1',
28+
});
29+
console.log('Empty network created', newNetwork);
30+
const network = newNetwork.network;
31+
alert(`An empty network created: ${network.id}`);
32+
handleClose && handleClose();
33+
};
34+
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material__WEBPACK_IMPORTED_MODULE_1__.MenuItem, { onClick: handleClick, children: "Create an empty network" });
35+
};
36+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MenuExample);
37+
38+
39+
/***/ })
40+
41+
}]);

0 commit comments

Comments
 (0)