-
Notifications
You must be signed in to change notification settings - Fork 0
Deploying the OER Geomatics visualizations
The OER Geomatics project involves the creation of React-Three-Fiber visualizations to support selected chapters in the UBC Geomatics Textbook. Here is some information to assist with building and deploying these visualizations alongside the textbook.
The OER Geomatics project visualizations are located in the docs/viz
folder in the UBC Geomatics Textbook repository. There are two relevant folders for each visualization:
- The folder with the visualization name (e.g.
docs/viz/geodesy
) contains the visualization's source code. - The folder that ends with
-viz
(e.g.docs/viz/geodesy-viz
) contains the generated build. The contents of this folder can be re-generated by following the build and deployment steps.
The source code directory of each visualization (e.g. docs/viz/geodesy
) is structured as follows:
-
docs/viz/geodesy/
-
build
: Automatically created by theyarn build
ornpm run build
command. This folder is not tracked by version control. The contents of thebuild
folder comprise the final build. -
node_modules
: Holds the dependencies of the project. It is automatically created when you run the commandyarn install
ornpm install
. This folder is not tracked by version control. -
public
: Contains the public objects and assets, such as images andindex.html
, used in the visualization. -
src
: Contains the JavaScript source code of the visualization.
-
The OER Geomatics project source code was originally developed in the OER Geomatics repository, a private repository within the EML organization. The correspondence between the repositories' structure is as follows:
-
docs/viz/emspectrum
=>src/emspectrum
: Source code for EM Spectrum visualization. -
docs/viz/geodesy
=>src/geodesy
: Source code for Geodesy visualization. -
docs/viz/lidar
=>src/lidar
: Source code for LiDAR visualization.
Each visualization is served from its own folder inside docs/viz
.
-
In the terminal, navigate to the root directory of the visualization you wish to build (e.g.
docs/viz/geodesy
) -
Open
package.json
and verify that thehomepage
variable matches the intended destination after deployment. For example, for the geodesy visualization, it may look like:https://ubc-geomatics-textbook.github.io/geomatics-textbook/viz/geodesy-viz
-
Run the command
yarn build
(ornpm run build
) and wait for it to complete. This builds the visualization and places the build files in thebuild
folder. Here is what the output should look like:
- Copy the contents of the
build
folder generated above intodocs/viz/[VIZ NAME]-viz
in the UBC Geomatics Textbook repository. For example, for the geodesy visualization, copy the contents of thebuild
folder intodocs/viz/geodesy-viz
. Here is what the folder should now look like:
-
Commit and push the changes to
docs/viz/[VIZ NAME]-viz
. -
Once the changes are merged into the main branch, they should appear on GitHub Pages. Verify the deployment by accessing the visualization at the url in the
homepage
variable (e.g. https://ubc-geomatics-textbook.github.io/geomatics-textbook/viz/geodesy-viz/).
/ In progress – subject to change! /
EM Spectrum visualization (src/emspectrum
)
- Lines 31 and 40,
src/App.js/
: Links back to the textbook chapter the emspectrum visualization is associated with.
Geodesy visualization (src/geodesy/
)
- Line 28,
src/App.js/
: Has a link back to the textbook chapter the geodesy visualization is associated with.