Skip to content

Instantly share code, notes, and snippets.

View amitkaps's full-sized avatar

Amit Kapoor amitkaps

View GitHub Profile
@amitkaps
amitkaps / LICENSE
Last active August 12, 2017 11:27
Unit Chart Rectangular
The MIT License (MIT)
Copyright (c) 2017 Amit Kapoor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@amitkaps
amitkaps / LICENSE
Last active August 10, 2017 01:23
Scatter Nearest Rule
The MIT License (MIT)
Copyright (c) 2017 Amit Kapoor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@amitkaps
amitkaps / LICENSE
Created August 10, 2017 01:06
Bar Brushing Rule
The MIT License (MIT)
Copyright (c) 2017 Amit Kapoor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
gistup
@amitkaps
amitkaps / index.html
Last active June 2, 2017 13:10
Render 100000 points with Vega-lite & WebGL
<!DOCTYPE html>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://unpkg.com/vega/build/vega.min.js" charset="utf-8"></script>
<script src="https://unpkg.com/vega-webgl-renderer/build/vega-webgl-renderer.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega-lite/2.0.0-beta.3/vega-lite.js"></script>
<div id="vis"></div>
@amitkaps
amitkaps / 0_reuse_code.js
Created June 2, 2017 13:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# Visdown
**Make visualisations using only markdown**
Write visualisation using a simple declarative markup like you would write code. Just wrap it in fenced block (three backticks) and mark the language as `vis`.
*Make simple static visualisations*
```vis
data:
<html lang="en">
<head>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/themes/prism.min.css'/>
<script src='https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.6/marked.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/prism.min.js' data-manual></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/prism/1.5.1/components/prism-python.min.js' data-manual></script>
<script src="https://rawgit.com/kokes/nbviewer.js/master/lib/nbv.js"></script>
<link rel='stylesheet' src="https://rawgit.com/kokes/nbviewer.js/master/lib/nbv.css">
<!DOCTYPE html>
<canvas id="chart" width="250" height="200"></canvas>
<script>
var data = [5, 25, 15, 20, 10];
var canvas = document.getElementById("chart");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "brown";
for (i = 0; i < data.length; i++){
<!DOCTYPE html>
<script src="../lib/d3.min.js"></script>
<script src="../lib/vega.min.js"></script>
<div id="chart"></div>
<script>
function parse(spec) {
vg.parse.spec(spec, function(chart) {