Skip to content

Instantly share code, notes, and snippets.

@biovisualize
biovisualize / index.js
Created December 14, 2018 15:20
Think API first
const ChartManager = function() {
function init() { }
function config() { }
function setData() { }
function render() { }
return {
@biovisualize
biovisualize / .block
Last active November 20, 2018 16:08
Sankey from CSV II
license: gpl-3.0
@biovisualize
biovisualize / .block
Created March 14, 2018 18:54
scale copy
license: mit
@biovisualize
biovisualize / index.html
Last active March 10, 2023 22:15
MapD3 chart update
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="./mapd3.min.css">
<style>
.chart1 {
margin-top: 80px;
margin-left: 40px;
}
.mapd3 {
@biovisualize
biovisualize / index.html
Created September 12, 2017 22:53
MapD3 early example
<html>
<head>
<link rel="stylesheet" href="mapd3.min.css">
</head><body>
<div class="chart1"></div>
<div class="chart2"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.min.js"></script>
<script src="mapd3.min.js"></script>
<script>
@biovisualize
biovisualize / .block
Last active September 4, 2017 02:04
Badge for d3 unconf using a superformula
license: mit
@biovisualize
biovisualize / interactors.js
Last active August 18, 2017 14:38
Simple Britecharts interactor plugin
define(function(require) {
const d3Selection = require('d3-selection');
/**
* Toggles selection on clickable elements. Will set classes "selected" and "dimmed".
* @param {Number} selector A valid selector of the elements to toggle
* @example
* barChart.on('customClick', britecharts.interactors.multiToggle('rect.bar'))
*
@biovisualize
biovisualize / chart.js
Created July 21, 2017 15:56
Empty interface example - refactoring blog post
var chartManager = {}
chartManager.line = function(selector) {
var config = {
height: 200,
width: 200
}
var dataCache = []
var events = function(eventName, cb) {
@biovisualize
biovisualize / chart.js
Last active July 20, 2017 16:08
Chart API variant - refactoring blog post
var data = dataManager.getData(dimension, group)
var lineChart = chartManager.line('#chart')
.config({
height: 100,
width: 100
})
.on('click', (e => {}))
.data(data)