@gisce/ooui 0.5.0 → 0.6.0
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/dist/Graph/Graph.d.ts +1 -1
- package/dist/Graph/GraphChart.d.ts +4 -4
- package/dist/Graph/GraphIndicatorField.d.ts +4 -4
- package/dist/Graph/GraphIndicatorField.js +1 -3
- package/dist/Graph/GraphIndicatorField.js.map +1 -1
- package/dist/Graph/graphHelper.d.ts +1 -1
- package/dist/Graph/graphHelper.js +14 -4
- package/dist/Graph/graphHelper.js.map +1 -1
- package/package.json +1 -1
- package/src/Graph/Graph.ts +1 -1
- package/src/Graph/GraphChart.ts +4 -4
- package/src/Graph/GraphIndicatorField.ts +5 -5
- package/src/Graph/graphHelper.ts +17 -5
package/dist/Graph/Graph.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GraphAxis } from ".";
|
|
2
2
|
import { Graph, GraphType } from "./Graph";
|
|
3
3
|
export declare class GraphChart extends Graph {
|
|
4
|
-
_x: GraphAxis
|
|
5
|
-
get x(): GraphAxis
|
|
6
|
-
_y: GraphAxis[]
|
|
7
|
-
get y(): GraphAxis[]
|
|
4
|
+
_x: GraphAxis;
|
|
5
|
+
get x(): GraphAxis;
|
|
6
|
+
_y: GraphAxis[];
|
|
7
|
+
get y(): GraphAxis[];
|
|
8
8
|
constructor(type: GraphType, element: HTMLElement);
|
|
9
9
|
}
|
|
@@ -2,9 +2,9 @@ import { Operator } from ".";
|
|
|
2
2
|
import { GraphType } from "./Graph";
|
|
3
3
|
import { GraphIndicator } from "./GraphIndicator";
|
|
4
4
|
export declare class GraphIndicatorField extends GraphIndicator {
|
|
5
|
-
_field: string |
|
|
6
|
-
get field(): string |
|
|
7
|
-
_operator: Operator |
|
|
8
|
-
get operator(): Operator |
|
|
5
|
+
_field: string | undefined;
|
|
6
|
+
get field(): string | undefined;
|
|
7
|
+
_operator: Operator | undefined;
|
|
8
|
+
get operator(): Operator | undefined;
|
|
9
9
|
constructor(type: GraphType, element: HTMLElement);
|
|
10
10
|
}
|
|
@@ -16,13 +16,11 @@ var GraphIndicatorField = /** @class */ (function (_super) {
|
|
|
16
16
|
__extends(GraphIndicatorField, _super);
|
|
17
17
|
function GraphIndicatorField(type, element) {
|
|
18
18
|
var _this = _super.call(this, type, element) || this;
|
|
19
|
-
_this._field = null;
|
|
20
|
-
_this._operator = null;
|
|
21
19
|
Array.prototype.forEach.call(element.childNodes, function (child) {
|
|
22
20
|
if (child.nodeType === child.ELEMENT_NODE && child.nodeName === "field") {
|
|
23
21
|
var name_1 = child.getAttribute("name");
|
|
24
22
|
var operator = child.getAttribute("operator");
|
|
25
|
-
_this._field = name_1;
|
|
23
|
+
_this._field = name_1 || undefined;
|
|
26
24
|
_this._operator = operator;
|
|
27
25
|
}
|
|
28
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphIndicatorField.js","sourceRoot":"","sources":["../../src/Graph/GraphIndicatorField.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;IAAyC,uCAAc;IAWrD,6BAAY,IAAe,EAAE,OAAoB;QAAjD,YACE,kBAAM,IAAI,EAAE,OAAO,CAAC,SAUrB;
|
|
1
|
+
{"version":3,"file":"GraphIndicatorField.js","sourceRoot":"","sources":["../../src/Graph/GraphIndicatorField.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;IAAyC,uCAAc;IAWrD,6BAAY,IAAe,EAAE,OAAoB;QAAjD,YACE,kBAAM,IAAI,EAAE,OAAO,CAAC,SAUrB;QARC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,UAAC,KAAc;YAC9D,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,EAAE;gBACvE,IAAM,MAAI,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;gBACxC,IAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;gBAChD,KAAI,CAAC,MAAM,GAAG,MAAI,IAAI,SAAS,CAAC;gBAChC,KAAI,CAAC,SAAS,GAAG,QAAoB,CAAC;aACvC;QACH,CAAC,CAAC,CAAC;;IACL,CAAC;IApBD,sBAAI,sCAAK;aAAT;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;;;OAAA;IAGD,sBAAI,yCAAQ;aAAZ;YACE,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;;;OAAA;IAcH,0BAAC;AAAD,CAAC,AAvBD,CAAyC,cAAc,GAuBtD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GraphAxis } from ".";
|
|
2
2
|
export var parseXYAxis = function (nodes) {
|
|
3
|
-
var
|
|
3
|
+
var yAxisElements = [];
|
|
4
|
+
var xAxis;
|
|
4
5
|
Array.prototype.forEach.call(nodes, function (child) {
|
|
5
6
|
if (child.nodeType === child.ELEMENT_NODE && child.nodeName === "field") {
|
|
6
7
|
var axis = child.getAttribute("axis");
|
|
@@ -20,13 +21,22 @@ export var parseXYAxis = function (nodes) {
|
|
|
20
21
|
label: label || undefined,
|
|
21
22
|
});
|
|
22
23
|
if (axis === "x") {
|
|
23
|
-
|
|
24
|
+
xAxis = graphAxis;
|
|
24
25
|
}
|
|
25
26
|
else if (axis === "y") {
|
|
26
|
-
|
|
27
|
+
yAxisElements.push(graphAxis);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
|
-
|
|
31
|
+
if (!xAxis) {
|
|
32
|
+
throw new Error("No x axis found");
|
|
33
|
+
}
|
|
34
|
+
if (!yAxisElements.length) {
|
|
35
|
+
throw new Error("No y axis found. At least we need one y axis");
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
x: xAxis,
|
|
39
|
+
y: yAxisElements,
|
|
40
|
+
};
|
|
31
41
|
};
|
|
32
42
|
//# sourceMappingURL=graphHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphHelper.js","sourceRoot":"","sources":["../../src/Graph/graphHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAY,MAAM,GAAG,CAAC;AAO9C,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,KAA4B;IACtD,IAAM,
|
|
1
|
+
{"version":3,"file":"graphHelper.js","sourceRoot":"","sources":["../../src/Graph/graphHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAY,MAAM,GAAG,CAAC;AAO9C,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,KAA4B;IACtD,IAAM,aAAa,GAAgB,EAAE,CAAC;IACtC,IAAI,KAAK,CAAC;IAEV,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,UAAC,KAAc;QACjD,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,EAAE;YACvE,IAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YACxC,IAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YAChD,IAAM,MAAI,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YACxC,IAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAE1C,IAAI,CAAC,IAAI,EAAE;gBACT,MAAM,IAAI,KAAK,CAAC,WAAS,MAAI,0BAAuB,CAAC,CAAC;aACvD;YAED,IAAI,CAAC,MAAI,EAAE;gBACT,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;aACrD;YAED,IAAM,SAAS,GAAG,IAAI,SAAS,CAAC;gBAC9B,IAAI,EAAE,IAAY;gBAClB,IAAI,QAAA;gBACJ,QAAQ,EAAE,QAAoB;gBAC9B,KAAK,EAAE,KAAK,IAAI,SAAS;aAC1B,CAAC,CAAC;YAEH,IAAI,IAAI,KAAK,GAAG,EAAE;gBAChB,KAAK,GAAG,SAAS,CAAC;aACnB;iBAAM,IAAI,IAAI,KAAK,GAAG,EAAE;gBACvB,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC/B;SACF;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;IAED,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;KACjE;IAED,OAAO;QACL,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,aAAa;KACjB,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/Graph/Graph.ts
CHANGED
package/src/Graph/GraphChart.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { Graph, GraphType } from "./Graph";
|
|
|
3
3
|
import { parseXYAxis } from "./graphHelper";
|
|
4
4
|
|
|
5
5
|
export class GraphChart extends Graph {
|
|
6
|
-
_x: GraphAxis
|
|
7
|
-
get x(): GraphAxis
|
|
6
|
+
_x: GraphAxis;
|
|
7
|
+
get x(): GraphAxis {
|
|
8
8
|
return this._x;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
_y: GraphAxis[]
|
|
12
|
-
get y(): GraphAxis[]
|
|
11
|
+
_y: GraphAxis[];
|
|
12
|
+
get y(): GraphAxis[] {
|
|
13
13
|
return this._y;
|
|
14
14
|
}
|
|
15
15
|
constructor(type: GraphType, element: HTMLElement) {
|
|
@@ -3,13 +3,13 @@ import { GraphType } from "./Graph";
|
|
|
3
3
|
import { GraphIndicator } from "./GraphIndicator";
|
|
4
4
|
|
|
5
5
|
export class GraphIndicatorField extends GraphIndicator {
|
|
6
|
-
_field: string |
|
|
7
|
-
get field(): string |
|
|
6
|
+
_field: string | undefined;
|
|
7
|
+
get field(): string | undefined {
|
|
8
8
|
return this._field;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
_operator: Operator |
|
|
12
|
-
get operator(): Operator |
|
|
11
|
+
_operator: Operator | undefined;
|
|
12
|
+
get operator(): Operator | undefined {
|
|
13
13
|
return this._operator;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -20,7 +20,7 @@ export class GraphIndicatorField extends GraphIndicator {
|
|
|
20
20
|
if (child.nodeType === child.ELEMENT_NODE && child.nodeName === "field") {
|
|
21
21
|
const name = child.getAttribute("name");
|
|
22
22
|
const operator = child.getAttribute("operator");
|
|
23
|
-
this._field = name;
|
|
23
|
+
this._field = name || undefined;
|
|
24
24
|
this._operator = operator as Operator;
|
|
25
25
|
}
|
|
26
26
|
});
|
package/src/Graph/graphHelper.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Axis, GraphAxis, Operator } from ".";
|
|
2
2
|
|
|
3
3
|
export type XYAxis = {
|
|
4
|
-
x: GraphAxis
|
|
4
|
+
x: GraphAxis;
|
|
5
5
|
y: GraphAxis[];
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export const parseXYAxis = (nodes: NodeListOf<ChildNode>): XYAxis => {
|
|
9
|
-
const
|
|
9
|
+
const yAxisElements: GraphAxis[] = [];
|
|
10
|
+
let xAxis;
|
|
10
11
|
|
|
11
12
|
Array.prototype.forEach.call(nodes, (child: Element) => {
|
|
12
13
|
if (child.nodeType === child.ELEMENT_NODE && child.nodeName === "field") {
|
|
@@ -31,12 +32,23 @@ export const parseXYAxis = (nodes: NodeListOf<ChildNode>): XYAxis => {
|
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
if (axis === "x") {
|
|
34
|
-
|
|
35
|
+
xAxis = graphAxis;
|
|
35
36
|
} else if (axis === "y") {
|
|
36
|
-
|
|
37
|
+
yAxisElements.push(graphAxis);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
if (!xAxis) {
|
|
43
|
+
throw new Error("No x axis found");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!yAxisElements.length) {
|
|
47
|
+
throw new Error("No y axis found. At least we need one y axis");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
x: xAxis,
|
|
52
|
+
y: yAxisElements,
|
|
53
|
+
};
|
|
42
54
|
};
|