Skip to content

Commit

Permalink
migration of epi-rgee webpage to leaflet ☑️
Browse files Browse the repository at this point in the history
  • Loading branch information
ambarja committed Jan 3, 2023
1 parent 8cb0127 commit bcc6564
Show file tree
Hide file tree
Showing 32 changed files with 1,489 additions and 1,943 deletions.
12 changes: 6 additions & 6 deletions content/demos/01_continuous_data/index.html

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions content/demos/01_continuous_data/index.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -308,5 +308,4 @@ v2 <- so2_to_sandiego %>%
p2 + v2
```

<center><img src="https://user-images.githubusercontent.com/23284899/155409222-220b2417-9166-41b4-b731-244d934baae7.png" width="100%"></center>

<center><img src="https://user-images.githubusercontent.com/23284899/155409222-220b2417-9166-41b4-b731-244d934baae7.png" width="100%"></center>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -287,29 +287,31 @@
document.body.style.height = "100%";
document.documentElement.style.width = "100%";
document.documentElement.style.height = "100%";
if (cel) {
cel.style.position = "absolute";
var pad = unpackPadding(sizing.padding);
cel.style.top = pad.top + "px";
cel.style.right = pad.right + "px";
cel.style.bottom = pad.bottom + "px";
cel.style.left = pad.left + "px";
el.style.width = "100%";
el.style.height = "100%";
}
cel.style.position = "absolute";
var pad = unpackPadding(sizing.padding);
cel.style.top = pad.top + "px";
cel.style.right = pad.right + "px";
cel.style.bottom = pad.bottom + "px";
cel.style.left = pad.left + "px";
el.style.width = "100%";
el.style.height = "100%";

var rect = cel.getBoundingClientRect();

return {
getWidth: function() { return cel.offsetWidth; },
getHeight: function() { return cel.offsetHeight; }
getWidth: function() { return rect.width; },
getHeight: function() { return rect.height; }
};

} else {
el.style.width = px(sizing.width);
el.style.height = px(sizing.height);

var rect = cel.getBoundingClientRect();

return {
getWidth: function() { return el.offsetWidth; },
getHeight: function() { return el.offsetHeight; }
getWidth: function() { return rect.width; },
getHeight: function() { return rect.height; }
};
}
}
Expand Down Expand Up @@ -533,8 +535,8 @@

elementData(el, "initialized", true);
if (bindingDef.initialize) {
var result = bindingDef.initialize(el, el.offsetWidth,
el.offsetHeight);
var rect = el.getBoundingClientRect();
var result = bindingDef.initialize(el, rect.width, rect.height);
elementData(el, "init_result", result);
}
}
Expand Down Expand Up @@ -576,29 +578,30 @@
forEach(matches, function(el) {
var sizeObj = initSizing(el, binding);

var getSize = function(el) {
if (sizeObj) {
return {w: sizeObj.getWidth(), h: sizeObj.getHeight()}
} else {
var rect = el.getBoundingClientRect();
return {w: rect.width, h: rect.height}
}
};

if (hasClass(el, "html-widget-static-bound"))
return;
el.className = el.className + " html-widget-static-bound";

var initResult;
if (binding.initialize) {
initResult = binding.initialize(el,
sizeObj ? sizeObj.getWidth() : el.offsetWidth,
sizeObj ? sizeObj.getHeight() : el.offsetHeight
);
var size = getSize(el);
initResult = binding.initialize(el, size.w, size.h);
elementData(el, "init_result", initResult);
}

if (binding.resize) {
var lastSize = {
w: sizeObj ? sizeObj.getWidth() : el.offsetWidth,
h: sizeObj ? sizeObj.getHeight() : el.offsetHeight
};
var lastSize = getSize(el);
var resizeHandler = function(e) {
var size = {
w: sizeObj ? sizeObj.getWidth() : el.offsetWidth,
h: sizeObj ? sizeObj.getHeight() : el.offsetHeight
};
var size = getSize(el);
if (size.w === 0 && size.h === 0)
return;
if (size.w === lastSize.w && size.h === lastSize.h)
Expand Down Expand Up @@ -900,4 +903,3 @@
return result;
}
})();

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Leaflet.AwesomeMarkers, a plugin that adds colorful iconic markers for Leaflet, based on the Font Awesome icons
(c) 2012-2013, Lennard Voogdt
https://leafletjs.com
http://leafletjs.com
https://github.com/lvoogdt
*/

Expand Down
Loading

0 comments on commit bcc6564

Please sign in to comment.