Skip to content

Commit 4b0511a

Browse files
committed
eslint stuff
1 parent 7e00f30 commit 4b0511a

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

lib/plots/canopy.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import etch from 'etch';
55
import { prewalk, postwalk, prefor } from './tree.js';
6-
import { Etch, Tip, Button, toView } from '../util/etch.js';
6+
import { Etch, Button, toView } from '../util/etch.js';
77

88
function clamp (x, min, max) {
99
return Math.min(Math.max(x, min), max)
@@ -26,12 +26,12 @@ function dims(tree) {
2626
left += ch.width;
2727
});
2828
// Centre align children
29-
chwidth = parent.children.map(({width})=>width).reduce((a,b)=>a+b, 0);
29+
const chwidth = parent.children.map(({width})=>width).reduce((a,b)=>a+b, 0);
3030
parent.children.forEach(ch => ch.left += (parent.width-chwidth)/2);
3131
return parent;
3232
});
3333
// Scale total height to 100%
34-
let max = postwalk(tree, ({height, children}) =>
34+
const max = postwalk(tree, ({height, children}) =>
3535
Math.max(height, ...children.map(x=>x+height)));
3636
prewalk(tree, (node) => {
3737
node.top /= max;
@@ -172,7 +172,7 @@ export class Pannable extends Etch {
172172
this.toolbar = this.toolbar.concat(this.item.toolbar)
173173
}
174174

175-
let style = {position:'relative', height:'inherit', width:'inherit', transformOrigin: '0px 0px'}
175+
const style = { position:'relative', height:'inherit', width:'inherit', transformOrigin: '0px 0px' }
176176

177177
if (this.zoomstrategy == 'width') {
178178
style.transform = 'translate('+this.left+'px,'+this.top+'px)'
@@ -214,22 +214,27 @@ export class Pannable extends Etch {
214214

215215
class NodeView extends Etch {
216216
render() {
217-
let {height, width, top, left, onclick, onmouseover, onmouseout} = this.props;
218-
return <Clickable onclick={onclick}><div className='node' {...{onmouseover, onmouseout}} style={{
219-
height: 100*height+'%',
220-
width: 100*width +'%',
221-
top: 100*top +'%',
222-
left: 100*left +'%'
223-
}}>
224-
<div><div></div></div>
225-
</div></Clickable>;
217+
const { height, width, top, left, onclick, onmouseover, onmouseout } = this.props;
218+
return <Clickable onclick={onclick}>
219+
<div className='node' {...{onmouseover, onmouseout}} style={{
220+
height: 100*height+'%',
221+
width: 100*width +'%',
222+
top: 100*top +'%',
223+
left: 100*left +'%'
224+
}}>
225+
<div>
226+
<div>
227+
</div>
228+
</div>
229+
</div>
230+
</Clickable>;
226231
}
227232
}
228233

229234
export default class Canopy extends Etch {
230-
update({data}) {}
235+
update({ data }) {}
231236
render() {
232-
let nodes = [];
237+
const nodes = [];
233238
prefor(dims(this.props.data), node => nodes.push(<NodeView {...node} />));
234239
return <div className="ink-canopy">
235240
{nodes}

lib/util/etch.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export class Tip {
108108
this.tooltip = atom.tooltips.add(this.element, {title: () => this.text});
109109
}
110110

111-
112111
this.text = alt;
113112
this.child = child;
114113
etch.update(this, false);

0 commit comments

Comments
 (0)