Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 8aceb6d

Browse files
BoykoAlexoodamien
authored andcommitted
Various Flo fixes. Flo 0.8.4
1 parent fc6bdb5 commit 8aceb6d

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

ui/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"web-animations-js": "2.3.1",
5050
"stompjs": "2.3.3",
5151
"jshint": "2.9.5",
52-
"spring-flo": "0.8.1",
52+
"spring-flo": "0.8.4",
5353
"ng-busy": "1.4.4",
5454
"rxjs-compat": "6.2.1",
5555
"uuid": "3.3.2"
@@ -64,6 +64,10 @@
6464
"@types/jasminewd2": "2.0.3",
6565
"@types/node": "8.9.5",
6666
"@types/uuid": "3.4.3",
67+
"@types/backbone": "1.3.43",
68+
"@types/codemirror": "0.0.60",
69+
"@types/jquery": "3.3.6",
70+
"@types/lodash": "4.14.116",
6771
"codelyzer": "4.2.1",
6872
"jasmine-core": "2.99.1",
6973
"jasmine-spec-reporter": "4.2.1",

ui/src/app/shared/flo/support/shared-shapes.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { dia } from 'jointjs';
22
import * as _joint from 'jointjs';
3+
34
const joint: any = _joint;
45
const g = joint.g;
56
const V = joint.V;
67

7-
joint.connectors.smoothHorizontal = function(sourcePoint, targetPoint, route, opt) {
8+
joint.connectors.smoothHorizontal = function (sourcePoint, targetPoint, route, opt) {
89

910
const raw = opt && opt.raw;
1011
let path;
@@ -38,7 +39,7 @@ joint.connectors.smoothHorizontal = function(sourcePoint, targetPoint, route, op
3839
return (raw) ? path : path.serialize();
3940
};
4041

41-
joint.connectors.smoothVertical = function(sourcePoint, targetPoint, route, opt) {
42+
joint.connectors.smoothVertical = function (sourcePoint, targetPoint, route, opt) {
4243

4344
const raw = opt && opt.raw;
4445
let path;
@@ -72,10 +73,10 @@ joint.connectors.smoothVertical = function(sourcePoint, targetPoint, route, opt)
7273
return (raw) ? path : path.serialize();
7374
};
7475

75-
export function centerGraphHorizontallyOnPaper(paper: dia.Paper) {
76+
export function shiftGraphHorizontallyOnPaper(paper: dia.Paper, offset: number) {
7677
const currentTranslate = paper.translate();
7778
const box = /*V(paper.viewport).getBBox()*/paper.getContentBBox();
78-
const tx = (paper.$el.innerWidth() - box.width) / 2;
79+
const tx = offset > 0 && offset <= 1 ? (paper.$el.innerWidth() - box.width) * offset : offset;
7980
paper.translate(tx, currentTranslate.ty);
8081
}
8182

ui/src/app/streams/stream-create/stream-create.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<div id="flo-container" class="stream-editor" dataflowLayoutType type="full">
1111
<flo-editor (floApi)="setEditorContext($event)" [metamodel]="metamodelService" [renderer]="renderService"
12-
[editor]="editorService" [paletteSize]="paletteSize" [(dsl)]="dsl" [paperPadding]="20"
12+
[editor]="editorService" [paletteSize]="paletteSize" [(dsl)]="dsl" [paperPadding]="55"
1313
(contentValidated)="contentValidated=$event" (validationMarkers)="validationMarkers = $event">
1414

1515
<div class="flow-definition-container">

ui/src/app/tasks/components/flo/support/layout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { dia } from 'jointjs';
22
import { IMAGE_H, START_NODE_TYPE, END_NODE_TYPE, CONTROL_GROUP_TYPE } from './shapes';
33
import * as dagre from 'dagre';
4-
import { centerGraphHorizontallyOnPaper } from '../../../../shared/flo/support/shared-shapes';
4+
import { shiftGraphHorizontallyOnPaper } from '../../../../shared/flo/support/shared-shapes';
55
import { Flo } from 'spring-flo';
66

77
export function layout(paper: dia.Paper) {
@@ -68,7 +68,7 @@ export function layout(paper: dia.Paper) {
6868
export function arrangeAll(editorContext: Flo.EditorContext): Promise<void> {
6969
return editorContext.performLayout().then(() => {
7070
editorContext.fitToPage();
71-
centerGraphHorizontallyOnPaper(editorContext.getPaper());
71+
shiftGraphHorizontallyOnPaper(editorContext.getPaper(), 1 / 5);
7272
});
7373
}
7474

ui/src/app/tasks/task-definition-create/task-definition-create.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<div id="flo-container" class="stream-editor" [ngBusy]="busy">
1111
<flo-editor (floApi)="setEditorContext($event)" [metamodel]="metamodelService" [renderer]="renderService"
12-
[editor]="editorService" [paletteSize]="paletteSize" [paperPadding]="20" [(dsl)]="dsl"
12+
[editor]="editorService" [paletteSize]="paletteSize" [paperPadding]="55" [(dsl)]="dsl"
1313
(contentValidated)="contentValidated=$event" (validationMarkers)="validationMarkers = $event">
1414

1515
<div class="flow-definition-container">

0 commit comments

Comments
 (0)