@flexem/fc-gui 3.0.0-alpha.35 → 3.0.0-alpha.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -3
- package/bundles/@flexem/fc-gui.umd.js +96 -54
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +2 -2
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/historical-curve/historical-curve.element.js +37 -5
- package/gui/gui-host.d.ts +1 -1
- package/gui/gui.component.d.ts +3 -0
- package/gui/gui.component.js +12 -2
- package/gui/gui.component.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
22
22
|
marginRight: 20,
|
|
23
23
|
mobileMinWidth: 450,
|
|
24
24
|
operationAreaHeight: 32,
|
|
25
|
-
operationAreaMarginTop:
|
|
25
|
+
operationAreaMarginTop: 25,
|
|
26
26
|
operationSelectFontSize: '16px',
|
|
27
27
|
operationButtonWidth: 24,
|
|
28
28
|
operationButtonHeight: 24,
|
|
@@ -39,7 +39,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
39
39
|
}, this.model.displaySetting.refreshInterval * 1000);
|
|
40
40
|
this.isMobileMode = DisplayMode.Mobile === injector.get(GlobalSettings).displayMode;
|
|
41
41
|
if (this.isMobileMode) {
|
|
42
|
-
this.displayOption.operationAreaMarginTop =
|
|
42
|
+
this.displayOption.operationAreaMarginTop = 35;
|
|
43
43
|
if (this.model.displaySetting.size.width >= this.displayOption.mobileMinWidth) {
|
|
44
44
|
this.displayOption.operationAreaHeight = 68;
|
|
45
45
|
this.displayOption.operationSelectFontSize = '24px';
|
|
@@ -206,7 +206,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
206
206
|
chart.tooltip.headerFormatter(d => this.timeFormat(d, '%x %X'));
|
|
207
207
|
if (this.model.displaySetting.showAxis) {
|
|
208
208
|
chart.xAxis.showMaxMin(true).tickFormat(d => {
|
|
209
|
-
if (this.currentTimePeriod
|
|
209
|
+
if (this.currentTimePeriod === 3 || this.currentTimePeriod === 4 || this.currentTimePeriod === 5) {
|
|
210
210
|
return this.timeFormat(d, '%y-%m-%d');
|
|
211
211
|
}
|
|
212
212
|
return this.timeFormat(Number(d), '%X');
|
|
@@ -258,7 +258,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
258
258
|
.attr('class', 'full-date')
|
|
259
259
|
.attr('x', 0)
|
|
260
260
|
.attr('y', 0)
|
|
261
|
-
.attr('dy', '2.
|
|
261
|
+
.attr('dy', '2.3em')
|
|
262
262
|
.style('text-anchor', 'middle')
|
|
263
263
|
.style('font-size', fontSize)
|
|
264
264
|
.text((d) => d);
|
|
@@ -273,10 +273,42 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
273
273
|
.attr('class', 'full-date')
|
|
274
274
|
.attr('x', 0)
|
|
275
275
|
.attr('y', 0)
|
|
276
|
-
.attr('dy', '2.
|
|
276
|
+
.attr('dy', '2.3em')
|
|
277
277
|
.style('text-anchor', 'middle')
|
|
278
278
|
.style('font-size', fontSize)
|
|
279
279
|
.text((d) => d);
|
|
280
|
+
const h = this.rootElement
|
|
281
|
+
.selectAll('.nv-focusWrap')
|
|
282
|
+
.attr('transform')
|
|
283
|
+
.slice(0, -1)
|
|
284
|
+
.split(',')[1];
|
|
285
|
+
this.rootElement
|
|
286
|
+
.selectAll('.nv-focusWrap')
|
|
287
|
+
.attr('transform', `translate(0,${Number(h) + 15})`);
|
|
288
|
+
const resizeObserver = new window.MutationObserver(() => {
|
|
289
|
+
this.rootElement
|
|
290
|
+
.selectAll('.nv-x')
|
|
291
|
+
.selectAll('.tick')
|
|
292
|
+
.selectAll('.full-date')
|
|
293
|
+
.remove();
|
|
294
|
+
this.rootElement
|
|
295
|
+
.selectAll('.nv-x')
|
|
296
|
+
.selectAll('.tick')
|
|
297
|
+
.selectAll('text')
|
|
298
|
+
.data(function (d) {
|
|
299
|
+
return [self.timeFormat(Number(d), '%y-%m-%d'), self.timeFormat(Number(d), '%H:%M:%S')];
|
|
300
|
+
})
|
|
301
|
+
.enter()
|
|
302
|
+
.append('text')
|
|
303
|
+
.attr('class', 'full-date')
|
|
304
|
+
.attr('x', 0)
|
|
305
|
+
.attr('y', 0)
|
|
306
|
+
.attr('dy', '2.3em')
|
|
307
|
+
.style('text-anchor', 'middle')
|
|
308
|
+
.style('font-size', fontSize)
|
|
309
|
+
.text((d) => d);
|
|
310
|
+
});
|
|
311
|
+
resizeObserver.observe(document.getElementsByClassName('extent')[0], { attributes: true });
|
|
280
312
|
}
|
|
281
313
|
else {
|
|
282
314
|
this.rootElement
|
package/gui/gui-host.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare class GuiHost implements Disposable {
|
|
|
13
13
|
readonly el: ElementRef;
|
|
14
14
|
private isLoaded;
|
|
15
15
|
private currentView;
|
|
16
|
-
|
|
16
|
+
currentViewIndex: number;
|
|
17
17
|
private containerEl;
|
|
18
18
|
private currentViewSize;
|
|
19
19
|
private currentViewReiszeMode;
|
package/gui/gui.component.d.ts
CHANGED
|
@@ -24,10 +24,12 @@ export declare class GuiComponent implements OnChanges, OnDestroy {
|
|
|
24
24
|
initHeight: number;
|
|
25
25
|
lastScale: number;
|
|
26
26
|
isMobileMode: boolean;
|
|
27
|
+
hostContainerId: string;
|
|
27
28
|
private $svg;
|
|
28
29
|
private host;
|
|
29
30
|
private get viewResizeMode();
|
|
30
31
|
private readonly globalSettings;
|
|
32
|
+
private readonly viewService;
|
|
31
33
|
constructor(el: ElementRef, localization: Localization, injector: Injector, bsModalService: BsModalService);
|
|
32
34
|
ngOnChanges(changes: {
|
|
33
35
|
[propKey: string]: SimpleChange;
|
|
@@ -39,4 +41,5 @@ export declare class GuiComponent implements OnChanges, OnDestroy {
|
|
|
39
41
|
private onSizeChanged;
|
|
40
42
|
private onResizeModeChanged;
|
|
41
43
|
private onDisplayModeChanged;
|
|
44
|
+
refreshCurrentPage(): void;
|
|
42
45
|
}
|
package/gui/gui.component.js
CHANGED
|
@@ -18,6 +18,7 @@ import { Size } from '../model';
|
|
|
18
18
|
import { DisplayMode, GlobalSettings, ViewResizeMode } from '../settings';
|
|
19
19
|
import { GuiHost } from './gui-host';
|
|
20
20
|
import { Guid } from '../utils/guid';
|
|
21
|
+
import { ViewService } from '../view/view.service';
|
|
21
22
|
let GuiComponent = class GuiComponent {
|
|
22
23
|
constructor(el, localization, injector, bsModalService) {
|
|
23
24
|
this.el = el;
|
|
@@ -29,6 +30,7 @@ let GuiComponent = class GuiComponent {
|
|
|
29
30
|
this.lastScale = 1;
|
|
30
31
|
this.isMobileMode = false;
|
|
31
32
|
this.globalSettings = this.injector.get(GlobalSettings);
|
|
33
|
+
this.viewService = injector.get(ViewService);
|
|
32
34
|
}
|
|
33
35
|
get viewResizeMode() {
|
|
34
36
|
switch (this.resizeMode) {
|
|
@@ -131,11 +133,11 @@ let GuiComponent = class GuiComponent {
|
|
|
131
133
|
this.$svg = $(this.el.nativeElement).find('div.svgView').first();
|
|
132
134
|
this.$svg.empty();
|
|
133
135
|
const svgRootClass = 'S' + Guid.newGuid().toString('n');
|
|
134
|
-
|
|
136
|
+
this.hostContainerId = 'H' + Guid.newGuid().toString('n');
|
|
135
137
|
this.$svg.addClass(svgRootClass);
|
|
136
138
|
const guiOptions = {
|
|
137
139
|
svgRootClass: svgRootClass,
|
|
138
|
-
hostContainerId: hostContainerId,
|
|
140
|
+
hostContainerId: this.hostContainerId,
|
|
139
141
|
el: this.el
|
|
140
142
|
};
|
|
141
143
|
const host = new GuiHost(this.injector, this.bsModalService, newValue, guiOptions, this.el);
|
|
@@ -190,6 +192,14 @@ let GuiComponent = class GuiComponent {
|
|
|
190
192
|
this.isMobileMode = this.displayMode === 'Mobile';
|
|
191
193
|
this.globalSettings.displayMode = this.isMobileMode ? DisplayMode.Mobile : DisplayMode.Web;
|
|
192
194
|
}
|
|
195
|
+
refreshCurrentPage() {
|
|
196
|
+
const viewIndex = this.host.currentViewIndex || 0;
|
|
197
|
+
const toggleView = this.viewService.toggleViews.get(this.el);
|
|
198
|
+
if (!toggleView) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
toggleView(viewIndex, this.hostContainerId, this.el).subscribe();
|
|
202
|
+
}
|
|
193
203
|
};
|
|
194
204
|
__decorate([
|
|
195
205
|
Input(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"GuiComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"GuiComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":12,"character":1},"arguments":[{"selector":"fc-gui","template":"<div> <div class='svgView' style=\"position: relative;display: flex;justify-content: center;align-items: center;\"></div> </div> "}]}],"members":{"context":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":5}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":5}}]}],"resizeMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":5}}]}],"displayMode":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":5}}]}],"loadFailed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":22,"character":5}}]}],"loaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":23,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":50,"character":9},"arguments":[{"__symbolic":"reference","module":"../localization","name":"LOCALIZATION","line":50,"character":16}]}],null,null],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":49,"character":37},{"__symbolic":"reference","module":"../localization","name":"Localization","line":50,"character":61},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":51,"character":35},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":52,"character":41}]}],"ngOnChanges":[{"__symbolic":"method"}],"doubleFingerZooming":[{"__symbolic":"method"}],"getDistance":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onProviderChanged":[{"__symbolic":"method"}],"onSizeChanged":[{"__symbolic":"method"}],"onResizeModeChanged":[{"__symbolic":"method"}],"onDisplayModeChanged":[{"__symbolic":"method"}],"refreshCurrentPage":[{"__symbolic":"method"}]}}}}]
|