@gisce/ooui 0.3.2 → 0.3.3
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/{GraphLine.d.ts → GraphChart.d.ts} +3 -3
- package/dist/Graph/{GraphLine.js → GraphChart.js} +9 -9
- package/dist/Graph/GraphChart.js.map +1 -0
- package/dist/Graph/GraphFactory.d.ts +2 -2
- package/dist/Graph/GraphFactory.js +3 -3
- package/dist/Graph/GraphFactory.js.map +1 -1
- package/dist/Graph/GraphIndicator.d.ts +2 -2
- package/dist/Graph/GraphIndicator.js +2 -2
- package/dist/Graph/GraphIndicator.js.map +1 -1
- package/dist/Graph/index.d.ts +1 -1
- package/dist/Graph/index.js +1 -1
- package/dist/Graph/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Graph/{GraphLine.ts → GraphChart.ts} +4 -4
- package/src/Graph/GraphFactory.ts +4 -4
- package/src/Graph/GraphIndicator.ts +3 -3
- package/src/Graph/index.ts +1 -1
- package/src/index.ts +2 -2
- package/src/spec/Graph.spec.ts +2 -2
- package/dist/Graph/GraphLine.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GraphAxis } from ".";
|
|
2
|
-
import { Graph } from "./Graph";
|
|
3
|
-
export declare class
|
|
2
|
+
import { Graph, GraphType } from "./Graph";
|
|
3
|
+
export declare class GraphChart extends Graph {
|
|
4
4
|
_x: GraphAxis | undefined;
|
|
5
5
|
get x(): GraphAxis | undefined;
|
|
6
6
|
_y: GraphAxis | undefined;
|
|
7
7
|
get y(): GraphAxis | undefined;
|
|
8
|
-
constructor(element: HTMLElement);
|
|
8
|
+
constructor(type: GraphType, element: HTMLElement);
|
|
9
9
|
}
|
|
@@ -13,31 +13,31 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
})();
|
|
14
14
|
import { Graph } from "./Graph";
|
|
15
15
|
import { parseXYAxis } from "./graphHelper";
|
|
16
|
-
var
|
|
17
|
-
__extends(
|
|
18
|
-
function
|
|
16
|
+
var GraphChart = /** @class */ (function (_super) {
|
|
17
|
+
__extends(GraphChart, _super);
|
|
18
|
+
function GraphChart(type, element) {
|
|
19
19
|
var _this = _super.call(this, element) || this;
|
|
20
|
-
_this._type =
|
|
20
|
+
_this._type = type;
|
|
21
21
|
var xyAxis = parseXYAxis(element.childNodes);
|
|
22
22
|
_this._x = xyAxis.x;
|
|
23
23
|
_this._y = xyAxis.y;
|
|
24
24
|
return _this;
|
|
25
25
|
}
|
|
26
|
-
Object.defineProperty(
|
|
26
|
+
Object.defineProperty(GraphChart.prototype, "x", {
|
|
27
27
|
get: function () {
|
|
28
28
|
return this._x;
|
|
29
29
|
},
|
|
30
30
|
enumerable: false,
|
|
31
31
|
configurable: true
|
|
32
32
|
});
|
|
33
|
-
Object.defineProperty(
|
|
33
|
+
Object.defineProperty(GraphChart.prototype, "y", {
|
|
34
34
|
get: function () {
|
|
35
35
|
return this._y;
|
|
36
36
|
},
|
|
37
37
|
enumerable: false,
|
|
38
38
|
configurable: true
|
|
39
39
|
});
|
|
40
|
-
return
|
|
40
|
+
return GraphChart;
|
|
41
41
|
}(Graph));
|
|
42
|
-
export {
|
|
43
|
-
//# sourceMappingURL=
|
|
42
|
+
export { GraphChart };
|
|
43
|
+
//# sourceMappingURL=GraphChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphChart.js","sourceRoot":"","sources":["../../src/Graph/GraphChart.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;IAAgC,8BAAK;IAUnC,oBAAY,IAAe,EAAE,OAAoB;QAAjD,YACE,kBAAM,OAAO,CAAC,SAOf;QALC,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,IAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/C,KAAI,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;QACnB,KAAI,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;;IACrB,CAAC;IAhBD,sBAAI,yBAAC;aAAL;YACE,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,CAAC;;;OAAA;IAGD,sBAAI,yBAAC;aAAL;YACE,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,CAAC;;;OAAA;IAUH,iBAAC;AAAD,CAAC,AAnBD,CAAgC,KAAK,GAmBpC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphIndicator } from "./GraphIndicator";
|
|
2
|
-
import {
|
|
3
|
-
export declare const parseGraph: (xml: string) => GraphIndicator |
|
|
2
|
+
import { GraphChart } from "./GraphChart";
|
|
3
|
+
export declare const parseGraph: (xml: string) => GraphIndicator | GraphChart;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GraphIndicator } from "./GraphIndicator";
|
|
2
|
-
import {
|
|
2
|
+
import { GraphChart } from "./GraphChart";
|
|
3
3
|
var GraphTypes = {
|
|
4
4
|
indicator: GraphIndicator,
|
|
5
|
-
line:
|
|
5
|
+
line: GraphChart,
|
|
6
6
|
};
|
|
7
7
|
export var parseGraph = function (xml) {
|
|
8
8
|
var parser = new DOMParser();
|
|
@@ -15,6 +15,6 @@ export var parseGraph = function (xml) {
|
|
|
15
15
|
if (!graphModel) {
|
|
16
16
|
throw new Error(type + " not found as a GraphModel");
|
|
17
17
|
}
|
|
18
|
-
return new graphModel(view.documentElement);
|
|
18
|
+
return new graphModel(type, view.documentElement);
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=GraphFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphFactory.js","sourceRoot":"","sources":["../../src/Graph/GraphFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GraphFactory.js","sourceRoot":"","sources":["../../src/Graph/GraphFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,IAAM,UAAU,GAA2B;IACzC,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,MAAM,CAAC,IAAM,UAAU,GAAG,UAAC,GAAW;IACpC,IAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;IAC/B,IAAM,IAAI,GAAa,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAE/D,IAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAEvD,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CAAI,IAAI,0BAAuB,CAAC,CAAC;KACjD;IAED,IAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAEpC,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAI,IAAI,+BAA4B,CAAC,CAAC;KACtD;IAED,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;AACpD,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Graph } from "./Graph";
|
|
1
|
+
import { Graph, GraphType } from "./Graph";
|
|
2
2
|
export declare class GraphIndicator extends Graph {
|
|
3
3
|
_color: string | null;
|
|
4
4
|
get color(): string | null;
|
|
@@ -10,5 +10,5 @@ export declare class GraphIndicator extends Graph {
|
|
|
10
10
|
get showPercent(): boolean;
|
|
11
11
|
_suffix: string | null;
|
|
12
12
|
get suffix(): string | null;
|
|
13
|
-
constructor(element: HTMLElement);
|
|
13
|
+
constructor(type: GraphType, element: HTMLElement);
|
|
14
14
|
}
|
|
@@ -14,14 +14,14 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
import { Graph } from "./Graph";
|
|
15
15
|
var GraphIndicator = /** @class */ (function (_super) {
|
|
16
16
|
__extends(GraphIndicator, _super);
|
|
17
|
-
function GraphIndicator(element) {
|
|
17
|
+
function GraphIndicator(type, element) {
|
|
18
18
|
var _this = _super.call(this, element) || this;
|
|
19
19
|
_this._color = null;
|
|
20
20
|
_this._icon = null;
|
|
21
21
|
_this._totalDomain = null;
|
|
22
22
|
_this._showPercent = false;
|
|
23
23
|
_this._suffix = null;
|
|
24
|
-
_this._type =
|
|
24
|
+
_this._type = type;
|
|
25
25
|
_this._color = element.getAttribute("color");
|
|
26
26
|
_this._icon = element.getAttribute("icon");
|
|
27
27
|
_this._suffix = element.getAttribute("suffix");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphIndicator.js","sourceRoot":"","sources":["../../src/Graph/GraphIndicator.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"GraphIndicator.js","sourceRoot":"","sources":["../../src/Graph/GraphIndicator.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAE3C;IAAoC,kCAAK;IA0BvC,wBAAY,IAAe,EAAE,OAAoB;QAAjD,YACE,kBAAM,OAAO,CAAC,SAgBf;QA1CD,YAAM,GAAkB,IAAI,CAAC;QAK7B,WAAK,GAAkB,IAAI,CAAC;QAK5B,kBAAY,GAAkB,IAAI,CAAC;QAKnC,kBAAY,GAAY,KAAK,CAAC;QAK9B,aAAO,GAAkB,IAAI,CAAC;QAQ5B,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,KAAI,CAAC,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5C,KAAI,CAAC,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC1C,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC9C,KAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACxD,IAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QAExD,IACE,WAAW;YACX,CAAC,WAAW,KAAK,GAAG;gBAClB,CAAC,OAAO,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI,CAAC,CAAC,EAC7D;YACA,KAAI,CAAC,YAAY,GAAG,IAAI,CAAC;SAC1B;;IACH,CAAC;IAzCD,sBAAI,iCAAK;aAAT;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;;;OAAA;IAGD,sBAAI,gCAAI;aAAR;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;;;OAAA;IAGD,sBAAI,uCAAW;aAAf;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IAGD,sBAAI,uCAAW;aAAf;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IAGD,sBAAI,kCAAM;aAAV;YACE,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;;;OAAA;IAoBH,qBAAC;AAAD,CAAC,AA5CD,CAAoC,KAAK,GA4CxC"}
|
package/dist/Graph/index.d.ts
CHANGED
package/dist/Graph/index.js
CHANGED
package/dist/Graph/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -33,5 +33,5 @@ import Timeline from "./Timeline";
|
|
|
33
33
|
import Indicator from "./Indicator";
|
|
34
34
|
import Dashboard from "./Dashboard";
|
|
35
35
|
import DashboardItem from "./DashboardItem";
|
|
36
|
-
import { Graph, GraphAxis, GraphIndicator,
|
|
37
|
-
export { Char, Selection, Many2one, Field, Widget, Form, Tree, Boolean, One2many, Integer, Float, FloatTime, Date, DateTime, Many2many, SearchFilter, Container, ContainerWidget, Text, ProgressBar, Notebook, Group, Page, Label, Separator, Button, Reference, Binary, Image, parseContext, transformDomainForChildWidget, Timeline, Indicator, Dashboard, DashboardItem, Graph, GraphAxis, GraphIndicator,
|
|
36
|
+
import { Graph, GraphAxis, GraphIndicator, GraphChart, GraphType, parseGraph, Operator } from "./Graph";
|
|
37
|
+
export { Char, Selection, Many2one, Field, Widget, Form, Tree, Boolean, One2many, Integer, Float, FloatTime, Date, DateTime, Many2many, SearchFilter, Container, ContainerWidget, Text, ProgressBar, Notebook, Group, Page, Label, Separator, Button, Reference, Binary, Image, parseContext, transformDomainForChildWidget, Timeline, Indicator, Dashboard, DashboardItem, Graph, GraphAxis, GraphIndicator, GraphChart, GraphType, parseGraph, Operator, };
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,6 @@ import Timeline from "./Timeline";
|
|
|
33
33
|
import Indicator from "./Indicator";
|
|
34
34
|
import Dashboard from "./Dashboard";
|
|
35
35
|
import DashboardItem from "./DashboardItem";
|
|
36
|
-
import { Graph, GraphAxis, GraphIndicator,
|
|
37
|
-
export { Char, Selection, Many2one, Field, Widget, Form, Tree, Boolean, One2many, Integer, Float, FloatTime, Date, DateTime, Many2many, SearchFilter, Container, ContainerWidget, Text, ProgressBar, Notebook, Group, Page, Label, Separator, Button, Reference, Binary, Image, parseContext, transformDomainForChildWidget, Timeline, Indicator, Dashboard, DashboardItem, Graph, GraphAxis, GraphIndicator,
|
|
36
|
+
import { Graph, GraphAxis, GraphIndicator, GraphChart, parseGraph, } from "./Graph";
|
|
37
|
+
export { Char, Selection, Many2one, Field, Widget, Form, Tree, Boolean, One2many, Integer, Float, FloatTime, Date, DateTime, Many2many, SearchFilter, Container, ContainerWidget, Text, ProgressBar, Notebook, Group, Page, Label, Separator, Button, Reference, Binary, Image, parseContext, transformDomainForChildWidget, Timeline, Indicator, Dashboard, DashboardItem, Graph, GraphAxis, GraphIndicator, GraphChart, parseGraph, };
|
|
38
38
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,SAAS,MAAM,aA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EACT,eAAe,EACf,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,KAAK,EACL,YAAY,EACZ,6BAA6B,EAC7B,QAAQ,EACR,SAAS,EACT,SAAS,EACT,aAAa,EACb,KAAK,EACL,SAAS,EACT,cAAc,EACd,UAAU,EAEV,UAAU,GAEX,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GraphAxis } from ".";
|
|
2
|
-
import { Graph } from "./Graph";
|
|
2
|
+
import { Graph, GraphType } from "./Graph";
|
|
3
3
|
import { parseXYAxis } from "./graphHelper";
|
|
4
4
|
|
|
5
|
-
export class
|
|
5
|
+
export class GraphChart extends Graph {
|
|
6
6
|
_x: GraphAxis | undefined;
|
|
7
7
|
get x(): GraphAxis | undefined {
|
|
8
8
|
return this._x;
|
|
@@ -12,10 +12,10 @@ export class GraphLine extends Graph {
|
|
|
12
12
|
get y(): GraphAxis | undefined {
|
|
13
13
|
return this._y;
|
|
14
14
|
}
|
|
15
|
-
constructor(element: HTMLElement) {
|
|
15
|
+
constructor(type: GraphType, element: HTMLElement) {
|
|
16
16
|
super(element);
|
|
17
17
|
|
|
18
|
-
this._type =
|
|
18
|
+
this._type = type;
|
|
19
19
|
|
|
20
20
|
const xyAxis = parseXYAxis(element.childNodes);
|
|
21
21
|
this._x = xyAxis.x;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { GraphIndicator } from "./GraphIndicator";
|
|
2
|
-
import {
|
|
2
|
+
import { GraphChart } from "./GraphChart";
|
|
3
3
|
|
|
4
4
|
const GraphTypes: { [key: string]: any } = {
|
|
5
5
|
indicator: GraphIndicator,
|
|
6
|
-
line:
|
|
6
|
+
line: GraphChart,
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export const parseGraph = (xml: string): GraphIndicator |
|
|
9
|
+
export const parseGraph = (xml: string): GraphIndicator | GraphChart => {
|
|
10
10
|
const parser = new DOMParser();
|
|
11
11
|
const view: Document = parser.parseFromString(xml, "text/xml");
|
|
12
12
|
|
|
@@ -22,5 +22,5 @@ export const parseGraph = (xml: string): GraphIndicator | GraphLine => {
|
|
|
22
22
|
throw new Error(`${type} not found as a GraphModel`);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
return new graphModel(view.documentElement);
|
|
25
|
+
return new graphModel(type, view.documentElement);
|
|
26
26
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Graph } from "./Graph";
|
|
1
|
+
import { Graph, GraphType } from "./Graph";
|
|
2
2
|
|
|
3
3
|
export class GraphIndicator extends Graph {
|
|
4
4
|
_color: string | null = null;
|
|
@@ -26,10 +26,10 @@ export class GraphIndicator extends Graph {
|
|
|
26
26
|
return this._suffix;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
constructor(element: HTMLElement) {
|
|
29
|
+
constructor(type: GraphType, element: HTMLElement) {
|
|
30
30
|
super(element);
|
|
31
31
|
|
|
32
|
-
this._type =
|
|
32
|
+
this._type = type;
|
|
33
33
|
this._color = element.getAttribute("color");
|
|
34
34
|
this._icon = element.getAttribute("icon");
|
|
35
35
|
this._suffix = element.getAttribute("suffix");
|
package/src/Graph/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
Graph,
|
|
38
38
|
GraphAxis,
|
|
39
39
|
GraphIndicator,
|
|
40
|
-
|
|
40
|
+
GraphChart,
|
|
41
41
|
GraphType,
|
|
42
42
|
parseGraph,
|
|
43
43
|
Operator,
|
|
@@ -82,7 +82,7 @@ export {
|
|
|
82
82
|
Graph,
|
|
83
83
|
GraphAxis,
|
|
84
84
|
GraphIndicator,
|
|
85
|
-
|
|
85
|
+
GraphChart,
|
|
86
86
|
GraphType,
|
|
87
87
|
parseGraph,
|
|
88
88
|
Operator,
|
package/src/spec/Graph.spec.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphIndicator,
|
|
1
|
+
import { GraphIndicator, GraphChart, parseGraph } from "..";
|
|
2
2
|
|
|
3
3
|
describe("A Graph", () => {
|
|
4
4
|
it("should parse a basic XML title and type indicator", () => {
|
|
@@ -21,7 +21,7 @@ describe("A Graph", () => {
|
|
|
21
21
|
</graph>
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
|
-
const graph = parseGraph(xml) as
|
|
24
|
+
const graph = parseGraph(xml) as GraphChart;
|
|
25
25
|
expect(graph.type).toBe("line");
|
|
26
26
|
expect(graph.x).toBeDefined();
|
|
27
27
|
expect(graph.y).toBeDefined();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GraphLine.js","sourceRoot":"","sources":["../../src/Graph/GraphLine.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;IAA+B,6BAAK;IAUlC,mBAAY,OAAoB;QAAhC,YACE,kBAAM,OAAO,CAAC,SAOf;QALC,KAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QAEpB,IAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC/C,KAAI,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;QACnB,KAAI,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;;IACrB,CAAC;IAhBD,sBAAI,wBAAC;aAAL;YACE,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,CAAC;;;OAAA;IAGD,sBAAI,wBAAC;aAAL;YACE,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,CAAC;;;OAAA;IAUH,gBAAC;AAAD,CAAC,AAnBD,CAA+B,KAAK,GAmBnC"}
|