Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Map-Based Query Mode for Working with Spatial Data #103

Draft
wants to merge 81 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
838f94f
Add GIS component for map-querying + align icons in Query dropdown co…
murermader Nov 29, 2024
e21bdb9
Fixed typo in class name
murermader Nov 29, 2024
5754874
Show empty leaflet map correctly inside results view
murermader Nov 29, 2024
26c980d
Add classes from prototype + fix layout for map and layers + dynamic …
murermader Nov 29, 2024
d0261b7
Add code back in to render circles and paths on map
murermader Nov 30, 2024
a2ff5ef
Change padding to margin to fix layout problem
murermader Nov 30, 2024
5351461
Add websocket + ability to run query to layer settings + heuristic fo…
murermader Dec 2, 2024
f8bf8aa
Add parsing for relational model for CombinedResult
murermader Dec 2, 2024
ba35c95
layersettings.service.ts TsLint
murermader Dec 2, 2024
7052834
Add parsing for graph model for CombinedResult
murermader Dec 2, 2024
54c78e7
Add navigation from results to map query mode + fix show/hide layer
murermader Dec 3, 2024
a0f03e3
Add log statements to debug why layer settings do not show layers
murermader Dec 3, 2024
48949f3
try to get queries to work
murermader Dec 3, 2024
631e028
Add leaflet-draw + npm packages for typescript types (d3, leaflet)
murermader Dec 3, 2024
a1ac558
disable other leaflet-draw options, 1 is enough
murermader Dec 3, 2024
1b184ad
Extract app-query-editor and app-submit-query-button out of app-console
murermader Dec 6, 2024
3e0fb81
Add GIS components to ViewsModule and remove standalone:true
murermader Dec 6, 2024
8dfce4f
Add noLimit to UiRequest
murermader Dec 7, 2024
09f45a3
Add "Add Layer From Query"
murermader Dec 7, 2024
daf3bec
Fix submitQuery() in console
murermader Dec 8, 2024
98a4e5e
map-layers cleanup + layer name from query
murermader Dec 8, 2024
1a6e9b6
Map-based query: Fix lifecycle issues (unsubscribe from service, run …
murermader Dec 8, 2024
5dabcbd
Detect GEOMETRY columns from relational CombinedResult
murermader Dec 9, 2024
b7e697b
GIS: Add button for each layer to zoom the map to fit the layer + aut…
murermader Dec 9, 2024
e52d9df
Add Data section to each MapLayer card, instead of popover
murermader Dec 9, 2024
a9e0766
Add filter button that starts drawing mode (WIP)
murermader Dec 10, 2024
e30c7ef
Reset everything in LayerSettingsService once we navigate away from t…
murermader Dec 10, 2024
c0458da
Use Object (Record) instead of Map
murermader Dec 10, 2024
73f7cc3
Use layer-id instead of layer-name + layer-index for hiding / removin…
murermader Dec 10, 2024
86da72f
MapLayer.addData(): Remove everything where geometry is null
murermader Dec 10, 2024
76531af
Filter Section + Export Button
murermader Dec 11, 2024
dcc2231
Add button to rerender query layers + update layer change detection
murermader Dec 11, 2024
4efdc81
Add edit query button
murermader Dec 11, 2024
62b2d90
set host to node URL
murermader Dec 11, 2024
be8f01a
Merge branch 'algebra-exploration' into gis
murermader Dec 13, 2024
927160e
Update dependencies
murermader Dec 13, 2024
2b8bece
GIS: Close the linear ring of the polygon after creation by appending…
murermader Dec 14, 2024
f63d3fe
GIS: Set analyze to true, so that we can access the plan for applying…
murermader Dec 14, 2024
7f54449
GIS: Print GeoJSON polygon when added
murermader Dec 14, 2024
1d05b49
GIS: Add code for plan handling for each layer (WIP)
murermader Dec 14, 2024
8669829
map-layers.component.ts TsLint
murermader Dec 15, 2024
edd4a3f
MapLayer.model.ts TsLint
murermader Dec 15, 2024
01e1370
map-layers.component.ts: Load Logical Query Plan as JSON and attach t…
murermader Dec 15, 2024
3cf77bf
FilterConfig.ts TsLint
murermader Dec 15, 2024
863eb3e
querying/gis TsLint
murermader Dec 15, 2024
d73b05b
GIS: Add @terraformer/wkt to convert between GeoJSON and wkt format
murermader Dec 15, 2024
4697f95
GIS: Integrate app-alg-viewer into map-layers: convert query to plan …
murermader Dec 15, 2024
9a3d9c4
GIS: Add geometryField to layer, to know which field to use in filter
murermader Dec 15, 2024
0a729cd
GIS: Unify rendering method + implement square render function + fix …
murermader Dec 16, 2024
214a6ad
Update PointShapeConfig to render Triangle, Star or Square
murermader Dec 16, 2024
a80973a
GIS: Fix rendering of square shape
murermader Dec 16, 2024
b69a57a
GIS: Add cross shape
murermader Dec 17, 2024
fbccc83
GIS: Only allow one query (rerun layer / filter layer) at a time
murermader Dec 17, 2024
f5e5e1a
GIS: Apply filter geometry to layer now works per layer + updates ins…
murermader Dec 17, 2024
6aff571
GIS: Add note that filter is not stored inside query
murermader Dec 17, 2024
e06fd08
GIS: Map now empty after second query is run where no geometric data …
murermader Dec 17, 2024
a512064
GIS: Disable enable/disable functions for polygon tool, user must cli…
murermader Dec 17, 2024
7b1a0a6
GIS: Extract distance and add comment
murermader Dec 18, 2024
3b98ee7
GIS: Correctly parse relational column with type double
murermader Dec 18, 2024
49a5585
GIS: Refactor Add Drawing Mode
murermader Dec 18, 2024
7661ae3
GIS: Edit Layer + Remove layer now rerender immediately
murermader Dec 19, 2024
bbe61b4
Update PolyPlan
murermader Dec 21, 2024
c5b1ff2
GIS: Use ChangeDetectionStrategy.OnPush for map
murermader Dec 21, 2024
0e7fa08
GIS: Install leaflet.fullscreen + add fullscreen button to map
murermader Dec 23, 2024
49f8304
GIS: Fullscreen over sidebar + hide button on map in fullscreen
murermader Dec 23, 2024
d8bf82a
Rework data-view button visibility for CARD, GRAPH and MAP
murermader Dec 23, 2024
3e85293
GIS: Add Scale Linear and Sequential as options
murermader Dec 23, 2024
bbe8ccb
GIS: Make DBIS the center of the map
murermader Dec 23, 2024
f331a66
GIS: Apply DOC_PROJECT correctly if query is not MQL
murermader Dec 27, 2024
73169bf
GIS: Remove coordinates from preview data
murermader Dec 27, 2024
7dec258
GIS: Correctly convert BIGINT to number when parsing query results
murermader Dec 27, 2024
bfd2a7b
GIS: Update shape position when adjusting map position with magnifier…
murermader Dec 27, 2024
7c57c6b
GIS: Only close Edit Query dialog after query results are in
murermader Dec 30, 2024
54c1153
GIS: Data Preview now correctly updates after query is rerun
murermader Jan 2, 2025
6fb45c9
GIS: Remove DOC_PROJECT from poly plan, so fields other than the geom…
murermader Jan 2, 2025
9dd1cbd
GIS: Do not add empty layer, show warning toast instead
murermader Jan 2, 2025
c5af74d
GIS: Parse PolyMap as JSON recursively + Detect geometry in object re…
murermader Jan 2, 2025
b67d146
Comment out "Label" section, because the feature is not yet supported.
murermader Jan 6, 2025
b5d02a9
GIS: invalidate leaflet map to fix issue where tile map and map are n…
murermader Feb 11, 2025
71bdcd1
Merge branch 'master' into gis
murermader Feb 12, 2025
ef76fe6
GIS: Update data-graph component to not throw ts compile errors
murermader Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
"node_modules/plyr/dist/plyr.css",
"node_modules/@ali-hm/angular-tree-component/css/angular-tree-component.css",
"node_modules/katex/dist/katex.min.css",
"node_modules/prismjs/themes/prism-okaidia.css"
"node_modules/prismjs/themes/prism-okaidia.css",
"src/app/components/data-view/data-map/leaflet.css",
"node_modules/leaflet-draw/dist/leaflet.draw.css",
"node_modules/leaflet.fullscreen/Control.FullScreen.css"
],
"stylePreprocessorOptions": {
"includePaths": [
Expand Down
3,031 changes: 2,954 additions & 77 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 27 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve -o",
"start2": "ng serve --no-live-reload -o",
"build": "ng build --configuration production --aot --optimization --progress --extract-licenses",
"test": "ng test",
"lint": "ng lint",
Expand All @@ -30,6 +31,9 @@
"@coreui/icons-angular": "^4.7.14",
"@coreui/utils": "2.0.2",
"@ngtools/webpack": "^17.2.2",
"@terraformer/wkt": "^2.2.1",
"@turf/turf": "^7.1.0",
"@types/leaflet.fullscreen": "^3.0.2",
"ace-builds": "^1.31.1",
"ajv": "^8.12.0",
"angular-ng-autocomplete": "^2.0.12",
Expand All @@ -42,13 +46,17 @@
"flag-icons": "^6.10.0",
"flatpickr": "^4.6.3",
"font-awesome": "^4.7.0",
"geojson": "^0.5.0",
"graphlib-dot": "^0.6.4",
"hammer": "0.0.5",
"hammerjs": "^2.0.8",
"highlight.js": "^11.8.0",
"jquery": "3.7.1",
"jquery-ui": "^1.13.0",
"katex": "^0.16.0",
"katex": "0.16.10",
"leaflet": "^1.9.4",
"leaflet-draw": "^1.0.4",
"leaflet.fullscreen": "^3.0.2",
"lodash": "^4.17.20",
"marked": "^9.1.6",
"moment": "^2.30.1",
Expand All @@ -59,6 +67,16 @@
"ngx-markdown": "^17.1.1",
"ngx-plyr": "^4.0.1",
"prismjs": "1.29.0",
"rete": "^2.0.5",
"rete-angular-plugin": "^2.2.1",
"rete-area-plugin": "^2.1.3",
"rete-auto-arrange-plugin": "^2.0.2",
"rete-connection-path-plugin": "^2.0.4",
"rete-connection-plugin": "^2.0.5",
"rete-context-menu-plugin": "^2.0.4",
"rete-engine": "^2.0.2",
"rete-readonly-plugin": "^2.0.2",
"rete-render-utils": "^2.0.3",
"rxjs": "^7.8.1",
"rxjs-compat": "^6.5.5",
"sass": "^1.26.3",
Expand All @@ -67,17 +85,7 @@
"ts-helpers": "^1.1.2",
"ts-md5": "^1.2.7",
"uuid": "^9.0.0",
"zone.js": "~0.14.4",
"rete": "^2.0.3",
"rete-angular-plugin": "^2.1.1",
"rete-connection-plugin": "^2.0.1",
"rete-auto-arrange-plugin": "^2.0.1",
"rete-area-plugin": "^2.0.4",
"rete-render-utils": "^2.0.2",
"rete-readonly-plugin": "^2.0.1",
"rete-connection-path-plugin": "^2.0.3",
"rete-context-menu-plugin": "^2.0.3",
"rete-engine": "^2.0.1"
"zone.js": "~0.14.4"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^17.0.1",
Expand All @@ -86,11 +94,17 @@
"@angular/compiler-cli": "^17.2.3",
"@angular/language-service": "^17.2.3",
"@ngtools/webpack": "^17.2.2",
"@types/d3": "^7.4.3",
"@types/d3-shape": "^3.1.6",
"@types/hammerjs": "^2.0.36",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "^2.0.8",
"@types/leaflet": "^1.9.14",
"@types/leaflet-draw": "^1.0.11",
"@types/marked": "^4.3.0",
"@types/node": "^12.11.1",
"@types/terraformer__wkt": "^2.0.3",
"@types/uuid": "^10.0.0",
"codelyzer": "^6.0.2",
"fstream": "^1.0.12",
"html-webpack-plugin": "^5.5.3",
Expand All @@ -108,8 +122,7 @@
"tslint": "~6.1.0",
"typescript": "^5.3.3",
"webpack": "^5.54.0",
"webpack-bundle-analyzer": "^4.9.0",
"@types/d3-shape": "^3.1.6"
"webpack-bundle-analyzer": "^4.9.0"
},
"engines": {
"node": ">= 16.3.0",
Expand Down
6 changes: 5 additions & 1 deletion src/app/components/components.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ import {
DropdownItemDirective,
DropdownMenuDirective,
DropdownToggleDirective,
FormCheckInputDirective,
FormCheckComponent,
FormCheckLabelDirective,
FormCheckInputDirective,
FormControlDirective,
FormDirective,
FormFeedbackComponent,
Expand Down Expand Up @@ -108,6 +109,7 @@ import {ToastComponent as Toast} from './toast-exposer/toast/toast.component';
import {ReloadButtonComponent} from '../views/util/reload-button/reload-button.component';
import {ViewComponent} from './data-view/view/view.component';
import {DockerInstanceComponent} from './docker/dockerinstance/dockerinstance.component';
import {DataMapComponent} from "./data-view/data-map/data-map.component";
import {AlgViewerComponent} from './polyalg/polyalg-viewer/alg-viewer.component';
import {AlgNodeComponent} from './polyalg/algnode/alg-node.component';
import {ReteModule} from 'rete-angular-plugin/17';
Expand Down Expand Up @@ -235,6 +237,7 @@ import {WindowArgComponent} from './polyalg/controls/window-arg/window-arg.compo
DataCardComponent,
DataTableComponent,
DataGraphComponent,
DataMapComponent,
MediaComponent,
DeleteConfirmComponent,
ExpandableTextComponent,
Expand Down Expand Up @@ -291,6 +294,7 @@ import {WindowArgComponent} from './polyalg/controls/window-arg/window-arg.compo
Toast,
ReloadButtonComponent,
DockerInstanceComponent,
DataMapComponent,
AlgViewerComponent
]
})
Expand Down
14 changes: 6 additions & 8 deletions src/app/components/data-view/data-graph/data-graph.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ export class DataGraphComponent extends DataTemplateComponent {
t = newOverlay.append('path').attr('fill', 'transparent')
.attr('stroke-width', overlayStroke)
.attr('stroke', 'transparent')
.attr('d', arc({startAngle: -(Math.PI / 3), endAngle: (Math.PI / 3)}));
.attr('d', arc({startAngle: -(Math.PI / 3), endAngle: (Math.PI / 3), innerRadius: 0, outerRadius: 50}));

right = newOverlay.append('path').attr('fill', 'grey')
.attr('stroke-width', overlayStroke)
.attr('stroke', 'white')
.style('cursor', 'pointer')
.attr('d', arc({startAngle: 0, endAngle: Math.PI}))
.attr('d', arc({startAngle: 0, endAngle: Math.PI, innerRadius: 0, outerRadius: 50}))
.on('mouseover', function (d) {
d3.select(this).attr('fill', 'darkgray');
})
Expand All @@ -371,7 +371,7 @@ export class DataGraphComponent extends DataTemplateComponent {
.attr('stroke-width', overlayStroke)
.attr('stroke', 'white')
.style('cursor', 'pointer')
.attr('d', arc({startAngle: -Math.PI, endAngle: 0}))
.attr('d', arc({startAngle: -Math.PI, endAngle: 0, innerRadius: 0, outerRadius: 50}))
.on('mouseover', function (d) {
d3.select(this).attr('fill', 'darkgray');
})
Expand Down Expand Up @@ -515,17 +515,15 @@ export class DataGraphComponent extends DataTemplateComponent {

};


// TODO RB: This function does not currently work.
function activate() {
// Attach nodes to the simulation, add listener on the "tick" event
simulation
.nodes(graph.nodes)
.nodes(graph.nodes as d3.SimulationNodeDatum[])
.on('tick', onTick);

// Associate the lines with the "link" force
simulation
.force('link')
.links(graph.edges);
(simulation.force('link') as d3.ForceLink<d3.SimulationNodeDatum, Edge>).links(graph.edges);

simulation.alpha(1).alphaTarget(0).restart();
}
Expand Down
24 changes: 24 additions & 0 deletions src/app/components/data-view/data-map/data-map.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div [ngClass]="isInsideResults ? '' : 'map-margin' ">
<div class="map-container" [ngClass]="isInsideResults ? 'inside-results' : '' ">
<div id="map"></div>
<div *ngIf="this.loading()" class="map-overlay">
<div class="spinner-container">
<c-spinner color="light">
<span class="visually-hidden">{{ this.isLoadingMessage }}</span>
<span class="visually-hidden">Loading...</span>
</c-spinner>
<span>{{ this.isLoadingMessage }}</span>
<span class="visually-hidden">Loading...</span>
</div>
</div>
<div *ngIf="!isFullscreen" class="map-overlay-buttons">
<button *ngIf="this.canRerenderLayers" (click)="this.layerSettings.rerenderButtonClicked()"
class="shadow-lg" cButton color="primary">Refresh layers
</button>
<button *ngIf="isInsideResults" (click)="navigateToMapQueryMode()"
class="shadow-lg" cButton color="primary">See full results in map-based query mode
</button>
</div>
</div>
</div>

62 changes: 62 additions & 0 deletions src/app/components/data-view/data-map/data-map.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.map-container {
position: relative;
height: 100%;
border: 1px solid lightgray;
}

// Only for query mode, the results view already has a margin
.map-margin {
margin: 1rem 0;
height: calc(100% - 2rem);
}

.inside-results {
min-height: 600px;
padding: 0;
}

#map {
position: absolute;
inset: 0;
z-index: 1;
}

.map-overlay {
position: absolute;
inset: 0;
z-index: 2;
pointer-events: none;
display: grid;
background: rgba(0, 0, 0, 0.1);
place-items: center;
}

.spinner-container {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
background: rgba(0, 0, 0, 0.25);
padding: 2rem;
}

.map-overlay-buttons {
display: flex;
flex-direction: row;
gap: 1rem;
position: absolute;
z-index: 3;
bottom: 2rem;
right: 2rem;
}

.spinner-container > span {
font-size: 1.5rem;
font-weight: 400;
color: white;
}


.leaflet-overlay-pane > svg {
transition: opacity 50ms ease-in-out;
}
Loading