diff --git a/lib/plots/canopy.js b/lib/plots/canopy.js index 0915dfe9..db631316 100644 --- a/lib/plots/canopy.js +++ b/lib/plots/canopy.js @@ -3,7 +3,7 @@ import etch from 'etch'; import { prewalk, postwalk, prefor } from './tree.js'; -import { Etch, Tip, Button, toView } from '../util/etch.js'; +import { Etch, Button, toView } from '../util/etch.js'; function clamp (x, min, max) { return Math.min(Math.max(x, min), max) @@ -26,12 +26,12 @@ function dims(tree) { left += ch.width; }); // Centre align children - chwidth = parent.children.map(({width})=>width).reduce((a,b)=>a+b, 0); + const chwidth = parent.children.map(({width})=>width).reduce((a,b)=>a+b, 0); parent.children.forEach(ch => ch.left += (parent.width-chwidth)/2); return parent; }); // Scale total height to 100% - let max = postwalk(tree, ({height, children}) => + const max = postwalk(tree, ({height, children}) => Math.max(height, ...children.map(x=>x+height))); prewalk(tree, (node) => { node.top /= max; @@ -172,7 +172,7 @@ export class Pannable extends Etch { this.toolbar = this.toolbar.concat(this.item.toolbar) } - let style = {position:'relative', height:'inherit', width:'inherit', transformOrigin: '0px 0px'} + const style = { position:'relative', height:'inherit', width:'inherit', transformOrigin: '0px 0px' } if (this.zoomstrategy == 'width') { style.transform = 'translate('+this.left+'px,'+this.top+'px)' @@ -214,22 +214,27 @@ export class Pannable extends Etch { class NodeView extends Etch { render() { - let {height, width, top, left, onclick, onmouseover, onmouseout} = this.props; - return
-
-
; + const { height, width, top, left, onclick, onmouseover, onmouseout } = this.props; + return +
+
+
+
+
+
+
; } } export default class Canopy extends Etch { - update({data}) {} + update({ data }) {} render() { - let nodes = []; + const nodes = []; prefor(dims(this.props.data), node => nodes.push()); return
{nodes} diff --git a/lib/util/etch.js b/lib/util/etch.js index 4597d2c6..f4297b69 100644 --- a/lib/util/etch.js +++ b/lib/util/etch.js @@ -108,7 +108,6 @@ export class Tip { this.tooltip = atom.tooltips.add(this.element, {title: () => this.text}); } - this.text = alt; this.child = child; etch.update(this, false);