├── .Rbuildignore ├── .gitignore ├── data ├── web_index.rda └── violent_crime.rda ├── inst └── libraries │ ├── crosslet │ ├── css │ │ ├── styles.css │ │ ├── crosslet-min.css │ │ ├── crosslet.css │ │ ├── bootstrap-responsive.min.css │ │ └── bootstrap-responsive.css │ ├── img │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png │ ├── config.yml │ ├── styles.css │ ├── layouts │ │ ├── page.html │ │ └── chart.html │ ├── head.load.min.js │ ├── index.html │ └── js │ │ ├── crosslet-raw-min.js │ │ └── bootstrap.min.js │ ├── leaflet │ ├── external │ │ ├── images │ │ │ ├── layers.png │ │ │ ├── marker-icon.png │ │ │ ├── marker-shadow.png │ │ │ └── marker-icon@2x.png │ │ ├── icon-fullscreen.png │ │ ├── leaflet-rCharts.css │ │ ├── legend.css │ │ ├── leaflet.ie.css │ │ ├── leaflet.geocsv.js │ │ ├── Control.FullScreen.js │ │ ├── leaflet.css │ │ └── leaflet-providers.js │ ├── examples │ │ ├── example7.R │ │ ├── example2.R │ │ ├── example1.R │ │ ├── example8.R │ │ ├── example6.R │ │ ├── example9.R │ │ ├── example5.R │ │ ├── example3.R │ │ ├── regions.js │ │ ├── example4.R │ │ ├── example10.R │ │ └── example10.html │ ├── config.yml │ ├── LICENSE.MD │ └── layouts │ │ └── chart.html │ └── datamaps │ ├── config.yml │ ├── layouts │ ├── chart2.html │ └── chart.html │ ├── test_dmap2.html │ ├── examples.R │ ├── js │ └── topojson.v1.min.js │ └── test_datamaps.html ├── NAMESPACE ├── rMaps.Rproj ├── DESCRIPTION ├── R ├── Crosslet.R ├── Leaflet.R └── Datamaps.R └── README.md /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .cache -------------------------------------------------------------------------------- /data/web_index.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnathv/rMaps/HEAD/data/web_index.rda -------------------------------------------------------------------------------- /data/violent_crime.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnathv/rMaps/HEAD/data/violent_crime.rda -------------------------------------------------------------------------------- /inst/libraries/crosslet/css/styles.css: -------------------------------------------------------------------------------- 1 | #map{ 2 | height: 550px; 3 | width: 100%; 4 | border: 1px solid #999999; 5 | } -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnathv/rMaps/HEAD/inst/libraries/leaflet/external/images/layers.png -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/icon-fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnathv/rMaps/HEAD/inst/libraries/leaflet/external/icon-fullscreen.png -------------------------------------------------------------------------------- /inst/libraries/crosslet/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnathv/rMaps/HEAD/inst/libraries/crosslet/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnathv/rMaps/HEAD/inst/libraries/leaflet/external/images/marker-icon.png -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnathv/rMaps/HEAD/inst/libraries/leaflet/external/images/marker-shadow.png -------------------------------------------------------------------------------- /inst/libraries/crosslet/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnathv/rMaps/HEAD/inst/libraries/crosslet/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/images/marker-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnathv/rMaps/HEAD/inst/libraries/leaflet/external/images/marker-icon@2x.png -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | exportPattern("^[[:alpha:]]+") 2 | import(rCharts) 3 | import(lattice) 4 | import(RColorBrewer) 5 | import(plyr) 6 | import(yaml) 7 | import(whisker) 8 | import(RJSONIO) -------------------------------------------------------------------------------- /inst/libraries/crosslet/config.yml: -------------------------------------------------------------------------------- 1 | crosslet: 2 | css: 3 | - styles.css 4 | - "http://fonts.googleapis.com/css?family=Open+Sans" 5 | jshead: "head.load.min.js" 6 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example7.R: -------------------------------------------------------------------------------- 1 | map1b = Leaflet$new() 2 | map1b$setView(c(45.5236, -122.675), zoom = 14) 3 | map1b$tileLayer(provider = 'MapQuestOpen.OSM') 4 | map1b -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example2.R: -------------------------------------------------------------------------------- 1 | require(rMaps) 2 | map2 = Leaflet$new() 3 | map2$setView(c(45.5236, -122.675), 10) 4 | map2$tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png") 5 | map2 6 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example1.R: -------------------------------------------------------------------------------- 1 | require(rMaps) 2 | map1 = Leaflet$new() 3 | map1$setView(c(45.5236, -122.675), 13) 4 | map1$tileLayer("http://a.tiles.mapbox.com/v3/mapbox.control-room/{z}/{x}/{y}.png", zoom = 8) 5 | map1 6 | 7 | map1 = Leaflet$new() 8 | map1$setView(c(45.50867, -73.55399), 13) 9 | map1 -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example8.R: -------------------------------------------------------------------------------- 1 | require(rCharts) 2 | map3 <- Leaflet$new() 3 | map3$setView(c(51.505, -0.09), zoom = 13) 4 | map3$tileLayer( 5 | "http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png", 6 | maxZoom = 18 7 | ) 8 | map3$circle(c(51.5, -0.09), 100) 9 | map3 -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example6.R: -------------------------------------------------------------------------------- 1 | require(rMaps) 2 | map6 = Leaflet$new() 3 | map6$setView(c(45.372, -121.6972), 12) 4 | map6$tileLayer(provider ='Stamen.Terrain') 5 | map6$marker(c(45.3288, -121.6625), bindPopup = 'Mt. Hood Meadows') 6 | map6$marker(c(45.3311, -121.7113), bindPopup = 'Timberline Lodge') 7 | map6 -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example9.R: -------------------------------------------------------------------------------- 1 | map2 = Leaflet$new() 2 | map2$setView(c(45.5236, -122.6750), 13) 3 | map2$tileLayer(provider = 'Stamen.Toner') 4 | map2$marker(c(45.5244, -122.6699), bindPopup = 'The Waterfront') 5 | map2$circle(c(45.5215, -122.6261), radius = 500, bindPopup = 'Laurelhurst Park') 6 | map2 7 | -------------------------------------------------------------------------------- /rMaps.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | -------------------------------------------------------------------------------- /inst/libraries/datamaps/config.yml: -------------------------------------------------------------------------------- 1 | datamaps: 2 | jshead: [js/d3.v3.min.js, js/topojson.v1.min.js, js/datamaps.all.min.js] 3 | cdn: 4 | jshead: 5 | - "http://d3js.org/d3.v3.min.js" 6 | - "http://d3js.org/topojson.v1.min.js" 7 | - "http://datamaps.github.io/scripts/datamaps.all.min.js" 8 | - "http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.min.js" 9 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/leaflet-rCharts.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0px; 3 | } 4 | .leaflet-popup-content-wrapper, .leaflet-popup-tip { 5 | background-color: black; 6 | } 7 | .leaflet-popup-content{ 8 | color: white; 9 | font-family: "Helvetica" 10 | } 11 | .leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen.png); } 12 | .leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; } -------------------------------------------------------------------------------- /inst/libraries/datamaps/layouts/chart2.html: -------------------------------------------------------------------------------- 1 | 15 | 16 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example5.R: -------------------------------------------------------------------------------- 1 | rMap <- function(location = 'montreal', zoom = 10, provider = 'MapQuestOpen.OSM'){ 2 | m1 <- Leaflet$new() 3 | lnglat <- as.list(ggmap::geocode(location)) 4 | m1$setView(c(lnglat$lat, lnglat$lon), zoom = zoom) 5 | m1$tileLayer(provider = provider) 6 | return(m1) 7 | } 8 | 9 | r1 <- rMap() 10 | mcgill <- as.list(ggmap::geocode('mcgill univesity')) 11 | r1$marker(c(mcgill$lat, mcgill$lon), bindPopup = 'mcgill university') 12 | r1 -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example3.R: -------------------------------------------------------------------------------- 1 | require(rMaps) 2 | map3 <- Leaflet$new() 3 | map3$setView(c(51.505, -0.09), zoom = 13) 4 | map3$tileLayer( 5 | "http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png", 6 | maxZoom = 18 7 | ) 8 | map3$marker(c(51.5, -0.09), bindPopup = "

Hi. I am a popup

") 9 | map3$marker(c(51.495, -0.083), bindPopup = "

Hi. I am another popup

") 10 | map3$show(cdn = T) 11 | 12 | map3$circle(c(51.5, -0.09)) -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: rMaps 2 | Type: Package 3 | Title: Interactive Maps from R 4 | Version: 0.1.1 5 | Date: 2014-02-06 6 | Author: Ramnath Vaidyanathan 7 | Maintainer: Ramnath Vaidyanathan 8 | Description: This package allows R users to create interactive maps. 9 | License: MIT 10 | Imports: 11 | plyr, 12 | lattice, 13 | RCurl, 14 | RJSONIO, 15 | whisker, 16 | yaml, 17 | RColorBrewer, 18 | rCharts 19 | Collate: 20 | Crosslet.R 21 | Datamaps.R 22 | Leaflet.R 23 | LazyData: true -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/legend.css: -------------------------------------------------------------------------------- 1 | .info { 2 | padding: 6px 8px; 3 | font: 14px/16px Arial, Helvetica, sans-serif; 4 | background: white; 5 | background: rgba(255,255,255,0.8); 6 | box-shadow: 0 0 15px rgba(0,0,0,0.2); 7 | border-radius: 5px; 8 | } 9 | .info h4 { 10 | margin: 0 0 5px; 11 | color: #777; 12 | } 13 | 14 | .legend { 15 | line-height: 18px; 16 | color: #555; 17 | } 18 | .legend i { 19 | width: 18px; 20 | height: 18px; 21 | float: left; 22 | margin-right: 8px; 23 | opacity: 0.7; 24 | } -------------------------------------------------------------------------------- /inst/libraries/leaflet/config.yml: -------------------------------------------------------------------------------- 1 | leaflet: 2 | css: [external/leaflet.css, external/leaflet-rCharts.css, external/legend.css] 3 | jshead: 4 | - external/leaflet.js 5 | - external/leaflet-providers.js 6 | - external/Control.FullScreen.js 7 | 8 | cdn: 9 | css: http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.css 10 | jshead: 11 | - http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.js 12 | - https://rawgithub.com/leaflet-extras/leaflet-providers/gh-pages/leaflet-providers.js 13 | - "http://harrywood.co.uk/maps/examples/leaflet/leaflet-plugins/layer/vector/KML.js" 14 | -------------------------------------------------------------------------------- /inst/libraries/crosslet/styles.css: -------------------------------------------------------------------------------- 1 | html{ 2 | height: 100%; 3 | } 4 | body{ 5 | margin: 0px; 6 | padding: 0px; 7 | height: 100%; 8 | } 9 | 10 | #content{ 11 | margin-right: auto; 12 | margin-left: auto; 13 | height: 100%; 14 | 15 | //width: 1324px; 16 | } 17 | 18 | #map{ 19 | 20 | height: 100%; 21 | } 22 | 23 | #templates{ 24 | display: none; 25 | } 26 | 27 | .crosslet, .crosslet * { 28 | font-family: "Open Sans"; 29 | } 30 | .crosslet_panel .legendForm input[type="text"] { 31 | padding-right: 4px !important; 32 | height: 16px !important; 33 | } 34 | .crosslet svg .hover text { 35 | background: black !important; 36 | color: white !important; 37 | } 38 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/regions.js: -------------------------------------------------------------------------------- 1 | var regions = {"type":"FeatureCollection","features":[ 2 | {"type":"Feature", 3 | "properties":{"region_id":1, "region_name":"Australian Alps"}, 4 | "geometry":{"type":"Polygon","coordinates":[[[141.13037109375,-38.788345355085625],[141.13037109375,-36.65079252503469],[144.38232421875,-36.65079252503469],[144.38232421875,-38.788345355085625],[141.13037109375,-38.788345355085625]]]}}, 5 | {"type":"Feature", 6 | "properties":{"region_id":4, "region_name":"Shark Bay"}, 7 | "geometry":{"type":"Polygon","coordinates":[[[143.10791015625,-37.75334401310656],[143.10791015625,-34.95799531086791],[146.25,-34.95799531086791],[146.25,-37.75334401310656],[143.10791015625,-37.75334401310656]]]}} 8 | ]} -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example4.R: -------------------------------------------------------------------------------- 1 | map4 = Leaflet$new() 2 | map4$setView(c(29.6779, -95.4379), 10) 3 | map4$tileLayer("http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png") 4 | # map4$tileLayer(provider = 'Stamen.Terrain') 5 | 6 | 7 | data(crime, package = 'ggmap') 8 | dat <- head(crime)[,c('lat', 'lon', 'offense')] 9 | names(dat) <- c('lat', 'lng', 'offense') 10 | map4$geocsv(dat) 11 | map4 12 | 13 | # {title: New Map} ---- 14 | map5 = Leaflet$new() 15 | map5$setView(37.27667, -91.60611, 4) 16 | map5$tileLayer("http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png") 17 | 18 | dat <- read.csv('geoCoded.csv') 19 | names(dat) <- c('address', 'lat', 'lng') 20 | dat <- transform(dat, color = 'red', fillColor = '#f03', fillOpacity = 0.5, radius = 10) 21 | map5$circle(dat) 22 | map5 23 | 24 | 25 | -------------------------------------------------------------------------------- /inst/libraries/crosslet/layouts/page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | rMaps 10 | 11 | 12 | {{# assets.css }} 13 | 14 | {{/ assets.css }} 15 | 16 | {{# assets.jshead }} 17 | 18 | {{/ assets.jshead }} 19 | 20 | 21 | 22 | 23 | {{> chartDiv }} 24 | 25 | {{{ script }}} 26 | 27 | {{> afterScript }} 28 | 29 | 30 | -------------------------------------------------------------------------------- /inst/libraries/datamaps/test_dmap2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 19 | 20 | 21 | 22 |
23 | 24 | 38 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /R/Crosslet.R: -------------------------------------------------------------------------------- 1 | crosslet = function(x, y, data, active = y[1], map = 'world'){ 2 | L1 <- Crosslet$new() 3 | L1$set( 4 | scope = map, 5 | data = toJSONArray2(data, json = F), 6 | id_field = x, 7 | dimensions = make_dimensions(data[names(data) != x]), 8 | defaults = list( 9 | order = y, 10 | active = active 11 | ) 12 | ) 13 | return(L1) 14 | } 15 | Crosslet = setRefClass('Crosslet', contains = 'rCharts', methods = list( 16 | initialize = function(){ 17 | callSuper() 18 | lib <<- 'crosslet'; 19 | LIB <<- get_lib(system.file('libraries', 'crosslet', package = 'rMaps')) 20 | templates$chartDiv <<-'
' 21 | templates$script <<- system.file('libraries', 'crosslet', 'layouts', 'chart.html', package = 'rMaps') 22 | }, 23 | getPayload = function(chartId){ 24 | dimensions = toJSON2(params$dimensions) 25 | chartParams = rjson::toJSON(params[names(params) != 'dimensions']) 26 | list(chartParams = chartParams, dimensions = dimensions, lib = lib, 27 | liburl = LIB$url 28 | ) 29 | } 30 | )) 31 | 32 | 33 | make_dimensions <- function(data){ 34 | dimensions = lapply(names(data), function(x){ 35 | list( 36 | title = x, 37 | data = list( 38 | dataSet = "#! params.data !#", 39 | field = x 40 | ) 41 | ) 42 | }) 43 | names(dimensions) = colnames(data) 44 | return(dimensions) 45 | } 46 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/LICENSE.MD: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2013, Vladimir Agafonkin 2 | Copyright (c) 2010-2011, CloudMade 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are 6 | permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this list of 9 | conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | of conditions and the following disclaimer in the documentation and/or other materials 13 | provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 17 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 18 | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 22 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/leaflet.ie.css: -------------------------------------------------------------------------------- 1 | .leaflet-vml-shape { 2 | width: 1px; 3 | height: 1px; 4 | } 5 | .lvml { 6 | behavior: url(#default#VML); 7 | display: inline-block; 8 | position: absolute; 9 | } 10 | 11 | .leaflet-control { 12 | display: inline; 13 | } 14 | 15 | .leaflet-popup-tip { 16 | width: 21px; 17 | _width: 27px; 18 | margin: 0 auto; 19 | _margin-top: -3px; 20 | 21 | filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); 22 | -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; 23 | } 24 | .leaflet-popup-tip-container { 25 | margin-top: -1px; 26 | } 27 | .leaflet-popup-content-wrapper, .leaflet-popup-tip { 28 | border: 1px solid #999; 29 | } 30 | .leaflet-popup-content-wrapper { 31 | zoom: 1; 32 | } 33 | 34 | .leaflet-control-zoom, 35 | .leaflet-control-layers { 36 | border: 3px solid #999; 37 | } 38 | .leaflet-control-zoom a { 39 | background-color: #eee; 40 | } 41 | .leaflet-control-zoom a:hover { 42 | background-color: #fff; 43 | } 44 | .leaflet-control-layers-toggle { 45 | } 46 | .leaflet-control-attribution, 47 | .leaflet-control-layers, 48 | .leaflet-control-scale-line { 49 | background: white; 50 | } 51 | .leaflet-zoom-box { 52 | filter: alpha(opacity=50); 53 | } 54 | .leaflet-control-attribution { 55 | border-top: 1px solid #bbb; 56 | border-left: 1px solid #bbb; 57 | } 58 | -------------------------------------------------------------------------------- /inst/libraries/datamaps/layouts/chart.html: -------------------------------------------------------------------------------- 1 | 4 | 53 | 54 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/leaflet.geocsv.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 - GPL 3 | * Iván Eixarch 4 | * https://github.com/joker-x/Leaflet.geoCSV 5 | */ 6 | L.GeoCSV=L.GeoJSON.extend({options:{titles:["lat","lng","popup"],fieldSeparator:";",lineSeparator:"\n",deleteDobleQuotes:true,firstLineTitles:false},_propertiesNames:[],initialize:function(csv,options){L.Util.setOptions(this,options);L.GeoJSON.prototype.initialize.call(this,csv,options)},addData:function(data){if(typeof data==="string"){var titulos=this.options.titles;if(this.options.firstLineTitles){data=data.split(this.options.lineSeparator);if(data.length<2)return;titulos=data[0];data.splice(0,1);data=data.join(this.options.lineSeparator);titulos=titulos.trim().split(this.options.fieldSeparator);for(var i=0;i=0)prop="prop-"+i;this._propertiesNames[i]=prop}data=this._csv2json(data)}L.GeoJSON.prototype.addData.call(this,data)},getPropertyName:function(title){var pos=this.options.titles.indexOf(title),prop="";if(pos>=0)prop=this._propertiesNames[pos];return prop},getPropertyTitle:function(prop){var pos=this._propertiesNames.indexOf(prop),title="";if(pos>=0)title=this.options.titles[pos];return title},_deleteDobleQuotes:function(cadena){if(this.options.deleteDobleQuotes)cadena=cadena.trim().replace(/^"/,"").replace(/"$/,"");return cadena},_csv2json:function(csv){var json={};json["type"]="FeatureCollection";json["features"]=[];var titulos=this.options.titles;csv=csv.split(this.options.lineSeparator);for(var num_linea=0;num_linea-180&&lat<90&&lat>-90){var feature={};feature["type"]="Feature";feature["geometry"]={};feature["properties"]={};feature["geometry"]["type"]="Point";feature["geometry"]["coordinates"]=[lng,lat];for(var i=0;i 2 | var params = {{{ chartParams }}} 3 | head.ready(function(){ 4 | 5 | var myColorScale = d3.scale.linear() 6 | .domain([1, 10, 20.1]) 7 | .range(["red", "yellow", "green"]) 8 | .interpolate(d3.cie.interpolateLab) 9 | 10 | var config = { 11 | map: getMap(params.scope), 12 | data: {version: "1.0", id_field: params.id_field}, 13 | dimensions : {{{ dimensions }}}, 14 | defaults: params.defaults, 15 | }; 16 | new crosslet.MapView($("#map"),config) 17 | }) 18 | 19 | function getMap(scope){ 20 | var map = [] 21 | map.world = { 22 | leaflet: { 23 | key: "af67a5248c104d27bff9e8d363b6db4a", 24 | styleId: 96931, /* 81531, */ 25 | attribution: 'Map data © OpenStreetMap' 26 | }, 27 | view: { 28 | center: [35.505, -1.09], 29 | zoom: 2 30 | }, 31 | geo: { 32 | url: "http://rawgithub.com/markmarkoh/datamaps/master/src/js/data/world.topo.json", 33 | name_field: "name", 34 | id_field: "name", 35 | topo_object: "world" 36 | } 37 | } 38 | map.us = { 39 | leaflet: { 40 | key: "fe623ce312234f8f9333bbee72d4a176", 41 | styleId: 96931, /* 64657, */ 42 | attribution: 'Map data © OpenStreetMap' 43 | }, 44 | view: { 45 | center: [40.42, -98.73], 46 | zoom:5 47 | }, 48 | geo: { 49 | url: "http://rawgithub.com/sztanko/crosslet/gh-pages/examples/us/data/us_counties.topo.json", 50 | name_field: "NAME", 51 | id_field: "GEOID", 52 | topo_object: "us_counties" 53 | } 54 | } 55 | return map[scope] 56 | } 57 | 58 | 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rMaps 2 | 3 | rMaps is an R package to create, customize and publish interactive maps from R. It supports multiple mapping libraries, including [leaflet](http://leafletjs.com), [datamaps](http://datamaps.github.io) and [crosslet](http://sztanko.github.io/crosslet/) 4 | 5 | ## Installation 6 | 7 | You can install `rMaps` from github using the `devtools` package. You will also need to install the `dev` version of `rCharts`, that contains several experimental features, required by `rMaps`. 8 | 9 | ```S 10 | require(devtools) 11 | install_github('ramnathv/rCharts@dev') 12 | install_github('ramnathv/rMaps') 13 | ``` 14 | 15 | ## Quick Start 16 | 17 | Here are some quick examples to get you started. 18 | 19 | __Example 1: CrossLet__ 20 | 21 | [CrossLet](http://sztanko.github.io/crosslet/) is an amazing mappling library that combines Leaflet and CrossFilter, allowing one to create awesome visualizations. `rMaps` wraps CrossLet and provides R users with a simple interface to access its features. 22 | 23 | ```S 24 | library(rMaps) 25 | crosslet( 26 | x = "country", 27 | y = c("web_index", "universal_access", "impact_empowerment", "freedom_openness"), 28 | data = web_index 29 | ) 30 | ``` 31 | 32 | 33 | 34 | [Click to see Interactive Map](http://bl.ocks.org/ramnathv/raw/8970935/mymap.html) 35 | 36 | __Example 2: DataMaps__ 37 | 38 | [DataMaps](http://datamaps.github.io) uses [D3.js](http://d3js.org) to create customizable SVG map visualizations in a single Javscript file. rMaps provides a simple wrapper around DataMaps and also extends its features using AngularJS. 39 | 40 | ```S 41 | ichoropleth(Crime ~ State, data = subset(violent_crime, Year == 2010)) 42 | ichoropleth(Crime ~ State, data = violent_crime, animate = "Year") 43 | ichoropleth(Crime ~ State, data = violent_crime, animate = "Year", play = TRUE) 44 | ``` 45 | 46 | 47 | 48 | __Example 3: Leaflet__ 49 | 50 | ```S 51 | map <- Leaflet$new() 52 | map$setView(c(51.505, -0.09), zoom = 13) 53 | map$tileLayer(provider = 'Stamen.Watercolor') 54 | map$marker( 55 | c(51.5, -0.09), 56 | bindPopup = 'Hi. I am a popup' 57 | ) 58 | map 59 | ``` 60 | 61 | 62 | 63 | 64 | 65 | 66 | ### Credits 67 | 68 | rMaps would have not been possible without these amazing mapping libraries written in javascript 69 | 70 | 1. [Leaflet](http://leafletjs.com) 71 | 2. [DataMaps](http://datamaps.github.io) 72 | 3. [CrossLet](http://sztanko.github.io/crosslet/) 73 | 74 | ### License 75 | 76 | rMaps is licensed under the MIT License. However, the JavaScript charting libraries that are included with this package are licensed under their own terms. All of them are free for non-commercial and commercial use. For more details on the licensing terms, you can consult the `License.md` file in each of the charting libraries. 77 | 78 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/layouts/chart.html: -------------------------------------------------------------------------------- 1 | 109 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example10.R: -------------------------------------------------------------------------------- 1 | # devtools::install_github('rCharts', 'bbest') # tweak to make var geojsonLayer available 2 | require(rMaps) 3 | 4 | json = '{"type":"FeatureCollection","features":[ 5 | {"type":"Feature", 6 | "properties":{"region_id":1, "region_name":"Australian Alps"}, 7 | "geometry":{"type":"Polygon","coordinates":[[[141.13037109375,-38.788345355085625],[141.13037109375,-36.65079252503469],[144.38232421875,-36.65079252503469],[144.38232421875,-38.788345355085625],[141.13037109375,-38.788345355085625]]]}}, 8 | {"type":"Feature", 9 | "properties":{"region_id":4, "region_name":"Shark Bay"}, 10 | "geometry":{"type":"Polygon","coordinates":[[[143.10791015625,-37.75334401310656],[143.10791015625,-34.95799531086791],[146.25,-34.95799531086791],[146.25,-37.75334401310656],[143.10791015625,-37.75334401310656]]]}} 11 | ]}' 12 | regions=RJSONIO::fromJSON(json) 13 | 14 | lmap <- Leaflet$new() 15 | lmap$tileLayer(provide='Stamen.TonerLite') 16 | lmap$setView(c(-37, 145), zoom = 6) 17 | lmap$geoJson( 18 | regions, 19 | style = "#! function(feature) { 20 | var rgn2col = {1:'red',2:'blue',4:'green'}; 21 | return { 22 | color: rgn2col[feature.properties['region_id']], 23 | strokeWidth: '1px', 24 | strokeOpacity: 0.5, 25 | fillOpacity: 0.2 26 | }; } !#", 27 | onEachFeature = "#! function (feature, layer) { 28 | 29 | // info rollover 30 | if (document.getElementsByClassName('info leaflet-control').length == 0 ){ 31 | info = L.control({position: 'topright'}); // NOTE: made global b/c not ideal place to put this function 32 | info.onAdd = function (map) { 33 | this._div = L.DomUtil.create('div', 'info'); 34 | this.update(); 35 | return this._div; 36 | }; 37 | info.update = function (props) { 38 | this._div.innerHTML = '

Field Name

' + (props ? 39 | props['region_id'] + ': + props[fld] + ' 40 | : 'Hover over a region'); 41 | }; 42 | info.addTo(map); 43 | }; 44 | 45 | // mouse events 46 | layer.on({ 47 | 48 | // mouseover to highlightFeature 49 | mouseover: function (e) { 50 | var layer = e.target; 51 | layer.setStyle({ 52 | strokeWidth: '3px', 53 | strokeOpacity: 0.7, 54 | fillOpacity: 0.5 55 | }); 56 | if (!L.Browser.ie && !L.Browser.opera) { 57 | layer.bringToFront(); 58 | } 59 | info.update(layer.feature.properties); 60 | }, 61 | 62 | // mouseout to resetHighlight 63 | mouseout: function (e) { 64 | geojsonLayer.resetStyle(e.target); 65 | info.update(); 66 | }, 67 | 68 | // click to zoom 69 | click: function (e) { 70 | var layer = e.target; 71 | if ( feature.geometry.type === 'MultiPolygon' ) { 72 | // for multipolygons get true extent 73 | var bounds = layer.getBounds(); // get the bounds for the first polygon that makes up the multipolygon 74 | // loop through coordinates array, skip first element as the bounds var represents the bounds for that element 75 | for ( var i = 1, il = feature.geometry.coordinates[0].length; i < il; i++ ) { 76 | var ring = feature.geometry.coordinates[0][i]; 77 | var latLngs = ring.map(function(pair) { 78 | return new L.LatLng(pair[1], pair[0]); 79 | }); 80 | var nextBounds = new L.LatLngBounds(latLngs); 81 | bounds.extend(nextBounds); 82 | } 83 | map.fitBounds(bounds); 84 | } else { 85 | // otherwise use native target bounds 86 | map.fitBounds(e.target.getBounds()); 87 | } 88 | } 89 | }); 90 | } !#") 91 | legend_vec = c('red'='high', 'blue'='medium', 'green'='low') 92 | lmap$legend(position = 'bottomright', 93 | colors = names(legend_vec), 94 | labels = as.vector(legend_vec)) 95 | lmap -------------------------------------------------------------------------------- /R/Leaflet.R: -------------------------------------------------------------------------------- 1 | Leaflet = setRefClass('Leaflet', contains = 'rCharts', methods = list( 2 | initialize = function(){ 3 | callSuper() 4 | LIB <<- get_lib(system.file('libraries', 'leaflet', package = 'rMaps')) 5 | .self$tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png') 6 | params$addons <<- list(enablePopover = FALSE) 7 | }, 8 | enablePopover = function(e = TRUE){ 9 | params$addons$enablePopover <<- e 10 | }, 11 | mapOpts = function(worldCopyJump = FALSE, ...){ 12 | params$mapOpts <<- list(..., worldCopyJump = worldCopyJump) 13 | }, 14 | fullScreen = function(e = TRUE){ 15 | params$addons$fullscreen <<- e 16 | }, 17 | setView = function(center, zoom = 10, ...){ 18 | params <<- c(params, list(center = center, zoom = zoom)) 19 | }, 20 | tileLayer = function(urlTemplate, provider = NULL, ...){ 21 | if (!is.null(provider)){ 22 | params$provider <<- provider 23 | } else { 24 | params$urlTemplate <<- urlTemplate 25 | params$layerOpts <<- list(..., 26 | attribution = 'Map dataOpenStreetMap 27 | contributors, ImageryMapBox' 28 | ) 29 | } 30 | }, 31 | marker = function(LatLng, ...){ 32 | m = list( 33 | marker = as.list(LatLng), 34 | addTo = '#! map !#', 35 | ... 36 | ) 37 | params$marker <<- c(params$marker, list(m)) 38 | }, 39 | circle = function(LatLng, radius = 500, ...){ 40 | circle_ = list( 41 | circle = LatLng, 42 | setRadius = radius, 43 | ..., 44 | addTo = '#! map !#' 45 | ) 46 | params$circle <<- c(params$circle, list(circle_)) 47 | }, 48 | circle2 = function(circleData){ 49 | require(plyr) 50 | dat = alply(circleData, 1, function(c){ 51 | list( 52 | center = list(c$lat, c$lng), 53 | radius = c$radius, 54 | opts = c[!(names(c) %in% c('lat', 'lng', 'radius'))]) 55 | }) 56 | params$circle2 <<- setNames(dat, nm = NULL) 57 | }, 58 | geocsv = function(data){ 59 | paste2 = function(...) {paste(..., sep = ';')} 60 | params$addons$geocsv <<- TRUE 61 | params$geocsv <<- list( 62 | titles = names(data), 63 | data = paste(do.call('paste2', data), collapse = '\n') 64 | ) 65 | }, 66 | geoJson = function(list_, ...){ 67 | params$addons$geoJson <<- TRUE 68 | params$features <<- list_ 69 | dotlist = list(...) 70 | if (length(dotlist) > 0){ 71 | params$geoJson <<- list(...) 72 | } else { 73 | params$geoJson <<- FALSE 74 | } 75 | }, 76 | addKML = function(kmlFile){ 77 | params$addons$kml <<- TRUE 78 | params$kml <<- kmlFile 79 | }, 80 | legend = function(position, colors, labels){ 81 | params$addons$legend <<- TRUE 82 | params$legend <<- list(position = position, colors = colors, labels = labels) 83 | }, 84 | getPayload = function(chartId){ 85 | skip = c('marker', 'circle', 'addons', 'geoJson', 'kml') 86 | geoJson = toJSON2(params$geoJson) 87 | kml = toJSON2(params$kml) 88 | marker = paste(lapply(params$marker, toChain, obj = 'L'), collapse = '\n') 89 | # circle = paste(lapply(params$circle, toChain, obj = 'L'), collapse = '\n') 90 | circle = toChain(params$circle, obj = 'L') 91 | chartParams = toJSON(params[!(names(params) %in% skip)], digits = 13) 92 | list( 93 | chartParams = chartParams, 94 | chartId = chartId, 95 | lib = basename(lib), 96 | marker = marker, 97 | circle = circle, 98 | addons = params$addons, 99 | geoJson = geoJson, 100 | kml = kml 101 | ) 102 | } 103 | )) 104 | 105 | rqMap <- function(location = "montreal", ...){ 106 | myMap = Leaflet$new() 107 | myMap$setView(c(LngLat$lat, LngLat$lon), ...) 108 | return(myMap) 109 | } 110 | 111 | 112 | 113 | # data1 = makeChoroData( 114 | # cut(Adult_Obesity_Rate, 5, labels = F) ~ state | Mandates_BMI_Screening, 115 | # data = obesity, 116 | # pal = 'PuRd' 117 | # ) 118 | # 119 | # data2 = llply(data1, processChoroData, 120 | # x =cut(Adult_Obesity_Rate, 5, labels = F) ~ state | Mandates_BMI_Screening, 121 | # pal = 'PuRd', map = 'usa' 122 | # ) 123 | 124 | -------------------------------------------------------------------------------- /inst/libraries/datamaps/examples.R: -------------------------------------------------------------------------------- 1 | require(rCharts) 2 | d <- rCharts$new() 3 | d$setLib('datamaps') 4 | d$set( 5 | scope = 'usa', 6 | fills = fills, 7 | data = data1 8 | ) 9 | 10 | 11 | fills = list( 12 | REP = "#CC4731", 13 | DEM = "#306596", 14 | HEAVY_DEM = "#667FAF", 15 | LIGHT_DEM = "#A9C0DE", 16 | HEAVY_REP = "#EAA9A8", 17 | LIGHT_REP = "#EDDC4E", 18 | defaultFill = "#EDDC4E" 19 | ) 20 | 21 | geographyConfig = list(popupTemplate = '#! _.template('
<%= geography.properties.name %> <% if (data.electoralVotes) { %>
Electoral Votes: <%= data.electoralVotes %> <% } %>
' !#') 22 | 23 | 24 | 25 | require(RColorBrewer) 26 | 27 | 28 | # read data and replace dots in names with underscores 29 | obesity = read.csv( 30 | 'http://www.stat.berkeley.edu/classes/s133/data/obesity.csv', 31 | stringsAsFactors = F 32 | ) 33 | names(obesity) = gsub("\\.", "_", names(obesity)) 34 | 35 | # add column with two letter state names and 36 | obesity = plyr::mutate(obesity, 37 | State = str_trim(State), 38 | state = state.abb[match(State, state.name)], 39 | ) 40 | rCharts::choropleth( 41 | cut(Adult_Obesity_Rate, 5, labels = F) ~ state, 42 | data = obesity, 43 | pal = 'PuRd' 44 | ) 45 | 46 | 47 | 48 | choropleth <- function(x, data, pal){ 49 | fml = lattice::latticeParseFormula(x, data = data) 50 | data = transform(data, fillKey = fml$right) 51 | mypal = RColorBrewer::brewer.pal(length(unique(fml$right)), pal) 52 | d <- rCharts$new() 53 | d$setLib('datamaps') 54 | d$set( 55 | scope = 'usa', 56 | fills = as.list(setNames(mypal, unique(fml$right))), 57 | data = dlply(data, .(state)) 58 | ) 59 | return(d) 60 | } 61 | 62 | 63 | makeChoroData <- function(x, data, pal, map = 'usa'){ 64 | fml = lattice::latticeParseFormula(x, data = data) 65 | dlply(transform(data, fillKey = fml$right), fml$right.name) 66 | } 67 | 68 | pal = RColorBrewer::brewer.pal(6, 'Blues') 69 | 70 | d <- rCharts::rCharts$new() 71 | d$setLib('datamaps') 72 | d$set( 73 | scope = 'usa', 74 | fills = as.list(setNames(pal, 0:5)), 75 | data = dlply(obesity, .(state)) 76 | ) 77 | 78 | d <- rCharts::rCharts$new() 79 | d$setLib('datamaps') 80 | d$set( 81 | scope = 'county', 82 | geographyConfig = list( 83 | datUrl = "/datamaps/data/county.json" 84 | ) 85 | ) 86 | 87 | 88 | d <- rCharts::rCharts$new() 89 | d$setLib('datamaps') 90 | d$set( 91 | scope = 'world', 92 | projection = 'mercator' 93 | ) 94 | 95 | 96 | dat <- unemp$long.mnth 97 | dat = mutate(dat, 98 | state = state.abb[match(State, state.name)] 99 | ) 100 | 101 | pal = RColorBrewer::brewer.pal(6, 'PuRd') 102 | 103 | d <- rCharts::rCharts$new() 104 | d$setLib('datamaps') 105 | d$set( 106 | scope = 'usa', 107 | fills = as.list(setNames(pal, 0:5)), 108 | data = dlply(subset(dat, Year == 2012), .(state)) 109 | ) 110 | 111 | require(shiny) 112 | require(rCharts) 113 | runApp(list( 114 | ui = pageWithSidebar( 115 | headerPanel('rCharts with Datamaps'), 116 | sidebarPanel( 117 | sliderInput("year", label = "Year", 118 | min = 1980, max = 2012, 1980, animate = T) 119 | ), 120 | mainPanel( 121 | showOutput("mymap", "datamaps") 122 | ) 123 | ), 124 | server = function(input, output){ 125 | output$mymap <- renderChart2({ 126 | pal = RColorBrewer::brewer.pal(6, 'Blues') 127 | d <- rCharts::rCharts$new() 128 | d$setLib('datamaps') 129 | d$set( 130 | scope = 'usa', 131 | fills = as.list(setNames(pal, 0:5)), 132 | data = dlply(subset(dat, Year == input$year), .(state)) 133 | ) 134 | d 135 | }) 136 | } 137 | 138 | )) 139 | 140 | 141 | require(shiny) 142 | require(rCharts) 143 | runApp(list( 144 | ui = pageWithSidebar( 145 | headerPanel('rCharts with Datamaps'), 146 | sidebarPanel( 147 | sliderInput("year", label = "Year", 148 | min = 1981, max = 2012, 1981, animate = T 149 | ) 150 | ), 151 | mainPanel( 152 | showOutput("mymap", "datamaps") 153 | ) 154 | ), 155 | server = function(input, output){ 156 | output$mymap <- renderChart2({ 157 | unemp <- read.csv("http://mgcr271.github.io/data/unemp.csv") 158 | rCharts::choropleth( 159 | cut(unemp_rate, c(0, 2, 4, 8, 18), labels = F) ~ state, 160 | data = subset(unemp, Year == input$year), 161 | pal = 'Blues' 162 | ) 163 | }) 164 | } 165 | )) -------------------------------------------------------------------------------- /inst/libraries/crosslet/head.load.min.js: -------------------------------------------------------------------------------- 1 | /*! head.load - v1.0.3 */ 2 | (function(n,t){"use strict";function w(){}function u(n,t){if(n){typeof n=="object"&&(n=[].slice.call(n));for(var i=0,r=n.length;i 77 | 78 | 79 |
80 | 81 | ", range_[1], range_[6]) 94 | ) 95 | 96 | } else { 97 | d$setTemplate(chartDiv = sprintf(" 98 |
99 | 100 | 101 |
102 |
103 | ", range_[1], range_[6], range_[1]) 111 | ) 112 | } 113 | d$set(newData = data, data = data[[1]]) 114 | 115 | } else { 116 | d$set(data = dlply(data, fml$right.name)) 117 | } 118 | return(d) 119 | } 120 | 121 | # choropleth <- function(x, data, pal, map = 'usa', ...){ 122 | # fml = lattice::latticeParseFormula(x, data = data) 123 | # data = transform(data, fillKey = fml$left) 124 | # mypal = RColorBrewer::brewer.pal(length(unique(fml$left)), pal) 125 | # d <- Datamaps$new() 126 | # d$set( 127 | # scope = map, 128 | # fills = as.list(setNames(mypal, unique(fml$left))), 129 | # data = dlply(data, fml$right.name), 130 | # ... 131 | # ) 132 | # return(d) 133 | # } 134 | # 135 | # choropleth2 <- function(x, data, pal, map = 'usa', ...){ 136 | # data1 = makeChoroData(x, data, pal, map, ...) 137 | # data2 = llply(data1, processChoroData, x = x, pal, map, ...) 138 | # d <- Datamaps$new() 139 | # d$setTemplate( 140 | # script = system.file('libraries', 'datamaps', 'layouts', 141 | # 'chart2.html', package = 'rCharts') 142 | # ) 143 | # d$set(map = data2) 144 | # return(d) 145 | # } 146 | 147 | -------------------------------------------------------------------------------- /inst/libraries/datamaps/js/topojson.v1.min.js: -------------------------------------------------------------------------------- 1 | topojson=function(){function e(e,n){function t(n){var t=e.arcs[n],r=t[0],o=[0,0];return t.forEach(function(e){o[0]+=e[0],o[1]+=e[1]}),[r,o]}var r={},o={};n.forEach(function(e){var n,a,i=t(e),u=i[0],c=i[1];if(n=o[u])if(delete o[n.end],n.push(e),n.end=c,a=r[c]){delete r[a.start];var s=a===n?n:n.concat(a);r[s.start=n.start]=o[s.end=a.end]=s}else if(a=o[c]){delete r[a.start],delete o[a.end];var s=n.concat(a.map(function(e){return~e}).reverse());r[s.start=n.start]=o[s.end=a.start]=s}else r[n.start]=o[n.end]=n;else if(n=r[c])if(delete r[n.start],n.unshift(e),n.start=u,a=o[u]){delete o[a.end];var f=a===n?n:a.concat(n);r[f.start=a.start]=o[f.end=n.end]=f}else if(a=r[u]){delete r[a.start],delete o[a.end];var f=a.map(function(e){return~e}).reverse().concat(n);r[f.start=a.end]=o[f.end=n.end]=f}else r[n.start]=o[n.end]=n;else if(n=r[u])if(delete r[n.start],n.unshift(~e),n.start=c,a=o[c]){delete o[a.end];var f=a===n?n:a.concat(n);r[f.start=a.start]=o[f.end=n.end]=f}else if(a=r[c]){delete r[a.start],delete o[a.end];var f=a.map(function(e){return~e}).reverse().concat(n);r[f.start=a.end]=o[f.end=n.end]=f}else r[n.start]=o[n.end]=n;else if(n=o[c])if(delete o[n.end],n.push(~e),n.end=u,a=o[u]){delete r[a.start];var s=a===n?n:n.concat(a);r[s.start=n.start]=o[s.end=a.end]=s}else if(a=r[u]){delete r[a.start],delete o[a.end];var s=n.concat(a.map(function(e){return~e}).reverse());r[s.start=n.start]=o[s.end=a.start]=s}else r[n.start]=o[n.end]=n;else n=[e],r[n.start=u]=o[n.end=c]=n});var a=[];for(var i in o)a.push(o[i]);return a}function n(n,t,r){function a(e){0>e&&(e=~e),(l[e]||(l[e]=[])).push(f)}function i(e){e.forEach(a)}function u(e){e.forEach(i)}function c(e){"GeometryCollection"===e.type?e.geometries.forEach(c):e.type in d&&(f=e,d[e.type](e.arcs))}var s=[];if(arguments.length>1){var f,l=[],d={LineString:i,MultiLineString:u,Polygon:u,MultiPolygon:function(e){e.forEach(u)}};c(t),l.forEach(arguments.length<3?function(e,n){s.push(n)}:function(e,n){r(e[0],e[e.length-1])&&s.push(n)})}else for(var p=0,v=n.arcs.length;v>p;++p)s.push(p);return o(n,{type:"MultiLineString",arcs:e(n,s)})}function t(e,n){return"GeometryCollection"===n.type?{type:"FeatureCollection",features:n.geometries.map(function(n){return r(e,n)})}:r(e,n)}function r(e,n){var t={type:"Feature",id:n.id,properties:n.properties||{},geometry:o(e,n)};return null==n.id&&delete t.id,t}function o(e,n){function t(e,n){n.length&&n.pop();for(var t,r=f[0>e?~e:e],o=0,i=r.length;i>o;++o)n.push(t=r[o].slice()),s(t,o);0>e&&a(n,i)}function r(e){return e=e.slice(),s(e,0),e}function o(e){for(var n=[],r=0,o=e.length;o>r;++r)t(e[r],n);return n.length<2&&n.push(n[0].slice()),n}function i(e){for(var n=o(e);n.length<4;)n.push(n[0].slice());return n}function u(e){return e.map(i)}function c(e){var n=e.type;return"GeometryCollection"===n?{type:n,geometries:e.geometries.map(c)}:n in l?{type:n,coordinates:l[n](e)}:null}var s=d(e.transform),f=e.arcs,l={Point:function(e){return r(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(r)},LineString:function(e){return o(e.arcs)},MultiLineString:function(e){return e.arcs.map(o)},Polygon:function(e){return u(e.arcs)},MultiPolygon:function(e){return e.arcs.map(u)}};return c(n)}function a(e,n){for(var t,r=e.length,o=r-n;o<--r;)t=e[o],e[o++]=e[r],e[r]=t}function i(e,n){for(var t=0,r=e.length;r>t;){var o=t+r>>>1;e[o]e&&(e=~e);var t=o[e];t?t.push(n):o[e]=[n]})}function t(e,t){e.forEach(function(e){n(e,t)})}function r(e,n){"GeometryCollection"===e.type?e.geometries.forEach(function(e){r(e,n)}):e.type in u&&u[e.type](e.arcs,n)}var o={},a=e.map(function(){return[]}),u={LineString:n,MultiLineString:t,Polygon:t,MultiPolygon:function(e,n){e.forEach(function(e){t(e,n)})}};e.forEach(r);for(var c in o)for(var s=o[c],f=s.length,l=0;f>l;++l)for(var d=l+1;f>d;++d){var p,v=s[l],h=s[d];(p=a[v])[c=i(p,h)]!==h&&p.splice(c,0,h),(p=a[h])[c=i(p,v)]!==v&&p.splice(c,0,v)}return a}function c(e,n){function t(e){i.remove(e),e[1][2]=n(e),i.push(e)}var r,o=d(e.transform),a=p(e.transform),i=l(f),u=0;for(n||(n=s),e.arcs.forEach(function(e){var t=[];e.forEach(o);for(var a=1,u=e.length-1;u>a;++a)r=e.slice(a-1,a+2),r[1][2]=n(r),t.push(r),i.push(r);e[0][2]=e[u][2]=1/0;for(var a=0,u=t.length;u>a;++a)r=t[a],r.previous=t[a-1],r.next=t[a+1]});r=i.pop();){var c=r.previous,v=r.next;r[1][2]0;){var r=(n+1>>1)-1,a=o[r];if(e(t,a)>=0)break;o[a.index=n]=a,o[t.index=n=r]=t}}function t(n){for(var t=o[n];;){var r=n+1<<1,a=r-1,i=n,u=o[i];if(ae;++e){var r=arguments[e];n(r.index=o.push(r)-1)}return o.length},r.pop=function(){var e=o[0],n=o.pop();return o.length&&(o[n.index=0]=n,t(0)),e},r.remove=function(r){var a=r.index,i=o.pop();return a!==o.length&&(o[i.index=a]=i,(e(i,r)<0?n:t)(a)),a},r}function d(e){if(!e)return v;var n,t,r=e.scale[0],o=e.scale[1],a=e.translate[0],i=e.translate[1];return function(e,u){u||(n=t=0),e[0]=(n+=e[0])*r+a,e[1]=(t+=e[1])*o+i}}function p(e){if(!e)return v;var n,t,r=e.scale[0],o=e.scale[1],a=e.translate[0],i=e.translate[1];return function(e,u){u||(n=t=0);var c=0|(e[0]-a)/r,s=0|(e[1]-i)/o;e[0]=c-n,e[1]=s-t,n=c,t=s}}function v(){}return{version:"1.4.0",mesh:n,feature:t,neighbors:u,presimplify:c}}(); -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/Control.FullScreen.js: -------------------------------------------------------------------------------- 1 | L.Control.FullScreen = L.Control.extend({ 2 | options: { 3 | position: 'topleft', 4 | title: 'Full Screen', 5 | forceSeparateButton: false 6 | }, 7 | 8 | onAdd: function (map) { 9 | // Do nothing if we can't 10 | if (!fullScreenApi.supportsFullScreen) 11 | return map.zoomControl._container; 12 | 13 | var containerClass = 'leaflet-control-zoom', className, container; 14 | 15 | if(map.zoomControl && !this.options.forceSeparateButton) { 16 | container = map.zoomControl._container; 17 | className = '-fullscreen leaflet-bar-part leaflet-bar-part-bottom last'; 18 | // Update class of the zoom out button (Leaflet v0.5) 19 | if (map.zoomControl._zoomOutButton) { 20 | L.DomUtil.removeClass(map.zoomControl._zoomOutButton, 'leaflet-bar-part-bottom'); 21 | } 22 | } else { 23 | container = L.DomUtil.create('div', containerClass); 24 | className = '-fullscreen leaflet-bar leaflet-bar-part last'; 25 | } 26 | 27 | this._createButton(this.options.title, containerClass + className, container, this.toogleFullScreen, map); 28 | 29 | return container; 30 | }, 31 | 32 | _createButton: function (title, className, container, fn, context) { 33 | var link = L.DomUtil.create('a', className, container); 34 | link.href = '#'; 35 | link.title = title; 36 | 37 | L.DomEvent 38 | .addListener(link, 'click', L.DomEvent.stopPropagation) 39 | .addListener(link, 'click', L.DomEvent.preventDefault) 40 | .addListener(link, 'click', fn, context); 41 | 42 | L.DomEvent 43 | .addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation) 44 | .addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault) 45 | .addListener(container, fullScreenApi.fullScreenEventName, this._handleEscKey, context); 46 | 47 | L.DomEvent 48 | .addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation) 49 | .addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault) 50 | .addListener(document, fullScreenApi.fullScreenEventName, this._handleEscKey, context); 51 | 52 | return link; 53 | }, 54 | 55 | toogleFullScreen: function () { 56 | this._exitFired = false; 57 | if (fullScreenApi.supportsFullScreen){ 58 | var container = this._container; 59 | if(fullScreenApi.isFullScreen(container)){ 60 | fullScreenApi.cancelFullScreen(container); 61 | this.invalidateSize(); 62 | this.fire('exitFullscreen'); 63 | this._exitFired = true; 64 | } 65 | else { 66 | fullScreenApi.requestFullScreen(container); 67 | this.invalidateSize(); 68 | this.fire('enterFullscreen'); 69 | } 70 | } 71 | }, 72 | 73 | _handleEscKey: function () { 74 | if(!fullScreenApi.isFullScreen(this) && !this._exitFired){ 75 | this.fire('exitFullscreen'); 76 | this._exitFired = true; 77 | } 78 | } 79 | }); 80 | 81 | L.Map.addInitHook(function () { 82 | if (this.options.fullscreenControl) { 83 | this.fullscreenControl = L.control.fullscreen(this.options.fullscreenControlOptions); 84 | this.addControl(this.fullscreenControl); 85 | } 86 | }); 87 | 88 | L.control.fullscreen = function (options) { 89 | return new L.Control.FullScreen(options); 90 | }; 91 | 92 | /* 93 | Native FullScreen JavaScript API 94 | ------------- 95 | Assumes Mozilla naming conventions instead of W3C for now 96 | 97 | source : http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/ 98 | 99 | */ 100 | 101 | (function() { 102 | var 103 | fullScreenApi = { 104 | supportsFullScreen: false, 105 | isFullScreen: function() { return false; }, 106 | requestFullScreen: function() {}, 107 | cancelFullScreen: function() {}, 108 | fullScreenEventName: '', 109 | prefix: '' 110 | }, 111 | browserPrefixes = 'webkit moz o ms khtml'.split(' '); 112 | 113 | // check for native support 114 | if (typeof document.exitFullscreen != 'undefined') { 115 | fullScreenApi.supportsFullScreen = true; 116 | } else { 117 | // check for fullscreen support by vendor prefix 118 | for (var i = 0, il = browserPrefixes.length; i < il; i++ ) { 119 | fullScreenApi.prefix = browserPrefixes[i]; 120 | 121 | if (typeof document[fullScreenApi.prefix + 'CancelFullScreen' ] != 'undefined' ) { 122 | fullScreenApi.supportsFullScreen = true; 123 | 124 | break; 125 | } 126 | } 127 | } 128 | 129 | // update methods to do something useful 130 | if (fullScreenApi.supportsFullScreen) { 131 | fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange'; 132 | 133 | fullScreenApi.isFullScreen = function() { 134 | switch (this.prefix) { 135 | case '': 136 | return document.fullScreen; 137 | case 'webkit': 138 | return document.webkitIsFullScreen; 139 | default: 140 | return document[this.prefix + 'FullScreen']; 141 | } 142 | } 143 | fullScreenApi.requestFullScreen = function(el) { 144 | return (this.prefix === '') ? el.requestFullscreen() : el[this.prefix + 'RequestFullScreen'](); 145 | } 146 | fullScreenApi.cancelFullScreen = function(el) { 147 | return (this.prefix === '') ? document.exitFullscreen() : document[this.prefix + 'CancelFullScreen'](); 148 | } 149 | } 150 | 151 | // jQuery plugin 152 | if (typeof jQuery != 'undefined') { 153 | jQuery.fn.requestFullScreen = function() { 154 | 155 | return this.each(function() { 156 | var el = jQuery(this); 157 | if (fullScreenApi.supportsFullScreen) { 158 | fullScreenApi.requestFullScreen(el); 159 | } 160 | }); 161 | }; 162 | } 163 | 164 | // export api 165 | window.fullScreenApi = fullScreenApi; 166 | })(); 167 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/examples/example10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 | 26 |
27 | 28 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /inst/libraries/datamaps/test_datamaps.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 22 | 23 | 24 | 25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | 36 | 37 | 268 | 269 | 270 | 271 | -------------------------------------------------------------------------------- /inst/libraries/crosslet/css/crosslet-min.css: -------------------------------------------------------------------------------- 1 | .crosslet,.crosslet *{font-family:georgia,"times new roman",times,serif}.crosslet .crosslet_panel,.crosslet * .crosslet_panel{color:#565656;top:-10px}.crosslet .crosslet_panel .box,.crosslet * .crosslet_panel .box{display:inline-block;vertical-align:top;width:215px;margin-left:5px;background-color:#efefef;transition:background-color .2s;-moz-transition:background-color .2s;-webkit-transition:background-color .2s;-o-transition:background-color .2s;border-bottom-right-radius:15px;border-bottom-left-radius:15px;border:1px solid #d6d6d6;border-top:0;box-shadow:0 10px 14px -10px rgba(0,0,0,0.8);padding:5px;font-size:11px;text-align:center;line-height:10px}.crosslet .crosslet_panel .box .legendForm,.crosslet * .crosslet_panel .box .legendForm{display:none}.crosslet .crosslet_panel .box .legendText h2,.crosslet * .crosslet_panel .box .legendText h2,.crosslet .crosslet_panel .box .legendForm h2,.crosslet * .crosslet_panel .box .legendForm h2{font-size:1.1em;margin:0;margin-bottom:4px;text-align:center;line-height:1.3em}.crosslet .crosslet_panel .box .legendText p,.crosslet * .crosslet_panel .box .legendText p,.crosslet .crosslet_panel .box .legendForm p,.crosslet * .crosslet_panel .box .legendForm p{margin:0}.crosslet .crosslet_panel .box .legendText select,.crosslet * .crosslet_panel .box .legendText select,.crosslet .crosslet_panel .box .legendForm select,.crosslet * .crosslet_panel .box .legendForm select,.crosslet .crosslet_panel .box .legendText input[type="text"],.crosslet * .crosslet_panel .box .legendText input[type="text"],.crosslet .crosslet_panel .box .legendForm input[type="text"],.crosslet * .crosslet_panel .box .legendForm input[type="text"]{background-color:#efefef;width:auto;padding:0;padding-left:4px;height:12px;line-height:13px;font-size:12px;text-align:center;border:1px solid #efefef;border-radius:6px;font-weight:bold;margin:0;transition:background-color .2s;-moz-transition:background-color .2s;-webkit-transition:background-color .2s;-o-transition:background-color .2s}.crosslet .crosslet_panel .box .graph,.crosslet * .crosslet_panel .box .graph{display:none}.crosslet .crosslet_panel .box .graph,.crosslet * .crosslet_panel .box .graph{display:inline-block;margin-bottom:0}.crosslet .crosslet_panel .box .background.bar,.crosslet * .crosslet_panel .box .background.bar{fill:#d6d6d6}.crosslet .crosslet_panel .box .axis,.crosslet * .crosslet_panel .box .axis{display:none}.crosslet .crosslet_panel .box .axis path,.crosslet * .crosslet_panel .box .axis path,.crosslet .crosslet_panel .box .axis line,.crosslet * .crosslet_panel .box .axis line{fill:none;stroke:#000;shape-rendering:crispEdges}.crosslet .crosslet_panel .box .axis text,.crosslet * .crosslet_panel .box .axis text{font:10px sans-serif}.crosslet .crosslet_panel .box .brush rect.extent,.crosslet * .crosslet_panel .box .brush rect.extent{fill:steelblue;fill-opacity:.125}.crosslet .crosslet_panel .box .brush .resize,.crosslet * .crosslet_panel .box .brush .resize{display:none}.crosslet .crosslet_panel .box .brush .resize path,.crosslet * .crosslet_panel .box .brush .resize path{fill:#eee;stroke:#666}.crosslet .crosslet_panel .box svg,.crosslet * .crosslet_panel .box svg{height:25px;transition:height .2s;-moz-transition:height .2s;-webkit-transition:height .2s;-o-transition:height .2s}.crosslet .crosslet_panel .box.selected,.crosslet * .crosslet_panel .box.selected,.crosslet .crosslet_panel .box:hover,.crosslet * .crosslet_panel .box:hover{opacity:1;background:#fff;border-color:#b3b3b3;transition:background-color .2s;-moz-transition:background-color .2s;-webkit-transition:background-color .2s;-o-transition:background-color .2s;color:black}.crosslet .crosslet_panel .box.selected .legendForm,.crosslet * .crosslet_panel .box.selected .legendForm,.crosslet .crosslet_panel .box:hover .legendForm,.crosslet * .crosslet_panel .box:hover .legendForm{display:block}.crosslet .crosslet_panel .box.selected .legendText,.crosslet * .crosslet_panel .box.selected .legendText,.crosslet .crosslet_panel .box:hover .legendText,.crosslet * .crosslet_panel .box:hover .legendText{display:none}.crosslet .crosslet_panel .box.selected select,.crosslet * .crosslet_panel .box.selected select,.crosslet .crosslet_panel .box:hover select,.crosslet * .crosslet_panel .box:hover select,.crosslet .crosslet_panel .box.selected input[type="text"],.crosslet * .crosslet_panel .box.selected input[type="text"],.crosslet .crosslet_panel .box:hover input[type="text"],.crosslet * .crosslet_panel .box:hover input[type="text"]{background-color:#fff;border:1px solid #b3b3b3;transition:background-color .2s;-moz-transition:background-color .2s;-webkit-transition:background-color .2s;-o-transition:background-color .2s}.crosslet .crosslet_panel .box.selected .graph,.crosslet * .crosslet_panel .box.selected .graph,.crosslet .crosslet_panel .box:hover .graph,.crosslet * .crosslet_panel .box:hover .graph{margin:5px;margin-bottom:2px;display:block}.crosslet .crosslet_panel .box.selected .graph svg,.crosslet * .crosslet_panel .box.selected .graph svg,.crosslet .crosslet_panel .box:hover .graph svg,.crosslet * .crosslet_panel .box:hover .graph svg{height:45px;transition:height .2s;-moz-transition:height .2s;-webkit-transition:height .2s;-o-transition:height .2s}.crosslet .crosslet_panel .box.selected .graph .axis,.crosslet * .crosslet_panel .box.selected .graph .axis,.crosslet .crosslet_panel .box:hover .graph .axis,.crosslet * .crosslet_panel .box:hover .graph .axis{display:inline;transition:display .2s;-moz-transition:display .2s;-webkit-transition:display .2s;-o-transition:display .2s}.crosslet .crosslet_panel .box.selected .graph .brush .resize,.crosslet * .crosslet_panel .box.selected .graph .brush .resize,.crosslet .crosslet_panel .box:hover .graph .brush .resize,.crosslet * .crosslet_panel .box:hover .graph .brush .resize{display:inline}.crosslet .crosslet_panel .box.selected .graph .background.bar,.crosslet * .crosslet_panel .box.selected .graph .background.bar,.crosslet .crosslet_panel .box:hover .graph .background.bar,.crosslet * .crosslet_panel .box:hover .graph .background.bar{fill:#ccc}.crosslet .box:not(.selected):hover .foreground.bar,.crosslet * .box:not(.selected):hover .foreground.bar{fill:#808080}.crosslet .box:not(.selected) .foreground.bar,.crosslet * .box:not(.selected) .foreground.bar{fill:#bcbcbc}.crosslet svg g.crosslet_geometry{fill-opacity:.5}.crosslet svg g.crosslet_geometry path{fill:white;stroke:none}.crosslet svg g.crosslet_geometry path:hover{fill-opacity:.2;stroke-width:2px;stroke:white;box-shadow:-5px -5px -5px -5px rgba(0,0,0,0.8)}.crosslet svg .hover{display:none}.crosslet svg .hover rect{stroke:none;fill-opacity:.5;fill:#efefef;border-radius:5px}.crosslet svg .hover text{font-size:12px;fill:black;font-weight:bold}.crosslet svg:hover .hover{display:inline} -------------------------------------------------------------------------------- /inst/libraries/crosslet/css/crosslet.css: -------------------------------------------------------------------------------- 1 | .crosslet, 2 | .crosslet * { 3 | font-family: georgia, "times new roman", times, serif; 4 | } 5 | .crosslet .crosslet_panel, 6 | .crosslet * .crosslet_panel { 7 | /*display: none;*/ 8 | 9 | /*width: 950px;*/ 10 | 11 | color: #565656; 12 | top: -10px; 13 | } 14 | .crosslet .crosslet_panel .box, 15 | .crosslet * .crosslet_panel .box { 16 | /*float:left;*/ 17 | 18 | display: inline-block; 19 | vertical-align: top; 20 | width: 215px; 21 | margin-left: 5px; 22 | background-color: #efefef; 23 | transition: background-color 0.2s; 24 | -moz-transition: background-color 0.2s; 25 | /* Firefox 4 */ 26 | 27 | -webkit-transition: background-color 0.2s; 28 | /* Safari and Chrome */ 29 | 30 | -o-transition: background-color 0.2s; 31 | /* Opera */ 32 | 33 | /*background: -webkit-linear-gradient(left top, white, darken(white,5%));*/ 34 | 35 | border-bottom-right-radius: 15px; 36 | /*opacity: 0.9;*/ 37 | 38 | border-bottom-left-radius: 15px; 39 | border: 1px solid #d6d6d6; 40 | border-top: none; 41 | box-shadow: 0 10px 14px -10px rgba(0, 0, 0, 0.8); 42 | padding: 5px; 43 | font-size: 11px; 44 | text-align: center; 45 | line-height: 10px; 46 | } 47 | .crosslet .crosslet_panel .box .legendForm, 48 | .crosslet * .crosslet_panel .box .legendForm { 49 | display: none; 50 | } 51 | .crosslet .crosslet_panel .box .legendText h2, 52 | .crosslet * .crosslet_panel .box .legendText h2, 53 | .crosslet .crosslet_panel .box .legendForm h2, 54 | .crosslet * .crosslet_panel .box .legendForm h2 { 55 | font-size: 1.1em; 56 | margin: 0px; 57 | margin-bottom: 4px; 58 | text-align: center; 59 | line-height: 1.3em; 60 | } 61 | .crosslet .crosslet_panel .box .legendText p, 62 | .crosslet * .crosslet_panel .box .legendText p, 63 | .crosslet .crosslet_panel .box .legendForm p, 64 | .crosslet * .crosslet_panel .box .legendForm p { 65 | margin: 0px; 66 | } 67 | .crosslet .crosslet_panel .box .legendText select, 68 | .crosslet * .crosslet_panel .box .legendText select, 69 | .crosslet .crosslet_panel .box .legendForm select, 70 | .crosslet * .crosslet_panel .box .legendForm select, 71 | .crosslet .crosslet_panel .box .legendText input[type="text"], 72 | .crosslet * .crosslet_panel .box .legendText input[type="text"], 73 | .crosslet .crosslet_panel .box .legendForm input[type="text"], 74 | .crosslet * .crosslet_panel .box .legendForm input[type="text"] { 75 | background-color: #efefef; 76 | width: auto; 77 | padding: 0px; 78 | padding-left: 4px; 79 | height: 12px; 80 | line-height: 13px; 81 | font-size: 12px; 82 | text-align: center; 83 | border: 1px solid #efefef; 84 | border-radius: 6px; 85 | font-weight: bold; 86 | margin: 0px; 87 | transition: background-color 0.2s; 88 | -moz-transition: background-color 0.2s; 89 | /* Firefox 4 */ 90 | 91 | -webkit-transition: background-color 0.2s; 92 | /* Safari and Chrome */ 93 | 94 | -o-transition: background-color 0.2s; 95 | /* Opera */ 96 | 97 | /*text-align: center;*/ 98 | 99 | } 100 | .crosslet .crosslet_panel .box .graph, 101 | .crosslet * .crosslet_panel .box .graph { 102 | /*.transition(height);*/ 103 | 104 | display: none; 105 | } 106 | .crosslet .crosslet_panel .box .graph, 107 | .crosslet * .crosslet_panel .box .graph { 108 | display: inline-block; 109 | margin-bottom: 0px; 110 | } 111 | .crosslet .crosslet_panel .box .background.bar, 112 | .crosslet * .crosslet_panel .box .background.bar { 113 | fill: #d6d6d6; 114 | } 115 | .crosslet .crosslet_panel .box .axis, 116 | .crosslet * .crosslet_panel .box .axis { 117 | display: none; 118 | } 119 | .crosslet .crosslet_panel .box .axis path, 120 | .crosslet * .crosslet_panel .box .axis path, 121 | .crosslet .crosslet_panel .box .axis line, 122 | .crosslet * .crosslet_panel .box .axis line { 123 | fill: none; 124 | stroke: #000; 125 | shape-rendering: crispEdges; 126 | } 127 | .crosslet .crosslet_panel .box .axis text, 128 | .crosslet * .crosslet_panel .box .axis text { 129 | font: 10px sans-serif; 130 | } 131 | .crosslet .crosslet_panel .box .brush rect.extent, 132 | .crosslet * .crosslet_panel .box .brush rect.extent { 133 | fill: steelblue; 134 | fill-opacity: .125; 135 | } 136 | .crosslet .crosslet_panel .box .brush .resize, 137 | .crosslet * .crosslet_panel .box .brush .resize { 138 | display: none; 139 | } 140 | .crosslet .crosslet_panel .box .brush .resize path, 141 | .crosslet * .crosslet_panel .box .brush .resize path { 142 | fill: #eee; 143 | stroke: #666; 144 | } 145 | .crosslet .crosslet_panel .box svg, 146 | .crosslet * .crosslet_panel .box svg { 147 | height: 25px; 148 | transition: height 0.2s; 149 | -moz-transition: height 0.2s; 150 | /* Firefox 4 */ 151 | 152 | -webkit-transition: height 0.2s; 153 | /* Safari and Chrome */ 154 | 155 | -o-transition: height 0.2s; 156 | /* Opera */ 157 | 158 | } 159 | .crosslet .crosslet_panel .box.selected, 160 | .crosslet * .crosslet_panel .box.selected, 161 | .crosslet .crosslet_panel .box:hover, 162 | .crosslet * .crosslet_panel .box:hover { 163 | opacity: 1; 164 | background: #ffffff; 165 | border-color: #b3b3b3; 166 | transition: background-color 0.2s; 167 | -moz-transition: background-color 0.2s; 168 | /* Firefox 4 */ 169 | 170 | -webkit-transition: background-color 0.2s; 171 | /* Safari and Chrome */ 172 | 173 | -o-transition: background-color 0.2s; 174 | /* Opera */ 175 | 176 | /*min-height: 110px;*/ 177 | 178 | color: black; 179 | } 180 | .crosslet .crosslet_panel .box.selected .legendForm, 181 | .crosslet * .crosslet_panel .box.selected .legendForm, 182 | .crosslet .crosslet_panel .box:hover .legendForm, 183 | .crosslet * .crosslet_panel .box:hover .legendForm { 184 | display: block; 185 | } 186 | .crosslet .crosslet_panel .box.selected .legendText, 187 | .crosslet * .crosslet_panel .box.selected .legendText, 188 | .crosslet .crosslet_panel .box:hover .legendText, 189 | .crosslet * .crosslet_panel .box:hover .legendText { 190 | display: none; 191 | } 192 | .crosslet .crosslet_panel .box.selected select, 193 | .crosslet * .crosslet_panel .box.selected select, 194 | .crosslet .crosslet_panel .box:hover select, 195 | .crosslet * .crosslet_panel .box:hover select, 196 | .crosslet .crosslet_panel .box.selected input[type="text"], 197 | .crosslet * .crosslet_panel .box.selected input[type="text"], 198 | .crosslet .crosslet_panel .box:hover input[type="text"], 199 | .crosslet * .crosslet_panel .box:hover input[type="text"] { 200 | background-color: #ffffff; 201 | border: 1px solid #b3b3b3; 202 | transition: background-color 0.2s; 203 | -moz-transition: background-color 0.2s; 204 | /* Firefox 4 */ 205 | 206 | -webkit-transition: background-color 0.2s; 207 | /* Safari and Chrome */ 208 | 209 | -o-transition: background-color 0.2s; 210 | /* Opera */ 211 | 212 | } 213 | .crosslet .crosslet_panel .box.selected .graph, 214 | .crosslet * .crosslet_panel .box.selected .graph, 215 | .crosslet .crosslet_panel .box:hover .graph, 216 | .crosslet * .crosslet_panel .box:hover .graph { 217 | /*border: 1px dotted @inactive-border;*/ 218 | 219 | /*height: 55px;*/ 220 | 221 | margin: 5px; 222 | margin-bottom: 2px; 223 | display: block; 224 | /* 225 | 226 | 227 | }*/ 228 | 229 | } 230 | .crosslet .crosslet_panel .box.selected .graph svg, 231 | .crosslet * .crosslet_panel .box.selected .graph svg, 232 | .crosslet .crosslet_panel .box:hover .graph svg, 233 | .crosslet * .crosslet_panel .box:hover .graph svg { 234 | height: 45px; 235 | transition: height 0.2s; 236 | -moz-transition: height 0.2s; 237 | /* Firefox 4 */ 238 | 239 | -webkit-transition: height 0.2s; 240 | /* Safari and Chrome */ 241 | 242 | -o-transition: height 0.2s; 243 | /* Opera */ 244 | 245 | } 246 | .crosslet .crosslet_panel .box.selected .graph .axis, 247 | .crosslet * .crosslet_panel .box.selected .graph .axis, 248 | .crosslet .crosslet_panel .box:hover .graph .axis, 249 | .crosslet * .crosslet_panel .box:hover .graph .axis { 250 | display: inline; 251 | transition: display 0.2s; 252 | -moz-transition: display 0.2s; 253 | /* Firefox 4 */ 254 | 255 | -webkit-transition: display 0.2s; 256 | /* Safari and Chrome */ 257 | 258 | -o-transition: display 0.2s; 259 | /* Opera */ 260 | 261 | } 262 | .crosslet .crosslet_panel .box.selected .graph .brush .resize, 263 | .crosslet * .crosslet_panel .box.selected .graph .brush .resize, 264 | .crosslet .crosslet_panel .box:hover .graph .brush .resize, 265 | .crosslet * .crosslet_panel .box:hover .graph .brush .resize { 266 | display: inline; 267 | } 268 | .crosslet .crosslet_panel .box.selected .graph .background.bar, 269 | .crosslet * .crosslet_panel .box.selected .graph .background.bar, 270 | .crosslet .crosslet_panel .box:hover .graph .background.bar, 271 | .crosslet * .crosslet_panel .box:hover .graph .background.bar { 272 | fill: #cccccc; 273 | } 274 | .crosslet .box:not(.selected):hover .foreground.bar, 275 | .crosslet * .box:not(.selected):hover .foreground.bar { 276 | fill: #808080; 277 | } 278 | .crosslet .box:not(.selected) .foreground.bar, 279 | .crosslet * .box:not(.selected) .foreground.bar { 280 | fill: #bcbcbc; 281 | /*fill: steelblue;*/ 282 | 283 | } 284 | .crosslet .box.selected #imd .foreground.bar, 285 | .crosslet * .box.selected #imd .foreground.bar { 286 | /* fill: inherit; */ 287 | 288 | } 289 | .crosslet svg g.crosslet_geometry { 290 | fill-opacity: 0.5; 291 | } 292 | .crosslet svg g.crosslet_geometry path { 293 | fill: white; 294 | stroke: none; 295 | /*stroke: black; */ 296 | 297 | } 298 | .crosslet svg g.crosslet_geometry path:hover { 299 | fill-opacity: 0.2; 300 | stroke-width: 2px; 301 | stroke: white; 302 | box-shadow: -5px -5px -5px -5px rgba(0, 0, 0, 0.8); 303 | } 304 | .crosslet svg .hover { 305 | display: none; 306 | } 307 | .crosslet svg .hover rect { 308 | stroke: none; 309 | fill-opacity: 0.5; 310 | fill: #efefef; 311 | border-radius: 5px; 312 | } 313 | .crosslet svg .hover text { 314 | font-size: 12px; 315 | fill: black; 316 | font-weight: bold; 317 | } 318 | .crosslet svg:hover .hover { 319 | display: inline; 320 | } 321 | -------------------------------------------------------------------------------- /inst/libraries/crosslet/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Crosslet 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |

Crosslet

67 | 68 |

Crosslet is a free small (22k without dependencies) JavaScript widget for interactive visualisation and analysis of geostatistical datasets. You can also use it for visualizing and comparing multivariate datasets.

69 | 70 |

It is a combination of three very powerful JavaScript libraries:

71 | 72 |
    73 |
  • 74 | Leaflet, an elegant and beautiful mapping solution, and
  • 75 |
  • 76 | Crossfilter, a library for exploring large multivariate datasets in the browser.
  • 77 |
  • 78 | D3, a data driven way of manipulating objects.
  • 79 |
80 |

Crosslet also supports TopoJSON, a GeoJSON extension that allows to present geometry in a highly compact way.

81 |

Crosslet is written in CoffeeScript and uses less for styling.

82 | 83 | Download crosslet-0.1.zip (44k js and css) 84 | 98 |
99 |
100 | 101 | 102 |

Documentation & Tutorials

103 | 104 | 114 |

Examples

115 | 120 | 121 | 122 |

Github

123 | 128 | 129 |
130 |
131 | 132 |
133 |

Useful links

134 |
140 |
141 |

Disclaimer

142 |

Crosslet uses some latest web technologies including SVG, therefore it is not compatible with older browsers and browser which do not support SVG. Complex maps with more then a thousand items might cause Crosslet perform slower on non webkit based maps.

143 |
144 |
145 | 146 |
147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 261 | 262 | 275 | 276 | 277 | 278 | 279 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/leaflet.css: -------------------------------------------------------------------------------- 1 | /* required styles */ 2 | 3 | .leaflet-map-pane, 4 | .leaflet-tile, 5 | .leaflet-marker-icon, 6 | .leaflet-marker-shadow, 7 | .leaflet-tile-pane, 8 | .leaflet-overlay-pane, 9 | .leaflet-shadow-pane, 10 | .leaflet-marker-pane, 11 | .leaflet-popup-pane, 12 | .leaflet-overlay-pane svg, 13 | .leaflet-zoom-box, 14 | .leaflet-image-layer, 15 | .leaflet-layer { 16 | position: absolute; 17 | left: 0; 18 | top: 0; 19 | } 20 | .leaflet-container { 21 | overflow: hidden; 22 | -ms-touch-action: none; 23 | } 24 | .leaflet-tile, 25 | .leaflet-marker-icon, 26 | .leaflet-marker-shadow { 27 | -webkit-user-select: none; 28 | -moz-user-select: none; 29 | user-select: none; 30 | } 31 | .leaflet-marker-icon, 32 | .leaflet-marker-shadow { 33 | display: block; 34 | } 35 | /* map is broken in FF if you have max-width: 100% on tiles */ 36 | .leaflet-container img { 37 | max-width: none !important; 38 | } 39 | /* stupid Android 2 doesn't understand "max-width: none" properly */ 40 | .leaflet-container img.leaflet-image-layer { 41 | max-width: 15000px !important; 42 | } 43 | .leaflet-tile { 44 | filter: inherit; 45 | visibility: hidden; 46 | } 47 | .leaflet-tile-loaded { 48 | visibility: inherit; 49 | } 50 | .leaflet-zoom-box { 51 | width: 0; 52 | height: 0; 53 | } 54 | 55 | .leaflet-tile-pane { z-index: 2; } 56 | .leaflet-objects-pane { z-index: 3; } 57 | .leaflet-overlay-pane { z-index: 4; } 58 | .leaflet-shadow-pane { z-index: 5; } 59 | .leaflet-marker-pane { z-index: 6; } 60 | .leaflet-popup-pane { z-index: 7; } 61 | 62 | 63 | /* control positioning */ 64 | 65 | .leaflet-control { 66 | position: relative; 67 | z-index: 7; 68 | pointer-events: auto; 69 | } 70 | .leaflet-top, 71 | .leaflet-bottom { 72 | position: absolute; 73 | z-index: 1000; 74 | pointer-events: none; 75 | } 76 | .leaflet-top { 77 | top: 0; 78 | } 79 | .leaflet-right { 80 | right: 0; 81 | } 82 | .leaflet-bottom { 83 | bottom: 0; 84 | } 85 | .leaflet-left { 86 | left: 0; 87 | } 88 | .leaflet-control { 89 | float: left; 90 | clear: both; 91 | } 92 | .leaflet-right .leaflet-control { 93 | float: right; 94 | } 95 | .leaflet-top .leaflet-control { 96 | margin-top: 10px; 97 | } 98 | .leaflet-bottom .leaflet-control { 99 | margin-bottom: 10px; 100 | } 101 | .leaflet-left .leaflet-control { 102 | margin-left: 10px; 103 | } 104 | .leaflet-right .leaflet-control { 105 | margin-right: 10px; 106 | } 107 | 108 | 109 | /* zoom and fade animations */ 110 | 111 | .leaflet-fade-anim .leaflet-tile, 112 | .leaflet-fade-anim .leaflet-popup { 113 | opacity: 0; 114 | -webkit-transition: opacity 0.2s linear; 115 | -moz-transition: opacity 0.2s linear; 116 | -o-transition: opacity 0.2s linear; 117 | transition: opacity 0.2s linear; 118 | } 119 | .leaflet-fade-anim .leaflet-tile-loaded, 120 | .leaflet-fade-anim .leaflet-map-pane .leaflet-popup { 121 | opacity: 1; 122 | } 123 | 124 | .leaflet-zoom-anim .leaflet-zoom-animated { 125 | -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); 126 | -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); 127 | -o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1); 128 | transition: transform 0.25s cubic-bezier(0,0,0.25,1); 129 | } 130 | .leaflet-zoom-anim .leaflet-tile, 131 | .leaflet-pan-anim .leaflet-tile, 132 | .leaflet-touching .leaflet-zoom-animated { 133 | -webkit-transition: none; 134 | -moz-transition: none; 135 | -o-transition: none; 136 | transition: none; 137 | } 138 | 139 | .leaflet-zoom-anim .leaflet-zoom-hide { 140 | visibility: hidden; 141 | } 142 | 143 | 144 | /* cursors */ 145 | 146 | .leaflet-clickable { 147 | cursor: pointer; 148 | } 149 | .leaflet-container { 150 | cursor: -webkit-grab; 151 | cursor: -moz-grab; 152 | } 153 | .leaflet-popup-pane, 154 | .leaflet-control { 155 | cursor: auto; 156 | } 157 | .leaflet-dragging, 158 | .leaflet-dragging .leaflet-clickable, 159 | .leaflet-dragging .leaflet-container { 160 | cursor: move; 161 | cursor: -webkit-grabbing; 162 | cursor: -moz-grabbing; 163 | } 164 | 165 | 166 | /* visual tweaks */ 167 | 168 | .leaflet-container { 169 | background: #ddd; 170 | outline: 0; 171 | } 172 | .leaflet-container a { 173 | color: #0078A8; 174 | } 175 | .leaflet-container a.leaflet-active { 176 | outline: 2px solid orange; 177 | } 178 | .leaflet-zoom-box { 179 | border: 2px dotted #05f; 180 | background: white; 181 | opacity: 0.5; 182 | } 183 | 184 | 185 | /* general typography */ 186 | .leaflet-container { 187 | font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; 188 | } 189 | 190 | 191 | /* general toolbar styles */ 192 | 193 | .leaflet-bar { 194 | box-shadow: 0 0 8px rgba(0,0,0,0.4); 195 | border: 1px solid #888; 196 | -webkit-border-radius: 5px; 197 | border-radius: 5px; 198 | } 199 | .leaflet-bar-part { 200 | background-color: rgba(255, 255, 255, 0.8); 201 | border-bottom: 1px solid #aaa; 202 | } 203 | .leaflet-bar-part-top { 204 | -webkit-border-radius: 4px 4px 0 0; 205 | border-radius: 4px 4px 0 0; 206 | } 207 | .leaflet-bar-part-bottom { 208 | -webkit-border-radius: 0 0 4px 4px; 209 | border-radius: 0 0 4px 4px; 210 | border-bottom: none; 211 | } 212 | 213 | .leaflet-touch .leaflet-bar { 214 | -webkit-border-radius: 10px; 215 | border-radius: 10px; 216 | } 217 | .leaflet-touch .leaflet-bar-part { 218 | border-bottom: 4px solid rgba(0,0,0,0.3); 219 | } 220 | .leaflet-touch .leaflet-bar-part-top { 221 | -webkit-border-radius: 7px 7px 0 0; 222 | border-radius: 7px 7px 0 0; 223 | } 224 | .leaflet-touch .leaflet-bar-part-bottom { 225 | -webkit-border-radius: 0 0 7px 7px; 226 | border-radius: 0 0 7px 7px; 227 | border-bottom: none; 228 | } 229 | 230 | 231 | /* zoom control */ 232 | 233 | .leaflet-container .leaflet-control-zoom { 234 | margin-left: 13px; 235 | margin-top: 12px; 236 | } 237 | .leaflet-control-zoom a { 238 | width: 22px; 239 | height: 22px; 240 | text-align: center; 241 | text-decoration: none; 242 | color: black; 243 | } 244 | .leaflet-control-zoom a, 245 | .leaflet-control-layers-toggle { 246 | background-position: 50% 50%; 247 | background-repeat: no-repeat; 248 | display: block; 249 | } 250 | .leaflet-control-zoom a:hover { 251 | background-color: #fff; 252 | color: #777; 253 | } 254 | .leaflet-control-zoom-in { 255 | font: bold 18px/24px Arial, Helvetica, sans-serif; 256 | } 257 | .leaflet-control-zoom-out { 258 | font: bold 23px/20px Tahoma, Verdana, sans-serif; 259 | } 260 | .leaflet-control-zoom a.leaflet-control-zoom-disabled { 261 | cursor: default; 262 | background-color: rgba(255, 255, 255, 0.8); 263 | color: #bbb; 264 | } 265 | 266 | .leaflet-touch .leaflet-control-zoom a { 267 | width: 30px; 268 | height: 30px; 269 | } 270 | .leaflet-touch .leaflet-control-zoom-in { 271 | font-size: 24px; 272 | line-height: 29px; 273 | } 274 | .leaflet-touch .leaflet-control-zoom-out { 275 | font-size: 28px; 276 | line-height: 24px; 277 | } 278 | 279 | /* layers control */ 280 | 281 | .leaflet-control-layers { 282 | box-shadow: 0 1px 7px rgba(0,0,0,0.4); 283 | background: #f8f8f9; 284 | -webkit-border-radius: 8px; 285 | border-radius: 8px; 286 | } 287 | .leaflet-control-layers-toggle { 288 | background-image: url(images/layers.png); 289 | width: 36px; 290 | height: 36px; 291 | } 292 | .leaflet-touch .leaflet-control-layers-toggle { 293 | width: 44px; 294 | height: 44px; 295 | } 296 | .leaflet-control-layers .leaflet-control-layers-list, 297 | .leaflet-control-layers-expanded .leaflet-control-layers-toggle { 298 | display: none; 299 | } 300 | .leaflet-control-layers-expanded .leaflet-control-layers-list { 301 | display: block; 302 | position: relative; 303 | } 304 | .leaflet-control-layers-expanded { 305 | padding: 6px 10px 6px 6px; 306 | color: #333; 307 | background: #fff; 308 | } 309 | .leaflet-control-layers-selector { 310 | margin-top: 2px; 311 | position: relative; 312 | top: 1px; 313 | } 314 | .leaflet-control-layers label { 315 | display: block; 316 | } 317 | .leaflet-control-layers-separator { 318 | height: 0; 319 | border-top: 1px solid #ddd; 320 | margin: 5px -10px 5px -6px; 321 | } 322 | 323 | 324 | /* attribution and scale controls */ 325 | 326 | .leaflet-container .leaflet-control-attribution { 327 | background-color: rgba(255, 255, 255, 0.7); 328 | box-shadow: 0 0 5px #bbb; 329 | margin: 0; 330 | } 331 | .leaflet-control-attribution, 332 | .leaflet-control-scale-line { 333 | padding: 0 5px; 334 | color: #333; 335 | } 336 | .leaflet-container .leaflet-control-attribution, 337 | .leaflet-container .leaflet-control-scale { 338 | font-size: 11px; 339 | } 340 | .leaflet-left .leaflet-control-scale { 341 | margin-left: 5px; 342 | } 343 | .leaflet-bottom .leaflet-control-scale { 344 | margin-bottom: 5px; 345 | } 346 | .leaflet-control-scale-line { 347 | border: 2px solid #777; 348 | border-top: none; 349 | color: black; 350 | line-height: 1.1; 351 | padding: 2px 5px 1px; 352 | font-size: 11px; 353 | text-shadow: 1px 1px 1px #fff; 354 | background-color: rgba(255, 255, 255, 0.5); 355 | box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.2); 356 | white-space: nowrap; 357 | overflow: hidden; 358 | } 359 | .leaflet-control-scale-line:not(:first-child) { 360 | border-top: 2px solid #777; 361 | border-bottom: none; 362 | margin-top: -2px; 363 | box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); 364 | } 365 | .leaflet-control-scale-line:not(:first-child):not(:last-child) { 366 | border-bottom: 2px solid #777; 367 | } 368 | 369 | .leaflet-touch .leaflet-control-attribution, 370 | .leaflet-touch .leaflet-control-layers, 371 | .leaflet-touch .leaflet-control-zoom { 372 | box-shadow: none; 373 | } 374 | .leaflet-touch .leaflet-control-layers, 375 | .leaflet-touch .leaflet-control-zoom { 376 | border: 4px solid rgba(0,0,0,0.3); 377 | } 378 | 379 | 380 | /* popup */ 381 | 382 | .leaflet-popup { 383 | position: absolute; 384 | text-align: center; 385 | } 386 | .leaflet-popup-content-wrapper { 387 | padding: 1px; 388 | text-align: left; 389 | -webkit-border-radius: 20px; 390 | border-radius: 20px; 391 | } 392 | .leaflet-popup-content { 393 | margin: 14px 20px; 394 | line-height: 1.4; 395 | } 396 | .leaflet-popup-content p { 397 | margin: 18px 0; 398 | } 399 | .leaflet-popup-tip-container { 400 | margin: 0 auto; 401 | width: 40px; 402 | height: 20px; 403 | position: relative; 404 | overflow: hidden; 405 | } 406 | .leaflet-popup-tip { 407 | width: 15px; 408 | height: 15px; 409 | padding: 1px; 410 | 411 | margin: -8px auto 0; 412 | 413 | -webkit-transform: rotate(45deg); 414 | -moz-transform: rotate(45deg); 415 | -ms-transform: rotate(45deg); 416 | -o-transform: rotate(45deg); 417 | transform: rotate(45deg); 418 | } 419 | .leaflet-popup-content-wrapper, .leaflet-popup-tip { 420 | background: white; 421 | 422 | box-shadow: 0 3px 14px rgba(0,0,0,0.4); 423 | } 424 | .leaflet-container a.leaflet-popup-close-button { 425 | position: absolute; 426 | top: 0; 427 | right: 0; 428 | padding: 4px 5px 0 0; 429 | text-align: center; 430 | width: 18px; 431 | height: 14px; 432 | font: 16px/14px Tahoma, Verdana, sans-serif; 433 | color: #c3c3c3; 434 | text-decoration: none; 435 | font-weight: bold; 436 | background: transparent; 437 | } 438 | .leaflet-container a.leaflet-popup-close-button:hover { 439 | color: #999; 440 | } 441 | .leaflet-popup-scrolled { 442 | overflow: auto; 443 | border-bottom: 1px solid #ddd; 444 | border-top: 1px solid #ddd; 445 | } 446 | 447 | 448 | /* div icon */ 449 | 450 | .leaflet-div-icon { 451 | background: #fff; 452 | border: 1px solid #666; 453 | } 454 | .leaflet-editing-icon { 455 | -webkit-border-radius: 2px; 456 | border-radius: 2px; 457 | } 458 | -------------------------------------------------------------------------------- /inst/libraries/leaflet/external/leaflet-providers.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | L.TileLayer.Provider = L.TileLayer.extend({ 3 | initialize: function (arg, options) { 4 | var providers = L.TileLayer.Provider.providers; 5 | 6 | var parts = arg.split('.'); 7 | 8 | var providerName = parts[0]; 9 | var variantName = parts[1]; 10 | 11 | if (!providers[providerName]) { 12 | throw "No such provider (" + providerName + ")"; 13 | } 14 | 15 | var provider = { 16 | url: providers[providerName].url, 17 | options: providers[providerName].options 18 | }; 19 | 20 | // overwrite values in provider from variant. 21 | if (variantName && 'variants' in providers[providerName]) { 22 | if (!(variantName in providers[providerName].variants)) { 23 | throw "No such name in provider (" + variantName + ")"; 24 | } 25 | var variant = providers[providerName].variants[variantName]; 26 | provider = { 27 | url: variant.url || provider.url, 28 | options: L.Util.extend({}, provider.options, variant.options) 29 | }; 30 | } else if (typeof provider.url === 'function') { 31 | provider.url = provider.url(parts.splice(1).join('.')); 32 | } 33 | 34 | // replace attribution placeholders with their values from toplevel provider attribution. 35 | var attribution = provider.options.attribution; 36 | if (attribution.indexOf('{attribution.') != -1) { 37 | provider.options.attribution = attribution.replace(/\{attribution.(\w*)\}/, 38 | function(match, attributionName){ 39 | return providers[attributionName].options.attribution; 40 | }); 41 | } 42 | // Compute final options combining provider options with any user overrides 43 | var layer_opts = L.Util.extend({}, provider.options, options); 44 | L.TileLayer.prototype.initialize.call(this, provider.url, layer_opts); 45 | } 46 | }); 47 | 48 | /** 49 | * Definition of providers. 50 | * see http://leafletjs.com/reference.html#tilelayer for options in the options map. 51 | */ 52 | L.TileLayer.Provider.providers = { 53 | OpenStreetMap: { 54 | url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 55 | options: { 56 | attribution: '© OpenStreetMap contributors, CC-BY-SA' 57 | }, 58 | variants: { 59 | Mapnik: {}, 60 | BlackAndWhite: { 61 | url: 'http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png' 62 | }, 63 | DE: { 64 | url: 'http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png' 65 | } 66 | } 67 | }, 68 | OpenCycleMap: { 69 | url: 'http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', 70 | options: { 71 | attribution: '© OpenCycleMap, OpenStreetMap contributors, CC-BY-SA' 72 | } 73 | }, 74 | Thunderforest: { 75 | url: 'http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png', 76 | options: { 77 | attribution: '{attribution.OpenCycleMap}' 78 | }, 79 | variants: { 80 | OpenCycleMap: {}, 81 | Transport: { 82 | url: 'http://{s}.tile2.opencyclemap.org/transport/{z}/{x}/{y}.png' 83 | }, 84 | Landscape: { 85 | url: 'http://{s}.tile3.opencyclemap.org/landscape/{z}/{x}/{y}.png' 86 | } 87 | } 88 | }, 89 | MapQuestOpen: { 90 | url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg', 91 | options: { 92 | attribution: 'Tiles Courtesy of MapQuest — Map data {attribution.OpenStreetMap}', 93 | subdomains: '1234' 94 | }, 95 | variants: { 96 | OSM: {}, 97 | Aerial:{ 98 | url: 'http://oatile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg', 99 | options: { 100 | attribution: 101 | 'Tiles Courtesy of MapQuest — ' + 102 | 'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency' 103 | } 104 | } 105 | } 106 | }, 107 | MapBox: { 108 | url: function(id) { 109 | return 'http://{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png'; 110 | }, 111 | options: { 112 | attribution: 'Imagery from MapBox — Map data {attribution.OpenStreetMap}', 113 | subdomains: 'abcd' 114 | } 115 | }, 116 | Stamen: { 117 | url: 'http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png', 118 | options: { 119 | attribution: 120 | 'Map tiles by Stamen Design, CC BY 3.0 — ' + 121 | 'Map data {attribution.OpenStreetMap}', 122 | subdomains: 'abcd', 123 | minZoom: 0, 124 | maxZoom: 20 125 | }, 126 | variants: { 127 | Toner: {}, 128 | TonerBackground: { 129 | url: 'http://{s}.tile.stamen.com/toner-background/{z}/{x}/{y}.png' 130 | }, 131 | TonerHybrid: { 132 | url: 'http://{s}.tile.stamen.com/toner-hybrid/{z}/{x}/{y}.png' 133 | }, 134 | TonerLines: { 135 | url: 'http://{s}.tile.stamen.com/toner-lines/{z}/{x}/{y}.png' 136 | }, 137 | TonerLabels: { 138 | url: 'http://{s}.tile.stamen.com/toner-labels/{z}/{x}/{y}.png' 139 | }, 140 | TonerLite: { 141 | url: 'http://{s}.tile.stamen.com/toner-lite/{z}/{x}/{y}.png' 142 | }, 143 | Terrain: { 144 | url: 'http://{s}.tile.stamen.com/terrain/{z}/{x}/{y}.jpg', 145 | options: { 146 | minZoom: 4, 147 | maxZoom: 18 148 | } 149 | }, 150 | Watercolor: { 151 | url: 'http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.jpg', 152 | options: { 153 | minZoom: 3, 154 | maxZoom: 16 155 | } 156 | } 157 | } 158 | }, 159 | Esri: { 160 | url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', 161 | options: { 162 | attribution: 'Tiles © Esri' 163 | }, 164 | variants: { 165 | WorldStreetMap: { 166 | options: { 167 | attribution: '{attribution.Esri} — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012' 168 | } 169 | }, 170 | DeLorme: { 171 | url: 'http://server.arcgisonline.com/ArcGIS/rest/services/Specialty/DeLorme_World_Base_Map/MapServer/tile/{z}/{y}/{x}', 172 | options: { 173 | minZoom: 1, 174 | maxZoom: 11, 175 | attribution: '{attribution.Esri} — Copyright: ©2012 DeLorme' 176 | } 177 | }, 178 | WorldTopoMap: { 179 | url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', 180 | options: { 181 | attribution: '{attribution.Esri} — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community' 182 | } 183 | }, 184 | WorldImagery: { 185 | url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', 186 | options: { 187 | attribution: '{attribution.Esri} — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' 188 | } 189 | }, 190 | WorldTerrain: { 191 | url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/{z}/{y}/{x}', 192 | options: { 193 | maxZoom: 13, 194 | attribution: '{attribution.Esri} — Source: USGS, Esri, TANA, DeLorme, and NPS' 195 | } 196 | }, 197 | WorldShadedRelief: { 198 | url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}', 199 | options: { 200 | maxZoom: 13, 201 | attribution: '{attribution.Esri} — Source: Esri' 202 | } 203 | }, 204 | WorldPhysical: { 205 | url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer/tile/{z}/{y}/{x}', 206 | options: { 207 | maxZoom: 8, 208 | attribution: '{attribution.Esri} — Source: US National Park Service' 209 | } 210 | }, 211 | OceanBasemap: { 212 | url: 'http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/{z}/{y}/{x}', 213 | options: { 214 | maxZoom: 13, 215 | attribution: '{attribution.Esri} — Sources: GEBCO, NOAA, CHS, OSU, UNH, CSUMB, National Geographic, DeLorme, NAVTEQ, and Esri' 216 | } 217 | }, 218 | NatGeoWorldMap: { 219 | url: 'http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}', 220 | options: { 221 | maxZoom: 16, 222 | attribution: '{attribution.Esri} — National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC' 223 | } 224 | }, 225 | WorldGrayCanvas: { 226 | url: 'http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', 227 | options: { 228 | maxZoom: 16, 229 | attribution: '{attribution.Esri} — Esri, DeLorme, NAVTEQ' 230 | } 231 | } 232 | } 233 | }, 234 | OpenWeatherMap: { 235 | options: { 236 | attribution: 'Map data © OpenWeatherMap', 237 | opacity: 0.5 238 | }, 239 | variants: { 240 | Clouds: { 241 | url: 'http://{s}.tile.openweathermap.org/map/clouds/{z}/{x}/{y}.png' 242 | }, 243 | CloudsClassic: { 244 | url: 'http://{s}.tile.openweathermap.org/map/clouds_cls/{z}/{x}/{y}.png' 245 | }, 246 | Precipitation: { 247 | url: 'http://{s}.tile.openweathermap.org/map/precipitation/{z}/{x}/{y}.png' 248 | }, 249 | PrecipitationClassic: { 250 | url: 'http://{s}.tile.openweathermap.org/map/precipitation_cls/{z}/{x}/{y}.png' 251 | }, 252 | Rain: { 253 | url: 'http://{s}.tile.openweathermap.org/map/rain/{z}/{x}/{y}.png' 254 | }, 255 | RainClassic: { 256 | url: 'http://{s}.tile.openweathermap.org/map/rain_cls/{z}/{x}/{y}.png' 257 | }, 258 | Pressure: { 259 | url: 'http://{s}.tile.openweathermap.org/map/pressure/{z}/{x}/{y}.png' 260 | }, 261 | PressureContour: { 262 | url: 'http://{s}.tile.openweathermap.org/map/pressure_cntr/{z}/{x}/{y}.png' 263 | }, 264 | Wind: { 265 | url: 'http://{s}.tile.openweathermap.org/map/wind/{z}/{x}/{y}.png' 266 | }, 267 | Temperature: { 268 | url: 'http://{s}.tile.openweathermap.org/map/temp/{z}/{x}/{y}.png' 269 | }, 270 | Snow: { 271 | url: 'http://{s}.tile.openweathermap.org/map/snow/{z}/{x}/{y}.png' 272 | } 273 | } 274 | }, 275 | Nokia: { 276 | options: { 277 | attribution: 278 | 'Map © Nokia, Data © NAVTEQ 2012', 279 | subdomains: '1234', 280 | devID: 'xyz', //These basemaps are free and you can sign up here: http://developer.here.com/plans 281 | appID: 'abc' 282 | }, 283 | variants: { 284 | normalDay: { 285 | url: 'http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/normal.day/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}' 286 | }, 287 | normalGreyDay: { 288 | url: 'http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/normal.day.grey/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}' 289 | }, 290 | satelliteNoLabelsDay: { 291 | url: 'http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/satellite.day/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}' 292 | }, 293 | satelliteYesLabelsDay: { 294 | url: 'http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/hybrid.day/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}' 295 | }, 296 | terrainDay: { 297 | url: 'http://{s}.maptile.lbs.ovi.com/maptiler/v2/maptile/newest/terrain.day/{z}/{x}/{y}/256/png8?token={devID}&app_id={appID}' 298 | } 299 | } 300 | }, 301 | Acetate: { 302 | url: 'http://a{s}.acetate.geoiq.com/tiles/acetate-hillshading/{z}/{x}/{y}.png', 303 | options: { 304 | attribution: 305 | '©2012 Esri & Stamen, Data from OSM and Natural Earth', 306 | subdomains: '0123', 307 | minZoom: 2, 308 | maxZoom: 18 309 | }, 310 | variants: { 311 | all: {}, 312 | basemap: { 313 | url: 'http://a{s}.acetate.geoiq.com/tiles/acetate-simple/{z}/{x}/{y}.png' 314 | }, 315 | terrain: { 316 | url: 'http://a{s}.acetate.geoiq.com/tiles/terrain/{z}/{x}/{y}.png' 317 | }, 318 | foreground: { 319 | url: 'http://a{s}.acetate.geoiq.com/tiles/acetate-fg/{z}/{x}/{y}.png' 320 | }, 321 | roads: { 322 | url: 'http://a{s}.acetate.geoiq.com/tiles/acetate-roads/{z}/{x}/{y}.png' 323 | }, 324 | labels: { 325 | url: 'http://a{s}.acetate.geoiq.com/tiles/acetate-labels/{z}/{x}/{y}.png' 326 | }, 327 | hillshading: { 328 | url: 'http://a{s}.acetate.geoiq.com/tiles/hillshading/{z}/{x}/{y}.png' 329 | } 330 | } 331 | } 332 | }; 333 | }()); 334 | 335 | L.tileLayer.provider = function(provider, options){ 336 | return new L.TileLayer.Provider(provider, options); 337 | }; 338 | 339 | L.Control.Layers.Provided = L.Control.Layers.extend({ 340 | initialize: function(base, overlay, options){ 341 | var first; 342 | if(base.length){ 343 | (function(){ 344 | var out = {}, 345 | len = base.length, 346 | i=0; 347 | while(ili{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} 10 | -------------------------------------------------------------------------------- /inst/libraries/crosslet/js/crosslet-raw-min.js: -------------------------------------------------------------------------------- 1 | barChart=function(){if(!barChart.id)barChart.id=0;var margin={top:5,right:10,bottom:20,left:10},x,y=d3.scale.pow().exponent(.01).clamp(true).range([20,0]),id=barChart.id++,axis=d3.svg.axis().orient("bottom"),brush=d3.svg.brush(),brushDirty,dimension,group,round,tickFormat,tickSize,filter=null,name_id,status,fill;function chart(div){var width=x.range()[1],height=y.range()[0];y.domain([group.top(1)[0].value/100,group.top(1)[0].value]);div.each(function(){var div=d3.select(this),g=div.select("g");if(g.empty()){var svg=div.append("svg").attr("width",width+margin.left+margin.right).attr("height",height+margin.top+margin.bottom).attr("id",name_id);if(fill){fill_svg=svg.append("defs").append("linearGradient").attr("id","lg-"+id).attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");var rr=x.copy().domain([0,20]).range(x.range);for(var i=0;i<20;i++){fill_svg.append("stop").attr("stop-color",fill(i)).attr("offset",i*5+"%").attr("stop-opacity","1")}}g=svg.append("g").attr("transform","translate("+margin.left+","+margin.top+")");if(filter)status.text(axis.tickFormat()(filter[0])+" - "+axis.tickFormat()(filter[1]));g.append("clipPath").attr("id","clip-"+id).append("rect").attr("width",width).attr("height",height);g.selectAll(".bar").data(["background","foreground"]).enter().append("path").attr("class",function(d){return d+" bar"}).datum(group.all());g.selectAll(".foreground.bar").attr("clip-path","url(#clip-"+id+")").attr("fill","url(#lg-"+id+")");g.append("g").attr("class","axis").attr("transform","translate(0,"+height+")").call(axis);var gBrush=g.append("g").attr("class","brush").call(brush);gBrush.selectAll("rect").attr("height",height);gBrush.selectAll(".resize").append("path").attr("d",resizePath)}if(brushDirty){brushDirty=false;g.selectAll(".brush").call(brush);div.select(".title a").style("display",brush.empty()?"none":null);if(brush.empty()){g.selectAll("#clip-"+id+" rect").attr("x",0).attr("width",width)}else{var extent=brush.extent();g.selectAll("#clip-"+id+" rect").attr("x",x(extent[0])).attr("width",x(extent[1])-x(extent[0]))}}g.selectAll(".bar").attr("d",barPath)});function barPath(groups){var path=[],i=-1,n=groups.length,d;while(++i0){if(status)status.text(axis.tickFormat()(extent[0])+" - "+axis.tickFormat()(extent[1]))}else{if(status)status.text("")}});brush.on("brushend.chart",function(){if(brush.empty()){var div=d3.select(this.parentNode.parentNode.parentNode);div.select("#clip-"+id+" rect").attr("x",null).attr("width","100%");dimension.filterAll();filter=null}});chart.margin=function(_){if(!arguments.length)return margin;margin=_;return chart};chart.x=function(_){if(!arguments.length)return x;x=_;axis.scale(x);brush.x(x);return chart};chart.tickFormat=function(_){if(!arguments.length)return tickFormat;tickFormat=_;axis.tickFormat(tickFormat);return chart};chart.name_id=function(_){if(!arguments.length)return name_id;name_id=_;return chart};chart.ticks=function(a){if(!arguments.length)return tickSize;ticks=a;if(a.length){axis.tickValues(ticks)}else axis.ticks(ticks);return chart};chart.fill=function(_){if(!arguments.length)return fill;fill=_;return chart};chart.y=function(_){if(!arguments.length)return y;y=_;return chart};chart.dimension=function(_){if(!arguments.length)return dimension;dimension=_;return chart};chart.filter=function(_){if(!arguments.length)return filter;if(_){filter=_;brush.extent(_);dimension.filterRange(_);if(status)status.text(axis.tickFormat()(filter[0])+" - "+axis.tickFormat()(filter[1]))}else{brush.clear();filter=null;dimension.filterAll()}brushDirty=true;return chart};chart.group=function(_){if(!arguments.length)return group;group=_;return chart};chart.round=function(_){if(!arguments.length)return round;round=_;return chart};return d3.rebind(chart,brush,"on")};var crosslet;crosslet={};if(!_){console.log("Please include underscore.js")}crosslet.createConfig=function(defaultConfig,config){var c;return c=jQuery.extend(true,jQuery.extend(true,{},defaultConfig),config)};crosslet.id=function(d){return d};crosslet.idf=function(d){return crosslet.id};crosslet.notimplemented=function(){throw"This function is not set. Please check your config."};crosslet.changeSelect=function(select,val){return $(select).find("option").filter(function(){return $(this).val()===val}).attr("selected",true)};crosslet.defaultConfig={map:{leaflet:{url:"http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png",key:"--your key--",styleId:64657,attribution:'Map data © OpenStreetMap contributors, ODbL, Imagery © CloudMade'},view:{center:[51.505,-.09],zoom:11},geo:{url:"please specify correct location of your geojson",name_field:"name",id_field:"code",topo_object:"please specify correct object name"}}};({data:{version:"1.0",id_field:"id"},dimensions:{},defaults:{colorscale:d3.scale.linear().domain([1,10,20]).range(["green","yellow","red"]).interpolate(d3.cie.interpolateLab),opacity:.75,order:[]}});crosslet.defaultDimensionConfig={p:{},filter:null,data:{interval:null,filter:null,field:function(d){return d.id},dataSet:crosslet.notimplemented,method:d3.tsv,preformat:function(dd){return function(d){return+d}},ticks:4,colorscale:d3.scale.linear().domain([1,10,20]).range(["green","yellow","red"]).interpolate(d3.cie.interpolateLab),exponent:1},format:{"short":function(d){return d3.format(",.2f")},"long":function(d){return d.format.short(d)},input:function(d){return d3.format(".2f")},axis:function(d){return d.format.short(d)}},render:{legend:function(d,el){var f,html;f=d.title?d.title:d.data.field_func(d);html="

"+f+"

";return el.html(html)},range:function(d,el){var html;html="

"+d.format.short(d)(d.filter[0])+""+d.format.short(d)(d.filter[1])+"

";return el.html(html)},form:function(d,el){return d.render.legend(d,el)},rangeForm:function(d,el){var html,size;size=_.max(_.map(d.data.interval,function(dd){return("_"+d.format.input(d)(dd)).length-1}));html="Range: ";return el.html(html)}},submitter:function(d,el){var out;out={};$(el).find("input, select").each(function(index,el){return out[$(el).attr("name")]=$(el).val()});return out}};var __bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i=0){this.executeCallbacks(this.callbackList[urlv],this.cache[urlv]);return this}else{if(this.status[urlv]!=="loading"){this.status[urlv]="loading";method(url,function(data){_this.cache[urlv]=data;_this.executeCallbacks(_this.callbackList[urlv],_this.cache[urlv]);_this.status[urlv]="done";return _this})}}return this};DataLoader.prototype.executeCallbacks=function(list,data){var _results;_results=[];while(list.length>0){_results.push(list.pop()(data))}return _results};return DataLoader}();var _ref,_ref1,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};crosslet.PanelView=function(_super){__extends(PanelView,_super);function PanelView(){this.renderCubes=__bind(this.renderCubes,this);this.createCube=__bind(this.createCube,this);this.setActive=__bind(this.setActive,this);this._renderMap=__bind(this._renderMap,this);this.getSelection=__bind(this.getSelection,this);_ref=PanelView.__super__.constructor.apply(this,arguments);return _ref}PanelView.prototype.initialize=function(el,config,parent){var e,o,_i,_len,_ref1;this.config=crosslet.createConfig(crosslet.defaultConfig,config);this.parent=parent;this.el=el;this.ds=parent.ds;this.boxes={};this.render();this.width=200;this.active=this.config.defaults.active?this.config.defaults.active:this.config.defaults.order[0];this.numloads=this.config.defaults.order.length;_ref1=this.config.defaults.order;for(_i=0,_len=_ref1.length;_i<_len;_i++){o=_ref1[_i];e=$("
");this.boxes[o]=new crosslet.BoxView(e,this.config.dimensions[o],this,o);$(this.el).append(e)}this.boxes[this.active].setActive(true);this.renderMap=_.debounce(this._renderMap,300);return this.boxes};PanelView.prototype.loaded=function(){this.numloads=this.numloads-1;if(this.numloads<=0){return this.createCube()}};PanelView.prototype.getSelection=function(){var abox,adata,k,keys,out,_i,_len;abox=this.boxes[this.active];adata=abox.getFilteredData();keys=this.intersection(_.map(_.values(this.boxes),function(b){return _.keys(b.getFilteredData()).sort()}));out={};for(_i=0,_len=keys.length;_i<_len;_i++){k=keys[_i];out[k]=adata[k]}return out};PanelView.prototype._renderMap=function(){var abox,f,out,_this=this;abox=this.boxes[this.active];out=this.getSelection();f=abox.config.format.long(abox.config);this.parent.renderMap(out,function(v){return abox.config.data.colorscale(abox.config.scale(v))},function(data,value){return data.properties[_this.config.map.geo.name_field]+" - "+f(value)});return this};PanelView.prototype.setActive=function(activeBox){if(activeBox!==this.active){this.boxes[this.active].setActive(false);this.active=activeBox;this.boxes[this.active].setActive(true);return this.renderMap()}};PanelView.prototype.intersection=function(a){var intersect_safe,o,out,_i,_len,_ref1;intersect_safe=function(a,b){var ai,bi,result;ai=bi=0;result=[];while(aib[bi]){bi++}if(a[ai]===b[bi]){result.push(a[ai]);ai++;bi++}}return result};switch(a.length){case 0:return a;case 1:return a[0];case 2:return intersect_safe(a[0],a[1]);default:out=a[0];_ref1=a.slice(1);for(_i=0,_len=_ref1.length;_i<_len;_i++){o=_ref1[_i];out=intersect_safe(out,o)}return out}};PanelView.prototype.createCube=function(){var bName,box,brushevent,chart,d,dg,getRounder,groups,int,js_bName,js_box,key,keys,o,row,t1,t15,t2,yscale,_i,_j,_len,_len1,_ref1,_ref2,_ref3;this.rows=[];t1=(new Date).getTime();keys=_.map(_.values(this.boxes),function(b){return _.keys(b.data).sort()});t15=(new Date).getTime();int=this.intersection(keys);for(_i=0,_len=int.length;_i<_len;_i++){key=int[_i];row={};_ref1=this.boxes;for(bName in _ref1){box=_ref1[bName];row[bName]=box.data[key]}this.rows.push(row)}t2=(new Date).getTime();this.cube=crossfilter(this.rows);getRounder=function(m1,m2,w,exp){var scale,t;t=5*(m2-m1)/w;scale=d3.scale.pow().exponent(exp).range([m1/t,m2/t]).domain([m1/t,m2/t]);return function(d){return t*scale.invert(Math.floor(scale(+d/t)))}};groups={};this.charts={};brushevent=function(box,ctx){return function(){box.event_click();return ctx.renderCubes()}};_ref2=this.boxes;for(bName in _ref2){box=_ref2[bName];var chart,js_box,js_bName;js_box=box;js_bName=bName;d=this.cube.dimension(function(dd){return dd[bName]});dg=d.group(getRounder(box.config.data.interval[0],box.config.data.interval[1],this.width-20,box.config.data.exponent));box.graph.empty();yscale=d3.scale.linear().clamp(true).range([20,0]);chart=barChart().dimension(d).name_id(bName).group(dg).x(d3.scale.pow().exponent(box.config.data.exponent).domain(box.config.data.interval).rangeRound([0,this.width-20])).y(yscale.copy()).ticks(box.config.data.ticks).tickFormat(box.config.format.axis(box.config)).fill(box.config.data.colorscale);chart.on("brush",brushevent(box,this));chart.on("brushend",this.renderCubes);box.chart=chart;this.charts[bName]=chart}if(this.parent.ds.isGeoLoaded){this.renderCubes()}_ref3=this.config.defaults.order;for(_j=0,_len1=_ref3.length;_j<_len1;_j++){o=_ref3[_j];if(this.config.dimensions[o].filter){this.boxes[o].setFilter(this.config.dimensions[o].filter,true)}}return this};PanelView.prototype.renderCubes=function(){var abox,bName,box,_ref1;_ref1=this.boxes;for(bName in _ref1){box=_ref1[bName];box.chart(box.graph);$(box.el).on("mousedown",box.event_click);box.setFilter(box.chart.filter(),false)}abox=this.boxes[this.active];abox.setFilter(abox.chart.filter(),false);this.renderMap();return this};return PanelView}(Backbone.View);crosslet.BoxView=function(_super){__extends(BoxView,_super);function BoxView(){this.setFilter=__bind(this.setFilter,this);this.event_click=__bind(this.event_click,this);this.setActive=__bind(this.setActive,this);this.dataLoaded=__bind(this.dataLoaded,this);_ref1=BoxView.__super__.constructor.apply(this,arguments);return _ref1}BoxView.prototype.initialize=function(el,config,parent,name){this.el=el;this.config=crosslet.createConfig(crosslet.defaultDimensionConfig,config);this.config.id=name;this.config.data.field_func=!_.isFunction(this.config.data.field)?function(d){return d.data.field}:this.config.data.field;$(this.el).on("mousedown",this.event_click);$(this.el).on("tap",this.event_click);$(this.el)[0].onmousedown=$(this.el)[0].ondblclick=L.DomEvent.stopPropagation;this.legend={};this.legend.all=$("
");this.legend.text=$("
");this.legend.text_p=$("
");this.legend.text_range=$("
");this.legend.text.append(this.legend.text_p).append(this.legend.text_range);this.legend.form=$("
");this.legend.form_p=$("
");this.legend.form_range=$("
");this.legend.form.append(this.legend.form_p).append(this.legend.form_range);this.legend.all.append(this.legend.text).append(this.legend.form);$(el).append(this.legend.all);this.graph=$("
");$(el).append(this.graph);this.parent=parent;this.ds=parent.ds;this.active=false;this.name=name;return this.loadData()};BoxView.prototype.loadData=function(){if(_.isString(this.config.data.dataSet)){return this.parent.ds.loadData(this.config.data.dataSet,this.dataLoaded,this.config.data.method)}else{if(_.isFunction(this.config.data.dataSet)){return this.parent.ds.loadData(this.config.data.dataSet(this.config),this.dataLoaded,this.config.data.method)}else{return this.parent.ds.addData(this.config.data.dataSet,this.dataLoaded)}}};BoxView.prototype.dataLoaded=function(){var f,id,pd,preformatter,val,_ref2;this.data={};f=this.config.data.field_func(this.config);preformatter=this.config.data.preformat(this.config);_ref2=this.parent.ds.data;for(id in _ref2){val=_ref2[id];if(_.isNumber(val[f])){pd=preformatter(val[f])}if(_.isNumber(pd)){this.data[id]=pd}}if(!this.config.data.interval){this.config.data.interval=[_.min(_.values(this.data)),_.max(_.values(this.data))]}if(!this.config.filter){this.config.filter=[_.min(_.values(this.data)),_.max(_.values(this.data))]}this.config.scale=d3.scale.pow().exponent(this.config.data.exponent).domain(this.config.data.interval).rangeRound([0,20]);this.config.scale.name="yes";this.render();return this.parent.loaded()};BoxView.prototype.setActive=function(isActive){this.active=isActive;if(isActive){return $(this.el).addClass("selected")}else{return $(this.el).removeClass("selected")}};BoxView.prototype.event_click=function(event){if(!this.active){this.parent.setActive(this.name)}return true};BoxView.prototype.setFilter=function(f,redrawCube){if(redrawCube==null){redrawCube=false}if(redrawCube){this.chart.filter(f);this.parent.renderCubes()}if(!f){f=this.config.data.interval}this.config.filter=f;this.filterElements[0].val(this.config.format.input(this.config)(f[0]));this.filterElements[1].val(this.config.format.input(this.config)(f[1]));$(this.legend.text_range).find(".m0").text(this.config.format.short(this.config)(f[0]));$(this.legend.text_range).find(".m1").text(this.config.format.short(this.config)(f[1]));return this};BoxView.prototype.getFilteredData=function(){var f,k,out,v,_ref2,_ref3;if(!this.chart.filter()){return this.data}f=(_ref2=this.chart.filter())!=null?_ref2:this.config.data.interval;out={};_ref3=this.data;for(k in _ref3){v=_ref3[k];if(f[0]<=v&&v<=f[1]){out[k]=v}}return out};BoxView.prototype.renderRange=function(){this.config.render.range(this.config,this.legend.text_range);return this.config.render.rangeForm(this.config,this.legend.form_range)};BoxView.prototype.render=function(){var _this=this;this.config.render.legend(this.config,this.legend.text_p);this.config.render.form(this.config,this.legend.form_p);this.renderRange();$(this.legend.form_range).find("input").on("change",function(){var f;f=[+_this.filterElements[0].val(),+_this.filterElements[1].val()];if(f[0]>f[1]){f.reverse()}f[0]=_.max([_this.config.data.interval[0],f[0]]);f[1]=_.min([_this.config.data.interval[1],f[1]]);if(_.isEqual(f,_this.config.data.interval)){f=null}return _this.setFilter(f,true)});$(this.legend.form_p).find("input, select").on("change",function(){var p;_this.config.data.interval=null;_this.config.scale=null;_this.config.filter=null;p=_this.config.submitter(_this.config,_this.legend.form_p);_this.config.p=p;console.log(p);return _this.loadData()});return this.filterElements=[$(this.legend.form_range).find("input[name=m0]"),$(this.legend.form_range).find("input[name=m1]")]};return BoxView}(Backbone.View);var _ref,__bind=function(fn,me){return function(){return fn.apply(me,arguments)}},__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent){if(__hasProp.call(parent,key))child[key]=parent[key]}function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor;child.__super__=parent.prototype;return child};crosslet.MapView=function(_super){__extends(MapView,_super);function MapView(){this._renderMap=__bind(this._renderMap,this);this.getSelection=__bind(this.getSelection,this);this.hover=__bind(this.hover,this);this.mouseMove=__bind(this.mouseMove,this);this.reset=__bind(this.reset,this);this.beforezoom=__bind(this.beforezoom,this);this.project=__bind(this.project,this);_ref=MapView.__super__.constructor.apply(this,arguments);return _ref}MapView.prototype.initialize=function(el,config){var _this=this;this.config=crosslet.createConfig(crosslet.defaultConfig,config);this.geoURL=this.config.map.geo.url;this.opacity=this.config.defaults.opacity;this.ds=new crosslet.DataStore(this.config);this.el=el;this.hoverFunc=this.default_hover;$(this.el).attr("class","crosslet");this.map=L.map(el[0]).setView(this.config.map.view.center,this.config.map.view.zoom);L.tileLayer(this.config.map.leaflet.url,this.config.map.leaflet).addTo(this.map);this.control=$("
");this.info=L.Control.extend({options:{position:"topright"},onAdd:function(map){return _this.control[0]}});this.map.addControl(new this.info);this.panel=new crosslet.PanelView(this.control,this.config,this);this.renderMap=this._renderMap;return this.ds.loadGeo(this.geoURL,this.config.map.geo.id_field,function(ds){_this.bounds=_this.ds.bounds;_this.path=d3.geo.path().projection(_this.project);_this.svg=d3.select(_this.map.getPanes().overlayPane).append("svg");_this.g=_this.svg.append("g");_this.g.attr("class","crosslet_geometry");_this.feature=_this.g.selectAll("path").data(ds.geometries).enter().append("path").attr("id",function(d){return"path_"+d.properties[_this.config.map.geo.id_field]}).on("mouseover",function(d){return _this.hover(d)}).on("mousemove",_this.mouseMove);_this.reset();_this.map.on("viewreset",_this.reset);_this.map.on("zoomstart",_this.beforezoom);_this.hoverElement=_this.svg.append("g").attr("class","hover");_this.hoverElementRect=_this.hoverElement.append("svg:rect").attr("x",0).attr("y",0).attr("width",10).attr("height",30).attr("rx",5).attr("ry",5);_this.hoverElementText=_this.hoverElement.append("text").attr("x",0).attr("y",0);_this.hoverElementTextBB={width:0,height:0,x:0,y:0};if(_this.panel.numloads<=0){return _this.panel.createCube()}},this.config.map.geo.topo_object)};MapView.prototype.project=function(x){var point;point=this.map.latLngToLayerPoint(new L.LatLng(x[1],x[0]));return[point.x,point.y]};MapView.prototype.beforezoom=function(){return this.g.style("display","none")};MapView.prototype.reset=function(){var bottomLeft,topRight;bottomLeft=this.project(this.bounds[0]);topRight=this.project(this.bounds[1]);this.svg.attr("width",topRight[0]-bottomLeft[0]).attr("height",bottomLeft[1]-topRight[1]).style("margin-left",bottomLeft[0]+"px").style("margin-top",topRight[1]+"px");this.g.attr("transform","translate("+-bottomLeft[0]+","+-topRight[1]+")");this.feature.attr("d",this.path);this.g.style("display","inline");return true};MapView.prototype.mouseMove=function(){var br,dx,dy,matrix,pos,trp;br=jQuery.browser;pos=d3.mouse(this.svg.node());if(br.mozilla){trp=this.svg.node().parentNode.parentNode.parentNode;matrix=$(trp).css("transform").split("(")[1].split(")")[0].split(",");dx=+matrix[4];dy=+matrix[5];pos[0]-=dx;pos[1]-=dy}pos[0]+=30;pos[1]+=30;if(this.hoverElementTextBB.width+pos[0]>=this.svg.attr("width")){pos[0]-=this.hoverElementTextBB.width+60}if(this.hoverElementTextBB.height+pos[1]>=this.svg.attr("height")){pos[1]-=this.hoverElementTextBB.height+60}return this.hoverElement.attr("transform","translate("+pos[0]+","+pos[1]+")")};MapView.prototype.hover=function(data){var text;text=this.hoverFunc(data,data.properties.value);this.hoverElementText.text(text);this.hoverElementTextBB=this.hoverElementText.node().getBBox();return this.hoverElementRect.attr("width",this.hoverElementTextBB.width+10).attr("height",this.hoverElementTextBB.height+10).attr("x",this.hoverElementTextBB.x-5).attr("y",this.hoverElementTextBB.y-5)};MapView.prototype.getSelection=function(){return this.panel.getSelection()};MapView.prototype.default_hover=function(data,value){return data.properties[this.config.map.geo.name_field]+" - "+value};MapView.prototype._renderMap=function(data,formatter,hoverFunc){var _this=this;if(hoverFunc){this.hoverFunc=hoverFunc}this.feature.attr("style",function(d){var id;id=d.properties[_this.config.map.geo.id_field];d.properties.value=data[id];if(_.isNumber(data[id])){return"fill: "+formatter(d.properties.value)}else{return"display:none"}});return this};return MapView}(Backbone.View); -------------------------------------------------------------------------------- /inst/libraries/crosslet/css/bootstrap-responsive.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.2.2 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */ 10 | 11 | @-ms-viewport { 12 | width: device-width; 13 | } 14 | 15 | .clearfix { 16 | *zoom: 1; 17 | } 18 | 19 | .clearfix:before, 20 | .clearfix:after { 21 | display: table; 22 | line-height: 0; 23 | content: ""; 24 | } 25 | 26 | .clearfix:after { 27 | clear: both; 28 | } 29 | 30 | .hide-text { 31 | font: 0/0 a; 32 | color: transparent; 33 | text-shadow: none; 34 | background-color: transparent; 35 | border: 0; 36 | } 37 | 38 | .input-block-level { 39 | display: block; 40 | width: 100%; 41 | min-height: 30px; 42 | -webkit-box-sizing: border-box; 43 | -moz-box-sizing: border-box; 44 | box-sizing: border-box; 45 | } 46 | 47 | .hidden { 48 | display: none; 49 | visibility: hidden; 50 | } 51 | 52 | .visible-phone { 53 | display: none !important; 54 | } 55 | 56 | .visible-tablet { 57 | display: none !important; 58 | } 59 | 60 | .hidden-desktop { 61 | display: none !important; 62 | } 63 | 64 | .visible-desktop { 65 | display: inherit !important; 66 | } 67 | 68 | @media (min-width: 768px) and (max-width: 979px) { 69 | .hidden-desktop { 70 | display: inherit !important; 71 | } 72 | .visible-desktop { 73 | display: none !important ; 74 | } 75 | .visible-tablet { 76 | display: inherit !important; 77 | } 78 | .hidden-tablet { 79 | display: none !important; 80 | } 81 | } 82 | 83 | @media (max-width: 767px) { 84 | .hidden-desktop { 85 | display: inherit !important; 86 | } 87 | .visible-desktop { 88 | display: none !important; 89 | } 90 | .visible-phone { 91 | display: inherit !important; 92 | } 93 | .hidden-phone { 94 | display: none !important; 95 | } 96 | } 97 | 98 | @media (min-width: 1200px) { 99 | .row { 100 | margin-left: -30px; 101 | *zoom: 1; 102 | } 103 | .row:before, 104 | .row:after { 105 | display: table; 106 | line-height: 0; 107 | content: ""; 108 | } 109 | .row:after { 110 | clear: both; 111 | } 112 | [class*="span"] { 113 | float: left; 114 | min-height: 1px; 115 | margin-left: 30px; 116 | } 117 | .container, 118 | .navbar-static-top .container, 119 | .navbar-fixed-top .container, 120 | .navbar-fixed-bottom .container { 121 | width: 1170px; 122 | } 123 | .span12 { 124 | width: 1170px; 125 | } 126 | .span11 { 127 | width: 1070px; 128 | } 129 | .span10 { 130 | width: 970px; 131 | } 132 | .span9 { 133 | width: 870px; 134 | } 135 | .span8 { 136 | width: 770px; 137 | } 138 | .span7 { 139 | width: 670px; 140 | } 141 | .span6 { 142 | width: 570px; 143 | } 144 | .span5 { 145 | width: 470px; 146 | } 147 | .span4 { 148 | width: 370px; 149 | } 150 | .span3 { 151 | width: 270px; 152 | } 153 | .span2 { 154 | width: 170px; 155 | } 156 | .span1 { 157 | width: 70px; 158 | } 159 | .offset12 { 160 | margin-left: 1230px; 161 | } 162 | .offset11 { 163 | margin-left: 1130px; 164 | } 165 | .offset10 { 166 | margin-left: 1030px; 167 | } 168 | .offset9 { 169 | margin-left: 930px; 170 | } 171 | .offset8 { 172 | margin-left: 830px; 173 | } 174 | .offset7 { 175 | margin-left: 730px; 176 | } 177 | .offset6 { 178 | margin-left: 630px; 179 | } 180 | .offset5 { 181 | margin-left: 530px; 182 | } 183 | .offset4 { 184 | margin-left: 430px; 185 | } 186 | .offset3 { 187 | margin-left: 330px; 188 | } 189 | .offset2 { 190 | margin-left: 230px; 191 | } 192 | .offset1 { 193 | margin-left: 130px; 194 | } 195 | .row-fluid { 196 | width: 100%; 197 | *zoom: 1; 198 | } 199 | .row-fluid:before, 200 | .row-fluid:after { 201 | display: table; 202 | line-height: 0; 203 | content: ""; 204 | } 205 | .row-fluid:after { 206 | clear: both; 207 | } 208 | .row-fluid [class*="span"] { 209 | display: block; 210 | float: left; 211 | width: 100%; 212 | min-height: 30px; 213 | margin-left: 2.564102564102564%; 214 | *margin-left: 2.5109110747408616%; 215 | -webkit-box-sizing: border-box; 216 | -moz-box-sizing: border-box; 217 | box-sizing: border-box; 218 | } 219 | .row-fluid [class*="span"]:first-child { 220 | margin-left: 0; 221 | } 222 | .row-fluid .controls-row [class*="span"] + [class*="span"] { 223 | margin-left: 2.564102564102564%; 224 | } 225 | .row-fluid .span12 { 226 | width: 100%; 227 | *width: 99.94680851063829%; 228 | } 229 | .row-fluid .span11 { 230 | width: 91.45299145299145%; 231 | *width: 91.39979996362975%; 232 | } 233 | .row-fluid .span10 { 234 | width: 82.90598290598291%; 235 | *width: 82.8527914166212%; 236 | } 237 | .row-fluid .span9 { 238 | width: 74.35897435897436%; 239 | *width: 74.30578286961266%; 240 | } 241 | .row-fluid .span8 { 242 | width: 65.81196581196582%; 243 | *width: 65.75877432260411%; 244 | } 245 | .row-fluid .span7 { 246 | width: 57.26495726495726%; 247 | *width: 57.21176577559556%; 248 | } 249 | .row-fluid .span6 { 250 | width: 48.717948717948715%; 251 | *width: 48.664757228587014%; 252 | } 253 | .row-fluid .span5 { 254 | width: 40.17094017094017%; 255 | *width: 40.11774868157847%; 256 | } 257 | .row-fluid .span4 { 258 | width: 31.623931623931625%; 259 | *width: 31.570740134569924%; 260 | } 261 | .row-fluid .span3 { 262 | width: 23.076923076923077%; 263 | *width: 23.023731587561375%; 264 | } 265 | .row-fluid .span2 { 266 | width: 14.52991452991453%; 267 | *width: 14.476723040552828%; 268 | } 269 | .row-fluid .span1 { 270 | width: 5.982905982905983%; 271 | *width: 5.929714493544281%; 272 | } 273 | .row-fluid .offset12 { 274 | margin-left: 105.12820512820512%; 275 | *margin-left: 105.02182214948171%; 276 | } 277 | .row-fluid .offset12:first-child { 278 | margin-left: 102.56410256410257%; 279 | *margin-left: 102.45771958537915%; 280 | } 281 | .row-fluid .offset11 { 282 | margin-left: 96.58119658119658%; 283 | *margin-left: 96.47481360247316%; 284 | } 285 | .row-fluid .offset11:first-child { 286 | margin-left: 94.01709401709402%; 287 | *margin-left: 93.91071103837061%; 288 | } 289 | .row-fluid .offset10 { 290 | margin-left: 88.03418803418803%; 291 | *margin-left: 87.92780505546462%; 292 | } 293 | .row-fluid .offset10:first-child { 294 | margin-left: 85.47008547008548%; 295 | *margin-left: 85.36370249136206%; 296 | } 297 | .row-fluid .offset9 { 298 | margin-left: 79.48717948717949%; 299 | *margin-left: 79.38079650845607%; 300 | } 301 | .row-fluid .offset9:first-child { 302 | margin-left: 76.92307692307693%; 303 | *margin-left: 76.81669394435352%; 304 | } 305 | .row-fluid .offset8 { 306 | margin-left: 70.94017094017094%; 307 | *margin-left: 70.83378796144753%; 308 | } 309 | .row-fluid .offset8:first-child { 310 | margin-left: 68.37606837606839%; 311 | *margin-left: 68.26968539734497%; 312 | } 313 | .row-fluid .offset7 { 314 | margin-left: 62.393162393162385%; 315 | *margin-left: 62.28677941443899%; 316 | } 317 | .row-fluid .offset7:first-child { 318 | margin-left: 59.82905982905982%; 319 | *margin-left: 59.72267685033642%; 320 | } 321 | .row-fluid .offset6 { 322 | margin-left: 53.84615384615384%; 323 | *margin-left: 53.739770867430444%; 324 | } 325 | .row-fluid .offset6:first-child { 326 | margin-left: 51.28205128205128%; 327 | *margin-left: 51.175668303327875%; 328 | } 329 | .row-fluid .offset5 { 330 | margin-left: 45.299145299145295%; 331 | *margin-left: 45.1927623204219%; 332 | } 333 | .row-fluid .offset5:first-child { 334 | margin-left: 42.73504273504273%; 335 | *margin-left: 42.62865975631933%; 336 | } 337 | .row-fluid .offset4 { 338 | margin-left: 36.75213675213675%; 339 | *margin-left: 36.645753773413354%; 340 | } 341 | .row-fluid .offset4:first-child { 342 | margin-left: 34.18803418803419%; 343 | *margin-left: 34.081651209310785%; 344 | } 345 | .row-fluid .offset3 { 346 | margin-left: 28.205128205128204%; 347 | *margin-left: 28.0987452264048%; 348 | } 349 | .row-fluid .offset3:first-child { 350 | margin-left: 25.641025641025642%; 351 | *margin-left: 25.53464266230224%; 352 | } 353 | .row-fluid .offset2 { 354 | margin-left: 19.65811965811966%; 355 | *margin-left: 19.551736679396257%; 356 | } 357 | .row-fluid .offset2:first-child { 358 | margin-left: 17.094017094017094%; 359 | *margin-left: 16.98763411529369%; 360 | } 361 | .row-fluid .offset1 { 362 | margin-left: 11.11111111111111%; 363 | *margin-left: 11.004728132387708%; 364 | } 365 | .row-fluid .offset1:first-child { 366 | margin-left: 8.547008547008547%; 367 | *margin-left: 8.440625568285142%; 368 | } 369 | input, 370 | textarea, 371 | .uneditable-input { 372 | margin-left: 0; 373 | } 374 | .controls-row [class*="span"] + [class*="span"] { 375 | margin-left: 30px; 376 | } 377 | input.span12, 378 | textarea.span12, 379 | .uneditable-input.span12 { 380 | width: 1156px; 381 | } 382 | input.span11, 383 | textarea.span11, 384 | .uneditable-input.span11 { 385 | width: 1056px; 386 | } 387 | input.span10, 388 | textarea.span10, 389 | .uneditable-input.span10 { 390 | width: 956px; 391 | } 392 | input.span9, 393 | textarea.span9, 394 | .uneditable-input.span9 { 395 | width: 856px; 396 | } 397 | input.span8, 398 | textarea.span8, 399 | .uneditable-input.span8 { 400 | width: 756px; 401 | } 402 | input.span7, 403 | textarea.span7, 404 | .uneditable-input.span7 { 405 | width: 656px; 406 | } 407 | input.span6, 408 | textarea.span6, 409 | .uneditable-input.span6 { 410 | width: 556px; 411 | } 412 | input.span5, 413 | textarea.span5, 414 | .uneditable-input.span5 { 415 | width: 456px; 416 | } 417 | input.span4, 418 | textarea.span4, 419 | .uneditable-input.span4 { 420 | width: 356px; 421 | } 422 | input.span3, 423 | textarea.span3, 424 | .uneditable-input.span3 { 425 | width: 256px; 426 | } 427 | input.span2, 428 | textarea.span2, 429 | .uneditable-input.span2 { 430 | width: 156px; 431 | } 432 | input.span1, 433 | textarea.span1, 434 | .uneditable-input.span1 { 435 | width: 56px; 436 | } 437 | .thumbnails { 438 | margin-left: -30px; 439 | } 440 | .thumbnails > li { 441 | margin-left: 30px; 442 | } 443 | .row-fluid .thumbnails { 444 | margin-left: 0; 445 | } 446 | } 447 | 448 | @media (min-width: 768px) and (max-width: 979px) { 449 | .row { 450 | margin-left: -20px; 451 | *zoom: 1; 452 | } 453 | .row:before, 454 | .row:after { 455 | display: table; 456 | line-height: 0; 457 | content: ""; 458 | } 459 | .row:after { 460 | clear: both; 461 | } 462 | [class*="span"] { 463 | float: left; 464 | min-height: 1px; 465 | margin-left: 20px; 466 | } 467 | .container, 468 | .navbar-static-top .container, 469 | .navbar-fixed-top .container, 470 | .navbar-fixed-bottom .container { 471 | width: 724px; 472 | } 473 | .span12 { 474 | width: 724px; 475 | } 476 | .span11 { 477 | width: 662px; 478 | } 479 | .span10 { 480 | width: 600px; 481 | } 482 | .span9 { 483 | width: 538px; 484 | } 485 | .span8 { 486 | width: 476px; 487 | } 488 | .span7 { 489 | width: 414px; 490 | } 491 | .span6 { 492 | width: 352px; 493 | } 494 | .span5 { 495 | width: 290px; 496 | } 497 | .span4 { 498 | width: 228px; 499 | } 500 | .span3 { 501 | width: 166px; 502 | } 503 | .span2 { 504 | width: 104px; 505 | } 506 | .span1 { 507 | width: 42px; 508 | } 509 | .offset12 { 510 | margin-left: 764px; 511 | } 512 | .offset11 { 513 | margin-left: 702px; 514 | } 515 | .offset10 { 516 | margin-left: 640px; 517 | } 518 | .offset9 { 519 | margin-left: 578px; 520 | } 521 | .offset8 { 522 | margin-left: 516px; 523 | } 524 | .offset7 { 525 | margin-left: 454px; 526 | } 527 | .offset6 { 528 | margin-left: 392px; 529 | } 530 | .offset5 { 531 | margin-left: 330px; 532 | } 533 | .offset4 { 534 | margin-left: 268px; 535 | } 536 | .offset3 { 537 | margin-left: 206px; 538 | } 539 | .offset2 { 540 | margin-left: 144px; 541 | } 542 | .offset1 { 543 | margin-left: 82px; 544 | } 545 | .row-fluid { 546 | width: 100%; 547 | *zoom: 1; 548 | } 549 | .row-fluid:before, 550 | .row-fluid:after { 551 | display: table; 552 | line-height: 0; 553 | content: ""; 554 | } 555 | .row-fluid:after { 556 | clear: both; 557 | } 558 | .row-fluid [class*="span"] { 559 | display: block; 560 | float: left; 561 | width: 100%; 562 | min-height: 30px; 563 | margin-left: 2.7624309392265194%; 564 | *margin-left: 2.709239449864817%; 565 | -webkit-box-sizing: border-box; 566 | -moz-box-sizing: border-box; 567 | box-sizing: border-box; 568 | } 569 | .row-fluid [class*="span"]:first-child { 570 | margin-left: 0; 571 | } 572 | .row-fluid .controls-row [class*="span"] + [class*="span"] { 573 | margin-left: 2.7624309392265194%; 574 | } 575 | .row-fluid .span12 { 576 | width: 100%; 577 | *width: 99.94680851063829%; 578 | } 579 | .row-fluid .span11 { 580 | width: 91.43646408839778%; 581 | *width: 91.38327259903608%; 582 | } 583 | .row-fluid .span10 { 584 | width: 82.87292817679558%; 585 | *width: 82.81973668743387%; 586 | } 587 | .row-fluid .span9 { 588 | width: 74.30939226519337%; 589 | *width: 74.25620077583166%; 590 | } 591 | .row-fluid .span8 { 592 | width: 65.74585635359117%; 593 | *width: 65.69266486422946%; 594 | } 595 | .row-fluid .span7 { 596 | width: 57.18232044198895%; 597 | *width: 57.12912895262725%; 598 | } 599 | .row-fluid .span6 { 600 | width: 48.61878453038674%; 601 | *width: 48.56559304102504%; 602 | } 603 | .row-fluid .span5 { 604 | width: 40.05524861878453%; 605 | *width: 40.00205712942283%; 606 | } 607 | .row-fluid .span4 { 608 | width: 31.491712707182323%; 609 | *width: 31.43852121782062%; 610 | } 611 | .row-fluid .span3 { 612 | width: 22.92817679558011%; 613 | *width: 22.87498530621841%; 614 | } 615 | .row-fluid .span2 { 616 | width: 14.3646408839779%; 617 | *width: 14.311449394616199%; 618 | } 619 | .row-fluid .span1 { 620 | width: 5.801104972375691%; 621 | *width: 5.747913483013988%; 622 | } 623 | .row-fluid .offset12 { 624 | margin-left: 105.52486187845304%; 625 | *margin-left: 105.41847889972962%; 626 | } 627 | .row-fluid .offset12:first-child { 628 | margin-left: 102.76243093922652%; 629 | *margin-left: 102.6560479605031%; 630 | } 631 | .row-fluid .offset11 { 632 | margin-left: 96.96132596685082%; 633 | *margin-left: 96.8549429881274%; 634 | } 635 | .row-fluid .offset11:first-child { 636 | margin-left: 94.1988950276243%; 637 | *margin-left: 94.09251204890089%; 638 | } 639 | .row-fluid .offset10 { 640 | margin-left: 88.39779005524862%; 641 | *margin-left: 88.2914070765252%; 642 | } 643 | .row-fluid .offset10:first-child { 644 | margin-left: 85.6353591160221%; 645 | *margin-left: 85.52897613729868%; 646 | } 647 | .row-fluid .offset9 { 648 | margin-left: 79.8342541436464%; 649 | *margin-left: 79.72787116492299%; 650 | } 651 | .row-fluid .offset9:first-child { 652 | margin-left: 77.07182320441989%; 653 | *margin-left: 76.96544022569647%; 654 | } 655 | .row-fluid .offset8 { 656 | margin-left: 71.2707182320442%; 657 | *margin-left: 71.16433525332079%; 658 | } 659 | .row-fluid .offset8:first-child { 660 | margin-left: 68.50828729281768%; 661 | *margin-left: 68.40190431409427%; 662 | } 663 | .row-fluid .offset7 { 664 | margin-left: 62.70718232044199%; 665 | *margin-left: 62.600799341718584%; 666 | } 667 | .row-fluid .offset7:first-child { 668 | margin-left: 59.94475138121547%; 669 | *margin-left: 59.838368402492065%; 670 | } 671 | .row-fluid .offset6 { 672 | margin-left: 54.14364640883978%; 673 | *margin-left: 54.037263430116376%; 674 | } 675 | .row-fluid .offset6:first-child { 676 | margin-left: 51.38121546961326%; 677 | *margin-left: 51.27483249088986%; 678 | } 679 | .row-fluid .offset5 { 680 | margin-left: 45.58011049723757%; 681 | *margin-left: 45.47372751851417%; 682 | } 683 | .row-fluid .offset5:first-child { 684 | margin-left: 42.81767955801105%; 685 | *margin-left: 42.71129657928765%; 686 | } 687 | .row-fluid .offset4 { 688 | margin-left: 37.01657458563536%; 689 | *margin-left: 36.91019160691196%; 690 | } 691 | .row-fluid .offset4:first-child { 692 | margin-left: 34.25414364640884%; 693 | *margin-left: 34.14776066768544%; 694 | } 695 | .row-fluid .offset3 { 696 | margin-left: 28.45303867403315%; 697 | *margin-left: 28.346655695309746%; 698 | } 699 | .row-fluid .offset3:first-child { 700 | margin-left: 25.69060773480663%; 701 | *margin-left: 25.584224756083227%; 702 | } 703 | .row-fluid .offset2 { 704 | margin-left: 19.88950276243094%; 705 | *margin-left: 19.783119783707537%; 706 | } 707 | .row-fluid .offset2:first-child { 708 | margin-left: 17.12707182320442%; 709 | *margin-left: 17.02068884448102%; 710 | } 711 | .row-fluid .offset1 { 712 | margin-left: 11.32596685082873%; 713 | *margin-left: 11.219583872105325%; 714 | } 715 | .row-fluid .offset1:first-child { 716 | margin-left: 8.56353591160221%; 717 | *margin-left: 8.457152932878806%; 718 | } 719 | input, 720 | textarea, 721 | .uneditable-input { 722 | margin-left: 0; 723 | } 724 | .controls-row [class*="span"] + [class*="span"] { 725 | margin-left: 20px; 726 | } 727 | input.span12, 728 | textarea.span12, 729 | .uneditable-input.span12 { 730 | width: 710px; 731 | } 732 | input.span11, 733 | textarea.span11, 734 | .uneditable-input.span11 { 735 | width: 648px; 736 | } 737 | input.span10, 738 | textarea.span10, 739 | .uneditable-input.span10 { 740 | width: 586px; 741 | } 742 | input.span9, 743 | textarea.span9, 744 | .uneditable-input.span9 { 745 | width: 524px; 746 | } 747 | input.span8, 748 | textarea.span8, 749 | .uneditable-input.span8 { 750 | width: 462px; 751 | } 752 | input.span7, 753 | textarea.span7, 754 | .uneditable-input.span7 { 755 | width: 400px; 756 | } 757 | input.span6, 758 | textarea.span6, 759 | .uneditable-input.span6 { 760 | width: 338px; 761 | } 762 | input.span5, 763 | textarea.span5, 764 | .uneditable-input.span5 { 765 | width: 276px; 766 | } 767 | input.span4, 768 | textarea.span4, 769 | .uneditable-input.span4 { 770 | width: 214px; 771 | } 772 | input.span3, 773 | textarea.span3, 774 | .uneditable-input.span3 { 775 | width: 152px; 776 | } 777 | input.span2, 778 | textarea.span2, 779 | .uneditable-input.span2 { 780 | width: 90px; 781 | } 782 | input.span1, 783 | textarea.span1, 784 | .uneditable-input.span1 { 785 | width: 28px; 786 | } 787 | } 788 | 789 | @media (max-width: 767px) { 790 | body { 791 | padding-right: 20px; 792 | padding-left: 20px; 793 | } 794 | .navbar-fixed-top, 795 | .navbar-fixed-bottom, 796 | .navbar-static-top { 797 | margin-right: -20px; 798 | margin-left: -20px; 799 | } 800 | .container-fluid { 801 | padding: 0; 802 | } 803 | .dl-horizontal dt { 804 | float: none; 805 | width: auto; 806 | clear: none; 807 | text-align: left; 808 | } 809 | .dl-horizontal dd { 810 | margin-left: 0; 811 | } 812 | .container { 813 | width: auto; 814 | } 815 | .row-fluid { 816 | width: 100%; 817 | } 818 | .row, 819 | .thumbnails { 820 | margin-left: 0; 821 | } 822 | .thumbnails > li { 823 | float: none; 824 | margin-left: 0; 825 | } 826 | [class*="span"], 827 | .uneditable-input[class*="span"], 828 | .row-fluid [class*="span"] { 829 | display: block; 830 | float: none; 831 | width: 100%; 832 | margin-left: 0; 833 | -webkit-box-sizing: border-box; 834 | -moz-box-sizing: border-box; 835 | box-sizing: border-box; 836 | } 837 | .span12, 838 | .row-fluid .span12 { 839 | width: 100%; 840 | -webkit-box-sizing: border-box; 841 | -moz-box-sizing: border-box; 842 | box-sizing: border-box; 843 | } 844 | .row-fluid [class*="offset"]:first-child { 845 | margin-left: 0; 846 | } 847 | .input-large, 848 | .input-xlarge, 849 | .input-xxlarge, 850 | input[class*="span"], 851 | select[class*="span"], 852 | textarea[class*="span"], 853 | .uneditable-input { 854 | display: block; 855 | width: 100%; 856 | min-height: 30px; 857 | -webkit-box-sizing: border-box; 858 | -moz-box-sizing: border-box; 859 | box-sizing: border-box; 860 | } 861 | .input-prepend input, 862 | .input-append input, 863 | .input-prepend input[class*="span"], 864 | .input-append input[class*="span"] { 865 | display: inline-block; 866 | width: auto; 867 | } 868 | .controls-row [class*="span"] + [class*="span"] { 869 | margin-left: 0; 870 | } 871 | .modal { 872 | position: fixed; 873 | top: 20px; 874 | right: 20px; 875 | left: 20px; 876 | width: auto; 877 | margin: 0; 878 | } 879 | .modal.fade { 880 | top: -100px; 881 | } 882 | .modal.fade.in { 883 | top: 20px; 884 | } 885 | } 886 | 887 | @media (max-width: 480px) { 888 | .nav-collapse { 889 | -webkit-transform: translate3d(0, 0, 0); 890 | } 891 | .page-header h1 small { 892 | display: block; 893 | line-height: 20px; 894 | } 895 | input[type="checkbox"], 896 | input[type="radio"] { 897 | border: 1px solid #ccc; 898 | } 899 | .form-horizontal .control-label { 900 | float: none; 901 | width: auto; 902 | padding-top: 0; 903 | text-align: left; 904 | } 905 | .form-horizontal .controls { 906 | margin-left: 0; 907 | } 908 | .form-horizontal .control-list { 909 | padding-top: 0; 910 | } 911 | .form-horizontal .form-actions { 912 | padding-right: 10px; 913 | padding-left: 10px; 914 | } 915 | .media .pull-left, 916 | .media .pull-right { 917 | display: block; 918 | float: none; 919 | margin-bottom: 10px; 920 | } 921 | .media-object { 922 | margin-right: 0; 923 | margin-left: 0; 924 | } 925 | .modal { 926 | top: 10px; 927 | right: 10px; 928 | left: 10px; 929 | } 930 | .modal-header .close { 931 | padding: 10px; 932 | margin: -10px; 933 | } 934 | .carousel-caption { 935 | position: static; 936 | } 937 | } 938 | 939 | @media (max-width: 979px) { 940 | body { 941 | padding-top: 0; 942 | } 943 | .navbar-fixed-top, 944 | .navbar-fixed-bottom { 945 | position: static; 946 | } 947 | .navbar-fixed-top { 948 | margin-bottom: 20px; 949 | } 950 | .navbar-fixed-bottom { 951 | margin-top: 20px; 952 | } 953 | .navbar-fixed-top .navbar-inner, 954 | .navbar-fixed-bottom .navbar-inner { 955 | padding: 5px; 956 | } 957 | .navbar .container { 958 | width: auto; 959 | padding: 0; 960 | } 961 | .navbar .brand { 962 | padding-right: 10px; 963 | padding-left: 10px; 964 | margin: 0 0 0 -5px; 965 | } 966 | .nav-collapse { 967 | clear: both; 968 | } 969 | .nav-collapse .nav { 970 | float: none; 971 | margin: 0 0 10px; 972 | } 973 | .nav-collapse .nav > li { 974 | float: none; 975 | } 976 | .nav-collapse .nav > li > a { 977 | margin-bottom: 2px; 978 | } 979 | .nav-collapse .nav > .divider-vertical { 980 | display: none; 981 | } 982 | .nav-collapse .nav .nav-header { 983 | color: #777777; 984 | text-shadow: none; 985 | } 986 | .nav-collapse .nav > li > a, 987 | .nav-collapse .dropdown-menu a { 988 | padding: 9px 15px; 989 | font-weight: bold; 990 | color: #777777; 991 | -webkit-border-radius: 3px; 992 | -moz-border-radius: 3px; 993 | border-radius: 3px; 994 | } 995 | .nav-collapse .btn { 996 | padding: 4px 10px 4px; 997 | font-weight: normal; 998 | -webkit-border-radius: 4px; 999 | -moz-border-radius: 4px; 1000 | border-radius: 4px; 1001 | } 1002 | .nav-collapse .dropdown-menu li + li a { 1003 | margin-bottom: 2px; 1004 | } 1005 | .nav-collapse .nav > li > a:hover, 1006 | .nav-collapse .dropdown-menu a:hover { 1007 | background-color: #f2f2f2; 1008 | } 1009 | .navbar-inverse .nav-collapse .nav > li > a, 1010 | .navbar-inverse .nav-collapse .dropdown-menu a { 1011 | color: #999999; 1012 | } 1013 | .navbar-inverse .nav-collapse .nav > li > a:hover, 1014 | .navbar-inverse .nav-collapse .dropdown-menu a:hover { 1015 | background-color: #111111; 1016 | } 1017 | .nav-collapse.in .btn-group { 1018 | padding: 0; 1019 | margin-top: 5px; 1020 | } 1021 | .nav-collapse .dropdown-menu { 1022 | position: static; 1023 | top: auto; 1024 | left: auto; 1025 | display: none; 1026 | float: none; 1027 | max-width: none; 1028 | padding: 0; 1029 | margin: 0 15px; 1030 | background-color: transparent; 1031 | border: none; 1032 | -webkit-border-radius: 0; 1033 | -moz-border-radius: 0; 1034 | border-radius: 0; 1035 | -webkit-box-shadow: none; 1036 | -moz-box-shadow: none; 1037 | box-shadow: none; 1038 | } 1039 | .nav-collapse .open > .dropdown-menu { 1040 | display: block; 1041 | } 1042 | .nav-collapse .dropdown-menu:before, 1043 | .nav-collapse .dropdown-menu:after { 1044 | display: none; 1045 | } 1046 | .nav-collapse .dropdown-menu .divider { 1047 | display: none; 1048 | } 1049 | .nav-collapse .nav > li > .dropdown-menu:before, 1050 | .nav-collapse .nav > li > .dropdown-menu:after { 1051 | display: none; 1052 | } 1053 | .nav-collapse .navbar-form, 1054 | .nav-collapse .navbar-search { 1055 | float: none; 1056 | padding: 10px 15px; 1057 | margin: 10px 0; 1058 | border-top: 1px solid #f2f2f2; 1059 | border-bottom: 1px solid #f2f2f2; 1060 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1061 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1062 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1063 | } 1064 | .navbar-inverse .nav-collapse .navbar-form, 1065 | .navbar-inverse .nav-collapse .navbar-search { 1066 | border-top-color: #111111; 1067 | border-bottom-color: #111111; 1068 | } 1069 | .navbar .nav-collapse .nav.pull-right { 1070 | float: none; 1071 | margin-left: 0; 1072 | } 1073 | .nav-collapse, 1074 | .nav-collapse.collapse { 1075 | height: 0; 1076 | overflow: hidden; 1077 | } 1078 | .navbar .btn-navbar { 1079 | display: block; 1080 | } 1081 | .navbar-static .navbar-inner { 1082 | padding-right: 10px; 1083 | padding-left: 10px; 1084 | } 1085 | } 1086 | 1087 | @media (min-width: 980px) { 1088 | .nav-collapse.collapse { 1089 | height: auto !important; 1090 | overflow: visible !important; 1091 | } 1092 | } 1093 | -------------------------------------------------------------------------------- /inst/libraries/crosslet/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap.js by @fat & @mdo 3 | * Copyright 2012 Twitter, Inc. 4 | * http://www.apache.org/licenses/LICENSE-2.0.txt 5 | */ 6 | !function($){"use strict";$(function(){$.support.transition=function(){var transitionEnd=function(){var name,el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(name in transEndEventNames)if(void 0!==el.style[name])return transEndEventNames[name]}();return transitionEnd&&{end:transitionEnd}}()})}(window.jQuery),!function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){function removeElement(){$parent.trigger("closed").remove()}var $parent,$this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),e&&e.preventDefault(),$parent.length||($parent=$this.hasClass("alert")?$this:$this.parent()),$parent.trigger(e=$.Event("close")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.on($.support.transition.end,removeElement):removeElement())};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data("alert");data||$this.data("alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})},$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery),!function($){"use strict";var Button=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.button.defaults,options)};Button.prototype.setState=function(state){var d="disabled",$el=this.$element,data=$el.data(),val=$el.is("input")?"val":"html";state+="Text",data.resetText||$el.data("resetText",$el[val]()),$el[val](data[state]||this.options[state]),setTimeout(function(){"loadingText"==state?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)},Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons-radio"]');$parent&&$parent.find(".active").removeClass("active"),this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this),data=$this.data("button"),options="object"==typeof option&&option;data||$this.data("button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})},$.fn.button.defaults={loadingText:"loading..."},$.fn.button.Constructor=Button,$.fn.button.noConflict=function(){return $.fn.button=old,this},$(document).on("click.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),$btn.button("toggle")})}(window.jQuery),!function($){"use strict";var Carousel=function(element,options){this.$element=$(element),this.options=options,"hover"==this.options.pause&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},to:function(pos){var $active=this.$element.find(".item.active"),children=$active.parent().children(),activePos=children.index($active),that=this;if(!(pos>children.length-1||0>pos))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activePos==pos?this.pause().cycle():this.slide(pos>activePos?"next":"prev",$(children[pos]))},pause:function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(type,next){var e,$active=this.$element.find(".item.active"),$next=next||$active[type](),isCycling=this.interval,direction="next"==type?"left":"right",fallback="next"==type?"first":"last",that=this;if(this.sliding=!0,isCycling&&this.pause(),$next=$next.length?$next:this.$element.find(".item")[fallback](),e=$.Event("slide",{relatedTarget:$next[0]}),!$next.hasClass("active")){if($.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;$next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),this.$element.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger("slid")},0)})}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return isCycling&&this.cycle(),this}}};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this),data=$this.data("carousel"),options=$.extend({},$.fn.carousel.defaults,"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.cycle()})},$.fn.carousel.defaults={interval:5e3,pause:"hover"},$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this},$(document).on("click.carousel.data-api","[data-slide]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data());$target.carousel(options),e.preventDefault()})}(window.jQuery),!function($){"use strict";var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.collapse.defaults,options),this.options.parent&&(this.$parent=$(this.options.parent)),this.options.toggle&&this.toggle()};Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},show:function(){var dimension,scroll,actives,hasData;if(!this.transitioning){if(dimension=this.dimension(),scroll=$.camelCase(["scroll",dimension].join("-")),actives=this.$parent&&this.$parent.find("> .accordion-group > .in"),actives&&actives.length){if(hasData=actives.data("collapse"),hasData&&hasData.transitioning)return;actives.collapse("hide"),hasData||actives.data("collapse",null)}this.$element[dimension](0),this.transition("addClass",$.Event("show"),"shown"),$.support.transition&&this.$element[dimension](this.$element[0][scroll])}},hide:function(){var dimension;this.transitioning||(dimension=this.dimension(),this.reset(this.$element[dimension]()),this.transition("removeClass",$.Event("hide"),"hidden"),this.$element[dimension](0))},reset:function(size){var dimension=this.dimension();return this.$element.removeClass("collapse")[dimension](size||"auto")[0].offsetWidth,this.$element[null!==size?"addClass":"removeClass"]("collapse"),this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){"show"==startEvent.type&&that.reset(),that.transitioning=0,that.$element.trigger(completeEvent)};this.$element.trigger(startEvent),startEvent.isDefaultPrevented()||(this.transitioning=1,this.$element[method]("in"),$.support.transition&&this.$element.hasClass("collapse")?this.$element.one($.support.transition.end,complete):complete())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data("collapse"),options="object"==typeof option&&option;data||$this.data("collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})},$.fn.collapse.defaults={toggle:!0},$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.collapse.data-api","[data-toggle=collapse]",function(e){var href,$this=$(this),target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),option=$(target).data("collapse")?"toggle":$this.data();$this[$(target).hasClass("in")?"addClass":"removeClass"]("collapsed"),$(target).collapse(option)})}(window.jQuery),!function($){"use strict";function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass("open")})}function getParent($this){var $parent,selector=$this.attr("data-target");return selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),$parent.length||($parent=$this.parent()),$parent}var toggle="[data-toggle=dropdown]",Dropdown=function(element){var $el=$(element).on("click.dropdown.data-api",this.toggle);$("html").on("click.dropdown.data-api",function(){$el.parent().removeClass("open")})};Dropdown.prototype={constructor:Dropdown,toggle:function(){var $parent,isActive,$this=$(this);if(!$this.is(".disabled, :disabled"))return $parent=getParent($this),isActive=$parent.hasClass("open"),clearMenus(),isActive||$parent.toggleClass("open"),$this.focus(),!1},keydown:function(e){var $this,$items,$parent,isActive,index;if(/(38|40|27)/.test(e.keyCode)&&($this=$(this),e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled"))){if($parent=getParent($this),isActive=$parent.hasClass("open"),!isActive||isActive&&27==e.keyCode)return $this.click();$items=$("[role=menu] li:not(.divider):visible a",$parent),$items.length&&(index=$items.index($items.filter(":focus")),38==e.keyCode&&index>0&&index--,40==e.keyCode&&$items.length-1>index&&index++,~index||(index=0),$items.eq(index).focus())}}};var old=$.fn.dropdown;$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data("dropdown");data||$this.data("dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})},$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.dropdown.data-api touchstart.dropdown.data-api",clearMenus).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery),!function($){"use strict";var Modal=function(element,options){this.options=options,this.$element=$(element).delegate('[data-dismiss="modal"]',"click.dismiss.modal",$.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};Modal.prototype={constructor:Modal,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var that=this,e=$.Event("show");this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(document.body),that.$element.show(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in").attr("aria-hidden",!1),that.enforceFocus(),transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger("shown")}):that.$element.focus().trigger("shown")}))},hide:function(e){e&&e.preventDefault(),e=$.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),$(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),$.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var that=this;$(document).on("focusin.modal",function(e){that.$element[0]===e.target||that.$element.has(e.target).length||that.$element.focus()})},escape:function(){var that=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&that.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var that=this,timeout=setTimeout(function(){that.$element.off($.support.transition.end),that.hideModal()},500);this.$element.one($.support.transition.end,function(){clearTimeout(timeout),that.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(callback){var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$('