Skip to content

Instantly share code, notes, and snippets.

View Pacsangon's full-sized avatar

Pacsan Pacsangon

View GitHub Profile
@Pacsangon
Pacsangon / chart.js
Created August 4, 2016 00:57 — forked from chrtze/chart.js
Line Chart Example
var Chart = (function(window,d3) {
var svg, data, x, y, xAxis, yAxis, dim, chartWrapper, line, path, margin = {}, width, height, locator;
var breakPoint = 768;
d3.csv('data.csv', init); //load data, then initialize chart
//called once the data is loaded
function init(csv) {
@Pacsangon
Pacsangon / README.md
Created July 27, 2016 21:42 — forked from robschmuecker/README.md
D3.js Drag and Drop, Zoomable, Panning, Collapsible Tree with auto-sizing.

This example pulls together various examples of work with trees in D3.js.

The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.

One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.

Dragging can be performed on any node other than root (flare). Dropping can be done on any node.

Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.

@Pacsangon
Pacsangon / d3js layout scaling
Created July 27, 2016 09:21 — forked from plandem/d3js layout scaling
Correct zoom of layout
In some cases you want to handle zooming and rescale your layout.
But at all examples you can see something like this:
-------
var width = 640;
var height = 480;
var outer = d3.select('div')
.append("svg:svg")
.attr("width", width)
.attr("height", height)
@Pacsangon
Pacsangon / index.html
Created July 21, 2016 09:09 — forked from syntagmatic/index.html
Nutrient Parallel Coordinates
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Nutrient Database Explorer</title>
<link rel="stylesheet" type="text/css" href="parallel.css" />
</head>
<body>
<div id="header">
<h1>Nutrient Explorer</h1>