cx 24.9.4 → 24.10.1
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 +19 -16
- package/dist/charts.js +129 -94
- package/dist/data.js +29 -26
- package/dist/manifest.js +718 -718
- package/dist/svg.js +56 -59
- package/dist/ui.js +52 -51
- package/dist/widgets.js +44 -40
- package/package.json +32 -32
- package/src/charts/Legend.js +49 -33
- package/src/charts/Legend.scss +40 -42
- package/src/charts/LegendEntry.js +120 -121
- package/src/charts/LegendEntry.scss +27 -31
- package/src/charts/PieChart.d.ts +92 -89
- package/src/charts/PieChart.js +529 -527
- package/src/charts/PieLabel.js +71 -71
- package/src/charts/axis/NumericAxis.js +347 -347
- package/src/charts/axis/Stack.js +55 -55
- package/src/charts/helpers/PointReducer.js +43 -43
- package/src/charts/helpers/SnapPointFinder.js +69 -69
- package/src/data/Binding.spec.js +69 -69
- package/src/data/Expression.js +221 -221
- package/src/data/Expression.spec.js +184 -184
- package/src/data/StringTemplate.spec.js +105 -105
- package/src/data/getAccessor.spec.js +11 -11
- package/src/index.scss +6 -6
- package/src/svg/Text.d.ts +40 -40
- package/src/ui/Culture.d.ts +55 -55
- package/src/ui/Culture.js +139 -139
- package/src/ui/FocusManager.js +171 -171
- package/src/ui/Instance.d.ts +72 -72
- package/src/ui/VDOM.d.ts +12 -12
- package/src/ui/app/startAppLoop.js +58 -58
- package/src/ui/index.d.ts +42 -42
- package/src/ui/layout/LabelsTopLayout.js +134 -134
- package/src/util/Console.d.ts +4 -4
- package/src/util/index.d.ts +51 -51
- package/src/util/index.js +54 -54
- package/src/util/isValidIdentifierName.d.ts +1 -1
- package/src/util/isValidIdentifierName.js +5 -5
- package/src/util/isValidIdentifierName.spec.js +33 -33
- package/src/util/scss/add-rules.scss +38 -38
- package/src/widgets/CxCredit.scss +37 -37
- package/src/widgets/HighlightedSearchText.js +36 -36
- package/src/widgets/HighlightedSearchText.scss +18 -18
- package/src/widgets/List.scss +91 -91
- package/src/widgets/drag-drop/DropZone.js +214 -214
- package/src/widgets/form/Calendar.scss +196 -196
- package/src/widgets/form/ColorField.js +397 -397
- package/src/widgets/form/ColorPicker.scss +283 -283
- package/src/widgets/form/DateTimeField.js +573 -573
- package/src/widgets/form/LookupField.d.ts +179 -179
- package/src/widgets/form/MonthField.js +516 -516
- package/src/widgets/form/MonthPicker.scss +118 -118
- package/src/widgets/form/NumberField.js +459 -459
- package/src/widgets/form/NumberField.scss +61 -61
- package/src/widgets/form/Select.scss +99 -99
- package/src/widgets/form/Slider.scss +118 -118
- package/src/widgets/form/Switch.scss +140 -140
- package/src/widgets/form/TextArea.scss +43 -43
- package/src/widgets/form/TextField.js +290 -290
- package/src/widgets/form/TextField.scss +55 -55
- package/src/widgets/form/UploadButton.d.ts +34 -34
- package/src/widgets/form/variables.scss +353 -353
- package/src/widgets/grid/TreeNode.scss +88 -88
- package/src/widgets/grid/variables.scss +88 -88
- package/src/widgets/nav/Menu.scss +74 -74
- package/src/widgets/overlay/Dropdown.js +612 -612
- package/src/widgets/overlay/FlyweightTooltipTracker.js +39 -39
- package/src/widgets/overlay/Tooltip.js +300 -300
- package/src/widgets/overlay/Window.js +196 -196
- package/src/widgets/overlay/captureMouse.js +124 -124
- package/src/widgets/overlay/variables.scss +83 -83
- package/src/widgets/variables.scss +144 -144
package/src/charts/PieLabel.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { VDOM } from "../ui/Widget";
|
|
2
|
-
import { BoundedObject } from "../svg/BoundedObject";
|
|
3
|
-
import { Rect } from "../svg/util/Rect";
|
|
4
|
-
import { parseStyle } from "../util/parseStyle";
|
|
5
|
-
|
|
6
|
-
export class PieLabel extends BoundedObject {
|
|
7
|
-
init() {
|
|
8
|
-
this.lineStyle = parseStyle(this.lineStyle);
|
|
9
|
-
super.init();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declareData(...args) {
|
|
13
|
-
super.declareData(...args, {
|
|
14
|
-
distance: undefined,
|
|
15
|
-
lineStyle: { structured: true },
|
|
16
|
-
lineStroke: undefined,
|
|
17
|
-
lineClass: { structured: true },
|
|
18
|
-
lineColorIndex: undefined,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
calculateBounds(context, instance) {
|
|
23
|
-
var { data } = instance;
|
|
24
|
-
var bounds = Rect.add(Rect.add(Rect.multiply(instance.parentRect, data.anchors), data.offset), data.margin);
|
|
25
|
-
instance.originalBounds = bounds;
|
|
26
|
-
instance.actualBounds = context.placePieLabel(bounds, data.distance);
|
|
27
|
-
return new Rect({ t: 0, r: bounds.width(), b: bounds.height(), l: 0 });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
prepare(context, instance) {
|
|
31
|
-
super.prepare(context, instance);
|
|
32
|
-
if (!context.registerPieLabel)
|
|
33
|
-
throw new Error("PieLabel components are allowed only within PieLabelsContainer components.");
|
|
34
|
-
let right = instance.parentRect.r > instance.parentRect.l;
|
|
35
|
-
context.push("textDirection", right ? "right" : "left");
|
|
36
|
-
context.registerPieLabel(instance);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
prepareCleanup(context, instance) {
|
|
40
|
-
context.pop("textDirection");
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
render(context, instance, key) {
|
|
44
|
-
let { originalBounds, actualBounds, data } = instance;
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<g key={key} className={data.classNames}>
|
|
48
|
-
<line
|
|
49
|
-
className={this.CSS.element(
|
|
50
|
-
this.baseClass,
|
|
51
|
-
"line",
|
|
52
|
-
data.lineColorIndex != null && "color-" + data.lineColorIndex
|
|
53
|
-
)}
|
|
54
|
-
x1={actualBounds.l < originalBounds.l ? actualBounds.r : actualBounds.l}
|
|
55
|
-
y1={(actualBounds.t + actualBounds.b) / 2}
|
|
56
|
-
x2={(originalBounds.l + originalBounds.r) / 2}
|
|
57
|
-
y2={(originalBounds.t + originalBounds.b) / 2}
|
|
58
|
-
stroke={data.lineStroke}
|
|
59
|
-
style={data.lineStyle}
|
|
60
|
-
/>
|
|
61
|
-
<g transform={`translate(${instance.actualBounds.l} ${instance.actualBounds.t})`}>
|
|
62
|
-
{this.renderChildren(context, instance)}
|
|
63
|
-
</g>
|
|
64
|
-
</g>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
PieLabel.prototype.distance = 100;
|
|
70
|
-
PieLabel.prototype.baseClass = "pielabel";
|
|
71
|
-
PieLabel.prototype.styled = true;
|
|
1
|
+
import { VDOM } from "../ui/Widget";
|
|
2
|
+
import { BoundedObject } from "../svg/BoundedObject";
|
|
3
|
+
import { Rect } from "../svg/util/Rect";
|
|
4
|
+
import { parseStyle } from "../util/parseStyle";
|
|
5
|
+
|
|
6
|
+
export class PieLabel extends BoundedObject {
|
|
7
|
+
init() {
|
|
8
|
+
this.lineStyle = parseStyle(this.lineStyle);
|
|
9
|
+
super.init();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declareData(...args) {
|
|
13
|
+
super.declareData(...args, {
|
|
14
|
+
distance: undefined,
|
|
15
|
+
lineStyle: { structured: true },
|
|
16
|
+
lineStroke: undefined,
|
|
17
|
+
lineClass: { structured: true },
|
|
18
|
+
lineColorIndex: undefined,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
calculateBounds(context, instance) {
|
|
23
|
+
var { data } = instance;
|
|
24
|
+
var bounds = Rect.add(Rect.add(Rect.multiply(instance.parentRect, data.anchors), data.offset), data.margin);
|
|
25
|
+
instance.originalBounds = bounds;
|
|
26
|
+
instance.actualBounds = context.placePieLabel(bounds, data.distance);
|
|
27
|
+
return new Rect({ t: 0, r: bounds.width(), b: bounds.height(), l: 0 });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
prepare(context, instance) {
|
|
31
|
+
super.prepare(context, instance);
|
|
32
|
+
if (!context.registerPieLabel)
|
|
33
|
+
throw new Error("PieLabel components are allowed only within PieLabelsContainer components.");
|
|
34
|
+
let right = instance.parentRect.r > instance.parentRect.l;
|
|
35
|
+
context.push("textDirection", right ? "right" : "left");
|
|
36
|
+
context.registerPieLabel(instance);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
prepareCleanup(context, instance) {
|
|
40
|
+
context.pop("textDirection");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
render(context, instance, key) {
|
|
44
|
+
let { originalBounds, actualBounds, data } = instance;
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<g key={key} className={data.classNames}>
|
|
48
|
+
<line
|
|
49
|
+
className={this.CSS.element(
|
|
50
|
+
this.baseClass,
|
|
51
|
+
"line",
|
|
52
|
+
data.lineColorIndex != null && "color-" + data.lineColorIndex
|
|
53
|
+
)}
|
|
54
|
+
x1={actualBounds.l < originalBounds.l ? actualBounds.r : actualBounds.l}
|
|
55
|
+
y1={(actualBounds.t + actualBounds.b) / 2}
|
|
56
|
+
x2={(originalBounds.l + originalBounds.r) / 2}
|
|
57
|
+
y2={(originalBounds.t + originalBounds.b) / 2}
|
|
58
|
+
stroke={data.lineStroke}
|
|
59
|
+
style={data.lineStyle}
|
|
60
|
+
/>
|
|
61
|
+
<g transform={`translate(${instance.actualBounds.l} ${instance.actualBounds.t})`}>
|
|
62
|
+
{this.renderChildren(context, instance)}
|
|
63
|
+
</g>
|
|
64
|
+
</g>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
PieLabel.prototype.distance = 100;
|
|
70
|
+
PieLabel.prototype.baseClass = "pielabel";
|
|
71
|
+
PieLabel.prototype.styled = true;
|