Caution
- This implementation has been suspended in favour of the network graph prototype
Important
- This experiment was developed on the instruction of HDRUK's Disease Atlas team, a project being built alongside the BHF Data Science Centre and NHS Digital
This repository implements a 3d data explorer to allow users to navigate through each of the diseases defined within the Disease Atlas.
This application was developed with:
| Type | Details |
|---|---|
| Tech Stack | SolidJS & Three.JS |
| Languages | TypeScript & GLSL |
| Tooling | Vite |
Caution
Please note that you will need the Atlas dataset to use this app:
- This app requires the pre-processed
explorer-data.jsonfile to display datapoints - See
.processing/create_data.Rto process & produce thejsondata output file
-
Install git
- Instructions on installing
gitfor different platforms can be found here
- Instructions on installing
-
Download the Javascript runtime
-
Open a terminal and navigate to a directory in which you'd like to install the app, e.g.
cd /some/path/to/folder -
Enter the following into your terminal to clone the repository:
$ git clone https://github.com/JackScanlon/atlas-explorer.git-
Open a terminal and navigate to the project directory, e.g.
cd /path/to/atlas-explorer -
Install the application dependencies first by running the following:
$ npm install- To host the app locally enter the following:
$ npm run dev- The application will now be accessible at http://localhost:8000
- The following command builds/bundles the app for production into the
distfolder:
$ npm run build- Enter the following to preview the
prodbuild, and then visit http://localhost:4173
$ npm run previewNote
- The following describes the changes & decisions made to the implementation across meeting(s)
-
Implement base site
-
Implement base renderer & scene
-
Parse R data
- Column processing
- Add:
[ORGAN],[CATEGORY],[SEX]etc
- Add:
- Output targets
- Json: jsonify as
explorer-data.json - Zip: create encrypted archive
- Json: jsonify as
- Column processing
-
Parse the JSON data
- Create clusters of points from categories; need to fake the rotation on cat
- X / Y is age / prev etc
-
Add three UI/UX buttons
Button Functionality Search Search available phenotypes, retarget scene to object Camera Reset Reset camera to scene origin Theme Switch Toggle Light / Dark themes for accessibility -
Add in ability to interact with objects
- project 3d->2d
- hover tooltip render
- object click to info panel
-
Impl. search functionality
- Allow search by name, show list of results
- Selection should zoom + open new panel
-
Camera tween on focus
- Click world object to zoom (zoom btn also on the panel in case they move away) - need to tween cam towards object
-
Impl. axes
- Implement basic axes with intention to update later
-
Finalise design
- Impl. version component
- Impl. hover effect for button(s)?
Tip
- Implementation was discussed & reviewed on 11th November 2024
- It was agreed that changes would be implemented by 19th November 2024; follow-up meeting at 11am on the same date
-
Attempt to render SMR prev / Mortality measure(s)
- Determine whether incl. in current dataset; if not, send Harry an e-mail
- Await access to data after discussing with Harry
-
Change branding
- Remove current branding & apply "Atlas Explorer" title
- Create new temporary logo in Inkscape
-
UX changes
- Improve camera tween interp & easing
- Improve input handling
-
Render step improvements
- Update tooltip position when tweening if pointer isn't moved
-
Update Tooltip / Version / Search CSS
- No selection
- No pointer clickthrough on elements above canvas
- Ensure context menu & wheel scrolling functions in select / card components
- Thin scrollbar & theme on searchbar
-
Apply animation to presentation card on display
-
Tween improvements
- Allow cancellation
- Camera focus tween dependent on distance travelled
-
Use Hovercard-like interface instead of Tooltip
- Fix Z-fighting of elements
- Improve style reactivity
- Display subset of card information on hover
- Mini/Maximisable
-
Dataset loading changes
-
Implement spreading
- Revisit data loader
- Impl. spreading across angle interval
-
Compute domain & intervals:
- Intervals for
Age - Log10 intervals for
Frequency
- Intervals for
-
-
Implement new axes
-
Base axes
- Compute interval
- Render radial axes in reference to
Agefield, i.e. 2d circle (line) geometry for each interval - Render vertical axes in reference to
Frequencyfield, i.e. 2d line geometry
-
Interaction
- Use
closestPointOnRayinstead ofclosestPointOnCircle- better UX flow on linear axis than radial - Track axes intersection to display
(x, y)at coordinate along the line on both horizontal & vertical plane(s)
- Use
-
-
Implement header:
-
Await resources for search
-
Filter controls
- Dropdown component design & responsivity
- Impl. UI to toggle visibility by Speciality
- Update shaders to incl. an alpha channel for those toggled
- Add button to user controls to allow each axes to be toggle individually
-
-
Update presentation card:
- Improve card responsivity & layout
- URL to disease atlas website using slug
- Add virtualised lists that displays related Phecodes e.g. related organ target
-
Start-up animation
- Tween scene transform on start-up
- Welcome banner
-
Mobile UX
-
Touch input(s)
-
ShortPressevent to open node menu on touch devices -
LongPressevent to replaceHoverbehaviour on touch devices
-
-
User-controls changes...
- DollyPan / Rotate fixes on touch device
- Fix viewport issues on iOS
- Add option to toggle visibility of axis label(s)
-
-
Iterate point frag shader
- Improve scaling
- Selection border color
Tip
- Demonstration on the 19th November with a follow-up meeting planned for early December
-
Text content changes
Current Text Replacement Text 'Phecode' 'Disease' 'Age' 'Median age at first record' 'Standardised Mortality Ratio' 'Excess Mortality at one year' 'Visit Disease Atlas' 'View features in Atlas for Health' 'View related Phecodes' 'View related diseases by Organ' -
Card changes
-
Reorder Speciality/Organ/Category at top of card
-
Unminimise when clicking filter button in minimised state
-
Changes to relationship rendering:
- Alphabetical sort relationships
- Hide current Phecode in relationship panel
-
-
Make relationship filter more obvious by adding feature popover?
-
Interaction improvements
- Fix pointer events on app header
- No user selection & events on tooltip
-
Add mortality measure to tooltip hover
-
Outline on object when focusing / some other way to highlight it
-
Add axes labels, e.g.
(A: 0, F: 0)etc
-
gl_pointsmax size varies across implementations, e.g. reference @ here- Reimplement points to use instanced plane geometry instead of
gl_points - Initial raycasting for instanced geometry
- Reimplement points to use instanced plane geometry instead of
-
Use interleaved
offset&scalebuffer to improve data access on instanced geometry -
Frustum culling of instanced geometry
[!NOTE]
- BVH frustum culling is likely over kill and would require a dynamic buffer; instead we'll implement a basic sphere intersection test
- Compute world-space bounding box & sphere
- Implement basic bounding sphere frustum culling
-
Reimplement size attenuation to emulate
gl_pointsbehaviour- Implement attenuation in vertex shader
- Implement attenuation in
InstancedPointsclass
-
Project cleanup
- Cleanup const. usage across project
- Cleanup documentation
-
Initial work for scatter
- Data extraction
- Rework explorer & assoc. instances
-
Impl. scatter plot view
- Tween points between views via vertex shader
- Improve data access
-
Impl. base scatter axes via frag; drawing grid on backface of box
-
Impl. spring on tween banner; current impl. isn't very smooth & we can easily reduce a dependency here
-
Add labels to scatter axes
- Paint crosshair target on selection
- Scaled axes labels on X/Y/Z
- Select edges of box on the near plane of camera for each axis
-
Consider reimplmenting points:
- Mac devices clamps
GL_POINTsize much more than other platforms so points look many times smaller; attenuation is much more pronounced when the viewport is close to the subject - see reference @ here - Will probably need to render the points to a quad before applying the shader
- Mac devices clamps
-
Consider object partitioning, e.g. bounding volume hierarchy, for non-naive instanced point raycasting in
InstancedPoints -
Possible additions during future development
- Impl. post-process outline for selected objects?
- Depth of Field for nodes instead of fog? Or maybe just custom fog / blur built into shaders? Unsure
-
Node graph, attempt was made to allow user(s) to view connections by organ / some other categorical data (similar to force directed graph)
-
Issue:
- Examined the feasibility of using organ targets & other categorical tags to build a connectivity graph;
- Unfortunately there are far too many connections and they're mostly clustered within their own speciality
-
Future:
- Need to discuss with HDRUK - there may be other data points not yet available to me that we could use for weights in a FDG
- Based on my examination, I think it would be better to either (a) display this as an FDG using weights generated from shared symptomatology and/or SNOMED codes; or (b) display the data in a 3D scatter plot +/- some clustering visualisation (e.g. convex hull etc)
-