Skip to content

Instantly share code, notes, and snippets.

View kidwellj's full-sized avatar

Jeremy Kidwell kidwellj

View GitHub Profile
@ateucher
ateucher / geom_sf_slow_with_quartz.md
Last active January 27, 2019 18:59
geom_sf very slow with large sf objects using Mac OS quartz graphic device

I am on a Mac (2016 MBP 15" with 16GB memory) and am testing out the development version of ggplot2 with sf plotting support.

Overall I am loving it, but I am finding geom_sf to be very slow when plotting larger sf polygons objects. I think I've narrowed it down to the quartz graphics device, which is much slower than X11 on these large objects (however quartz produces nicer graphics than X11).

I would be happy to just use X11 but I do like having plots appear in the plot pane in RStudio, and I believe the RStudio Graphics Device uses quartz on Mac OS and I don't think there's a way to change that. So I'm not sure if this is really a ggplot2/sf issue or if it's a Mac quartz issue... or possibly even an RStudio issue, but I thought I would post it here first to see if others are experiencing the same thing.

I also did the same comparison with sf's plot method - there is still a large difference between X11 and quartz, however overall it is faster than ggplot2::geom_sf.

Inte

@ebrelsford
ebrelsford / carto-js-builder.md
Last active May 18, 2017 11:05
Potential issues and workarounds when using Carto.js v3 with maps made with the Builder interface

Potential issues and workarounds when using Carto.js v3 with maps made with the Builder interface

When using the current version (v3 as of March 2017) of Carto.js with maps using Carto's new Builder interface, there are some issues you are likely to run into. Here I run through the common issues and some suggested workarounds.

Analysis and Widgets don't work

This is because Carto.js v3 doesn't understand them. Sorry but there is no easy workaround here. In the case of Analysis you could save it as its own layer and use that layer instead.

Legends don't work

@ramiroaznar
ramiroaznar / index.html
Last active May 6, 2017 17:45
How to add a formula, histogram & category widget to a dashboard using deepinsights.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Deep-Insights.js | Highest Mountains</title>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<meta name=viewport content="width=device-width initial-scale=1">
<link rel="stylesheet" href="http://libs.cartocdn.com/di.js/v0/themes/css/deep-insights.css" />
<script src=" http://libs.cartocdn.com/di.js/v0/deep-insights.uncompressed.js"></script>
<style type="text/css">
@nitaku
nitaku / README.md
Last active January 17, 2017 19:11
Leaflet with CartoDB tiles

An example that shows a CartoDB layer with Leaflet.js. A lot of different tile services are compatible with Leaflet: click here for a list with live previews.

@maartenzam
maartenzam / README.md
Last active January 17, 2017 19:13
Responsive CartoDB choropleth linked to strip plot

A choropleth map created in CartoDB.js linked to a D3.js strip plot. Open to view in full.

For now the link is only one way (hover/click on the map updates the strip plot). Data is also duplicated (it lives in CartoDB and in a csv).

Both map and plot are responsive and respond to resize. The map responsiveness comes from my block Responsive map with Cartodb/Leaflet.

Integretad live on tijd.be (Dutch) and on lecho.be (French).

@rgdonohue
rgdonohue / README.md
Last active January 11, 2023 21:43
Batch Geocoding Script with GeoPy
@auremoser
auremoser / README.md
Last active January 17, 2017 19:10
Chart: NVD3 + CartoDB
@andy-esch
andy-esch / index.html
Last active January 18, 2017 20:19
Using a slider to control opacity of CartoDB layer
<!doctype html>
<html lang="en">
<!-- pulled some code from http://jqueryui.com/slider/#rangemin -->
<head>
<meta charset="utf-8">
<title>CartoDB.js Opacity Slider</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
@annard
annard / Import Instapaper CSV.applescript
Last active September 20, 2019 20:29
Import Instapaper articles (exported as CSV from their site) using Numbers into DEVONthink Pro (Office). The web pages will be imported as PDF documents. The folder structure of Instapaper will be replicated in an "Instapaper" top level group for the currently open database.
-- Use Instapaper to export a CSV file of your articles.
-- Must have Numbers to open it in.
-- Will create PDF documents in /Instapaper/<your folder in Instapaper> groups.
-- Be sure to select an open database in DT Pro before you run this.
--
-- Created by Annard Brouwer, 24/08/2014
--
-- This program is free software released "as-is"; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-- Get a copy of the GNU General Public License by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.