Skip to content

Instantly share code, notes, and snippets.

@asizer
asizer / index.html
Last active June 20, 2016 18:04
Locate Button calls break basemap tiles
<!DOCTYPE html>
<html>
<head>
<title>Locator Button problem</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no,width=device-width" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" href="//js.arcgis.com/3.17/esri/css/esri.css">
@asizer
asizer / index.html
Last active March 16, 2016 19:00
Lock x and y to full world extent
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>Map with Header and Footer</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.16/esri/css/esri.css">
<style>
@asizer
asizer / index.html
Created March 16, 2016 17:21
Limit map to full world extent
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>Map with Header and Footer</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.16/esri/css/esri.css">
<style>
@asizer
asizer / gruntfile-no-errorchecking.js
Last active March 8, 2016 16:45
Custom grunt task for updating widgets in deployed webappbuilder apps
/* this is a stripped-down version of a gruntfile that had lots of comments
and error checking, just to demonstrate the main workflow here.
this one will probably catch most problematic input, but no guarantees. */
module.exports = function(grunt) {
// TODO: replace these with your own paths
var builderDir = '../path/to/your/builder/root';
var repoBase = {
themes: 'src/themes',
widgets: 'src/widgets'
@asizer
asizer / cars-time.js
Last active October 5, 2015 13:57
Knight Course module 6: graph over time
/* global colorbrewer */
// lots of global variables...
// dimensions and elements
var margins, svgW, svgH, chartW, chartH, svg, chartG, carsG;
// scales, formatters, and axes
var xScale, yScale, xAxis, yAxis, formatDate, parseDate;
@asizer
asizer / cars-scatter.js
Created October 5, 2015 13:46
Knight course module 5b: Scales starting at 0
/* global colorbrewer */
// lots of global variables...
// dimensions and elements
var margins, svgW, svgH, chartW, chartH, svg, chartG;
// scales, formatters, and axes
var xScale, yScale, colorScale, xAxis, yAxis, parseDate;
@asizer
asizer / cars-scatter.js
Created October 5, 2015 13:43
Knight course module 5: scatter plot
/* global colorbrewer */
// lots of global variables...
// dimensions and elements
var margins, svgW, svgH, chartW, chartH, svg, chartG;
// scales, formatters, and axes
var xScale, yScale, colorScale, xAxis, yAxis, parseDate;
@asizer
asizer / car-bars2.js
Last active October 5, 2015 13:38
Knight course Module 4: bar chart with axes
/* global colorbrewer */
// lots of global variables...
// dimensions and elements
var margins, svgW, svgH, chartW, chartH, svg, chartG;
// scales, formatters, and axes
var xScale, yScale, colorScale, xAxis, yAxis, parseDate;
@asizer
asizer / car-bars.js
Last active October 5, 2015 13:20
Knight course module 3: Bar Chart
/* global colorbrewer */
// lots of global variables...
// dimensions and elements
var margins, svgW, svgH, chartW, chartH, svg, chartG;
// scales, formatters, and axes
var xScale, yScale, colorScale, yAxis, parseDate;
@asizer
asizer / carspecs.csv
Last active October 5, 2015 13:10
Knight course Module 2: logging data
make model style year length width height
Honda Civic Sedan 1995 173 66.9 51.7
Honda Civic Sedan 1996 175.1 67.1 54.7
Honda Civic Sedan 1997 175.1 67.1 54.7
Honda Civic Sedan 1998 175.1 67.1 54.7
Honda Civic Sedan 1999 175.1 67.1 54.7
Honda Civic Sedan 2000 175.1 67.1 54.7
Honda Civic Sedan 2001 174.6 67.5 56.7
Honda Civic Sedan 2002 174.6 67.5 56.7
Honda Civic Sedan 2003 174.6 67.5 56.7