Examples below use the lineage application but can be use for any existing Phovea application
There are two ways to set up an existing Phovea App
The first approach (creating a workspace) is particularly useful when developing multiple plugins, as all the projects within the workspace will share a common npm installation and Docker setup.
This approach creates a ''workspace'' which uses Docker and Docker Compose. The workspace setup also creates a PyCharm project.
mkdir workspace
cd workspace
git clone https://github.com/Caleydo/lineage.git
(and/or) clone any other repos that you will need).yo phovea:workspace
npm install
npm run start:lineage
http://localhost:8080/
Your directory structure (for one or more projects) will look like this:
workspace --> has the helper/docker files but is not attached to any repo
\- repo1 --> cloned from github
\- repo2 --> cloned from github
If you have several repos in your workspace, you can run:
to update all the repos in your workspace.
$ git clone https://github.com/Caleydo/lineage.git
$ cd lineage
$ npm install
$ npm run build
The build process is optional because it is not required in order to run the application (e.g. during testing/development).
The build process itself includes:
npm run start
Unlike npm run build
, npm run start
will just build the application in memory without any tests or code quality checks
Phovea ignores *.js files on commit. since TypeScript is a superset of javascript it's safe to rename *.js to *.ts files. The only thing you have to take care about is the import and export, since each file is a separate module/file.
The need for import and export is because with TypeScript (and ES6 in general) you cannot use the global scope and every file has his own scope. You need to declare what variables and functions should be exported/imported. Follow the links to learn more about export and import.
Now that you have successfully (hopefully) cloned and examined an existing application, you are ready to build your own application!