Skip to content

Instantly share code, notes, and snippets.

View markmarkoh's full-sized avatar

Mark DiMarco markmarkoh

View GitHub Profile

Seeing that the bubbles json call returns something like:

[
       {name: 'Hot', latitude: 21.32, longitude: 5.32, radius: 10, fillKey: 'gt50'},
       {name: 'Chilly', latitude: -25.32, longitude: 120.32, radius: 18, fillKey: 'lt50'},
       {name: 'Hot again', latitude: 21.32, longitude: -84.32, radius: 8, fillKey: 'gt50'},
]
@markmarkoh
markmarkoh / partials.jsx
Created July 2, 2014 16:14
Fun with React.js and ES6 Module Transpiler
/**
* @jsx React.DOM
*/
import React from 'react';
var ImagePlaceholder = {
imgLoadError: function() {
this.getDOMNode().querySelector('img').src = '/img/no-image.jpg';
}
};
@markmarkoh
markmarkoh / index.html
Created July 1, 2014 02:28
Maxnet Updates
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Realtime Traffic Mapper</title>
<link rel="stylesheet" href="http://www.maxux.net/devs/maptraffic/style.css" media="all" type="text/css" />
<style>
html, body, #map {
height: 100%;
@markmarkoh
markmarkoh / README.md
Last active August 29, 2015 14:02 — forked from markmarkoh/README.md
Centering bubbles with custom map data
@markmarkoh
markmarkoh / README.md
Last active August 29, 2015 14:00
Fetching remote data with Datamaps

Remote Data with Datamaps

If you have data in CSV or JSON format on your server, you can now ( v0.2.7 ) fetch that data remotely.

CSV

To specify CSV, set dataType to "csv" and specify the dataUrl for the resource.

The format for this data should be:

@markmarkoh
markmarkoh / index.html
Last active August 29, 2015 13:59 — forked from pachevalier/datamaps.html
Datamaps with custom data and custom projection
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="http://datamaps.github.io/scripts/datamaps.none.min.js"></script>
<div id="container" style="position: relative; width: 500px; height: 300px;"></div>
<script>
@markmarkoh
markmarkoh / README.md
Last active August 29, 2015 13:57
State Centered Bubbles

Center Bubbles in each state

Instead of passing a distinct latitude/longitude with each bubble, you can optionally pass a centered property which should be the ISO ID ( 2 character for US states (like NY), 3 character for Countries (like USA) ). The bubbles will appeared in the centermost point of each geography.

More DataMaps here

<script id='popup-template' type='text/x-handlebars-template'>
{{{ popup_template }}}
</script>
<script>
var chartParams = {{{ chartParams }}}
chartParams.element = document.getElementById('{{chartId}}')
{{# popup_template }}
var tmplFn = Handlebars.compile(
document.getElementById("popup-template").innerHTML.replace(/\"#!(.*?)!#\"/g, "\\$1")
@markmarkoh
markmarkoh / gist:9749481
Created March 24, 2014 21:25
keybase.md
### Keybase proof
I hereby claim:
* I am markmarkoh on github.
* I am markmarkoh (https://keybase.io/markmarkoh) on keybase.
* I have a public key whose fingerprint is 3E98 C273 2434 4AB1 832C DD4C 7875 6107 8850 09AE
To claim this, I am signing this object: