Skip to content

Commit

Permalink
Stuff for legends + Prepare for 0.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed Jul 3, 2018
1 parent 652c997 commit a92e854
Show file tree
Hide file tree
Showing 12 changed files with 1,587 additions and 16 deletions.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/dist/d3-custom.min.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.630f0f.js"></script>
<script src="static/dist/vendor.9b2b11.js"></script>
<script src="static/dist/d3-custom.min.js"></script>
<script src="static/dist/app.630f0f.js"></script>
<script src="static/dist/app.9b2b11.js"></script>
</body>
</html>
File renamed without changes.
4 changes: 3 additions & 1 deletion client/js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ export function create_li_layer_elem(layerName, nbFt, typeGeom, typeLayer) {
if (typeLayer === 'result') {
li.setAttribute('class', ['sortable_result ', layerId].join(''));
const promotable = [ 'flow', 'grid', 'discont', 'cartogram', 'smooth'];
const legend_but = typeGeom[1] !== 'cartogram'
? button_legend : undefined;
const replace_but = promotable.indexOf(typeGeom[1]) > -1
? button_replace : undefined;
li.innerHTML = [
Expand All @@ -427,7 +429,7 @@ export function create_li_layer_elem(layerName, nbFt, typeGeom, typeLayer) {
button_zoom_fit,
button_table,
eye_open0,
button_legend,
legend_but,
button_result_type.get(typeGeom[1]),
replace_but,
'</div> ',
Expand Down
12 changes: 10 additions & 2 deletions client/js/layers_style_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,13 @@ function createStyleBox_Line(layer_name) {
// using the minimum value of the serie (skipping unused class if necessary)
threshold_section.insert('input')
.attrs({ type: 'range', min: 0, max: max_val, step: 0.5 })
.styles({ width: '58px', 'vertical-align': 'middle', display: 'inline', float: 'right', 'margin-right': '0px' })
.styles({
width: '58px',
'vertical-align': 'middle',
display: 'inline',
float: 'right',
'margin-right': '0px',
})
.property('value', prev_min_display)
.on('change', function () {
const val = +this.value;
Expand Down Expand Up @@ -1490,7 +1496,9 @@ function createStyleBox(layer_name) {
}
});

if (data_manager.current_layers[layer_name].renderer === undefined) {
if (data_manager.current_layers[layer_name].renderer === undefined
|| data_manager.current_layers[layer_name].renderer === 'Carto_doug'
|| data_manager.current_layers[layer_name].renderer === 'OlsonCarto') {
const generate_legend_section = popup.append('p');
const generate_lgd_chkbox = generate_legend_section.insert('input')
.style('margin', 0)
Expand Down
6 changes: 4 additions & 2 deletions client/js/map_ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ export function rotate_global(angle) {
}

export function redraw_legends_symbols(targeted_node) {
const legend_nodes = targeted_node ? [targeted_node] : document.querySelectorAll('#legend_root_symbol,#legend_root_layout');
const legend_nodes = targeted_node
? [targeted_node]
: document.querySelectorAll('#legend_root_symbol,#legend_root_layout');
const hide = svg_map.__zoom.k > 5 || svg_map.__zoom.k < 0.15;
let hidden_message = false;

Expand Down Expand Up @@ -244,7 +246,7 @@ export function redraw_legends_symbols(targeted_node) {
notes);

new_lgd = document.querySelector(['#legend_root_layout.lgdf_', layer_id].join(''));
} else if (rendered_field) {
} else if (rendered_field && ['Carto_doug', 'OlsonCarto'].indexOf(data_manager.current_layers[layer_name].renderer) < 0) {
const nested = legend_nodes[i].getAttribute('nested'),
join_line = legend_nodes[i].getAttribute('join_line');

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.4",
"version": "0.8.5",
"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.4'
__version__ = '0.8.5'
722 changes: 722 additions & 0 deletions magrit_app/static/dist/app.9b2b11.js

Large diffs are not rendered by default.

836 changes: 836 additions & 0 deletions magrit_app/static/dist/vendor.9b2b11.js

Large diffs are not rendered by default.

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.630f0f.js"></script>
<script src="static/dist/vendor.9b2b11.js"></script>
<script src="static/dist/d3-custom.min.js"></script>
<script src="static/dist/app.630f0f.js"></script>
<script src="static/dist/app.9b2b11.js"></script>
</body>
</html>

0 comments on commit a92e854

Please sign in to comment.