Skip to content

Commit e1d6777

Browse files
authored
Merge pull request #96 from JunoLab/omm/plot-pane
Plot Pane refactor
2 parents 44d17f2 + 64a18c2 commit e1d6777

File tree

4 files changed

+48
-48
lines changed

4 files changed

+48
-48
lines changed

lib/plots/pane.coffee

-30
This file was deleted.

lib/plots/pane.js

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
'use babel'
2+
/** @jsx etch.dom */
3+
4+
import etch from 'etch';
5+
6+
import PaneItem from '../util/pane-item';
7+
import { toView } from '../util/etch'
8+
9+
export default class PlotPane extends PaneItem {
10+
11+
static activate() {
12+
this.pane = PlotPane.fromId('default');
13+
atom.workspace.addOpener(uri => {
14+
if (uri.startsWith('atom://ink/plots')) {
15+
return this.pane;
16+
}
17+
});
18+
}
19+
20+
constructor() {
21+
super();
22+
etch.initialize(this);
23+
this.element.setAttribute('tabindex', -1);
24+
}
25+
26+
update() {}
27+
28+
render() {
29+
return <span className="ink-plot-pane">{toView(this.item)}</span>;
30+
}
31+
32+
show(view) {
33+
this.item = view;
34+
etch.update(this);
35+
}
36+
37+
getTitle() {
38+
return 'Plots';
39+
}
40+
41+
getIconName() {
42+
return 'graph';
43+
}
44+
45+
};
46+
47+
PlotPane.registerView();

lib/plots/view.coffee

-17
This file was deleted.

styles/plot-pane.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import "syntax-variables";
22

3-
ink-plot-pane {
3+
.ink-plot-pane {
44
background-color: @syntax-background-color;
55
-webkit-user-select: none;
66
overflow: auto;

0 commit comments

Comments
 (0)