Skip to content

Commit

Permalink
trends in ntl
Browse files Browse the repository at this point in the history
  • Loading branch information
ramarty committed May 9, 2024
1 parent 64c0231 commit bb6a93f
Show file tree
Hide file tree
Showing 13 changed files with 4,545 additions and 54 deletions.
4 changes: 2 additions & 2 deletions notebooks/nighttime-lights/02_extract_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ adm0_sf <- read_sf(file.path(boundaries_dir, "ner_adm_ignn_20230720_ab_shp",
adm1_sf <- read_sf(file.path(boundaries_dir, "ner_adm_ignn_20230720_ab_shp",
"NER_admbnda_adm1_IGNN_20230720.shp"))
adm2_sf <- read_sf(file.path(boundaries_dir, "ner_adm_ignn_20230720_ab_shp",
"NER_admbnda_adm1_IGNN_20230720.shp"))
"NER_admbnda_adm2_IGNN_20230720.shp"))
adm3_sf <- read_sf(file.path(boundaries_dir, "ner_adm_ignn_20230720_ab_shp",
"NER_admbnda_adm1_IGNN_20230720.shp"))
"NER_admbnda_adm3_IGNN_20230720.shp"))

city_df <- read.csv(file.path(city_dir, "niger_cities.csv"))
city_sf <- st_as_sf(city_df, coords = c("longitude", "latitude"), crs = 4326)
Expand Down
492 changes: 440 additions & 52 deletions notebooks/nighttime-lights/ntl_analysis.html

Large diffs are not rendered by default.

369 changes: 369 additions & 0 deletions notebooks/nighttime-lights/ntl_analysis.qmd

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
jQuery Sparklines
=================

This jQuery plugin makes it easy to generate a number of different types
of sparklines directly in the browser, using online a line of two of HTML
and Javascript.

The plugin has no dependencies other than jQuery and works with all modern
browsers and also Internet Explorer 6 and later (excanvas is not required
for IE support).

See the [jQuery Sparkline project page](http://omnipotent.net/jquery.sparkline/)
for live examples and documentation.

## License

Released under the New BSD License

(c) Splunk, Inc 2012


## About this fork

* The intent of this fork is to build the Javascript files with Grunt 0.4 and to check the built files into the repo.
* The min file is minified using [UglifyJS](https://github.com/mishoo/UglifyJS) with default settings.
* Checking in built files is [not what the original author wants](https://github.com/gwatts/jquery.sparkline/pull/77) in his repo.
* So why does this fork do that? Well, the built files will then be available to developers who use jquery.sparkline and use Bower for dependency management and Grunt to pluck the files they need in their project. This lets the developer avoid having to run Grunt in dependency directories (eg, node_modules) before running their own builds.
* In order to allow for tag level targeting via Bower, new tags will be made, starting at 2.1.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.jqstooltip {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "Sparkline",
"title": "jQuery Sparkline",
"description": "Easily generate small, inline sparkline charts directly in the browser",
"keywords": ["canvas", "charts", "graphics", "graphing", "graphs", "sparklines", "ui", "vml"],
"banner": "/* jquery.sparkline 2.1.3 - http://omnipotent.net/jquery.sparkline/ \n Licensed under the New BSD License - see above site for details */\n",
"version": "2.1.4",
"repository": "[email protected]:relayfoods/jquery.sparkline.git",
"author": {
"name": "Gareth Watts",
"url": "http://gwatts.com/"
},
"licenses": [{
"type": "BSD-3-Clause",
"url": "http://opensource.org/licenses/BSD-3-Clause"
}],
"bugs": "https://github.com/gwatts/jquery.sparkline/issues",
"homepage": "http://omnipotent.net/jquery.sparkline/",
"demo": "http://omnipotent.net/jquery.sparkline/",
"docs": "http://omnipotent.net/jquery.sparkline/#s-docs",
"download": "http://omnipotent.net/jquery.sparkline/#s-download",
"dependencies": {
"jquery": ">=2.1.4"
},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-jshint": "~0.11.3",
"grunt-contrib-uglify": "~0.9.2",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-concat": "~0.5.1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
HTMLWidgets.widget({
name: "sparkline",
type: "output",
factory: function(el, width, height) {

var instance = {};

return {

renderValue: function(data) {

$(el).empty();

// if renderTag provided then we will do three things
// 1. set height and width to 0 and display none
// 2. set our el to the render tag if available
// 3. set height and width options to null
if(data.renderSelector && $(data.renderSelector).length){
$(el).css({
'height': '0',
'width': '0',
'display': 'none'
});
el = data.renderSelector;
// set height and width to null
// this might be confusing and need to be reverted
data.options.height = null;
data.options.width = null;
}
$(el).sparkline(data.values, data.options);

// experimental addComposite function in R
// will add composites to data.composites
if(data.composites) {
if(!Array.isArray(data.composites)) {
data.composites = [data.composites];
}
data.composites.map( function(spk) {
$(el).sparkline(spk.values,spk.options);
});
}

instance.data = data;
},

resize: function(width, height) {

// not sure what to do in the event of resize
// I think nothing for now
// but will need to get a feel for use cases
// where this is important such as slides, flexdashboard, tabset
this.renderValue(instance.data);

}

};
}
});

0 comments on commit bb6a93f

Please sign in to comment.