cx 24.3.2 → 24.3.4
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/charts.css +5 -0
- package/dist/charts.js +130 -0
- package/dist/manifest.js +619 -615
- package/dist/widgets.js +82 -33
- package/package.json +1 -1
- package/src/charts/Swimlanes.d.ts +41 -0
- package/src/charts/Swimlanes.js +112 -0
- package/src/charts/Swimlanes.scss +14 -0
- package/src/charts/index.d.ts +24 -23
- package/src/charts/index.js +1 -0
- package/src/charts/index.scss +17 -17
- package/src/charts/variables.scss +19 -13
- package/src/widgets/grid/Grid.js +119 -93
package/dist/widgets.js
CHANGED
|
@@ -15439,7 +15439,7 @@ var Grid = /*#__PURE__*/ (function (_Container) {
|
|
|
15439
15439
|
(c.header3 && c.header3.resizable)
|
|
15440
15440
|
)
|
|
15441
15441
|
row.hasResizableColumns = true;
|
|
15442
|
-
if (c.aggregate && (c.aggregateField || isDefined(c.aggregateValue))) {
|
|
15442
|
+
if (c.aggregate && c.aggregateAlias && (c.aggregateField || isDefined(c.aggregateValue))) {
|
|
15443
15443
|
aggregates[c.aggregateAlias] = {
|
|
15444
15444
|
value: isDefined(c.aggregateValue)
|
|
15445
15445
|
? c.aggregateValue
|
|
@@ -15868,14 +15868,13 @@ var Grid = /*#__PURE__*/ (function (_Container) {
|
|
|
15868
15868
|
var headerRows = [];
|
|
15869
15869
|
if (!header) return null;
|
|
15870
15870
|
var skip = {};
|
|
15871
|
-
|
|
15872
|
-
header.children.forEach(function (line) {
|
|
15871
|
+
header.children.forEach(function (line, lineIndex) {
|
|
15873
15872
|
var empty = [true, true, true];
|
|
15874
15873
|
var result = [[], [], []];
|
|
15875
15874
|
line.children.forEach(function (hdinst, colIndex) {
|
|
15876
15875
|
var hdwidget = hdinst.widget;
|
|
15877
15876
|
var _loop = function _loop(l) {
|
|
15878
|
-
var colKey = lineIndex +
|
|
15877
|
+
var colKey = lineIndex + "-" + colIndex + "-" + l;
|
|
15879
15878
|
if (skip[colKey]) return 0; // continue
|
|
15880
15879
|
if (Boolean(hdinst.data.fixed) != fixedColumns) return 0; // continue
|
|
15881
15880
|
var header = hdinst.components["header" + (l + 1)];
|
|
@@ -15932,7 +15931,8 @@ var Grid = /*#__PURE__*/ (function (_Container) {
|
|
|
15932
15931
|
colSpan = header.data.colSpan;
|
|
15933
15932
|
rowSpan = header.data.rowSpan;
|
|
15934
15933
|
for (var r = 0; r < header.data.rowSpan; r++)
|
|
15935
|
-
for (var c = 0; c < header.data.colSpan; c++)
|
|
15934
|
+
for (var c = 0; c < header.data.colSpan; c++)
|
|
15935
|
+
skip[lineIndex + "-" + (colIndex + c) + "-" + (l + r)] = true;
|
|
15936
15936
|
}
|
|
15937
15937
|
if ((hdwidget.resizable || header.data.resizable) && header.data.colSpan < 2) {
|
|
15938
15938
|
resizer = _this3.renderResizer(instance, hdinst, header, colIndex);
|
|
@@ -16000,7 +16000,6 @@ var Grid = /*#__PURE__*/ (function (_Container) {
|
|
|
16000
16000
|
result = result.filter(function (_, i) {
|
|
16001
16001
|
return !empty[i];
|
|
16002
16002
|
});
|
|
16003
|
-
lineIndex += result.length;
|
|
16004
16003
|
if (result[0]) {
|
|
16005
16004
|
if (fixed && !fixedColumns) {
|
|
16006
16005
|
result[0].push(
|
|
@@ -16157,7 +16156,9 @@ var Grid = /*#__PURE__*/ (function (_Container) {
|
|
|
16157
16156
|
var v,
|
|
16158
16157
|
c = ci.widget,
|
|
16159
16158
|
colSpan,
|
|
16160
|
-
pad
|
|
16159
|
+
pad,
|
|
16160
|
+
cls = "",
|
|
16161
|
+
style = null;
|
|
16161
16162
|
if (c.caption) {
|
|
16162
16163
|
if (c.caption.children)
|
|
16163
16164
|
v = /*#__PURE__*/ jsx(Cx, {
|
|
@@ -16166,10 +16167,16 @@ var Grid = /*#__PURE__*/ (function (_Container) {
|
|
|
16166
16167
|
parentInstance: instance,
|
|
16167
16168
|
subscribe: true,
|
|
16168
16169
|
});
|
|
16169
|
-
else
|
|
16170
|
+
else {
|
|
16171
|
+
v = c.caption.value(data);
|
|
16172
|
+
var fmt = c.caption.format(data);
|
|
16173
|
+
if (fmt) v = Format.value(v, fmt);
|
|
16174
|
+
}
|
|
16170
16175
|
pad = c.caption.pad;
|
|
16171
16176
|
colSpan = c.caption.colSpan;
|
|
16172
16177
|
empty = false;
|
|
16178
|
+
cls = CSS.expand(c.caption["class"](data)) || "";
|
|
16179
|
+
style = parseStyle$1(c.caption.style(data));
|
|
16173
16180
|
if (c.caption.expand) {
|
|
16174
16181
|
colSpan = 1;
|
|
16175
16182
|
for (
|
|
@@ -16182,12 +16189,12 @@ var Grid = /*#__PURE__*/ (function (_Container) {
|
|
|
16182
16189
|
colSpan++;
|
|
16183
16190
|
}
|
|
16184
16191
|
if (colSpan > 1) skip = colSpan - 1;
|
|
16185
|
-
} else if (c.aggregate && c.
|
|
16192
|
+
} else if (c.aggregate && c.aggregateAlias && c.caption !== false) {
|
|
16186
16193
|
empty = false;
|
|
16187
|
-
v = group[c.
|
|
16194
|
+
v = group[c.aggregateAlias];
|
|
16188
16195
|
if (isString(ci.data.format)) v = Format.value(v, ci.data.format);
|
|
16189
16196
|
}
|
|
16190
|
-
|
|
16197
|
+
if (cls) cls += " ";
|
|
16191
16198
|
if (c.align) cls += CSS.state("aligned-" + c.align);
|
|
16192
16199
|
if (pad !== false) cls += (cls ? " " : "") + CSS.state("pad");
|
|
16193
16200
|
return /*#__PURE__*/ jsx(
|
|
@@ -16195,6 +16202,7 @@ var Grid = /*#__PURE__*/ (function (_Container) {
|
|
|
16195
16202
|
{
|
|
16196
16203
|
className: cls,
|
|
16197
16204
|
colSpan: colSpan,
|
|
16205
|
+
style: style,
|
|
16198
16206
|
children: v,
|
|
16199
16207
|
},
|
|
16200
16208
|
i,
|
|
@@ -16273,9 +16281,9 @@ var Grid = /*#__PURE__*/ (function (_Container) {
|
|
|
16273
16281
|
colSpan++;
|
|
16274
16282
|
}
|
|
16275
16283
|
if (colSpan > 1) skip = colSpan - 1;
|
|
16276
|
-
} else if (c.aggregate && c.
|
|
16284
|
+
} else if (c.aggregate && c.aggregateAlias && c.footer !== false) {
|
|
16277
16285
|
empty = false;
|
|
16278
|
-
v = group[c.
|
|
16286
|
+
v = group[c.aggregateAlias];
|
|
16279
16287
|
if (isString(ci.data.format)) v = Format.value(v, ci.data.format);
|
|
16280
16288
|
}
|
|
16281
16289
|
if (cls) cls += " ";
|
|
@@ -16524,6 +16532,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
16524
16532
|
cursorCellIndex: 0,
|
|
16525
16533
|
focused: widget.focused,
|
|
16526
16534
|
dropInsertionIndex: null,
|
|
16535
|
+
dropNextToTheRowAbove: null,
|
|
16527
16536
|
start: 0,
|
|
16528
16537
|
end: end,
|
|
16529
16538
|
};
|
|
@@ -16640,7 +16649,6 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
16640
16649
|
mod["draggable"] = draggable;
|
|
16641
16650
|
mod["non-draggable"] = !draggable;
|
|
16642
16651
|
var wrap = function wrap(children) {
|
|
16643
|
-
var skipCells = {};
|
|
16644
16652
|
return /*#__PURE__*/ jsx(
|
|
16645
16653
|
GridRowComponent,
|
|
16646
16654
|
{
|
|
@@ -16690,20 +16698,6 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
16690
16698
|
maxWidth: width + "px",
|
|
16691
16699
|
});
|
|
16692
16700
|
}
|
|
16693
|
-
if (skipCells[line + "-" + cellIndex]) return null;
|
|
16694
|
-
if (data.colSpan > 1 || data.rowSpan > 1) {
|
|
16695
|
-
for (var r = line; r < line + ((_data$rowSpan = data.rowSpan) != null ? _data$rowSpan : 1); r++) {
|
|
16696
|
-
var _data$rowSpan;
|
|
16697
|
-
for (
|
|
16698
|
-
var c = cellIndex;
|
|
16699
|
-
c < cellIndex + ((_data$colSpan = data.colSpan) != null ? _data$colSpan : 1);
|
|
16700
|
-
c++
|
|
16701
|
-
) {
|
|
16702
|
-
var _data$colSpan;
|
|
16703
|
-
skipCells[r + "-" + c] = true;
|
|
16704
|
-
}
|
|
16705
|
-
}
|
|
16706
|
-
}
|
|
16707
16701
|
if (cellWrap) content = cellWrap(content);
|
|
16708
16702
|
return /*#__PURE__*/ jsx(
|
|
16709
16703
|
"td",
|
|
@@ -16925,7 +16919,48 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
16925
16919
|
},
|
|
16926
16920
|
"dropzone",
|
|
16927
16921
|
);
|
|
16928
|
-
|
|
16922
|
+
var index = 0;
|
|
16923
|
+
while (
|
|
16924
|
+
index < children.length &&
|
|
16925
|
+
((_children$index = children[index]) == null ||
|
|
16926
|
+
(_children$index = _children$index.props) == null ||
|
|
16927
|
+
(_children$index = _children$index.record) == null
|
|
16928
|
+
? void 0
|
|
16929
|
+
: _children$index.type) != "data"
|
|
16930
|
+
) {
|
|
16931
|
+
var _children$index;
|
|
16932
|
+
index++;
|
|
16933
|
+
}
|
|
16934
|
+
var count = 0;
|
|
16935
|
+
while (count < this.state.dropInsertionIndex) {
|
|
16936
|
+
var _children$index2;
|
|
16937
|
+
if (
|
|
16938
|
+
((_children$index2 = children[index]) == null ||
|
|
16939
|
+
(_children$index2 = _children$index2.props) == null ||
|
|
16940
|
+
(_children$index2 = _children$index2.record) == null
|
|
16941
|
+
? void 0
|
|
16942
|
+
: _children$index2.type) == "data"
|
|
16943
|
+
)
|
|
16944
|
+
count++;
|
|
16945
|
+
index++;
|
|
16946
|
+
}
|
|
16947
|
+
var savedIndexPos = index;
|
|
16948
|
+
if (!this.state.dropNextToTheRowAbove)
|
|
16949
|
+
while (
|
|
16950
|
+
index < children.length &&
|
|
16951
|
+
((_children$index3 = children[index]) == null ||
|
|
16952
|
+
(_children$index3 = _children$index3.props) == null ||
|
|
16953
|
+
(_children$index3 = _children$index3.record) == null
|
|
16954
|
+
? void 0
|
|
16955
|
+
: _children$index3.type) != "data"
|
|
16956
|
+
) {
|
|
16957
|
+
var _children$index3;
|
|
16958
|
+
index++;
|
|
16959
|
+
}
|
|
16960
|
+
|
|
16961
|
+
// do not allow insertion after the last group footer
|
|
16962
|
+
if (savedIndexPos < index && index == children.length) index = savedIndexPos;
|
|
16963
|
+
children.splice(index, 0, dragInsertionRow);
|
|
16929
16964
|
}
|
|
16930
16965
|
var content = [],
|
|
16931
16966
|
fixedColumnsContent = [];
|
|
@@ -17311,12 +17346,14 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
17311
17346
|
start = _this$getBufferStartE2.start;
|
|
17312
17347
|
var _this$state2 = this.state,
|
|
17313
17348
|
dropInsertionIndex = _this$state2.dropInsertionIndex,
|
|
17314
|
-
dropTarget = _this$state2.dropTarget
|
|
17349
|
+
dropTarget = _this$state2.dropTarget,
|
|
17350
|
+
dropNextToTheRowAbove = _this$state2.dropNextToTheRowAbove;
|
|
17315
17351
|
if (dropTarget == "grid" && widget.onDrop && dropInsertionIndex != null) {
|
|
17316
17352
|
e.target = {
|
|
17317
17353
|
insertionIndex: start + dropInsertionIndex,
|
|
17318
17354
|
recordBefore: this.getRecordAt(start + dropInsertionIndex - 1),
|
|
17319
17355
|
recordAfter: this.getRecordAt(start + dropInsertionIndex),
|
|
17356
|
+
dropNextToTheRowAbove: dropNextToTheRowAbove,
|
|
17320
17357
|
};
|
|
17321
17358
|
instance.invoke("onDrop", e, instance);
|
|
17322
17359
|
} else if (dropTarget == "row") {
|
|
@@ -17436,6 +17473,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
17436
17473
|
var parentOffset = getParentFrameBoundingClientRect(this.dom.scroller);
|
|
17437
17474
|
var cy = ev.cursor.clientY - parentOffset.top;
|
|
17438
17475
|
var rowOverIndex = null;
|
|
17476
|
+
var nextToTheRowAbove = false;
|
|
17439
17477
|
while (s < e) {
|
|
17440
17478
|
m = Math.floor((s + e) / 2);
|
|
17441
17479
|
b = nodes[m].getBoundingClientRect();
|
|
@@ -17471,8 +17509,10 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
17471
17509
|
break;
|
|
17472
17510
|
}
|
|
17473
17511
|
}
|
|
17474
|
-
if (cy > (b.bottom + b.top) / 2)
|
|
17475
|
-
|
|
17512
|
+
if (cy > (b.bottom + b.top) / 2) {
|
|
17513
|
+
s = e = m + 1;
|
|
17514
|
+
nextToTheRowAbove = true;
|
|
17515
|
+
} else s = e = m;
|
|
17476
17516
|
}
|
|
17477
17517
|
}
|
|
17478
17518
|
var cancel = false;
|
|
@@ -17487,6 +17527,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
17487
17527
|
else if (rowOverIndex != this.state.dropInsertionIndex || this.state.dropTarget != "row") {
|
|
17488
17528
|
this.setState({
|
|
17489
17529
|
dropInsertionIndex: rowOverIndex,
|
|
17530
|
+
dropNextToTheRowAbove: false,
|
|
17490
17531
|
dropItemHeight: ev.source.height - 1,
|
|
17491
17532
|
dropTarget: "row",
|
|
17492
17533
|
});
|
|
@@ -17504,6 +17545,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
17504
17545
|
else if (s != this.state.dropInsertionIndex || this.state.dropTarget != "grid") {
|
|
17505
17546
|
this.setState({
|
|
17506
17547
|
dropInsertionIndex: s,
|
|
17548
|
+
dropNextToTheRowAbove: nextToTheRowAbove,
|
|
17507
17549
|
dropItemHeight: ev.source.height - 1,
|
|
17508
17550
|
dropTarget: "grid",
|
|
17509
17551
|
});
|
|
@@ -17512,6 +17554,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
17512
17554
|
if (cancel) {
|
|
17513
17555
|
this.setState({
|
|
17514
17556
|
dropInsertionIndex: null,
|
|
17557
|
+
dropNextToTheRowAbove: null,
|
|
17515
17558
|
dropTarget: null,
|
|
17516
17559
|
});
|
|
17517
17560
|
}
|
|
@@ -17519,6 +17562,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
|
|
|
17519
17562
|
_proto2.onDragLeave = function onDragLeave(e) {
|
|
17520
17563
|
this.setState({
|
|
17521
17564
|
dropInsertionIndex: null,
|
|
17565
|
+
dropNextToTheRowAbove: null,
|
|
17522
17566
|
dropTarget: null,
|
|
17523
17567
|
});
|
|
17524
17568
|
};
|
|
@@ -18389,7 +18433,12 @@ var GridColumnHeader = /*#__PURE__*/ (function (_Widget) {
|
|
|
18389
18433
|
if (children) {
|
|
18390
18434
|
delete this.caption.items;
|
|
18391
18435
|
this.caption.children = Widget.create(children);
|
|
18392
|
-
} else
|
|
18436
|
+
} else {
|
|
18437
|
+
this.caption.value = getSelector(this.caption.value);
|
|
18438
|
+
this.caption["class"] = getSelector(this.caption["class"]);
|
|
18439
|
+
this.caption.style = getSelector(this.caption.style);
|
|
18440
|
+
this.caption.format = getSelector(this.caption.format);
|
|
18441
|
+
}
|
|
18393
18442
|
}
|
|
18394
18443
|
_Widget.prototype.init.call(this);
|
|
18395
18444
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as Cx from "../core";
|
|
2
|
+
import { BoundedObject, BoundedObjectProps } from "../svg/BoundedObject";
|
|
3
|
+
|
|
4
|
+
interface SwimlanesProps extends BoundedObjectProps {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the horizontal axis. The value should match one of the horizontal axes set
|
|
7
|
+
* in the `axes` configuration of the parent `Chart` component. Default value is `x`.
|
|
8
|
+
* Set to `false` to hide the grid lines in x direction.
|
|
9
|
+
*/
|
|
10
|
+
xAxis?: string | boolean;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Name of the vertical axis. The value should match one of the vertical axes set
|
|
14
|
+
* in the `axes` configuration if the parent `Chart` component. Default value is `y`.
|
|
15
|
+
* Set to `false` to hide the grid lines in y direction.
|
|
16
|
+
*/
|
|
17
|
+
yAxis?: string | boolean;
|
|
18
|
+
|
|
19
|
+
/** Base CSS class to be applied to the element. Defaults to `swimlanes`. */
|
|
20
|
+
baseClass?: string;
|
|
21
|
+
|
|
22
|
+
/** Represents a swimlane size. */
|
|
23
|
+
size?: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Represents a swimlane step. Define a step on which a swimlane will be rendered. (eg. step 2 will render
|
|
27
|
+
* every second swimlane in the chart.)
|
|
28
|
+
*/
|
|
29
|
+
step?: number;
|
|
30
|
+
|
|
31
|
+
/** Switch to vertical swimlanes. */
|
|
32
|
+
vertical?: boolean;
|
|
33
|
+
|
|
34
|
+
/**The laneOffset property adjusts the positioning of lane elements, enhancing their alignment and readability. */
|
|
35
|
+
laneOffset?: number;
|
|
36
|
+
|
|
37
|
+
/** Style object applied to the swimlanes. */
|
|
38
|
+
laneStyle?: StyleProp;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class Swimlanes extends Cx.Widget<SwimlanesProps> {}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { BoundedObject } from "../svg/BoundedObject";
|
|
2
|
+
import { parseStyle } from "../util/parseStyle";
|
|
3
|
+
import { VDOM } from "../ui/Widget";
|
|
4
|
+
|
|
5
|
+
export class Swimlanes extends BoundedObject {
|
|
6
|
+
init() {
|
|
7
|
+
this.laneStyle = parseStyle(this.laneStyle);
|
|
8
|
+
super.init();
|
|
9
|
+
}
|
|
10
|
+
declareData(...args) {
|
|
11
|
+
super.declareData(...args, {
|
|
12
|
+
size: undefined,
|
|
13
|
+
step: undefined,
|
|
14
|
+
laneOffset: undefined,
|
|
15
|
+
laneStyle: { structured: true },
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
explore(context, instance) {
|
|
20
|
+
super.explore(context, instance);
|
|
21
|
+
instance.xAxis = context.axes[this.xAxis];
|
|
22
|
+
instance.yAxis = context.axes[this.yAxis];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
prepare(context, instance) {
|
|
26
|
+
super.prepare(context, instance);
|
|
27
|
+
let { xAxis, yAxis } = instance;
|
|
28
|
+
if ((xAxis && xAxis.shouldUpdate) || (yAxis && yAxis.shouldUpdate)) instance.markShouldUpdate(context);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
render(context, instance, key) {
|
|
32
|
+
let { data, xAxis, yAxis } = instance;
|
|
33
|
+
let { bounds } = data;
|
|
34
|
+
let { CSS, baseClass } = this;
|
|
35
|
+
|
|
36
|
+
let axis = this.vertical ? xAxis : yAxis;
|
|
37
|
+
|
|
38
|
+
if (!axis) return null;
|
|
39
|
+
|
|
40
|
+
let min, max, valueFunction;
|
|
41
|
+
|
|
42
|
+
if (axis.scale) {
|
|
43
|
+
min = axis.scale.min;
|
|
44
|
+
max = axis.scale.max;
|
|
45
|
+
let clamp = (value) => [Math.max(min, Math.min(max, value)), 0];
|
|
46
|
+
valueFunction = (value, offset) => clamp(value + offset);
|
|
47
|
+
} else if (axis.valueList) {
|
|
48
|
+
min = 0;
|
|
49
|
+
max = axis.valueList.length;
|
|
50
|
+
valueFunction = (value, offset) => [axis.valueList[value], offset];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!(min < max)) return null;
|
|
54
|
+
|
|
55
|
+
let rects = [];
|
|
56
|
+
|
|
57
|
+
let at = Math.ceil(min / data.step) * data.step;
|
|
58
|
+
let index = 0;
|
|
59
|
+
|
|
60
|
+
let rectClass = CSS.element(baseClass, "lane");
|
|
61
|
+
|
|
62
|
+
while (at - data.size / 2 < max) {
|
|
63
|
+
let c1 = axis.map(...valueFunction(at, -data.size / 2 + data.laneOffset));
|
|
64
|
+
let c2 = axis.map(...valueFunction(at, +data.size / 2 + data.laneOffset));
|
|
65
|
+
if (this.vertical) {
|
|
66
|
+
rects.push(
|
|
67
|
+
<rect
|
|
68
|
+
key={index++}
|
|
69
|
+
y={bounds.t}
|
|
70
|
+
x={Math.min(c1, c2)}
|
|
71
|
+
height={bounds.b - bounds.t}
|
|
72
|
+
width={Math.abs(c1 - c2)}
|
|
73
|
+
className={rectClass}
|
|
74
|
+
style={data.laneStyle}
|
|
75
|
+
/>,
|
|
76
|
+
);
|
|
77
|
+
} else {
|
|
78
|
+
rects.push(
|
|
79
|
+
<rect
|
|
80
|
+
key={index++}
|
|
81
|
+
x={bounds.l}
|
|
82
|
+
y={Math.min(c1, c2)}
|
|
83
|
+
width={bounds.r - bounds.l}
|
|
84
|
+
height={Math.abs(c1 - c2)}
|
|
85
|
+
className={rectClass}
|
|
86
|
+
style={data.laneStyle}
|
|
87
|
+
/>,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
at += data.step;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<g key={key} className={data.classNames}>
|
|
96
|
+
{rects}
|
|
97
|
+
</g>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
Swimlanes.prototype.xAxis = "x";
|
|
103
|
+
Swimlanes.prototype.yAxis = "y";
|
|
104
|
+
Swimlanes.prototype.anchors = "0 1 1 0";
|
|
105
|
+
Swimlanes.prototype.baseClass = "swimlanes";
|
|
106
|
+
Swimlanes.prototype.size = 0.5;
|
|
107
|
+
Swimlanes.prototype.laneOffset = 0;
|
|
108
|
+
Swimlanes.prototype.step = 1;
|
|
109
|
+
Swimlanes.prototype.vertical = false;
|
|
110
|
+
Swimlanes.prototype.styled = true;
|
|
111
|
+
|
|
112
|
+
BoundedObject.alias("swimlanes", Swimlanes);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@mixin cx-swimlanes($name: "swimlanes", $besm: $cx-besm, $lane-color: $cx-default-swimlanes-lane-background-color) {
|
|
2
|
+
$block: map-get($besm, block);
|
|
3
|
+
$element: map-get($besm, element);
|
|
4
|
+
$state: map-get($besm, state);
|
|
5
|
+
|
|
6
|
+
.#{$element}#{$name}-lane {
|
|
7
|
+
fill: $lane-color;
|
|
8
|
+
stroke: none;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@if (cx-should-include("cx/charts/Swimlanes")) {
|
|
13
|
+
@include cx-swimlanes();
|
|
14
|
+
}
|
package/src/charts/index.d.ts
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
1
|
+
export * from "./Chart";
|
|
2
|
+
export * from "./PieChart";
|
|
3
|
+
export * from "./Pie";
|
|
4
|
+
export * from "./PieLabel";
|
|
5
|
+
export * from "./PieLabelsContainer";
|
|
6
|
+
export * from "./Column";
|
|
7
|
+
export * from "./Bar";
|
|
8
|
+
export * from "./Legend";
|
|
9
|
+
export * from "./LegendEntry";
|
|
10
|
+
export * from "./ColorMap";
|
|
11
|
+
export * from "./Marker";
|
|
12
|
+
export * from "./MarkerLine";
|
|
13
|
+
export * from "./Range";
|
|
14
|
+
export * from "./Gridlines";
|
|
15
|
+
export * from "./Swimlanes";
|
|
16
|
+
export * from "./LineGraph";
|
|
17
|
+
export * from "./ColumnGraph";
|
|
18
|
+
export * from "./BarGraph";
|
|
19
|
+
export * from "./ScatterGraph";
|
|
20
|
+
export * from "./BubbleGraph";
|
|
21
|
+
export * from "./shapes";
|
|
22
|
+
export * from "./MouseTracker";
|
|
22
23
|
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
24
|
+
export * from "./axis/index";
|
|
25
|
+
export * from "./helpers/index";
|
package/src/charts/index.js
CHANGED
package/src/charts/index.scss
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
@import "axis/index";
|
|
1
2
|
|
|
2
|
-
@import
|
|
3
|
-
|
|
4
|
-
@import
|
|
5
|
-
@import
|
|
6
|
-
@import
|
|
7
|
-
@import
|
|
8
|
-
@import
|
|
9
|
-
@import
|
|
10
|
-
@import
|
|
11
|
-
@import
|
|
12
|
-
@import
|
|
13
|
-
@import
|
|
14
|
-
@import
|
|
15
|
-
@import
|
|
16
|
-
@import
|
|
17
|
-
@import 'Range';
|
|
3
|
+
@import "PieChart";
|
|
4
|
+
@import "Legend";
|
|
5
|
+
@import "LegendEntry";
|
|
6
|
+
@import "Gridlines";
|
|
7
|
+
@import "Swimlanes";
|
|
8
|
+
@import "Column";
|
|
9
|
+
@import "Bar";
|
|
10
|
+
@import "LineGraph";
|
|
11
|
+
@import "ColumnGraph";
|
|
12
|
+
@import "BarGraph";
|
|
13
|
+
@import "ScatterGraph";
|
|
14
|
+
@import "BubbleGraph";
|
|
15
|
+
@import "Marker";
|
|
16
|
+
@import "MarkerLine";
|
|
17
|
+
@import "Range";
|
|
18
18
|
|
|
19
19
|
//define last for higher priority
|
|
20
|
-
@import
|
|
20
|
+
@import "palette";
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
@import "axis/variables";
|
|
2
2
|
|
|
3
|
-
$cx-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
$cx-default-swimlanes-lane-background-color: #f1f1f1;
|
|
4
|
+
|
|
5
|
+
$cx-dependencies: map-merge(
|
|
6
|
+
$cx-dependencies,
|
|
7
|
+
(
|
|
8
|
+
"cx/charts/Bar": "cx/charts/palette",
|
|
9
|
+
"cx/charts/BarGraph": "cx/charts/palette",
|
|
10
|
+
"cx/charts/Column": "cx/charts/palette",
|
|
11
|
+
"cx/charts/ColumnGraph": "cx/charts/palette",
|
|
12
|
+
"cx/charts/LineGraph": "cx/charts/palette",
|
|
13
|
+
"cx/charts/ColorMap": "cx/charts/palette",
|
|
14
|
+
"cx/charts/ScatterGraph": "cx/charts/palette",
|
|
15
|
+
"cx/charts/BubbleGraph": "cx/charts/palette",
|
|
16
|
+
"cx/charts/MarkerLine": "cx/charts/palette",
|
|
17
|
+
"cx/charts/Marker": "cx/charts/palette",
|
|
18
|
+
"cx/charts/PieChart": "cx/charts/palette",
|
|
19
|
+
"cx/charts/Swimlanes": "cx/charts/Swimlanes",
|
|
20
|
+
)
|
|
21
|
+
);
|