Skip to content

Commit c384114

Browse files
committed
fix initial zoom for profiler etc
1 parent 6f550d5 commit c384114

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

lib/plots/canopy.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ export class Pannable extends Etch {
8888
})
8989
}
9090
} else {
91-
this.isLoaded = true
91+
etch.update(this).then(() => {
92+
this.setInitialScale(item)
93+
this.isLoaded = true
94+
etch.update(this)
95+
})
9296
}
9397
etch.update(this)
9498
}
@@ -115,7 +119,7 @@ export class Pannable extends Etch {
115119
this.scale = this.initialScale
116120
this.left = 0
117121
this.top = 0
118-
122+
119123
etch.update(this)
120124
}
121125

@@ -211,14 +215,19 @@ export class Pannable extends Etch {
211215
class NodeView extends Etch {
212216
render() {
213217
const {height, width, top, left, onclick, classes, onmouseover, onmouseout} = this.props;
214-
return <Clickable onclick={onclick}><div className={`node ${classes.join(' ')}`} {...{onmouseover, onmouseout}} style={{
215-
height: 100*height+'%',
216-
width: 100*width +'%',
217-
top: 100*top +'%',
218-
left: 100*left +'%'
219-
}}>
220-
<div><div></div></div>
221-
</div></Clickable>;
218+
return <Clickable onclick={onclick}>
219+
<div className={`node ${classes.join(' ')}`} {...{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>;
222231
}
223232
}
224233

0 commit comments

Comments
 (0)