Skip to content

Instantly share code, notes, and snippets.

View jthomassie's full-sized avatar

Juan Thomassie jthomassie

View GitHub Profile
@jthomassie
jthomassie / index.html
Last active August 29, 2015 13:56
World map - orthographic
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.water {
fill: #ddd;
}
.graticule {
fill: none;
stroke: #444;
stroke-width: 0.6;
@jthomassie
jthomassie / index.html
Last active August 29, 2015 13:56
d3 World map I
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.graticule {
fill: none;
stroke: #444;
stroke-width: 0.6;
stroke-opacity: 0.4;
}
.edge {
@jthomassie
jthomassie / index.html
Last active August 29, 2015 13:57
Histogram: grouped, stacked, normalized
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
margin: auto;
position: relative;
width: 960px;
color: #333;
# encoding: utf-8
require "logstash/inputs/base"
require "logstash/namespace"
require "json"
# Read events from the twitter streaming api.
class LogStash::Inputs::Twitter < LogStash::Inputs::Base
config_name "twitter"
milestone 1
@jthomassie
jthomassie / arc-places.json
Last active June 13, 2023 20:25
d3 globe arcs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jthomassie
jthomassie / elasticsearch.js
Last active August 27, 2019 07:23
elasticsearch.js + aggregations + d3
/*! elasticsearch - v1.5.9 - 2014-02-26
* http://www.elasticsearch.org/guide/en/elasticsearch/client/javascript-api/current/index.html
* Copyright (c) 2014 Elasticsearch BV; Licensed Apache 2.0 */
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.elasticsearch=e():"undefined"!=typeof global?global.elasticsearch=e():"undefined"!=typeof self&&(self.elasticsearch=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
},{}],2:[function(require,module,exports){
//
// The shims in this fil
// zero injection
var testdata = {
"columns": [
{
"label": "Top 5 _type",
"rows": [
{
"label": "Top 5 response",
"xAxisLabel": "Daily @timestamp",
"yAxisLabel": "Count",
@jthomassie
jthomassie / histogram.js
Last active August 29, 2015 13:58
new histogram.js
define(function (require) {
'use strict';
var tooltip = require('bower_components/K4D3/src/tooltip'),
d3 = require('d3');
return function (elem, args) {
var chart = {},
elemWidth = parseInt(d3.select(elem.parentNode).style('width'), 10),
@jthomassie
jthomassie / index.js
Created October 1, 2014 16:42
requirebin sketch
// require something
var d3 = require('d3');
var _ = require('underscore');
var insertCSS = require("insert-css");
insertCSS(".list {width: 20px; margin: 4px 0px 0px 4px} .rect {width: 20px; height: 20px; margin: 4px 0px 0px 0px}");
var data = [
'#006555',//dkgreen
'#95c73d',//ltgreen
@jthomassie
jthomassie / index.js
Last active August 29, 2015 14:07
requirebin sketch
var d3 = require('d3');
var _ = require('underscore');
var insertCSS = require("insert-css");
insertCSS("body {font-family: sans-serif; font-size: 10px; color: #555;} .list {width: 100px; margin: 0} .item {width: 100px; height: 12px; margin: 1px 0px 0px 1px;} .chip {width: 30px; height: 12px; position: relative; float: left;} .text {width: 60px; position: relative; float: left; margin: 0px 0px 0px 3px}");
var brandcolors = [
'#006555',//dkgreen
'#95c73d',//ltgreen
'#2d448e',//dkprurp