Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add new 'enter' button on index page + Change stuffs with projection …
…+ change stuff with scale bar
  • Loading branch information
mz committed Feb 17, 2017
1 parent f8428d1 commit 1f82424
Show file tree
Hide file tree
Showing 17 changed files with 644 additions and 14,834 deletions.
4 changes: 2 additions & 2 deletions magrit_app/static/css/style-index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14,324 changes: 0 additions & 14,324 deletions magrit_app/static/js/app.0448f881a9f2.js

This file was deleted.

23 changes: 0 additions & 23 deletions magrit_app/static/js/app.0448f881a9f2.min.js

This file was deleted.

421 changes: 229 additions & 192 deletions magrit_app/static/js/app.js → magrit_app/static/js/app.5f408f9e65e4.js

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions magrit_app/static/js/app.5f408f9e65e4.min.js

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions magrit_app/static/js/app.min.js

This file was deleted.

30 changes: 21 additions & 9 deletions magrit_app/static/js/layout_features.js
Expand Up @@ -635,7 +635,10 @@ var scaleBar = {

let pt1 = proj.invert([(x_pos - z_trans[0]) / z_scale, (y_pos - z_trans[1]) / z_scale]),
pt2 = proj.invert([(x_pos + this.bar_size - z_trans[0]) / z_scale, (y_pos - z_trans[1]) / z_scale]);

if(!pt1 || !pt2){
this.remove();
return true;
}
this.dist = coslaw_dist([pt1[1], pt1[0]], [pt2[1], pt2[0]]);
let mult = this.unit == "km" ? 1
: this.unit == "m" ? 1000
Expand All @@ -655,18 +658,27 @@ var scaleBar = {
this.bar_size = new_size;
this.fixed_size = desired_dist;
this.under_rect.attr("width", new_size + 5);
this.changeText();
let err = this.getDist();
if(err){
this.remove();
return;
}
this.Scale.select("#text_limit_sup_scale").text(this.fixed_size + " " + this.unit);
this.handle_start_end_bar();

},
changeText: function(){
this.getDist();
this.Scale.select("#text_limit_sup_scale").text(this.dist_txt + " " + this.unit);
},
update: function(){
this.changeText();
if(this.fixed_size)
if(this.fixed_size){
this.getDist();
this.resize();
} else {
let err = this.getDist();
if(err){
this.remove();
return;
}
this.Scale.select("#text_limit_sup_scale").text(this.dist_txt + " " + this.unit);
}
},
remove: function(){
this.Scale.remove();
Expand All @@ -691,7 +703,7 @@ var scaleBar = {
self.resize(new_val);
else {
self.fixed_size = false;
self.changeText();
self.update();
}
};
make_confirm_dialog2("scaleBarEditBox", i18next.t("app_page.scale_bar_edit_box.title"), {widthFitContent: true})
Expand Down
428 changes: 213 additions & 215 deletions magrit_app/static/js/main.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion magrit_app/static/js/map_project.js
Expand Up @@ -503,6 +503,9 @@ function apply_user_preferences(json_pref){
document.getElementById("input-width").value = w;
document.getElementById("input-height").value = h;

// Projection were slightly changed in a last version :
map_config.projection = map_config.projection.replace(/ /g, '');

// Set the variables/fields related to the projection :
current_proj_name = map_config.projection;
proj = eval(available_projections.get(current_proj_name));
Expand All @@ -514,7 +517,7 @@ function apply_user_preferences(json_pref){
defs = map.append("defs");
{
let proj_select = document.getElementById('form_projection');
proj_select.value = Array.prototype.filter.call(proj_select.options, function(d){ if(d.text == current_proj_name) { return d;}})[0].value;
proj_select.value = current_proj_name;
}
path = d3.geoPath().projection(proj).pointRadius(4);
map.selectAll(".layer").selectAll("path").attr("d", path);
Expand Down
37 changes: 37 additions & 0 deletions magrit_app/static/js/projections.js
@@ -0,0 +1,37 @@
"use strict";

const available_projections = new Map([
["Armadillo", "d3.geoArmadillo().scale(400)"],
["AzimuthalEqualArea", "d3.geoAzimuthalEqualArea().rotate([-10,-52]).scale(700).translate([240, 290])"],
["Baker", "d3.geoBaker().scale(400)"],
["Boggs", "d3.geoBoggs().scale(400)"],
["InterruptedBoggs", "d3.geoInterruptedBoggs().scale(400)"],
["Bonne", "d3.geoBonne().scale(400)"],
["Bromley", "d3.geoBromley().scale(400)"],
["Collignon", "d3.geoCollignon().scale(400)"],
["ConicConformal", "d3.geoConicConformal().scale(400).parallels([43, 49])"],
["ConicEqualArea", "d3.geoConicEqualArea().scale(400)"],
["ConicEquidistant", "d3.geoConicEquidistant().scale(400)"],
["CrasterParabolic", "d3.geoCraster().scale(400)"],
["EckertI", "d3.geoEckert1().scale(400).translate([300, 250])"],
["EckertII", "d3.geoEckert2().scale(400).translate([300, 250])"],
["EckertIII", "d3.geoEckert3().scale(525).translate([150, 125])"],
["EckertIV", "d3.geoEckert4().scale(525).translate([150, 125])"],
["EckertV", "d3.geoEckert5().scale(400)"],
["EckertVI", "d3.geoEckert6().scale(400)"],
["Eisenlohr", "d3.geoEisenlohr().scale(400)"],
["Gnomonic", "d3.geoGnomonic().scale(400)"],
["Gringorten", "d3.geoGringorten().scale(400)"],
["HEALPix", "d3.geoHealpix().scale(400)"],
["Homolosine", "d3.geoHomolosine().scale(400)"],
["InterruptedHomolosine", "d3.geoInterruptedHomolosine().scale(400)"],
["Loximuthal", "d3.geoLoximuthal().scale(400)"],
["Mercator", "d3.geoMercator().scale(375).translate([525, 350])"],
["NaturalEarth", "d3.geoNaturalEarth().scale(400).translate([375, 50])"],
["Orthographic", "d3.geoOrthographic().scale(475).translate([480, 480]).clipAngle(90)"],
["Peircequincuncial", "d3.geoPeirceQuincuncial().scale(400)"],
["Robinson", "d3.geoRobinson().scale(400)"],
["InterruptedSinuMollweide", "d3.geoInterruptedSinuMollweide().scale(400)"],
["Sinusoidal", "d3.geoSinusoidal().scale(400)"],
["InterruptedSinusoidal", "d3.geoInterruptedSinusoidal().scale(400)"]
]);
32 changes: 16 additions & 16 deletions magrit_app/static/json/projections.json
Expand Up @@ -3,33 +3,33 @@
{"name": "AzimuthalEqualArea", "projection": "d3.geoAzimuthalEqualArea().rotate([-10,-52]).scale(700).translate([240, 290])"},
{"name": "Baker", "projection": "d3.geoBaker().scale(400)"},
{"name": "Boggs", "projection": "d3.geoBoggs().scale(400)"},
{"name": "Interrupted Boggs", "projection": "d3.geoInterruptedBoggs().scale(400)"},
{"name": "InterruptedBoggs", "projection": "d3.geoInterruptedBoggs().scale(400)"},
{"name": "Bonne", "projection": "d3.geoBonne().scale(400)"},
{"name": "Bromley", "projection": "d3.geoBromley().scale(400)"},
{"name": "Collignon", "projection": "d3.geoCollignon().scale(400)"},
{"name": "Conic Conformal", "projection": "d3.geoConicConformal().scale(400)"},
{"name": "Conic Equal Area", "projection": "d3.geoConicEqualArea().scale(400)"},
{"name": "Conic Equidistant", "projection": "d3.geoConicEquidistant().scale(400)"},
{"name": "Craster Parabolic", "projection": "d3.geoCraster().scale(400)"},
{"name": "Eckert I", "projection": "d3.geoEckert1().scale(400).translate([300, 250])"},
{"name": "Eckert II", "projection": "d3.geoEckert2().scale(400).translate([300, 250])"},
{"name": "Eckert III", "projection": "d3.geoEckert3().scale(525).translate([150, 125])"},
{"name": "Eckert IV", "projection": "d3.geoEckert4().scale(525).translate([150, 125])"},
{"name": "Eckert V", "projection": "d3.geoEckert5().scale(400)"},
{"name": "Eckert VI", "projection": "d3.geoEckert6().scale(400)"},
{"name": "ConicConformal", "projection": "d3.geoConicConformal().scale(400).parallels([43, 49])"},
{"name": "ConicEqualArea", "projection": "d3.geoConicEqualArea().scale(400)"},
{"name": "ConicEquidistant", "projection": "d3.geoConicEquidistant().scale(400)"},
{"name": "CrasterParabolic", "projection": "d3.geoCraster().scale(400)"},
{"name": "EckertI", "projection": "d3.geoEckert1().scale(400).translate([300, 250])"},
{"name": "EckertII", "projection": "d3.geoEckert2().scale(400).translate([300, 250])"},
{"name": "EckertIII", "projection": "d3.geoEckert3().scale(525).translate([150, 125])"},
{"name": "EckertIV", "projection": "d3.geoEckert4().scale(525).translate([150, 125])"},
{"name": "EckertV", "projection": "d3.geoEckert5().scale(400)"},
{"name": "EckertVI", "projection": "d3.geoEckert6().scale(400)"},
{"name": "Eisenlohr", "projection": "d3.geoEisenlohr().scale(400)"},
{"name": "Gnomonic", "projection": "d3.geoGnomonic().scale(400)"},
{"name": "Gringorten", "projection": "d3.geoGringorten().scale(400)"},
{"name": "HEALPix", "projection": "d3.geoHealpix().scale(400)"},
{"name": "Homolosine", "projection": "d3.geoHomolosine().scale(400)"},
{"name": "Interrupted Homolosine", "projection": "d3.geoInterruptedHomolosine().scale(400)"},
{"name": "InterruptedHomolosine", "projection": "d3.geoInterruptedHomolosine().scale(400)"},
{"name": "Loximuthal", "projection": "d3.geoLoximuthal().scale(400)"},
{"name": "Mercator", "projection": "d3.geoMercator().scale(375).translate([525, 350])"},
{"name": "Natural Earth", "projection": "d3.geoNaturalEarth().scale(400).translate([375, 50])"},
{"name": "NaturalEarth", "projection": "d3.geoNaturalEarth().scale(400).translate([375, 50])"},
{"name": "Orthographic", "projection": "d3.geoOrthographic().scale(475).translate([480, 480]).clipAngle(90)"},
{"name": "Peirce quincuncial", "projection": "d3.geoPeirceQuincuncial().scale(400)"},
{"name": "Peircequincuncial", "projection": "d3.geoPeirceQuincuncial().scale(400)"},
{"name": "Robinson", "projection": "d3.geoRobinson().scale(400)"},
{"name": "Interrupted Sinu-Mollweide", "projection": "d3.geoInterruptedSinuMollweide().scale(400)"},
{"name": "InterruptedSinuMollweide", "projection": "d3.geoInterruptedSinuMollweide().scale(400)"},
{"name": "Sinusoidal", "projection": "d3.geoSinusoidal().scale(400)"},
{"name": "Interrupted Sinusoidal", "projection": "d3.geoInterruptedSinusoidal().scale(400)"}
{"name": "InterruptedSinusoidal", "projection": "d3.geoInterruptedSinusoidal().scale(400)"}
]
35 changes: 35 additions & 0 deletions magrit_app/static/locales/en/translation.json
Expand Up @@ -153,6 +153,41 @@
"projection_center_gamma": "Projection center (γ-axis rotation)",
"reset": "Reset center/zooming/rotation"
},
"projection_name":{
"Armadillo": "Armadillo",
"AzimuthalEqualArea": "Azimuthal Equal Area",
"Baker": "Baker",
"Boggs": "Boggs",
"InterruptedBoggs": "Interrupted Boggs",
"Bonne": "Bonne",
"Bromley": "Bromley",
"Collignon": "Collignon",
"ConicConformal": "Conic Conformal",
"ConicEqualArea": "Conic Equal Area",
"ConicEquidistant": "Conic Equidistant",
"CrasterParabolic": "Craster Parabolic",
"EckertI": "Eckert I",
"EckertII": "Eckert II",
"EckertIII": "Eckert III",
"EckertIV": "Eckert IV",
"EckertV": "Eckert V",
"EckertVI": "Eckert VI",
"Eisenlohr": "Eisenlohr",
"Gnomonic": "Gnomonic",
"Gringorten": "Gringorten",
"HEALPix": "HEALPix",
"Homolosine": "Homolosine",
"InterruptedHomolosine": "Interrupted Homolosine",
"Loximuthal": "Loximuthal",
"Mercator": "Mercator",
"NaturalEarth": "Natural Earth",
"Orthographic": "Orthographic",
"Peircequincuncial": "Pierce Quincuncial",
"Robinson": "Robinson",
"InterruptedSinuMollweide": "Interrupted Sinu-Mollweide",
"Sinusoidal": "Sinusoidal",
"InterruptedSinusoidal": "Interrupted sinusoidal"
},
"stat_summary": {
"population": "Population",
"min": "Min",
Expand Down
35 changes: 35 additions & 0 deletions magrit_app/static/locales/fr/translation.json
Expand Up @@ -154,6 +154,41 @@
"projection_center_gamma": "Centre de la projection (rotation de l'axe γ)",
"reset": "Réinitialiser la vue"
},
"projection_name":{
"Armadillo": "Armadillo",
"AzimuthalEqualArea": "Azimuthale équivalente",
"Baker": "Baker",
"Boggs": "Boggs",
"InterruptedBoggs": "Boggs interrompue",
"Bonne": "Bonne",
"Bromley": "Bromley",
"Collignon": "Collignon",
"ConicConformal": "Conique conforme",
"ConicEqualArea": "Conique équivalente",
"ConicEquidistant": "Conique équidistante",
"CrasterParabolic": "Parabolique de Craster",
"EckertI": "Eckert I",
"EckertII": "Eckert II",
"EckertIII": "Eckert III",
"EckertIV": "Eckert IV",
"EckertV": "Eckert V",
"EckertVI": "Eckert VI",
"Eisenlohr": "Eisenlohr",
"Gnomonic": "Gnomonique",
"Gringorten": "Gringorten",
"HEALPix": "HEALPix",
"Homolosine": "Homolosine de Goode (non-interrompue)",
"InterruptedHomolosine": "Homolosine de Goode (interrompue)",
"Loximuthal": "Loximuthale",
"Mercator": "Mercator",
"NaturalEarth": "Natural Earth",
"Orthographic": "Orthographique",
"Peircequincuncial": "Pierce Quincuncial",
"Robinson": "Robinson",
"InterruptedSinuMollweide": "Sinu-Mollweide interrompue",
"Sinusoidal": "Sinusoïdale",
"InterruptedSinusoidal": "Sinusoïdale interrompue"
},
"stat_summary": {
"population": "Population",
"min": "Min",
Expand Down
27 changes: 6 additions & 21 deletions magrit_app/templates/index2.html
Expand Up @@ -33,7 +33,7 @@
</div>

<div class="collapse navbar-collapse">
<a class="btn btn-default enter_button i18n" style="float:right;color:greenyellow;background:transparent none repeat scroll 0% 0% border-box;margin-top:7px;" data-i18n="[html]index.buttons.start_now"></a>
<a class="btn btn-default enter_button i18n" style="float:right;color:greenyellow;background:transparent none repeat scroll 0% 0% border-box;margin-top:7px;font-weight:800;" data-i18n="[html]index.buttons.start_now"></a>
<div class="btn-group" style="float:right;margin-top:7px;";>
<button id="lang_current" type="button" class="btn btn-default" style="color:greenyellow;background:transparent none repeat scroll 0% 0% border-box;"></button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" style="color:greenyellow;background:transparent none repeat scroll 0% 0% border-box;">
Expand All @@ -44,8 +44,8 @@
<li><a id="lang2"></a></li>
</ul>
</div>
<div class="btn-group" style="float:right;margin:10px 15px 0 15px;";>
<a href="http://riate.cnrs.fr"><img src="/static/img/riate_green_grey.png" alt="RIATE logo" style="max-height:18px;"></a>
<div class="btn-group" style="float:right;margin:15px 15px 0 15px;";>
<a href="http://www.ums-riate.fr"><img src="/static/img/riate_green_grey.png" alt="RIATE logo" style="max-height:18px;"></a>
</div>
</div>
<!-- /.navbar-collapse -->
Expand All @@ -54,10 +54,11 @@
</div>
</nav>

<section id="intro" class="intro-section" style="height:115%;">
<section id="intro" class="intro-section">
<div class="container">
<div class="row">
<h1 style="font-family:Dosis;" class="i18n" data-i18n="index.title"></h1>
<a class="btn btn-default enter_button i18n" style="color:greenyellow;background:black;font-weight:800;border-color:none;" data-i18n="[html]index.buttons.start_now"></a>
<hr class="grad-transp"></hr>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 text-center">
<div class="box1">
Expand Down Expand Up @@ -122,7 +123,7 @@ <h4 class="i18n" data-i18n="[html]index.bloc.box3_title"></h4>
</div>
<hr class="grad-transp hidden-lg hidden-md"></hr>
</div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 text-center">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-4 text-center" style="margin-bottom:75px;">
<div class="box1">
<img style="max-height:22px;" class="hover_scale" src="/static/img/Documents_icon_-_noun_project_5020.svg"/>
<h4 class="i18n" data-i18n="[html]index.bloc.user_manual1"></h4>
Expand Down Expand Up @@ -157,17 +158,11 @@ <h4 class="i18n" data-i18n="[html]index.bloc.hypotheses1"></h4>
<div class="container">
<div class="row">
<div class="col-lg-3 col-md-4 hidden-sm hidden-xs" style="padding: 0;">

<span>
<a class="pop">
<img class="grey_img" data-toggle="popover" data-placement="auto" title="Choropleth map" src="/static/img/gallery/choropleth_map.png" alt="Choropleth map" style="max-height:65px;cursor:pointer;">
</a>
</span>
<!-- <span>
<a class="pop">
<img class="grey_img" data-toggle="popover" data-placement="auto" title="Categorical map" src="/static/img/gallery/typo.png" alt="Categorical map" style="max-height:65px;cursor:pointer;">
</a>
</span> -->
<span>
<a class="pop">
<img class="grey_img" data-toggle="popover" data-placement="auto" title="Discontinuity map" src="/static/img/gallery/discont.png" alt="Discontinuity map" style="max-height:65px;cursor:pointer;">
Expand All @@ -185,11 +180,6 @@ <h4 class="i18n" data-i18n="[html]index.bloc.hypotheses1"></h4>
<img class="grey_img" data-toggle="popover" data-placement="auto" title="Density map" src="/static/img/gallery/gridded.png" alt="Density map" style="max-height:65px;cursor:pointer;">
</a>
</span>
<!-- <span>
<a class="pop">
<img class="grey_img" data-toggle="popover" data-placement="auto" title="Proportional symbols map" src="/static/img/gallery/propsymbols.png" alt="Proportional symbols map" style="max-height:65px;cursor:pointer;">
</a>
</span> -->
<span>
<a class="pop">
<img class="grey_img" data-toggle="popover" data-placement="auto" title="Stock and ratios map" src="/static/img/gallery/worldpop.png" alt="Stock and ratios map" style="max-height:65px;cursor:pointer;">
Expand Down Expand Up @@ -217,11 +207,6 @@ <h4 class="i18n" data-i18n="[html]index.bloc.hypotheses1"></h4>
<img class="grey_img" data-toggle="popover" data-placement="auto" title="Dougenik cartogram" src="/static/img/gallery/dougenik.png" alt="Dougenik cartogram" style="max-height:65px;cursor:pointer;">
</a>
</span>
<!-- <span>
<a class="pop">
<img class="grey_img" data-toggle="popover" data-placement="auto" title="Countries visited by James Bond" src="/static/img/gallery/jamesbond_country.png" alt="Countries visited by James Bond" style="max-height:65px;cursor:pointer;">
</a>
</span> -->
</div>
<div class="col-lg-3 col-md-3 col-xs-12 col-sm-12">
<p class="i18n" data-i18n="[html]index.bloc.browser"></p>
Expand Down
2 changes: 1 addition & 1 deletion magrit_app/templates/modules.html
Expand Up @@ -48,6 +48,6 @@
<span style="color:red">To use Magrit, you need to have JavaScript enabled in your browser.</span>
</div>
</noscript>
<script src="/static/js/app.af4a4cbe3e47.js"></script>
<script src="/static/js/app.5f408f9e65e4.js"></script>
</body>
</html>

0 comments on commit 1f82424

Please sign in to comment.