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

Feature/statisticts table #119

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
5278025
Replaced List View with Dynamic Table
CliffHack Jan 5, 2024
50136e1
Added Table View Component
CliffHack Jan 18, 2024
ff1ebf0
Groupby functions init for table views
CliffHack Jan 19, 2024
1f6ba20
Added dymic read of the MapConfig to read Tables
CliffHack Jan 22, 2024
e7230ff
Grouped by tables complete with sorting implemented
CliffHack Jan 23, 2024
df1b82f
simple point on area join
LBHSBALLEY Jan 23, 2024
96fc879
Merged Spatial Enrichment Logic
CliffHack Jan 24, 2024
574e953
Added spatial enrichments to local config
CliffHack Jan 24, 2024
b9dd0c3
load geographies before data layers
LBHSBALLEY Jan 24, 2024
f34a913
Merging new enrichment changes
CliffHack Jan 24, 2024
83cb206
Refactor
CliffHack Jan 24, 2024
b9833ab
Enrichement waits for geography layers
LBHSBALLEY Jan 25, 2024
25bf6dd
Testing replacer code for unwanted values in df
CliffHack Jan 25, 2024
b15258b
Merging new code to allow layers to fully load before enrichment
CliffHack Jan 25, 2024
73226ea
Merging new code to allow layers to fully load before enrichment 2
CliffHack Jan 25, 2024
d44559a
Branch Switch
CliffHack Jan 25, 2024
2f79e67
Moved list-view into table-view to allow the front-end initAll to wor…
CliffHack Jan 25, 2024
318fafa
list enriching layers with other layers
LBHSBALLEY Jan 26, 2024
73dc51b
List view reads from geojson not from map
LBHSBALLEY Jan 26, 2024
32c1df3
clear debugging comments
LBHSBALLEY Jan 26, 2024
e803f05
Merge branch 'feat/spatial-enrichment' into cliff-dev-table
CliffHack Jan 29, 2024
250062f
Refactered code to catch errors when data is not present for tables
CliffHack Jan 29, 2024
94f4534
Moved attribute alignment code into spatial-enrichment.js from table …
CliffHack Jan 29, 2024
6fbd060
Statistics Table-View Beta with no comments
CliffHack Jan 30, 2024
c4747e0
Statistics Table-View BETA
CliffHack Jan 30, 2024
2ef709e
enrich only once
LBHSBALLEY Feb 6, 2024
3465a3a
Bug Fix - Decoupled List View and Table-View
CliffHack Feb 7, 2024
1c86d82
enableSpiderfy option
LBHSBALLEY Feb 26, 2024
e0453b2
Add gitguardian yaml to gitignore
LBHSBALLEY Feb 27, 2024
79099dd
Adding Statistics Tables to README and Spatial Enrichment
CliffHack Feb 27, 2024
2355a6b
Merge branch 'feature/statisticts-table' of https://github.com/LBHack…
CliffHack Feb 27, 2024
8c8c220
Adding Statistics Tables to README and Spatial Enrichments 2
CliffHack Feb 28, 2024
449fb81
Update README.md
LBHSBALLEY Feb 29, 2024
3e0f673
Remove global spatialEnrichment flag
LBHSBALLEY Feb 29, 2024
0bad63d
Refactoring Statistic Tables README
CliffHack Feb 29, 2024
ce7d3a2
Refactoring Statistic Tables README table headers
CliffHack Feb 29, 2024
04f6856
Refactoring Statistic Tables README table with functions table example
CliffHack Feb 29, 2024
50a6052
Refactoring Statistic Tables README table with functions table example2
CliffHack Feb 29, 2024
5e979aa
Refactoring Statistic Tables README table with json blocks
CliffHack Feb 29, 2024
34f8e15
Refactoring Statistic Tables README table with json blocks refactor
CliffHack Feb 29, 2024
5f6c201
Refactoring Statistic Tables README table with json blocks refactor2
CliffHack Feb 29, 2024
5b95f12
Refactoring Statistic Tables README table with json blocks refactor3
CliffHack Feb 29, 2024
16f88a9
Use the tableview-container and custom header
LBHSBALLEY Feb 29, 2024
b6371d9
Refactoring Statistic Tables README table with json blocks refactor2
CliffHack Feb 29, 2024
97aa299
Merge branch 'feature/statisticts-table' of https://github.com/LBHack…
CliffHack Feb 29, 2024
6dd93c2
Refactoring Statistic Tables README table with json blocks refactor 4
CliffHack Feb 29, 2024
55ac9cc
Refactoring Statistic Tables README table with json blocks refactor 5
CliffHack Mar 1, 2024
f5a018d
Refactoring Statistic Tables README table with json blocks refactor 6
CliffHack Mar 1, 2024
c1f1b77
Refactoring Statistic Tables README
CliffHack Mar 1, 2024
d5922e7
tweak table_view to support single list
LBHSBALLEY Mar 5, 2024
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
Prev Previous commit
tweak table_view to support single list
LBHSBALLEY committed Mar 5, 2024
commit d5922e7e7edf270ff78de54de957badb5d24e928
17 changes: 9 additions & 8 deletions src/js/map/data-layers.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import Personas from "./personas";
import Filters from "./filters";
import Search from "./search";
import addressSearch from "./address-search";
import List from "./list-view";
// import List from "./list-view";
import DrillDown from "./drill-down";
import Table from "./table-view";

@@ -531,13 +531,14 @@ class DataLayers {
this.filters.init();
}

//only happens once, after the last layer has loaded - create list view after the map
if (this.mapConfig.list && this.loadedLayerCount == this.layerCount) {
this.list = new List(this.mapClass,this.layersData);
this.list.init();
}
//only happens once, after the last layer has loaded - create statistics tables after the map
if (this.mapConfig.statistics && this.loadedLayerCount == this.layerCount) {
//only happens once, after the last layer has loaded - create list view after the map - now created with the tables
// if (this.mapConfig.list && this.loadedLayerCount == this.layerCount) {
// this.list = new List(this.mapClass,this.layersData);
// this.list.init();
// }

//only happens once, after the last layer has loaded - create lists and statistics tables after the map
if ((this.mapConfig.statistics || this.mapConfig.list) && this.loadedLayerCount == this.layerCount) {
this.statistics = new Table(this.mapClass,this.layersData);
this.statistics.init();
}
37 changes: 23 additions & 14 deletions src/js/map/table-view.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// import { MARKER_COLORS } from "./consts";
import { MARKER_COLORS } from "./consts";
import SpatialEnrichment from "./spatial-enrichment"

class Table {
@@ -12,14 +12,17 @@ class Table {
this.list = null;
this.accordionExpandedClass = null;
// Retrieve all layer names from all the scopes - these will be assinged event listeners
this.tableLayers = map.mapConfig.statistics.statisticsTables.reduce(
(accumulator, currentValue) => {
const scope = currentValue.scope
scope.map(layerName => accumulator.add(layerName))
return accumulator
},
new Set(),
);
if (this.mapConfig.statistics){
this.tableLayers = map.mapConfig.statistics.statisticsTables.reduce(
(accumulator, currentValue) => {
const scope = currentValue.scope
scope.map(layerName => accumulator.add(layerName))
return accumulator
},
new Set(),
);
}


}

@@ -45,10 +48,15 @@ class Table {
else{
this.accordionExpandedClass = '';
}

this.addlayerEventListeners(this.layersData,this.createTables.bind(this),this.createMarkup.bind(this))
if (this.mapConfig.statistics){
this.addlayerEventListeners(this.layersData,this.createTables.bind(this),this.createMarkup.bind(this));
}
this.list && this.createMarkup();
this.table && this.createTables();

//Activate ALL components from lbh-frontend
window.LBHFrontend.initAll();

}

addlayerEventListeners(dataLayers,createTables,createListViews){
@@ -366,11 +374,12 @@ class Table {
}
//Activate ALL components from lbh-frontend

if(this.mapConfig.statistics.statisticsTables || this.mapConfig.list){
window.LBHFrontend.initAll();
}
// if(this.mapConfig.statistics.statisticsTables || this.mapConfig.list){
// window.LBHFrontend.initAll();
// }

}

createMarkup() {
const listDiv = document.getElementById('listview')
listDiv&&listDiv.remove()