@hpcc-js/timeline 2.54.1 → 2.56.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/index.js +1201 -1626
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +2 -0
- package/dist/index.umd.cjs.map +1 -0
- package/package.json +36 -38
- package/src/MiniGantt.ts +10 -9
- package/src/ReactAxisGantt.ts +8 -1
- package/src/ReactAxisGanttSeries.ts +2 -2
- package/src/ReactGantt.ts +4 -0
- package/src/ReactTimeline.ts +23 -12
- package/src/ReactTimelineSeries.ts +21 -10
- package/src/__package__.ts +2 -2
- package/src/index.ts +7 -7
- package/types/MiniGantt.d.ts +4 -5
- package/types/ReactAxisGantt.d.ts +2 -2
- package/types/ReactAxisGanttSeries.d.ts +2 -3
- package/types/ReactGantt.d.ts +1 -1
- package/types/ReactTimeline.d.ts +2 -3
- package/types/ReactTimelineSeries.d.ts +1 -2
- package/types/__package__.d.ts +2 -3
- package/types/index.d.ts +7 -8
- package/dist/index.es6.js +0 -1625
- package/dist/index.es6.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- package/types/MiniGantt.d.ts.map +0 -1
- package/types/ReactAxisGantt.d.ts.map +0 -1
- package/types/ReactAxisGanttSeries.d.ts.map +0 -1
- package/types/ReactGantt.d.ts.map +0 -1
- package/types/ReactTimeline.d.ts.map +0 -1
- package/types/ReactTimelineSeries.d.ts.map +0 -1
- package/types/__package__.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types-3.4/MiniGantt.d.ts +0 -106
- package/types-3.4/ReactAxisGantt.d.ts +0 -83
- package/types-3.4/ReactAxisGanttSeries.d.ts +0 -82
- package/types-3.4/ReactGantt.d.ts +0 -135
- package/types-3.4/ReactTimeline.d.ts +0 -18
- package/types-3.4/ReactTimelineSeries.d.ts +0 -18
- package/types-3.4/__package__.d.ts +0 -4
- package/types-3.4/index.d.ts +0 -8
package/src/ReactTimeline.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { timeFormat as d3TimeFormat, timeParse as d3TimeParse } from "d3-time-format";
|
|
2
|
-
import { ReactAxisGantt } from "./ReactAxisGantt";
|
|
2
|
+
import { ReactAxisGantt } from "./ReactAxisGantt.ts";
|
|
3
3
|
|
|
4
4
|
export class ReactTimeline extends ReactAxisGantt {
|
|
5
5
|
|
|
6
6
|
protected _axisLabelFormatter;//TODO: add a type to this? d3 time formatting function type?
|
|
7
7
|
|
|
8
|
-
constructor(){
|
|
8
|
+
constructor() {
|
|
9
9
|
super();
|
|
10
10
|
this._drawStartPos = "origin";
|
|
11
11
|
this._topAxis.type("time");
|
|
@@ -24,29 +24,33 @@ export class ReactTimeline extends ReactAxisGantt {
|
|
|
24
24
|
update(domNode, element) {
|
|
25
25
|
super.update(domNode, element);
|
|
26
26
|
|
|
27
|
-
if(this.timePattern_exists()) {
|
|
27
|
+
if (this.timePattern_exists()) {
|
|
28
28
|
|
|
29
29
|
let minTimestamp = Infinity;
|
|
30
30
|
let maxTimestamp = -Infinity;
|
|
31
31
|
let lowDateStr = "";
|
|
32
32
|
let highDateStr = "";
|
|
33
|
-
this.data().map(n=>{
|
|
33
|
+
this.data().map(n => {
|
|
34
34
|
const start = new Date(n[1]).getTime();
|
|
35
35
|
const end = new Date(n[2]).getTime();
|
|
36
|
-
if(minTimestamp > start){
|
|
36
|
+
if (minTimestamp > start) {
|
|
37
37
|
minTimestamp = start;
|
|
38
38
|
lowDateStr = "" + n[1];
|
|
39
39
|
}
|
|
40
|
-
if(maxTimestamp < end){
|
|
40
|
+
if (maxTimestamp < end) {
|
|
41
41
|
maxTimestamp = end;
|
|
42
42
|
highDateStr = "" + n[2];
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
+
|
|
46
|
+
const axisTickFormat = this._axisLabelFormatter
|
|
47
|
+
? this._axisLabelFormatter
|
|
48
|
+
: (this.tickFormat_exists && this.tickFormat_exists() ? this.tickFormat() : undefined);
|
|
49
|
+
|
|
45
50
|
this._topAxis
|
|
46
51
|
.type("time")
|
|
47
52
|
.timePattern(this.timePattern())
|
|
48
53
|
.overlapMode("none")
|
|
49
|
-
.tickFormat(this._axisLabelFormatter)
|
|
50
54
|
.low(lowDateStr)
|
|
51
55
|
.high(highDateStr)
|
|
52
56
|
;
|
|
@@ -54,10 +58,17 @@ export class ReactTimeline extends ReactAxisGantt {
|
|
|
54
58
|
.type("time")
|
|
55
59
|
.timePattern(this.timePattern())
|
|
56
60
|
.overlapMode("none")
|
|
57
|
-
.tickFormat(this._axisLabelFormatter)
|
|
58
61
|
.low(lowDateStr)
|
|
59
62
|
.high(highDateStr)
|
|
60
63
|
;
|
|
64
|
+
|
|
65
|
+
if (axisTickFormat) {
|
|
66
|
+
this._topAxis.tickFormat(axisTickFormat);
|
|
67
|
+
this._bottomAxis.tickFormat(axisTickFormat);
|
|
68
|
+
} else {
|
|
69
|
+
this._topAxis.tickFormat_reset();
|
|
70
|
+
this._bottomAxis.tickFormat_reset();
|
|
71
|
+
}
|
|
61
72
|
this._gantt._minStart = minTimestamp;
|
|
62
73
|
this._gantt._maxEnd = maxTimestamp;
|
|
63
74
|
}
|
|
@@ -78,7 +89,7 @@ export class ReactTimeline extends ReactAxisGantt {
|
|
|
78
89
|
}
|
|
79
90
|
|
|
80
91
|
onzoom(transform) {
|
|
81
|
-
|
|
92
|
+
|
|
82
93
|
const w = this.width();
|
|
83
94
|
const low = this._gantt._minStart;
|
|
84
95
|
const high = this._gantt._maxEnd;
|
|
@@ -98,18 +109,18 @@ export class ReactTimeline extends ReactAxisGantt {
|
|
|
98
109
|
.render()
|
|
99
110
|
;
|
|
100
111
|
}
|
|
101
|
-
|
|
102
|
-
_tooltipHTML: (_) => string;
|
|
103
112
|
}
|
|
104
113
|
ReactTimeline.prototype._class += " timeline_ReactTimeline";
|
|
105
114
|
|
|
106
115
|
export interface ReactTimeline {
|
|
116
|
+
_tooltipHTML(_): string;
|
|
117
|
+
|
|
107
118
|
timePattern(): string;
|
|
108
119
|
timePattern(_: string): this;
|
|
109
120
|
timePattern_exists(): boolean;
|
|
110
121
|
tooltipTimeFormat(): string;
|
|
111
122
|
tooltipTimeFormat(_: string): this;
|
|
112
123
|
}
|
|
113
|
-
ReactTimeline.prototype.publish("timePattern", "%Y-%m-%d", "string", "Time pattern used for parsing datetime strings on each data row", null, {optional:true});
|
|
124
|
+
ReactTimeline.prototype.publish("timePattern", "%Y-%m-%d", "string", "Time pattern used for parsing datetime strings on each data row", null, { optional: true });
|
|
114
125
|
ReactTimeline.prototype.publish("tooltipTimeFormat", "%Y-%m-%d", "string", "Time format used in the default html tooltip");
|
|
115
126
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { timeFormat as d3TimeFormat, timeParse as d3TimeParse } from "d3-time-format";
|
|
2
|
-
import { ReactAxisGanttSeries } from "./ReactAxisGanttSeries";
|
|
2
|
+
import { ReactAxisGanttSeries } from "./ReactAxisGanttSeries.ts";
|
|
3
3
|
|
|
4
4
|
const parseTime = d3TimeParse("%Q");
|
|
5
5
|
export class ReactTimelineSeries extends ReactAxisGanttSeries {
|
|
6
6
|
|
|
7
7
|
protected _axisLabelFormatter;//TODO: add a type to this? d3 time formatting function type?
|
|
8
8
|
|
|
9
|
-
constructor(){
|
|
9
|
+
constructor() {
|
|
10
10
|
super();
|
|
11
11
|
this._topAxis.type("time");
|
|
12
12
|
this._bottomAxis.type("time");
|
|
@@ -23,29 +23,33 @@ export class ReactTimelineSeries extends ReactAxisGanttSeries {
|
|
|
23
23
|
update(domNode, element) {
|
|
24
24
|
super.update(domNode, element);
|
|
25
25
|
|
|
26
|
-
if(this.timePattern_exists()) {
|
|
26
|
+
if (this.timePattern_exists()) {
|
|
27
27
|
|
|
28
28
|
let minTimestamp = Infinity;
|
|
29
29
|
let maxTimestamp = -Infinity;
|
|
30
30
|
let lowDateStr = "";
|
|
31
31
|
let highDateStr = "";
|
|
32
|
-
this.data().forEach(n=>{
|
|
32
|
+
this.data().forEach(n => {
|
|
33
33
|
const start = new Date(n[1]).getTime();
|
|
34
34
|
const end = new Date(n[2]).getTime();
|
|
35
|
-
if(minTimestamp > start){
|
|
35
|
+
if (minTimestamp > start) {
|
|
36
36
|
minTimestamp = start;
|
|
37
37
|
lowDateStr = "" + n[1];
|
|
38
38
|
}
|
|
39
|
-
if(maxTimestamp < end){
|
|
39
|
+
if (maxTimestamp < end) {
|
|
40
40
|
maxTimestamp = end;
|
|
41
41
|
highDateStr = "" + n[2];
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
+
|
|
45
|
+
const axisTickFormat = this._axisLabelFormatter
|
|
46
|
+
? this._axisLabelFormatter
|
|
47
|
+
: (this.tickFormat_exists && this.tickFormat_exists() ? this.tickFormat() : undefined);
|
|
48
|
+
|
|
44
49
|
this._topAxis
|
|
45
50
|
.type("time")
|
|
46
51
|
.timePattern(this.timePattern())
|
|
47
52
|
.overlapMode("none")
|
|
48
|
-
.tickFormat(this._axisLabelFormatter)
|
|
49
53
|
.low(lowDateStr)
|
|
50
54
|
.high(highDateStr)
|
|
51
55
|
;
|
|
@@ -53,10 +57,17 @@ export class ReactTimelineSeries extends ReactAxisGanttSeries {
|
|
|
53
57
|
.type("time")
|
|
54
58
|
.timePattern(this.timePattern())
|
|
55
59
|
.overlapMode("none")
|
|
56
|
-
.tickFormat(this._axisLabelFormatter)
|
|
57
60
|
.low(lowDateStr)
|
|
58
61
|
.high(highDateStr)
|
|
59
62
|
;
|
|
63
|
+
|
|
64
|
+
if (axisTickFormat) {
|
|
65
|
+
this._topAxis.tickFormat(axisTickFormat);
|
|
66
|
+
this._bottomAxis.tickFormat(axisTickFormat);
|
|
67
|
+
} else {
|
|
68
|
+
this._topAxis.tickFormat_reset();
|
|
69
|
+
this._bottomAxis.tickFormat_reset();
|
|
70
|
+
}
|
|
60
71
|
this._gantt._minStart = minTimestamp;
|
|
61
72
|
this._gantt._maxEnd = maxTimestamp;
|
|
62
73
|
}
|
|
@@ -76,7 +87,7 @@ export class ReactTimelineSeries extends ReactAxisGanttSeries {
|
|
|
76
87
|
}
|
|
77
88
|
|
|
78
89
|
onzoom(transform) {
|
|
79
|
-
|
|
90
|
+
|
|
80
91
|
const w = this.width();
|
|
81
92
|
const low = this._gantt._minStart;
|
|
82
93
|
const high = this._gantt._maxEnd;
|
|
@@ -108,6 +119,6 @@ export interface ReactTimelineSeries {
|
|
|
108
119
|
tooltipTimeFormat(): string;
|
|
109
120
|
tooltipTimeFormat(_: string): this;
|
|
110
121
|
}
|
|
111
|
-
ReactTimelineSeries.prototype.publish("timePattern", "%Y-%m-%d", "string", "Time pattern used for parsing datetime strings on each data row", null, {optional:true});
|
|
122
|
+
ReactTimelineSeries.prototype.publish("timePattern", "%Y-%m-%d", "string", "Time pattern used for parsing datetime strings on each data row", null, { optional: true });
|
|
112
123
|
ReactTimelineSeries.prototype.publish("tooltipTimeFormat", "%Y-%m-%d", "string", "Time format used in the default html tooltip");
|
|
113
124
|
|
package/src/__package__.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const PKG_NAME = "@hpcc-js/timeline";
|
|
2
|
-
export const PKG_VERSION = "
|
|
3
|
-
export const BUILD_VERSION = "2.
|
|
2
|
+
export const PKG_VERSION = "3.0.0";
|
|
3
|
+
export const BUILD_VERSION = "3.2.1";
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./__package__";
|
|
2
|
-
export * from "./MiniGantt";
|
|
3
|
-
export * from "./ReactGantt";
|
|
4
|
-
export * from "./ReactAxisGantt";
|
|
5
|
-
export * from "./ReactAxisGanttSeries";
|
|
6
|
-
export * from "./ReactTimeline";
|
|
7
|
-
export * from "./ReactTimelineSeries";
|
|
1
|
+
export * from "./__package__.ts";
|
|
2
|
+
export * from "./MiniGantt.ts";
|
|
3
|
+
export * from "./ReactGantt.ts";
|
|
4
|
+
export * from "./ReactAxisGantt.ts";
|
|
5
|
+
export * from "./ReactAxisGanttSeries.ts";
|
|
6
|
+
export * from "./ReactTimeline.ts";
|
|
7
|
+
export * from "./ReactTimelineSeries.ts";
|
package/types/MiniGantt.d.ts
CHANGED
|
@@ -43,12 +43,12 @@ export declare class MiniGantt extends SVGWidget {
|
|
|
43
43
|
dblclick(row: any, col: any, sel: any): void;
|
|
44
44
|
enterEntityRect(textbox: EntityRect, d: any): void;
|
|
45
45
|
updateEntityRect(textbox: EntityRect, d: any): void;
|
|
46
|
-
tooltip: any;
|
|
47
|
-
tooltipHTML: (_: any) => string;
|
|
48
|
-
tooltipFormat: (_: any) => string;
|
|
49
|
-
_selection: any;
|
|
50
46
|
}
|
|
51
47
|
export interface MiniGantt {
|
|
48
|
+
tooltip: any;
|
|
49
|
+
tooltipHTML(_: any): string;
|
|
50
|
+
tooltipFormat(_: any): string;
|
|
51
|
+
_selection: any;
|
|
52
52
|
timePattern(): string;
|
|
53
53
|
timePattern(_: string): this;
|
|
54
54
|
tickFormat(): string;
|
|
@@ -97,4 +97,3 @@ export interface MiniGantt {
|
|
|
97
97
|
centerOnMostRecent(): boolean;
|
|
98
98
|
centerOnMostRecent(_: boolean): this;
|
|
99
99
|
}
|
|
100
|
-
//# sourceMappingURL=MiniGantt.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Axis } from "@hpcc-js/chart";
|
|
2
2
|
import { SVGWidget } from "@hpcc-js/common";
|
|
3
|
-
import { ReactGantt } from "./ReactGantt";
|
|
3
|
+
import { ReactGantt } from "./ReactGantt.ts";
|
|
4
4
|
export type IAxisGanttData = [string, number | string, number | string, any?] | any[];
|
|
5
5
|
export declare class ReactAxisGantt extends SVGWidget {
|
|
6
6
|
protected _topAxis: Axis;
|
|
@@ -20,6 +20,7 @@ export declare class ReactAxisGantt extends SVGWidget {
|
|
|
20
20
|
enter(domNode: any, element: any): void;
|
|
21
21
|
onzoom(transform: any): void;
|
|
22
22
|
update(domNode: any, element: any): void;
|
|
23
|
+
exit(domNode: any, element: any): void;
|
|
23
24
|
columns(): string[];
|
|
24
25
|
columns(_: string[]): this;
|
|
25
26
|
data(): IAxisGanttData[];
|
|
@@ -75,4 +76,3 @@ export interface ReactAxisGantt {
|
|
|
75
76
|
maxZoom(): number;
|
|
76
77
|
maxZoom(_: number): this;
|
|
77
78
|
}
|
|
78
|
-
//# sourceMappingURL=ReactAxisGantt.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Axis } from "@hpcc-js/chart";
|
|
2
2
|
import { Border2 } from "@hpcc-js/layout";
|
|
3
|
-
import { ReactGantt } from "./ReactGantt";
|
|
4
|
-
import { IAxisGanttData } from "./ReactAxisGantt";
|
|
5
3
|
import { React } from "@hpcc-js/react";
|
|
4
|
+
import { ReactGantt } from "./ReactGantt.ts";
|
|
5
|
+
import { IAxisGanttData } from "./ReactAxisGantt.ts";
|
|
6
6
|
export declare class ReactAxisGanttSeries extends Border2 {
|
|
7
7
|
protected _topAxis: Axis;
|
|
8
8
|
protected _gantt: ReactGantt;
|
|
@@ -79,4 +79,3 @@ export interface ReactAxisGanttSeries {
|
|
|
79
79
|
maxZoom(): number;
|
|
80
80
|
maxZoom(_: number): this;
|
|
81
81
|
}
|
|
82
|
-
//# sourceMappingURL=ReactAxisGanttSeries.d.ts.map
|
package/types/ReactGantt.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare class ReactGantt extends SVGZoomWidget {
|
|
|
43
43
|
rangeRenderer(_: React.FunctionComponent): this;
|
|
44
44
|
enter(domNode: any, element: any): void;
|
|
45
45
|
update(domNode: any, element: any): void;
|
|
46
|
+
exit(domNode: any, element: any): void;
|
|
46
47
|
renderRangeElement(d: any, i: any, transformEach?: boolean, options?: any, seriesKey?: string): void;
|
|
47
48
|
setRangeOptions(): void;
|
|
48
49
|
_transform: {
|
|
@@ -127,4 +128,3 @@ export interface ReactGantt {
|
|
|
127
128
|
oddSeriesBackground(): string;
|
|
128
129
|
oddSeriesBackground(_: string): this;
|
|
129
130
|
}
|
|
130
|
-
//# sourceMappingURL=ReactGantt.d.ts.map
|
package/types/ReactTimeline.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactAxisGantt } from "./ReactAxisGantt";
|
|
1
|
+
import { ReactAxisGantt } from "./ReactAxisGantt.ts";
|
|
2
2
|
export declare class ReactTimeline extends ReactAxisGantt {
|
|
3
3
|
protected _axisLabelFormatter: any;
|
|
4
4
|
constructor();
|
|
@@ -6,13 +6,12 @@ export declare class ReactTimeline extends ReactAxisGantt {
|
|
|
6
6
|
tooltipHTML(callback: any): this;
|
|
7
7
|
parseAxisValue(v: any): string;
|
|
8
8
|
onzoom(transform: any): void;
|
|
9
|
-
_tooltipHTML: (_: any) => string;
|
|
10
9
|
}
|
|
11
10
|
export interface ReactTimeline {
|
|
11
|
+
_tooltipHTML(_: any): string;
|
|
12
12
|
timePattern(): string;
|
|
13
13
|
timePattern(_: string): this;
|
|
14
14
|
timePattern_exists(): boolean;
|
|
15
15
|
tooltipTimeFormat(): string;
|
|
16
16
|
tooltipTimeFormat(_: string): this;
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=ReactTimeline.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactAxisGanttSeries } from "./ReactAxisGanttSeries";
|
|
1
|
+
import { ReactAxisGanttSeries } from "./ReactAxisGanttSeries.ts";
|
|
2
2
|
export declare class ReactTimelineSeries extends ReactAxisGanttSeries {
|
|
3
3
|
protected _axisLabelFormatter: any;
|
|
4
4
|
constructor();
|
|
@@ -15,4 +15,3 @@ export interface ReactTimelineSeries {
|
|
|
15
15
|
tooltipTimeFormat(): string;
|
|
16
16
|
tooltipTimeFormat(_: string): this;
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=ReactTimelineSeries.d.ts.map
|
package/types/__package__.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export declare const PKG_NAME = "@hpcc-js/timeline";
|
|
2
|
-
export declare const PKG_VERSION = "
|
|
3
|
-
export declare const BUILD_VERSION = "2.
|
|
4
|
-
//# sourceMappingURL=__package__.d.ts.map
|
|
2
|
+
export declare const PKG_VERSION = "3.0.0";
|
|
3
|
+
export declare const BUILD_VERSION = "3.2.1";
|
package/types/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export * from "./__package__";
|
|
2
|
-
export * from "./MiniGantt";
|
|
3
|
-
export * from "./ReactGantt";
|
|
4
|
-
export * from "./ReactAxisGantt";
|
|
5
|
-
export * from "./ReactAxisGanttSeries";
|
|
6
|
-
export * from "./ReactTimeline";
|
|
7
|
-
export * from "./ReactTimelineSeries";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from "./__package__.ts";
|
|
2
|
+
export * from "./MiniGantt.ts";
|
|
3
|
+
export * from "./ReactGantt.ts";
|
|
4
|
+
export * from "./ReactAxisGantt.ts";
|
|
5
|
+
export * from "./ReactAxisGanttSeries.ts";
|
|
6
|
+
export * from "./ReactTimeline.ts";
|
|
7
|
+
export * from "./ReactTimelineSeries.ts";
|