Skip to content

Instantly share code, notes, and snippets.

View efekarakus's full-sized avatar
📚

Efe Karakus efekarakus

📚
View GitHub Profile
@efekarakus
efekarakus / index.html
Last active March 1, 2017 06:14
Venn Diagram with d3js
<!DOCTYPE html>
<meta charset="utf-8">
<style>
g.A circle {
fill: brown;
fill-opacity: .5;
stroke: black;
}
g.B circle {
@efekarakus
efekarakus / README.md
Last active March 15, 2016 16:09
Find Peaks

This example illustrates how to use the findPeaks API. You can download the library from https://github.com/efekarakus/d3-peaks.

The algorithm is based on "Improved peak detection in mass spectrum by incorporating continuous wavelet transform-based pattern matching" by Pan Du, Warren A. Kibbe and Simon M. Lin. The paper can be found here.

@efekarakus
efekarakus / d3-peaks.js
Last active March 5, 2016 03:00
Convolution
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3_peaks = global.d3_peaks || {})));
}(this, function (exports) { 'use strict';
/**
* See https://en.wikipedia.org/wiki/Mexican_hat_wavelet
*/
function ricker() {
@efekarakus
efekarakus / d3-peaks.js
Last active March 4, 2016 18:20
Ricker Wavelet
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.d3_peaks = global.d3_peaks || {})));
}(this, function (exports) { 'use strict';
/**
* See https://en.wikipedia.org/wiki/Mexican_hat_wavelet
*/
function ricker() {
@efekarakus
efekarakus / bar.js
Last active October 15, 2015 04:23
Simple Bar Chart
var bar = function() {
var margin = {top: 0, right: 0, bottom: 0, left: 0},
width = 500,
height = 200;
function chart(selection) {
selection.each(function(data) {
var svg = d3.select(this).append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
@efekarakus
efekarakus / index.html
Last active October 15, 2015 04:24
Binary Step Plot
<html>
<head>
<meta charset="utf-8">
<title>Step Graph</title>
<style>
path.steps {
stroke: #000;
stroke-width: 3;
fill: none;
}