Skip to content

Commit

Permalink
Fix displaying of bar chart + prepare for 0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed May 22, 2018
1 parent fa793a4 commit c6666f5
Show file tree
Hide file tree
Showing 18 changed files with 167 additions and 3,143 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changes
=======

0.8.1 (2018-05-22)
------------------

- Fix the displaying of bar chart in classification panel.


0.8.0 (2018-05-22)
------------------

Expand Down
7 changes: 7 additions & 0 deletions client/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,13 @@ p.breaks_vals > input[type="number"].size_class {
width: 60px !important;
}

#sizes_div > div > p.breaks_vals > input[type="number"] {
width: 70px !important;
margin: 1px !important;
height: 2.5em !important;
}


/* Styles for modal box allowing to choose the type of each field */
#fields_select {
display: grid;
Expand Down
722 changes: 0 additions & 722 deletions client/dist/app.6c99da.js

This file was deleted.

1 change: 1 addition & 0 deletions client/dist/app.bb8420.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/dist/html/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
</div>
<script src="static/vendor/bootstrap-native3.mod.min.js"></script>
<script src="static/vendor/opentip-native.min.js"></script>
<script src="static/dist/vendor.6c99da.js"></script>
<script src="static/dist/vendor.bb8420.js"></script>
<script src="static/dist/d3-custom.min.js"></script>
<script src="static/dist/app.6c99da.js"></script>
<script src="static/dist/app.bb8420.js"></script>
</body>
</html>
836 changes: 0 additions & 836 deletions client/dist/vendor.6c99da.js

This file was deleted.

63 changes: 63 additions & 0 deletions client/dist/vendor.bb8420.js

Large diffs are not rendered by default.

17 changes: 6 additions & 11 deletions client/js/classification/discretization_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ export const display_discretization = (layer_name, field_name, nb_class, options
bin.val = stock_class[i];
bin.offset = i === 0 ? 0 : (bins[i - 1].width + bins[i - 1].offset);
bin.width = breaks[i + 1] - breaks[i];
bin.height = bin.val / (breaks[i + 1] - breaks[i]);
bin.height = bin.val / bin.width;
bins[i] = bin;
}
resolve(true);
Expand Down Expand Up @@ -572,18 +572,13 @@ export const display_discretization = (layer_name, field_name, nb_class, options

bins = [];
for (let i = 0, len = stock_class.length; i < len; i++) {
// const bin = {};
// bin.val = stock_class[i];
// bin.offset = i === 0 ? 0 : (bins[i - 1].width + bins[i - 1].offset);
// bin.width = breaks[i + 1] - breaks[i];
// bin.height = bin.val / (breaks[i + 1] - breaks[i]);
// bins[i] = bin;
const _stock = stock_class[i];
bins[i].push({
val: stock_class[i],
const _bin_width = breaks[i + 1] - breaks[i];
bins.push({
val: _stock,
offset: i === 0 ? 0 : (bins[i - 1].width + bins[i - 1].offset),
height: _stock / (breaks[i + 1] - breaks[i]),
width: breaks[i + 1] - breaks[i]
height: _stock / _bin_width,
width: _bin_width,
});
}
resolve(true);
Expand Down
5 changes: 3 additions & 2 deletions client/js/classification/discrtiz_links_discont.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { make_dialog_container, overlay_under_modal, reOpenParent } from './../dialogs';
import { make_min_max_tableau, fetch_min_max_table_value, } from './../interface';
import { fetch_min_max_table_value, make_min_max_tableau } from './../function';
import { make_content_summary } from './../helpers';
import { get_precision_axis, max_fast, min_fast } from './../helpers_calc';
import { Mabs } from './../helpers_math';
import { prepare_ref_histo } from './common';

export const display_discretization_links_discont = function (layer_name, field_name, nb_class, type) {
Expand Down Expand Up @@ -190,7 +191,7 @@ export const display_discretization_links_discont = function (layer_name, field_
breaks_info = [];
last_min = tmp_breaks.sizes[0];
last_max = tmp_breaks.sizes[tmp_breaks.sizes.length - 1];
if (+tmp_breaks.mins[0] > +serie.min()) {
if (Mabs(+serie.min() - +tmp_breaks.mins[0]) > 0.01) {
nb_class += 1;
txt_nb_class.node().value = nb_class;
// txt_nb_class.html(_tr("disc_box.class", {count: nb_class}));
Expand Down
15 changes: 9 additions & 6 deletions client/js/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,15 @@ export function make_min_max_tableau(values, nb_class, discontinuity_type, min_s

export function fetch_min_max_table_value(parent_id) {
let parent_node;
if (parent_id) parent_node = document.getElementById(parent_id);
else if (_app.current_functionnality.name === 'flow') document.getElementById('FlowMap_discTable');
else if (_app.current_functionnality.name === 'discont') document.getElementById('Discont_discTable');
else return;

if (parent_id) {
parent_node = document.getElementById(parent_id);
} else if (_app.current_functionnality.name === 'flow') {
parent_node = document.getElementById('FlowMap_discTable');
} else if (_app.current_functionnality.name === 'discont') {
parent_node = document.getElementById('Discont_discTable');
} else {
return;
}
const mins = Array.prototype.map.call(parent_node.querySelectorAll('.min_class'), el => +el.value),
maxs = Array.prototype.map.call(parent_node.querySelectorAll('.max_class'), el => +el.value),
sizes = Array.prototype.map.call(parent_node.querySelectorAll('.size_class'), el => +el.value),
Expand All @@ -482,7 +486,6 @@ export function fetch_min_max_table_value(parent_id) {
&& r_maxs.every((d, i) => sorted_max[i] === d)
&& r_sizes.every((d, i) => sorted_sizes[i] === d))) {
swal('', _tr('app_page.common.error_values_order'), 'error');
return false;
}

return { mins: sorted_min, maxs: sorted_max, sizes: sorted_sizes };
Expand Down
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "magrit-client",
"version": "0.8.0",
"version": "0.8.1",
"homepage": "https://github.com/riatelab/magrit",
"devDependencies": {
"babel-core": "^6.26.0",
Expand Down Expand Up @@ -59,4 +59,4 @@
"loc-i18next": "^0.1.3",
"tippy.js": "2.5.2"
}
}
}
2 changes: 1 addition & 1 deletion magrit_app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-

__version__ = '0.8.0'
__version__ = '0.8.1'
722 changes: 0 additions & 722 deletions magrit_app/static/dist/app.6c99da.js

This file was deleted.

1 change: 1 addition & 0 deletions magrit_app/static/dist/app.bb8420.js

Large diffs are not rendered by default.

836 changes: 0 additions & 836 deletions magrit_app/static/dist/vendor.6c99da.js

This file was deleted.

63 changes: 63 additions & 0 deletions magrit_app/static/dist/vendor.bb8420.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion magrit_app/static/json/list_symbols.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["tourist_beach.png","landuse_hills.png","poi_boundary_administrative.png","tourist_castle.png","tourist_casino.png","landuse_deciduous.png","amenity=bar.png","tourist_theatre.png","tourist_cinema.png","poi_tower_communications.png","poi_place_city.png","food_drinkingtap.png","walker.png","car.png","poi_mine.png","poi_peak.png","food_fastfood.png","swimmer.png","amenity=fire_station.png","city_medium.png","education_school.png","poi_place_town.png","tourist_museum.png","phone.png","landuse_coniferous.png","tourist_fountain.png","tourisum_fountain.png","tourist_waterwheel.png","education_nursery.png","cross.png","shipwreck.png","skull.png","poi_military_bunker.png","plane.png","tourist_wreck.png","amenity=hospital.png","poi_cave.png","fountain.png","tourist_picnic.png","poi_place_village.png","tourist_ruin.png","deer.png","tourist_art_gallery2.png","anchor.png","fish.png","couple.png","food_cafe.png","amenity=theatre.png","city_building.png","amenity=restaurant.png","gas.png","landuse_swamp.png","camera.png","poi_embassy.png","city_small.png","city_large.png","poi_point_of_interest.png","disability_accessibility.png","landuse_grass.png","landuse_quary.png","education_university.png","flag.png","poi_tower_power.png","amenity=police.png","parachute.png","house.png","disability_lowvision.png","parking.png","golf.png","food_bar.png","question.png","tourist_steam_train.png","amenity=fast_food.png","tourist_memorial.png","tourist_monument.png","teepee.png","tourist_archaeological.png","boat.png","amenity=pub.png","landuse_coniferous_and_deciduous.png","h.png","poi_tower_water.png","skier.png","tourist_zoo.png","poi_embassy2.png","waypoint.png","food_pub.png","tourist_view_point.png","landuse_scrub.png","tourist_battlefield.png","tourist_windmill.png","bank.png"]
["amenity=police.png","h.png","food_fastfood.png","bank.png","landuse_hills.png","landuse_quary.png","poi_military_bunker.png","poi_tower_water.png","landuse_coniferous_and_deciduous.png","deer.png","tourist_battlefield.png","amenity=restaurant.png","poi_place_village.png","house.png","tourist_memorial.png","disability_lowvision.png","fish.png","tourist_steam_train.png","city_large.png","poi_mine.png","tourist_cinema.png","city_small.png","boat.png","shipwreck.png","city_building.png","tourist_archaeological.png","amenity=hospital.png","walker.png","flag.png","amenity=fast_food.png","food_bar.png","food_cafe.png","landuse_grass.png","poi_point_of_interest.png","gas.png","tourist_theatre.png","phone.png","amenity=theatre.png","tourisum_fountain.png","poi_tower_communications.png","landuse_swamp.png","question.png","parking.png","tourist_monument.png","amenity=bar.png","tourist_casino.png","skull.png","landuse_deciduous.png","landuse_scrub.png","poi_cave.png","plane.png","food_pub.png","tourist_fountain.png","tourist_windmill.png","waypoint.png","food_drinkingtap.png","camera.png","amenity=pub.png","couple.png","skier.png","poi_place_city.png","tourist_castle.png","poi_place_town.png","poi_embassy2.png","tourist_view_point.png","poi_peak.png","tourist_picnic.png","tourist_waterwheel.png","cross.png","swimmer.png","tourist_beach.png","education_university.png","golf.png","education_school.png","tourist_ruin.png","tourist_zoo.png","tourist_wreck.png","landuse_coniferous.png","tourist_art_gallery2.png","education_nursery.png","poi_tower_power.png","car.png","teepee.png","tourist_museum.png","parachute.png","fountain.png","poi_boundary_administrative.png","poi_embassy.png","city_medium.png","amenity=fire_station.png","anchor.png","disability_accessibility.png"]
4 changes: 2 additions & 2 deletions magrit_app/static/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
</div>
<script src="static/vendor/bootstrap-native3.mod.min.js"></script>
<script src="static/vendor/opentip-native.min.js"></script>
<script src="static/dist/vendor.6c99da.js"></script>
<script src="static/dist/vendor.bb8420.js"></script>
<script src="static/dist/d3-custom.min.js"></script>
<script src="static/dist/app.6c99da.js"></script>
<script src="static/dist/app.bb8420.js"></script>
</body>
</html>

0 comments on commit c6666f5

Please sign in to comment.