Skip to content

Commit

Permalink
cumulative updates
Browse files Browse the repository at this point in the history
- Change the format of data labels in a chart
- Fixed opacity function
- Fixed zoom to country
- Fixed bottom table not showing up during selected country
  • Loading branch information
GISRedeDev committed Jan 12, 2025
1 parent 7795ba2 commit b3bc16b
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 31 deletions.
7 changes: 5 additions & 2 deletions www/public_html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ <h1 class="sidebar-header">Settings<span class="sidebar-close"><i class="fa fa-c
<input type="range" class="form-range" min="0" max="5" step="0.5" value="2" id="chPointRadius">
</div>
<div class="pt-4">
<label for="customRangeOpacity" class="form-label">Opacity</label>
<label for="customRangeOpacity" class="form-label">Map opacity</label>
<input type="range" class="form-range" min="0" max="1" step="0.1" value="0.9" id="customRangeOpacity">
</div>

Expand Down Expand Up @@ -522,6 +522,9 @@ <h5 class="modal-title" id="ModalPrivacyLabel">Privacy Policy</h5>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/locales/bootstrap-datepicker.en-GB.min.js"></script>


<script src="./utils/jszip_v3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pako/2.1.0/pako.min.js"></script>

<script src="./utils/moment/moment.js"></script>


Expand All @@ -541,7 +544,7 @@ <h5 class="modal-title" id="ModalPrivacyLabel">Privacy Policy</h5>
<script type="text/javascript">
window.mdebug = true;
</script>
<script src="./js/main.js?version=0.6554" type="module"></script>
<script src="./js/main.js?version=0.66" type="module"></script>

<script type="text/javascript">
$(document).ready(function () {
Expand Down
15 changes: 9 additions & 6 deletions www/public_html/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ var featureByName = {};
import * as _init from './init.js?version=0.72'
import * as _utils from './utils.js?version=0.672'
import * as _api from './api_requests.js?version=0.32'
import * as _worldLayer from './worldLayer.js?version=0.4952'
import * as _worldLayer from './worldLayer.js?version=0.5'
import * as _worldSubNationalLayer from './worldSubNationalLayer.js?version=0.82'
import * as _worldBoundariesLayer from './worldBoundariesLayer.js?version=0.462'
import * as _controlTable from './bottom_table.js?version=0.1652'
import * as _plotxyLayer from './plotxyLayer.js?version=0.34222'
import * as _controlTable from './bottom_table.js?version=0.1653'
import * as _plotxyLayer from './plotxyLayer.js?version=0.35'
import * as _infoBox from './infoBox.js?version=0.22'

import * as _palette from './palette.js?version=0.222'
Expand Down Expand Up @@ -240,7 +240,7 @@ var worldLayer = L.geoJson(null, {
console.log(error);
});


_worldLayer.zoomToFeature(e, map, world_geo_json);
}).then(() => {
_utils.progressMenuOff();
}).catch((error) => {
Expand Down Expand Up @@ -311,7 +311,7 @@ var worldSubNationalLayer = L.geoJson(null, {
.then((data_naional) => {
_controlTable.load_data_BottomTable(data_naional, data, prGroundTruth, _countriesList, _countriesListSubnational, sParams[2], modelsList, iso_gid_0, true, true);
}).then(() => {
//_utils.progressMenuTableOff();
_utils.progressMenuTableOff();
}).catch((error) => {
console.log(error);
});
Expand Down Expand Up @@ -751,7 +751,10 @@ $('#customRangeOpacity').change(function () {

worldLayer.setStyle({
fillOpacity: $(this).val()
});
});
worldSubNationalLayer.setStyle({
fillOpacity: $(this).val()
});
});


Expand Down
10 changes: 6 additions & 4 deletions www/public_html/js/plotxyLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function updateData(c, d, model, modelsList, _prSubNational) {
dataArray.push(d[key][model][PredictedType]);
});
} else {
Object.keys(d).reverse().forEach(function (key) {
Object.keys(d).forEach(function (key) {
ym = key.toString();
labels.push(ym);
dataArray.push(d[key][model][PredictedType]);
Expand All @@ -85,12 +85,14 @@ export function updateData(c, d, model, modelsList, _prSubNational) {
var min = (Math.min(...dataArray)),
max = (Math.max(...dataArray));

let min_f = percentage(35, min);
let max_f = percentage(35, max);
let min_f = percentage(15, min);
let max_f = percentage(15, max);


min=round_value(min-min_f,2);
max=round_value(max+max_f,2);
//max=round_value(max+max_f,2);

//max = (max > 1 ) ? 1 : max;

const data = {
labels: labels,
Expand Down
51 changes: 33 additions & 18 deletions www/public_html/js/worldLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,44 @@ export function resetHighlight(e, _layer, palette) {

}

export function zoomToFeature(_e, _map, data_raw, countriesList) {
export function zoomToFeature(_e, _map, _world_geo_json) {

//var data_national = data_raw.data;
// var layer = _e.target;
// var countryCode = _e.target.feature.properties.iso_a2;
//
// if (window.mdebug === true)
// console.log("clicked countryCode " + countryCode);
//
// var su_dif = _e.target.feature.properties.su_dif;
//
//
// if ((su_dif !== undefined) && (su_dif !== null) && (su_dif !== "")) {
//
//
//
// _map.fitBounds(layer.getBounds(), {paddingBottomRight: [0, 100]});
//
// var iso = _e.target.feature.properties.iso_a2;
// var sParams = _utils.getSelectedParameters();
//
//
// }

var layer = _e.target;
var countryCode = _e.target.feature.properties.iso_a2;
var iso_gid_0 = _e.target.feature.properties.GID_0;

for (var i = 0; i < _world_geo_json.features.length; i++) {

var iso = _world_geo_json.features[i].properties.GID_0;

if (iso===iso_gid_0){
var geoJsonLayer = L.geoJson(_world_geo_json.features[i]);
}
}

if (window.mdebug === true)
console.log("clicked countryCode " + countryCode);
_map.fitBounds(geoJsonLayer.getBounds(), {paddingBottomRight: [0, 100]});

var su_dif = _e.target.feature.properties.su_dif;


if ((su_dif !== undefined) && (su_dif !== null) && (su_dif !== "")) {



_map.fitBounds(layer.getBounds(), {paddingBottomRight: [0, 100]});

var iso = _e.target.feature.properties.iso_a2;
var sParams = _utils.getSelectedParameters();


}

}

Expand Down
2 changes: 1 addition & 1 deletion www/public_html/js/worldSubNationalLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as _utils from './utils.js?version=0.241'
import * as _api from './api_requests.js?version=0.11'
import * as _quartile from './quartile.js?version=11'

export function zoomToFeature(_e, _map, _world_geo_json,) {
export function zoomToFeature(_e, _map, _world_geo_json) {

var layer = _e.target;
var iso_gid_0 = _e.target.feature.properties.GID_0;
Expand Down

0 comments on commit b3bc16b

Please sign in to comment.