Skip to content

Commit 722e300

Browse files
authored
Merge pull request #260 from mgusmano/ext-angular-6.7.x
formatting
2 parents 01d1b7d + 1626a04 commit 722e300

File tree

37 files changed

+191
-401
lines changed

37 files changed

+191
-401
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
2-
import {createData} from './createData';
3-
41
declare var Ext: any;
2+
import { Component } from '@angular/core';
3+
import {createData} from './createData';
54

65
Ext.require([
76
'Ext.chart.axis.Numeric',
@@ -14,129 +13,120 @@ Ext.require([
1413
templateUrl: './OHLC.html',
1514
styles: [``]
1615
})
17-
export class OHLCComponent implements OnInit {
16+
export class OHLCComponent {
1817

1918
constructor() {
20-
2119
this.refresh();
2220
}
2321

24-
ngOnInit() {
22+
isPhone = Ext.os.is.Phone;
23+
store = Ext.create('Ext.data.Store', {
24+
fields: ['time', 'open', 'high', 'low', 'close']
25+
});
26+
27+
theme:string= 'default';
28+
zoom:boolean= false;
29+
30+
panzoom:any;
31+
crosshair:any;
32+
33+
chart:any;
34+
35+
chartNavReady = function(event) {
36+
console.log("chartNavReady");
37+
this.chart = event.ext;
38+
this.panzoom = this.chart.getInteraction('panzoom');
39+
this.crosshair = this.chart.getInteraction('crosshair');
2540
}
2641

27-
isPhone = Ext.os.is.Phone;
2842

43+
refresh = () => {
44+
this.store.loadData(createData(1000));
45+
}
2946

30-
store = Ext.create('Ext.data.Store', {
31-
fields: ['time', 'open', 'high', 'low', 'close']
32-
});
33-
34-
theme:string= 'default';
35-
zoom:boolean= false;
36-
37-
panzoom:any;
38-
crosshair:any;
39-
40-
chart:any;
41-
42-
chartNavReady = function(event) {
43-
console.log("chartNavReady");
44-
this.chart = event.ext;
45-
this.panzoom = this.chart.getInteraction('panzoom');
46-
this.crosshair = this.chart.getInteraction('crosshair');
47-
}
48-
49-
50-
refresh = () => {
51-
this.store.loadData(createData(1000));
52-
}
53-
54-
changeTheme = theme => this.theme = theme;
55-
56-
toggleZoomOnPan = (zoomOnPan) => {
57-
this.toggleCrosshair(false);
58-
this.panzoom.setZoomOnPan(zoomOnPan);
59-
this.zoom = zoomOnPan;
60-
}
61-
62-
toggleCrosshair = (crosshair) => {
63-
this.panzoom.setEnabled(!crosshair);
64-
this.crosshair.setEnabled(crosshair);
65-
if(crosshair){
66-
this.crosshair = crosshair;
67-
}
68-
}
69-
70-
71-
cartesianAxes = [{
72-
type: 'numeric',
73-
fields: ['open', 'high', 'low', 'close'],
74-
position: 'left',
75-
maximum: 1000,
76-
minimum: 0
77-
}, {
78-
type: 'time',
79-
fields: ['time'],
80-
position: 'bottom',
81-
visibleRange: [0, 0.3],
82-
style: {
83-
axisLine: false
84-
}
85-
}];
86-
87-
cartesianSeries = {
88-
type: 'candlestick',
89-
xField: 'time',
90-
openField: 'open',
91-
highField: 'high',
92-
lowField: 'low',
93-
closeField: 'close',
94-
style: {
95-
ohlcType: 'ohlc',
96-
barWidth: 10,
97-
opacity: 0.9,
98-
dropStyle: {
99-
fill: 'rgb(237,123,43)',
100-
stroke: 'rgb(237,123,43)'
101-
},
102-
raiseStyle: {
103-
fill: 'rgb(55,153,19)',
104-
stroke: 'rgb(55,153,19)'
105-
}
106-
},
107-
aggregator: {
108-
strategy: 'time'
109-
}
110-
};
111-
112-
113-
cartesianInteractions = [{
114-
type: 'panzoom',
115-
axes: {
116-
left: {
117-
allowPan: false,
118-
allowZoom: false
119-
},
120-
bottom: {
121-
allowPan: true,
122-
allowZoom: true
123-
}
124-
}
125-
}, {
126-
type: 'crosshair',
127-
axes: {
128-
label: {
129-
fillStyle: 'white'
130-
},
131-
rect: {
132-
fillStyle: '#344459',
133-
opacity: 0.7,
134-
radius: 5
135-
}
136-
}
137-
}];
47+
changeTheme = theme => this.theme = theme;
48+
49+
toggleZoomOnPan = (zoomOnPan) => {
50+
this.toggleCrosshair(false);
51+
this.panzoom.setZoomOnPan(zoomOnPan);
52+
this.zoom = zoomOnPan;
53+
}
13854

55+
toggleCrosshair = (crosshair) => {
56+
this.panzoom.setEnabled(!crosshair);
57+
this.crosshair.setEnabled(crosshair);
58+
if(crosshair){
59+
this.crosshair = crosshair;
60+
}
61+
}
13962

14063

64+
cartesianAxes = [{
65+
type: 'numeric',
66+
fields: ['open', 'high', 'low', 'close'],
67+
position: 'left',
68+
maximum: 1000,
69+
minimum: 0
70+
}, {
71+
type: 'time',
72+
fields: ['time'],
73+
position: 'bottom',
74+
visibleRange: [0, 0.3],
75+
style: {
76+
axisLine: false
77+
}
78+
}];
79+
80+
cartesianSeries = {
81+
type: 'candlestick',
82+
xField: 'time',
83+
openField: 'open',
84+
highField: 'high',
85+
lowField: 'low',
86+
closeField: 'close',
87+
style: {
88+
ohlcType: 'ohlc',
89+
barWidth: 10,
90+
opacity: 0.9,
91+
dropStyle: {
92+
fill: 'rgb(237,123,43)',
93+
stroke: 'rgb(237,123,43)'
94+
},
95+
raiseStyle: {
96+
fill: 'rgb(55,153,19)',
97+
stroke: 'rgb(55,153,19)'
98+
}
99+
},
100+
aggregator: {
101+
strategy: 'time'
102+
}
103+
};
104+
105+
106+
cartesianInteractions = [{
107+
type: 'panzoom',
108+
axes: {
109+
left: {
110+
allowPan: false,
111+
allowZoom: false
112+
},
113+
bottom: {
114+
allowPan: true,
115+
allowZoom: true
116+
}
117+
}
118+
}, {
119+
type: 'crosshair',
120+
axes: {
121+
label: {
122+
fillStyle: 'white'
123+
},
124+
rect: {
125+
fillStyle: '#344459',
126+
opacity: 0.7,
127+
radius: 5
128+
}
129+
}
130+
}];
141131

142132
}

packages/ext-angular-kitchensink/src/examples/Grid/AddonsDecorations/RowBody/RowBody.ts

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
2-
import {model} from '../../CompanyModel';
3-
41
declare var Ext: any;
5-
2+
import { Component } from '@angular/core';
3+
import {model} from '../../CompanyModel';
64

75
@Component({
86
selector: 'rowbody-component',
97
templateUrl: './RowBody.html',
108
styles: [``]
119
})
12-
export class RowBodyComponent implements OnInit {
10+
export class RowBodyComponent {
1311

1412
store = Ext.create('Ext.data.Store', {
1513
model,
@@ -50,12 +48,4 @@ export class RowBodyComponent implements OnInit {
5048
return formattedValue;
5149
}
5250

53-
constructor() { }
54-
55-
56-
57-
ngOnInit() {
58-
}
59-
60-
6151
}

packages/ext-angular-kitchensink/src/examples/Grid/AddonsDecorations/SummaryRow/SummaryRow.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
2-
import {model} from '../../CompanyModel';
3-
41
declare var Ext: any;
2+
import { Component } from '@angular/core';
3+
import {model} from '../../CompanyModel';
54

65
Ext.require([
76
'Ext.grid.plugin.SummaryRow',
@@ -14,7 +13,7 @@ Ext.require([
1413
templateUrl: './SummaryRow.html',
1514
styles: [``]
1615
})
17-
export class SummaryRowComponent implements OnInit {
16+
export class SummaryRowComponent {
1817

1918
store = Ext.create('Ext.data.Store', {
2019
model,
@@ -39,13 +38,5 @@ export class SummaryRowComponent implements OnInit {
3938
} ;
4039

4140
summarizeCompanies = (grid, context) => context.records.length + ' Companies';
42-
43-
constructor() { }
44-
45-
46-
47-
ngOnInit() {
48-
}
49-
5041

5142
}

packages/ext-angular-kitchensink/src/examples/Grid/AddonsDecorations/ViewOptions/ViewOptions.ts

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
2-
import {model} from '../../CompanyModel';
3-
41
declare var Ext: any;
2+
import { Component } from '@angular/core';
3+
import {model} from '../../CompanyModel';
54

65
Ext.require(['Ext.grid.plugin.ViewOptions']);
76

@@ -10,7 +9,7 @@ Ext.require(['Ext.grid.plugin.ViewOptions']);
109
templateUrl: './ViewOptions.html',
1110
styles: [``]
1211
})
13-
export class ViewOptionsComponent implements OnInit {
12+
export class ViewOptionsComponent {
1413

1514
toolbarHtml = `
1615
<div style="fontSize:'14px';fontWeight: 'normal';">Long press on a column header to customize this grid.</div>
@@ -25,8 +24,6 @@ export class ViewOptionsComponent implements OnInit {
2524
}
2625
});
2726

28-
constructor() { }
29-
3027
renderSign = (format, value) => {
3128
var formattedValue = Ext.util.Format.number(value, format);
3229
var color = "";
@@ -39,8 +36,4 @@ export class ViewOptionsComponent implements OnInit {
3936
return formattedValue;
4037
} ;
4138

42-
ngOnInit() {
43-
}
44-
45-
4639
}

packages/ext-angular-kitchensink/src/examples/Grid/AdvancedFeatures/BigData/BigData.ts

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
2-
1+
declare var Ext: any;
2+
import { Component } from '@angular/core';
33
import {model} from './GridModel'
44
import {BigDataService} from './BigData.service';
55

6-
declare var Ext: any;
7-
86
Ext.require([
97
'Ext.grid.plugin.*',
108
'Ext.tip.ToolTip',
119
'Ext.data.summary.Sum',
1210
'Ext.exporter.*'
1311
]);
1412

15-
1613
@Component({
1714
selector: 'bigdata-component',
1815
templateUrl: './BigData.html',
1916
styles: [``]
2017
})
21-
export class BigDataComponent implements OnInit {
18+
export class BigDataComponent {
2219

2320
constructor(bigDataService : BigDataService) { }
2421

@@ -37,10 +34,6 @@ export class BigDataComponent implements OnInit {
3734
});
3835

3936

40-
41-
ngOnInit() {
42-
}
43-
4437
grid:any;
4538

4639
gridReady = (event) => {

0 commit comments

Comments
 (0)