Skip to content

Instantly share code, notes, and snippets.

@PaulMaynard
PaulMaynard / MapProxy.js
Created October 18, 2014 16:08
ES6 Map Accessor Proxy
/**
* Proxy for accessing ES6 Maps like objects.
* Usage example:
*
* var p = new MapProxy();
* p['key'] = 'value';
* if ('key' in p) {
* console.log(p.key);
* }
* delete p.key;
/* USAGE
var graph = new Graph(paper.get(0), 800, 500);
graph.max(maxx, maxy)
.min(minx, miny)
.ticks(4, function(x, y){
var attrs = {stroke: "#ffffff", 'stroke-width': '1'};
graph.hor(y, attrs)
.ver(x, attrs);