timeline-chart 0.4.1 → 0.4.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/lib/components/time-graph-annotation.d.ts +1 -1
- package/lib/components/time-graph-component.js +3 -3
- package/lib/components/time-graph-state.d.ts +1 -1
- package/lib/layer/time-graph-chart.js +2 -2
- package/lib/time-graph-container.d.ts +1 -0
- package/lib/time-graph-container.js +2 -1
- package/lib/time-graph-container.js.map +1 -1
- package/package.json +5 -4
- package/src/components/time-graph-component.ts +3 -3
- package/src/time-graph-container.ts +3 -1
|
@@ -18,7 +18,7 @@ export declare class TimeGraphAnnotationComponent extends TimeGraphComponent<Tim
|
|
|
18
18
|
protected _row: TimeGraphRow;
|
|
19
19
|
protected scaleFactor: number;
|
|
20
20
|
protected _size: number;
|
|
21
|
-
constructor(id: string, model: TimelineChart.TimeGraphAnnotation, _options: TimeGraphAnnotationComponentOptions, _style: TimeGraphAnnotationStyle, _row: TimeGraphRow, scaleFactor: number, displayObject?: PIXI.Graphics);
|
|
21
|
+
constructor(id: string, model: TimelineChart.TimeGraphAnnotation, _options: TimeGraphAnnotationComponentOptions, _style: TimeGraphAnnotationStyle | undefined, _row: TimeGraphRow, scaleFactor: number, displayObject?: PIXI.Graphics);
|
|
22
22
|
update(opts?: TimeGraphAnnotationComponentOptions): void;
|
|
23
23
|
get row(): TimeGraphRow;
|
|
24
24
|
private updateYPosition;
|
|
@@ -52,7 +52,7 @@ var TimeGraphComponent = /** @class */ (function () {
|
|
|
52
52
|
TimeGraphComponent.prototype.rect = function (opts) {
|
|
53
53
|
var position = opts.position, width = opts.width, height = opts.height, color = opts.color, opacity = opts.opacity, borderColor = opts.borderColor, borderWidth = opts.borderWidth;
|
|
54
54
|
this.displayObject.lineStyle(borderWidth || 0, borderColor || 0x000000);
|
|
55
|
-
this.displayObject.beginFill((color ||
|
|
55
|
+
this.displayObject.beginFill((color || 0x000000), this.getPIXIOpacity(opacity));
|
|
56
56
|
this.displayObject.drawRect(position.x, position.y, width, height);
|
|
57
57
|
this.displayObject.endFill();
|
|
58
58
|
this.startPixiRender();
|
|
@@ -60,7 +60,7 @@ var TimeGraphComponent = /** @class */ (function () {
|
|
|
60
60
|
TimeGraphComponent.prototype.rectTruncated = function (opts) {
|
|
61
61
|
var position = opts.position, width = opts.width, height = opts.height, color = opts.color, opacity = opts.opacity, borderColor = opts.borderColor, borderWidth = opts.borderWidth;
|
|
62
62
|
this.displayObject.lineStyle(borderWidth || 0, borderColor || 0x000000);
|
|
63
|
-
this.displayObject.beginFill((color ||
|
|
63
|
+
this.displayObject.beginFill((color || 0x000000), this.getPIXIOpacity(opacity));
|
|
64
64
|
if (width > 20) {
|
|
65
65
|
var xpos = position.x + 0.5;
|
|
66
66
|
var ypos = position.y + 0.5;
|
|
@@ -77,7 +77,7 @@ var TimeGraphComponent = /** @class */ (function () {
|
|
|
77
77
|
TimeGraphComponent.prototype.roundedRect = function (opts) {
|
|
78
78
|
var position = opts.position, width = opts.width, height = opts.height, color = opts.color, opacity = opts.opacity, borderColor = opts.borderColor, borderWidth = opts.borderWidth, borderRadius = opts.borderRadius;
|
|
79
79
|
this.displayObject.lineStyle(borderWidth || 0, borderColor || 0x000000);
|
|
80
|
-
this.displayObject.beginFill((color ||
|
|
80
|
+
this.displayObject.beginFill((color || 0x000000), this.getPIXIOpacity(opacity));
|
|
81
81
|
this.displayObject.drawRoundedRect(position.x + 0.5, position.y + 0.5, width, height, borderRadius || 0);
|
|
82
82
|
this.displayObject.endFill();
|
|
83
83
|
this.startPixiRender();
|
|
@@ -19,7 +19,7 @@ export declare class TimeGraphStateComponent extends TimeGraphComponent<Timeline
|
|
|
19
19
|
static fontController: FontController;
|
|
20
20
|
protected _options: TimeGraphStyledRect;
|
|
21
21
|
private textLabelObject;
|
|
22
|
-
constructor(id: string, model: TimelineChart.TimeGraphState, xStart: number, xEnd: number, _row: TimeGraphRow, _style: TimeGraphStateStyle, displayWidth: number, scaleFactor: number, displayObject?: PIXI.Graphics);
|
|
22
|
+
constructor(id: string, model: TimelineChart.TimeGraphState, xStart: number, xEnd: number, _row: TimeGraphRow, _style: TimeGraphStateStyle | undefined, displayWidth: number, scaleFactor: number, displayObject?: PIXI.Graphics);
|
|
23
23
|
/**
|
|
24
24
|
* Conveniently generate the labels of states and apply proper scaling when zooming
|
|
25
25
|
*/
|
|
@@ -24,8 +24,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g =
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
28
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -29,7 +29,8 @@ var TimeGraphContainer = /** @class */ (function () {
|
|
|
29
29
|
else {
|
|
30
30
|
canvas = extCanvas;
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var supported = PIXI.utils.isWebGLSupported();
|
|
33
|
+
var noWebgl2 = !supported || config.forceCanvasRenderer || !canvas.getContext('webgl2');
|
|
33
34
|
canvas.style.width = config.width + 'px';
|
|
34
35
|
canvas.style.height = config.height + 'px';
|
|
35
36
|
canvas.width = config.width;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-graph-container.js","sourceRoot":"","sources":["../src/time-graph-container.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AAEtC,6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YACD,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,QAAQ;YACf,KAAK,EAAE,QAAQ;SAClB,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAd,CAAc,CAAC,CAAC;IAC7C,CAAC;IAED,sCAAS,GAAT,UAAU,MAAwB;QAAlC,iBAEC;QADG,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK,IAAI,OAAA,KAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;IAClD,CAAC;IAES,qCAAQ,GAAlB,UAAmB,KAAqB;QACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC/F,CAAC;IAED,oCAAO,GAAP;QACI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAE,EAAX,CAAW,CAAC,CAAC;QACtC,IAAI,CAAC,cAAc,CAAC,6BAA6B,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAChF,IAAI,CAAC,eAAe,CAAC,cAAc,EAAE,CAAC;QACtC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAeL,yBAAC;AAAD,CAAC,AA9HD,IA8HC;AA9HY,gDAAkB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "timeline-chart",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "A time graph / gantt chart library for large data (e.g. traces)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gantt",
|
|
@@ -26,11 +26,12 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/enzyme": "^3.10.10",
|
|
28
28
|
"@types/enzyme-adapter-react-16": "^1.0.6",
|
|
29
|
-
"@types/jest": "^
|
|
29
|
+
"@types/jest": "^28.0.0",
|
|
30
30
|
"enzyme": "^3.11.0",
|
|
31
31
|
"enzyme-adapter-react-16": "^1.15.6",
|
|
32
|
-
"jest": "^
|
|
32
|
+
"jest": "^28.0.0",
|
|
33
33
|
"jest-canvas-mock": "^2.3.1",
|
|
34
|
+
"jest-environment-jsdom": "28.0.0",
|
|
34
35
|
"rimraf": "^5.0.0",
|
|
35
36
|
"ts-jest": "^29.0.0"
|
|
36
37
|
},
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"bugs": {
|
|
43
44
|
"url": "https://github.com/eclipse-cdt-cloud/timeline-chart/issues"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "ff563d526554a3a543772d369106d8fd2a505825"
|
|
46
47
|
}
|
|
@@ -90,7 +90,7 @@ export abstract class TimeGraphComponent<T> {
|
|
|
90
90
|
protected rect(opts: TimeGraphStyledRect) {
|
|
91
91
|
const { position, width, height, color, opacity, borderColor, borderWidth } = opts;
|
|
92
92
|
this.displayObject.lineStyle(borderWidth || 0, borderColor || 0x000000);
|
|
93
|
-
this.displayObject.beginFill((color ||
|
|
93
|
+
this.displayObject.beginFill((color || 0x000000), this.getPIXIOpacity(opacity));
|
|
94
94
|
this.displayObject.drawRect(position.x, position.y, width, height);
|
|
95
95
|
this.displayObject.endFill();
|
|
96
96
|
this.startPixiRender();
|
|
@@ -99,7 +99,7 @@ export abstract class TimeGraphComponent<T> {
|
|
|
99
99
|
protected rectTruncated(opts: TimeGraphStyledRect) {
|
|
100
100
|
const { position, width, height, color, opacity, borderColor, borderWidth } = opts;
|
|
101
101
|
this.displayObject.lineStyle(borderWidth || 0, borderColor || 0x000000);
|
|
102
|
-
this.displayObject.beginFill((color ||
|
|
102
|
+
this.displayObject.beginFill((color || 0x000000), this.getPIXIOpacity(opacity));
|
|
103
103
|
if (width > 20) {
|
|
104
104
|
const xpos = position.x + 0.5;
|
|
105
105
|
const ypos = position.y + 0.5;
|
|
@@ -117,7 +117,7 @@ export abstract class TimeGraphComponent<T> {
|
|
|
117
117
|
protected roundedRect(opts: TimeGraphStyledRect) {
|
|
118
118
|
const { position, width, height, color, opacity, borderColor, borderWidth, borderRadius } = opts;
|
|
119
119
|
this.displayObject.lineStyle(borderWidth || 0, borderColor || 0x000000);
|
|
120
|
-
this.displayObject.beginFill((color ||
|
|
120
|
+
this.displayObject.beginFill((color || 0x000000), this.getPIXIOpacity(opacity));
|
|
121
121
|
|
|
122
122
|
this.displayObject.drawRoundedRect(position.x + 0.5, position.y + 0.5, width, height, borderRadius || 0);
|
|
123
123
|
|
|
@@ -12,6 +12,7 @@ export interface TimeGraphContainerOptions {
|
|
|
12
12
|
lineColor?: number;
|
|
13
13
|
transparent?: boolean;
|
|
14
14
|
classNames?: string;
|
|
15
|
+
forceCanvasRenderer?: boolean;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export class TimeGraphContainer {
|
|
@@ -36,7 +37,8 @@ export class TimeGraphContainer {
|
|
|
36
37
|
canvas = extCanvas;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
const
|
|
40
|
+
const supported = PIXI.utils.isWebGLSupported();
|
|
41
|
+
const noWebgl2 = !supported || config.forceCanvasRenderer || !canvas.getContext('webgl2');
|
|
40
42
|
canvas.style.width = config.width + 'px';
|
|
41
43
|
canvas.style.height = config.height + 'px';
|
|
42
44
|
canvas.width = config.width;
|