cx 26.2.1 → 26.2.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/build/charts/Chart.d.ts.map +1 -1
- package/build/charts/Chart.js +5 -4
- package/build/charts/ColumnBarBase.d.ts +3 -3
- package/build/charts/ColumnBarBase.d.ts.map +1 -1
- package/build/charts/ColumnBarBase.js +1 -1
- package/build/charts/Legend.d.ts.map +1 -1
- package/build/charts/Legend.js +11 -4
- package/build/charts/Marker.d.ts +3 -3
- package/build/charts/Marker.d.ts.map +1 -1
- package/build/charts/MarkerLine.d.ts +7 -7
- package/build/charts/MarkerLine.d.ts.map +1 -1
- package/build/charts/MarkerLine.js +14 -10
- package/build/charts/PieChart.d.ts +4 -4
- package/build/charts/PieChart.d.ts.map +1 -1
- package/build/charts/PieChart.js +36 -14
- package/build/charts/PieLabel.d.ts.map +1 -1
- package/build/charts/PieLabel.js +2 -1
- package/build/charts/RangeMarker.d.ts +3 -3
- package/build/charts/RangeMarker.d.ts.map +1 -1
- package/build/charts/RangeMarker.js +1 -1
- package/build/charts/axis/TimeAxis.d.ts +3 -3
- package/build/charts/axis/TimeAxis.d.ts.map +1 -1
- package/build/charts/axis/TimeAxis.js +70 -21
- package/build/charts/helpers/ValueAtFinder.d.ts +1 -1
- package/build/charts/helpers/ValueAtFinder.d.ts.map +1 -1
- package/build/charts/helpers/ValueAtFinder.js +5 -2
- package/build/data/StructuredSelector.js +3 -4
- package/build/data/createAccessorModelProxy.d.ts +6 -11
- package/build/data/createAccessorModelProxy.d.ts.map +1 -1
- package/build/data/createAccessorModelProxy.js +1 -3
- package/build/svg/Ellipse.d.ts +5 -4
- package/build/svg/Ellipse.d.ts.map +1 -1
- package/build/svg/Ellipse.js +9 -6
- package/build/svg/Line.d.ts +1 -0
- package/build/svg/Line.d.ts.map +1 -1
- package/build/svg/Line.js +4 -1
- package/build/svg/Text.d.ts +12 -6
- package/build/svg/Text.d.ts.map +1 -1
- package/build/svg/Text.js +12 -4
- package/build/ui/Controller.d.ts +2 -0
- package/build/ui/Controller.d.ts.map +1 -1
- package/build/ui/Controller.js +3 -0
- package/build/ui/HoverSync.d.ts.map +1 -1
- package/build/ui/HoverSync.js +7 -2
- package/build/ui/Prop.d.ts +1 -1
- package/build/ui/Prop.d.ts.map +1 -1
- package/build/ui/Text.d.ts +3 -3
- package/build/ui/Text.d.ts.map +1 -1
- package/build/ui/Text.js +5 -5
- package/build/ui/adapter/GroupAdapter.d.ts.map +1 -1
- package/build/ui/adapter/GroupAdapter.js +20 -10
- package/build/ui/app/History.js +1 -1
- package/build/widgets/List.d.ts.map +1 -1
- package/build/widgets/List.js +6 -7
- package/build/widgets/drag-drop/DropZone.d.ts +3 -3
- package/build/widgets/drag-drop/DropZone.d.ts.map +1 -1
- package/build/widgets/form/Calendar.d.ts.map +1 -1
- package/build/widgets/form/Calendar.js +30 -11
- package/build/widgets/form/ColorField.d.ts.map +1 -1
- package/build/widgets/form/ColorField.js +16 -7
- package/build/widgets/form/DateTimeField.d.ts.map +1 -1
- package/build/widgets/form/DateTimeField.js +23 -10
- package/build/widgets/form/Field.d.ts +2 -0
- package/build/widgets/form/Field.d.ts.map +1 -1
- package/build/widgets/form/Field.js +11 -5
- package/build/widgets/form/LookupField.d.ts +1 -1
- package/build/widgets/form/LookupField.d.ts.map +1 -1
- package/build/widgets/form/LookupField.js +6 -6
- package/build/widgets/form/MonthField.d.ts.map +1 -1
- package/build/widgets/form/MonthField.js +15 -7
- package/build/widgets/form/MonthPicker.d.ts +1 -2
- package/build/widgets/form/MonthPicker.d.ts.map +1 -1
- package/build/widgets/form/MonthPicker.js +84 -41
- package/build/widgets/form/NumberField.d.ts +2 -0
- package/build/widgets/form/NumberField.d.ts.map +1 -1
- package/build/widgets/form/NumberField.js +45 -15
- package/build/widgets/form/TextField.d.ts +1 -9
- package/build/widgets/form/TextField.d.ts.map +1 -1
- package/build/widgets/form/TextField.js +1 -1
- package/build/widgets/grid/Grid.d.ts +2 -2
- package/build/widgets/grid/Grid.d.ts.map +1 -1
- package/build/widgets/grid/Grid.js +9 -4
- package/build/widgets/grid/Pagination.d.ts.map +1 -1
- package/build/widgets/grid/Pagination.js +4 -4
- package/build/widgets/grid/TreeNode.d.ts.map +1 -1
- package/build/widgets/grid/TreeNode.js +10 -2
- package/build/widgets/icons/folder.d.ts.map +1 -1
- package/build/widgets/icons/folder.js +1 -0
- package/build/widgets/icons/forward.d.ts.map +1 -1
- package/build/widgets/icons/forward.js +4 -3
- package/build/widgets/icons/loading.d.ts.map +1 -1
- package/build/widgets/icons/loading.js +6 -5
- package/build/widgets/icons/square.d.ts.map +1 -1
- package/build/widgets/icons/square.js +3 -3
- package/build/widgets/index.d.ts +3 -1
- package/build/widgets/index.d.ts.map +1 -1
- package/build/widgets/index.js +3 -1
- package/build/widgets/overlay/ContextMenu.d.ts.map +1 -1
- package/build/widgets/overlay/ContextMenu.js +2 -0
- package/build/widgets/overlay/Dropdown.d.ts +2 -1
- package/build/widgets/overlay/Dropdown.d.ts.map +1 -1
- package/build/widgets/overlay/Dropdown.js +75 -20
- package/build/widgets/overlay/MsgBox.d.ts +1 -0
- package/build/widgets/overlay/MsgBox.d.ts.map +1 -1
- package/build/widgets/overlay/MsgBox.js +2 -2
- package/build/widgets/overlay/Overlay.d.ts +32 -2
- package/build/widgets/overlay/Overlay.d.ts.map +1 -1
- package/build/widgets/overlay/Overlay.js +47 -16
- package/build/widgets/overlay/Toast.d.ts +1 -1
- package/build/widgets/overlay/Toast.d.ts.map +1 -1
- package/build/widgets/overlay/Toast.js +4 -1
- package/build/widgets/overlay/Tooltip.d.ts +6 -0
- package/build/widgets/overlay/Tooltip.d.ts.map +1 -1
- package/build/widgets/overlay/Tooltip.js +24 -9
- package/build/widgets/overlay/Window.d.ts.map +1 -1
- package/build/widgets/overlay/Window.js +24 -9
- package/dist/charts.css +325 -272
- package/dist/charts.js +11 -5
- package/dist/data.js +2 -2
- package/dist/manifest.js +892 -880
- package/dist/svg.css +14 -8
- package/dist/svg.js +9 -1
- package/dist/ui.js +29 -16
- package/dist/widgets.css +997 -294
- package/dist/widgets.js +317 -121
- package/package.json +1 -1
- package/src/charts/Bar.scss +13 -10
- package/src/charts/BarGraph.scss +31 -29
- package/src/charts/BubbleGraph.scss +11 -8
- package/src/charts/Chart.ts +5 -3
- package/src/charts/Column.scss +13 -10
- package/src/charts/ColumnBarBase.tsx +255 -230
- package/src/charts/ColumnGraph.scss +13 -11
- package/src/charts/Gridlines.scss +10 -8
- package/src/charts/Legend.scss +57 -50
- package/src/charts/Legend.tsx +257 -213
- package/src/charts/LegendEntry.scss +35 -29
- package/src/charts/LineGraph.scss +28 -25
- package/src/charts/Marker.scss +12 -10
- package/src/charts/Marker.tsx +3 -2
- package/src/charts/MarkerLine.scss +11 -8
- package/src/charts/MarkerLine.tsx +196 -177
- package/src/charts/PieChart.scss +12 -9
- package/src/charts/PieChart.tsx +717 -591
- package/src/charts/PieLabel.tsx +99 -81
- package/src/charts/Range.scss +11 -8
- package/src/charts/RangeMarker.tsx +204 -187
- package/src/charts/ScatterGraph.scss +12 -9
- package/src/charts/axis/Axis.scss +6 -5
- package/src/charts/axis/CategoryAxis.scss +10 -8
- package/src/charts/axis/NumericAxis.scss +9 -6
- package/src/charts/axis/TimeAxis.scss +9 -6
- package/src/charts/axis/TimeAxis.tsx +753 -637
- package/src/charts/axis/index.scss +4 -5
- package/src/charts/axis/variables.scss +4 -2
- package/src/charts/helpers/ValueAtFinder.ts +19 -5
- package/src/charts/index.scss +16 -19
- package/src/charts/maps.scss +0 -0
- package/src/charts/palette.scss +11 -31
- package/src/charts/palette.variables.scss +23 -0
- package/src/charts/variables.scss +35 -3
- package/src/data/StructuredSelector.ts +2 -2
- package/src/data/createAccessorModelProxy.ts +66 -74
- package/src/index.scss +5 -6
- package/src/maps.scss +5 -0
- package/src/svg/Ellipse.tsx +62 -55
- package/src/svg/Line.tsx +57 -42
- package/src/svg/Svg.scss +6 -6
- package/src/svg/Text.scss +19 -0
- package/src/svg/Text.tsx +172 -116
- package/src/svg/index.scss +3 -2
- package/src/svg/maps.scss +0 -0
- package/src/svg/variables.scss +0 -0
- package/src/ui/Container.spec.ts +59 -0
- package/src/ui/Controller.spec.tsx +30 -0
- package/src/ui/Controller.ts +5 -0
- package/src/ui/HoverSync.tsx +179 -147
- package/src/ui/Prop.ts +1 -1
- package/src/ui/Text.ts +12 -9
- package/src/ui/adapter/GroupAdapter.spec.ts +42 -0
- package/src/ui/adapter/GroupAdapter.ts +25 -14
- package/src/ui/app/History.ts +1 -1
- package/src/ui/index.scss +1 -1
- package/src/ui/layout/LabelsLeftLayout.scss +5 -7
- package/src/ui/layout/LabelsTopLayout.scss +4 -6
- package/src/ui/layout/index.scss +2 -3
- package/src/ui/maps.scss +0 -0
- package/src/ui/variables.scss +1 -2
- package/src/util/index.scss +4 -2
- package/src/util/maps.scss +1 -0
- package/src/util/scss/besm.scss +15 -0
- package/src/util/scss/calc.scss +103 -11
- package/src/util/scss/defaults.scss +24 -0
- package/src/util/scss/elements.scss +78 -0
- package/src/util/scss/global.scss +15 -0
- package/src/util/scss/include.scss +17 -9
- package/src/util/scss/index.scss +1 -9
- package/src/util/scss/maps.scss +2 -0
- package/src/util/scss/pad-size.scss +9 -0
- package/src/util/scss/padding.scss +6 -0
- package/src/util/scss/screen-size.scss +5 -0
- package/src/util/scss/variables.scss +6 -0
- package/src/util/variables.scss +1 -0
- package/src/variables.scss +5 -217
- package/src/widgets/Button.maps.scss +103 -0
- package/src/widgets/Button.scss +33 -9
- package/src/widgets/Button.variables.scss +8 -104
- package/src/widgets/CxCredit.scss +2 -0
- package/src/widgets/FlexBox.scss +16 -11
- package/src/widgets/Heading.scss +6 -0
- package/src/widgets/HighlightedSearchText.scss +8 -1
- package/src/widgets/Icon.scss +6 -0
- package/src/widgets/List.scss +7 -0
- package/src/widgets/List.tsx +6 -7
- package/src/widgets/ProgressBar.scss +9 -0
- package/src/widgets/Resizer.scss +9 -7
- package/src/widgets/Section.scss +53 -56
- package/src/widgets/animations.scss +4 -2
- package/src/widgets/box.scss +47 -0
- package/src/widgets/drag-drop/DragClone.scss +12 -4
- package/src/widgets/drag-drop/DragHandle.scss +12 -6
- package/src/widgets/drag-drop/DragSource.scss +12 -6
- package/src/widgets/drag-drop/DropZone.scss +9 -0
- package/src/widgets/drag-drop/DropZone.tsx +3 -3
- package/src/widgets/drag-drop/index.scss +4 -4
- package/src/widgets/drag-drop/maps.scss +7 -0
- package/src/widgets/drag-drop/variables.scss +8 -5
- package/src/widgets/form/Calendar.maps.scss +54 -0
- package/src/widgets/form/Calendar.scss +49 -11
- package/src/widgets/form/Calendar.tsx +755 -653
- package/src/widgets/form/Calendar.variables.scss +3 -46
- package/src/widgets/form/Checkbox.maps.scss +34 -0
- package/src/widgets/form/Checkbox.scss +14 -3
- package/src/widgets/form/Checkbox.variables.scss +4 -36
- package/src/widgets/form/ColorField.scss +21 -2
- package/src/widgets/form/ColorField.tsx +485 -431
- package/src/widgets/form/ColorPicker.maps.scss +21 -0
- package/src/widgets/form/ColorPicker.scss +26 -9
- package/src/widgets/form/ColorPicker.variables.scss +3 -16
- package/src/widgets/form/DateTimeField.scss +54 -21
- package/src/widgets/form/DateTimeField.tsx +697 -615
- package/src/widgets/form/DateTimePicker.scss +14 -4
- package/src/widgets/form/Field.maps.scss +122 -0
- package/src/widgets/form/Field.scss +54 -18
- package/src/widgets/form/Field.tsx +611 -504
- package/src/widgets/form/Field.variables.scss +46 -0
- package/src/widgets/form/HelpText.scss +8 -5
- package/src/widgets/form/Label.scss +10 -3
- package/src/widgets/form/LookupField.maps.scss +26 -0
- package/src/widgets/form/LookupField.scss +54 -24
- package/src/widgets/form/LookupField.tsx +25 -21
- package/src/widgets/form/MonthField.scss +48 -26
- package/src/widgets/form/MonthField.tsx +645 -567
- package/src/widgets/form/MonthPicker.maps.scss +50 -0
- package/src/widgets/form/MonthPicker.scss +44 -35
- package/src/widgets/form/MonthPicker.tsx +954 -724
- package/src/widgets/form/MonthPicker.variables.scss +24 -0
- package/src/widgets/form/NumberField.scss +19 -2
- package/src/widgets/form/NumberField.tsx +576 -466
- package/src/widgets/form/Radio.maps.scss +36 -0
- package/src/widgets/form/Radio.scss +12 -2
- package/src/widgets/form/Radio.variables.scss +3 -42
- package/src/widgets/form/Select.scss +25 -9
- package/src/widgets/form/Slider.scss +23 -14
- package/src/widgets/form/Switch.scss +18 -8
- package/src/widgets/form/TextArea.scss +14 -1
- package/src/widgets/form/TextField.scss +24 -3
- package/src/widgets/form/TextField.tsx +9 -21
- package/src/widgets/form/UploadButton.scss +14 -6
- package/src/widgets/form/ValidationError.scss +10 -6
- package/src/widgets/form/Wheel.scss +14 -4
- package/src/widgets/form/index.scss +22 -24
- package/src/widgets/form/maps.scss +81 -0
- package/src/widgets/form/variables.scss +111 -355
- package/src/widgets/grid/Grid.scss +19 -2
- package/src/widgets/grid/Grid.spec.ts +42 -0
- package/src/widgets/grid/Grid.tsx +15 -7
- package/src/widgets/grid/Pagination.scss +11 -2
- package/src/widgets/grid/Pagination.tsx +110 -102
- package/src/widgets/grid/TreeNode.scss +25 -8
- package/src/widgets/grid/TreeNode.tsx +127 -116
- package/src/widgets/grid/index.scss +3 -4
- package/src/widgets/grid/maps.scss +110 -0
- package/src/widgets/grid/variables.scss +48 -137
- package/src/widgets/icons/folder.tsx +1 -2
- package/src/widgets/icons/forward.tsx +23 -20
- package/src/widgets/icons/loading.tsx +22 -19
- package/src/widgets/icons/square.tsx +20 -17
- package/src/widgets/index.scss +16 -16
- package/src/widgets/index.ts +63 -58
- package/src/widgets/lists.scss +42 -0
- package/src/widgets/maps.scss +139 -0
- package/src/widgets/nav/Link.scss +14 -1
- package/src/widgets/nav/Menu.scss +13 -7
- package/src/widgets/nav/Menu.variables.scss +1 -12
- package/src/widgets/nav/MenuItem.scss +21 -6
- package/src/widgets/nav/Scroller.scss +11 -2
- package/src/widgets/nav/Tab.maps.scss +78 -0
- package/src/widgets/nav/Tab.scss +12 -6
- package/src/widgets/nav/Tab.variables.scss +7 -76
- package/src/widgets/nav/cover.scss +6 -4
- package/src/widgets/nav/index.scss +6 -6
- package/src/widgets/nav/maps.scss +32 -0
- package/src/widgets/nav/variables.scss +4 -11
- package/src/widgets/overlay/ContextMenu.ts +3 -0
- package/src/widgets/overlay/Dropdown.scss +47 -16
- package/src/widgets/overlay/Dropdown.tsx +851 -676
- package/src/widgets/overlay/MsgBox.tsx +125 -111
- package/src/widgets/overlay/Overlay.scss +60 -40
- package/src/widgets/overlay/Overlay.tsx +948 -800
- package/src/widgets/overlay/Toast.scss +42 -34
- package/src/widgets/overlay/Toast.ts +11 -1
- package/src/widgets/overlay/Tooltip.scss +27 -96
- package/src/widgets/overlay/Tooltip.tsx +376 -309
- package/src/widgets/overlay/Window.maps.scss +51 -0
- package/src/widgets/overlay/Window.scss +17 -17
- package/src/widgets/overlay/Window.tsx +291 -236
- package/src/widgets/overlay/Window.variables.scss +2 -43
- package/src/widgets/overlay/index.d.ts +11 -11
- package/src/widgets/overlay/index.scss +6 -15
- package/src/widgets/overlay/maps.scss +44 -0
- package/src/widgets/overlay/variables.scss +11 -42
- package/src/widgets/variables.scss +33 -117
- package/src/global.scss +0 -14
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@import "TimeAxis";
|
|
1
|
+
@use 'Axis';
|
|
2
|
+
@use "NumericAxis";
|
|
3
|
+
@use "CategoryAxis";
|
|
4
|
+
@use "TimeAxis";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
$cx-axis-line-
|
|
3
|
-
$cx-axis-
|
|
2
|
+
$cx-default-chart-axis-line-color: rgba(128, 128, 128, 0.2) !default;
|
|
3
|
+
$cx-default-chart-axis-tick-color: rgba(128, 128, 128, 0.3) !default;
|
|
4
|
+
$cx-default-chart-axis-label-color: currentColor !default;
|
|
5
|
+
$cx-default-chart-axis-label-font-size: smaller !default;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
PointReducer,
|
|
3
|
+
PointReducerConfig,
|
|
4
|
+
PointReducerInstance,
|
|
5
|
+
PointReducerAccumulator,
|
|
6
|
+
} from "./PointReducer";
|
|
2
7
|
import { NumberProp, StringProp, Bind } from "../../ui/Prop";
|
|
3
8
|
import { AccessorChain } from "../../data/createAccessorModelProxy";
|
|
4
9
|
|
|
@@ -13,7 +18,7 @@ export interface ValueAtFinderConfig extends PointReducerConfig {
|
|
|
13
18
|
at?: NumberProp | StringProp;
|
|
14
19
|
|
|
15
20
|
/** A binding used to receive the measured y axis value */
|
|
16
|
-
value?: Bind | AccessorChain<number>;
|
|
21
|
+
value?: Bind | AccessorChain<number | null>;
|
|
17
22
|
|
|
18
23
|
/** A function used to convert x values into numeric format. Commonly used with dates. */
|
|
19
24
|
convert?: (value: number | string) => number;
|
|
@@ -34,7 +39,10 @@ export class ValueAtFinder extends PointReducer<ValueAtAccumulator> {
|
|
|
34
39
|
});
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
onInitAccumulator = (
|
|
42
|
+
onInitAccumulator = (
|
|
43
|
+
acc: ValueAtAccumulator,
|
|
44
|
+
{ data }: PointReducerInstance<ValueAtAccumulator>,
|
|
45
|
+
) => {
|
|
38
46
|
acc.at = this.convert((data as any).at);
|
|
39
47
|
};
|
|
40
48
|
|
|
@@ -57,12 +65,18 @@ export class ValueAtFinder extends PointReducer<ValueAtAccumulator> {
|
|
|
57
65
|
}
|
|
58
66
|
};
|
|
59
67
|
|
|
60
|
-
onReduce = (
|
|
68
|
+
onReduce = (
|
|
69
|
+
acc: ValueAtAccumulator,
|
|
70
|
+
instance: PointReducerInstance<ValueAtAccumulator>,
|
|
71
|
+
) => {
|
|
61
72
|
let y: number | null = null;
|
|
62
73
|
if (acc.left && acc.right) {
|
|
63
74
|
if (acc.left.x == acc.right.x) y = acc.left.y;
|
|
64
75
|
else if (acc.left.y != null && acc.right.y != null) {
|
|
65
|
-
y =
|
|
76
|
+
y =
|
|
77
|
+
acc.left.y +
|
|
78
|
+
((acc.right.y - acc.left.y) * (acc.at - acc.left.x)) /
|
|
79
|
+
(acc.right.x - acc.left.x);
|
|
66
80
|
}
|
|
67
81
|
}
|
|
68
82
|
instance.set("value", y);
|
package/src/charts/index.scss
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "axis/index" as *;
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
7
|
-
@
|
|
8
|
-
@
|
|
9
|
-
@
|
|
10
|
-
@
|
|
11
|
-
@
|
|
12
|
-
@
|
|
13
|
-
@
|
|
14
|
-
@
|
|
15
|
-
@
|
|
16
|
-
@
|
|
17
|
-
@import "Range";
|
|
18
|
-
@import "RangeMarker";
|
|
19
|
-
@import "Swimlane";
|
|
3
|
+
@use "PieChart";
|
|
4
|
+
@use "Legend";
|
|
5
|
+
@use "LegendEntry";
|
|
6
|
+
@use "Gridlines";
|
|
7
|
+
@use "Column";
|
|
8
|
+
@use "Bar";
|
|
9
|
+
@use "LineGraph";
|
|
10
|
+
@use "ColumnGraph";
|
|
11
|
+
@use "BarGraph";
|
|
12
|
+
@use "ScatterGraph";
|
|
13
|
+
@use "BubbleGraph";
|
|
14
|
+
@use "Marker";
|
|
15
|
+
@use "MarkerLine";
|
|
16
|
+
@use "Range";
|
|
20
17
|
|
|
21
18
|
//define last for higher priority
|
|
22
|
-
@
|
|
19
|
+
@use "palette";
|
|
File without changes
|
package/src/charts/palette.scss
CHANGED
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//selected: 300 900
|
|
5
|
-
//disabled: 0 100
|
|
1
|
+
// Use root entry points to get configured values
|
|
2
|
+
@use "../variables" as *;
|
|
3
|
+
@use "../util/scss/calc.scss" as *;
|
|
6
4
|
@use "sass:map";
|
|
7
5
|
@use "sass:list";
|
|
8
6
|
|
|
9
|
-
$cx-default-palette-colors: rgba(244, 67, 54, 1) rgba(233, 30, 99, 1) rgba(156, 39, 176, 1) rgba(103, 58, 183, 1)
|
|
10
|
-
rgba(63, 81, 181, 1) rgba(33, 150, 243, 1) rgba(3, 169, 244, 1) rgba(0, 188, 212, 1) rgba(0, 150, 136, 1)
|
|
11
|
-
rgba(76, 175, 80, 1) rgba(139, 195, 74, 1) rgba(205, 220, 57, 1) rgba(255, 235, 59, 1) rgba(255, 193, 7, 1)
|
|
12
|
-
rgba(255, 152, 0, 1) rgba(255, 87, 34, 1) !default;
|
|
13
|
-
|
|
14
|
-
$cx-default-palette-fill-whiten: 60% !default;
|
|
15
|
-
$cx-default-palette-fill-hover-whiten: 50% !default;
|
|
16
|
-
$cx-default-palette-fill-selected-whiten: 20% !default;
|
|
17
|
-
$cx-default-palette-fill-disabled-whiten: 90% !default;
|
|
18
|
-
|
|
19
|
-
$cx-default-palette-fill-blacken: 0% !default;
|
|
20
|
-
$cx-default-palette-fill-hover-blacken: 0% !default;
|
|
21
|
-
$cx-default-palette-fill-selected-blacken: 0% !default;
|
|
22
|
-
$cx-default-palette-fill-disabled-blacken: 0% !default;
|
|
23
|
-
|
|
24
|
-
$cx-default-palette-stroke-whiten: 0% !default;
|
|
25
|
-
$cx-default-palette-stroke-blacken: 10% !default;
|
|
26
|
-
|
|
27
7
|
@mixin cx-palette(
|
|
28
8
|
$palette-colors: $cx-default-palette-colors,
|
|
29
9
|
$palette-fill-whiten: $cx-default-palette-fill-whiten,
|
|
@@ -46,8 +26,8 @@ $cx-default-palette-stroke-blacken: 10% !default;
|
|
|
46
26
|
$c: list.nth($palette-colors, 1 + (($i - 1) * 1) % list.length($palette-colors));
|
|
47
27
|
|
|
48
28
|
.#{$state}color-#{$i - 1} {
|
|
49
|
-
$fill: cx-
|
|
50
|
-
$stroke: cx-
|
|
29
|
+
$fill: cx-darken(cx-lighten($c, $palette-fill-whiten), $palette-fill-blacken);
|
|
30
|
+
$stroke: cx-darken(cx-lighten($fill, $palette-stroke-whiten), $palette-stroke-blacken);
|
|
51
31
|
fill: $fill;
|
|
52
32
|
stroke: $stroke;
|
|
53
33
|
background: $fill;
|
|
@@ -57,8 +37,8 @@ $cx-default-palette-stroke-blacken: 10% !default;
|
|
|
57
37
|
&.#{$state}selectable.#{$state}hover,
|
|
58
38
|
.#{$state}color-root:hover &,
|
|
59
39
|
.#{$state}color-root.#{$state}hover & {
|
|
60
|
-
$fill: cx-
|
|
61
|
-
$stroke: cx-
|
|
40
|
+
$fill: cx-darken(cx-lighten($c, $palette-fill-hover-whiten), $palette-fill-hover-blacken);
|
|
41
|
+
$stroke: cx-darken(cx-lighten($fill, $palette-stroke-whiten), $palette-stroke-blacken);
|
|
62
42
|
fill: $fill;
|
|
63
43
|
stroke: $stroke;
|
|
64
44
|
background: $fill;
|
|
@@ -71,8 +51,8 @@ $cx-default-palette-stroke-blacken: 10% !default;
|
|
|
71
51
|
.#{$state}color-root.#{$state}selected &,
|
|
72
52
|
.#{$state}color-root.#{$state}selected:hover &,
|
|
73
53
|
.#{$state}color-root.#{$state}selected.#{$state}hover & {
|
|
74
|
-
$fill: cx-
|
|
75
|
-
$stroke: cx-
|
|
54
|
+
$fill: cx-darken(cx-lighten($c, $palette-fill-selected-whiten), $palette-fill-selected-blacken);
|
|
55
|
+
$stroke: cx-darken(cx-lighten($fill, $palette-stroke-whiten), $palette-stroke-blacken);
|
|
76
56
|
fill: $fill;
|
|
77
57
|
stroke: $stroke;
|
|
78
58
|
background: $fill;
|
|
@@ -81,8 +61,8 @@ $cx-default-palette-stroke-blacken: 10% !default;
|
|
|
81
61
|
|
|
82
62
|
&.#{$state}disabled,
|
|
83
63
|
.#{$state}color-root.#{$state}disabled & {
|
|
84
|
-
$fill: cx-
|
|
85
|
-
$stroke: cx-
|
|
64
|
+
$fill: cx-darken(cx-lighten($c, $palette-fill-disabled-whiten), $palette-fill-disabled-blacken);
|
|
65
|
+
$stroke: cx-darken(cx-lighten($fill, $palette-stroke-whiten), $palette-stroke-blacken);
|
|
86
66
|
fill: $fill;
|
|
87
67
|
stroke: $stroke;
|
|
88
68
|
background: $fill;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//https://www.materialui.co/colors
|
|
2
|
+
//normal:200 900
|
|
3
|
+
//hover:100 700
|
|
4
|
+
//selected: 300 900
|
|
5
|
+
//disabled: 0 100
|
|
6
|
+
|
|
7
|
+
$cx-default-palette-colors: rgba(244, 67, 54, 1) rgba(233, 30, 99, 1) rgba(156, 39, 176, 1) rgba(103, 58, 183, 1)
|
|
8
|
+
rgba(63, 81, 181, 1) rgba(33, 150, 243, 1) rgba(3, 169, 244, 1) rgba(0, 188, 212, 1) rgba(0, 150, 136, 1)
|
|
9
|
+
rgba(76, 175, 80, 1) rgba(139, 195, 74, 1) rgba(205, 220, 57, 1) rgba(255, 235, 59, 1) rgba(255, 193, 7, 1)
|
|
10
|
+
rgba(255, 152, 0, 1) rgba(255, 87, 34, 1) !default;
|
|
11
|
+
|
|
12
|
+
$cx-default-palette-fill-whiten: 60% !default;
|
|
13
|
+
$cx-default-palette-fill-hover-whiten: 50% !default;
|
|
14
|
+
$cx-default-palette-fill-selected-whiten: 20% !default;
|
|
15
|
+
$cx-default-palette-fill-disabled-whiten: 90% !default;
|
|
16
|
+
|
|
17
|
+
$cx-default-palette-fill-blacken: 0% !default;
|
|
18
|
+
$cx-default-palette-fill-hover-blacken: 0% !default;
|
|
19
|
+
$cx-default-palette-fill-selected-blacken: 0% !default;
|
|
20
|
+
$cx-default-palette-fill-disabled-blacken: 0% !default;
|
|
21
|
+
|
|
22
|
+
$cx-default-palette-stroke-whiten: 0% !default;
|
|
23
|
+
$cx-default-palette-stroke-blacken: 10% !default;
|
|
@@ -1,8 +1,40 @@
|
|
|
1
|
+
@forward "axis/variables";
|
|
2
|
+
@forward "palette.variables";
|
|
1
3
|
@use "sass:map";
|
|
2
|
-
@import "axis/variables";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
@use "../util/scss/include.scss" as *;
|
|
6
|
+
|
|
7
|
+
$cx-default-swimlanes-lane-background-color: #f1f1f1 !default;
|
|
8
|
+
$cx-default-range-marker-color: #696969 !default;
|
|
9
|
+
$cx-default-chart-gridline-color: rgba(128, 128, 128, 0.15) !default;
|
|
10
|
+
|
|
11
|
+
// Shape defaults (bars, columns, pie slices)
|
|
12
|
+
$cx-default-chart-shape-fill-color: #eee !default;
|
|
13
|
+
$cx-default-chart-shape-stroke-color: #ccc !default;
|
|
14
|
+
$cx-default-chart-shape-stroke-width: 1px !default;
|
|
15
|
+
$cx-default-chart-selected-stroke-width: 2px !default;
|
|
16
|
+
|
|
17
|
+
// Line defaults
|
|
18
|
+
$cx-default-chart-line-stroke-color: gray !default;
|
|
19
|
+
$cx-default-chart-line-stroke-width: 2px !default;
|
|
20
|
+
$cx-default-chart-area-opacity: 0.5 !default;
|
|
21
|
+
|
|
22
|
+
// Marker defaults (markers, scatter, bubble)
|
|
23
|
+
$cx-default-chart-marker-color: rgb(128, 128, 128) !default;
|
|
24
|
+
$cx-default-chart-marker-stroke-width: 1px !default;
|
|
25
|
+
$cx-default-chart-markerline-stroke-width: 1px !default;
|
|
26
|
+
|
|
27
|
+
// Range defaults
|
|
28
|
+
$cx-default-chart-range-fill-color: lightgray !default;
|
|
29
|
+
$cx-default-chart-range-opacity: 0.3 !default;
|
|
30
|
+
|
|
31
|
+
// Legend defaults
|
|
32
|
+
$cx-default-chart-legend-font-size: smaller !default;
|
|
33
|
+
$cx-default-chart-legend-padding: 5px !default;
|
|
34
|
+
$cx-default-chart-legend-gap: 5px 10px !default;
|
|
35
|
+
$cx-default-chart-legend-entry-gap: 5px !default;
|
|
36
|
+
$cx-default-chart-legend-shape-color: rgba(128, 128, 128, 0.1) !default;
|
|
37
|
+
$cx-default-chart-legend-shape-stroke-width: 1px !default;
|
|
6
38
|
|
|
7
39
|
$cx-dependencies: map.merge(
|
|
8
40
|
$cx-dependencies,
|
|
@@ -38,8 +38,8 @@ function getSelectorConfig(props: any, values: any, nameMap: any) {
|
|
|
38
38
|
constants[p] = null;
|
|
39
39
|
} else if (typeof v == "object") {
|
|
40
40
|
if (v.bind) {
|
|
41
|
-
|
|
42
|
-
if (isDefined(
|
|
41
|
+
const dv = isDefined(v.defaultValue) ? v.defaultValue : (v != pv ? defaultValue(pv) : undefined);
|
|
42
|
+
if (isDefined(dv)) defaultValues[v.bind] = dv;
|
|
43
43
|
nameMap[p] = v.bind;
|
|
44
44
|
functions[p] = Binding.get(v.bind).value;
|
|
45
45
|
constant = false;
|
|
@@ -1,74 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
nameOf
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
toString(): string;
|
|
18
|
-
valueOf(): M | undefined;
|
|
19
|
-
nameOf(): string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return proxy as unknown as AccessorChain<M>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export const createModel = createAccessorModelProxy;
|
|
71
|
-
|
|
72
|
-
export function isAccessorChain<M>(value: unknown): value is AccessorChain<M> {
|
|
73
|
-
return value != null && !!(value as any).isAccessorChain;
|
|
74
|
-
}
|
|
1
|
+
// Homomorphic mapped type preserves Go-to-Definition in IDEs
|
|
2
|
+
// -? strips optionality, as clause filters conflicting method names
|
|
3
|
+
type AccessorChainMap<M> = {
|
|
4
|
+
[K in keyof M as Exclude<K, "toString" | "valueOf" | "nameOf">]-?: AccessorChain<M[K]>;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// Check if a type is `any` using the intersection trick
|
|
8
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
9
|
+
|
|
10
|
+
export type AccessorChain<M> = (IsAny<M> extends true
|
|
11
|
+
? { [key: string]: any } // Allow any property access for `any` type
|
|
12
|
+
: [M] extends [object]
|
|
13
|
+
? AccessorChainMap<M> // Direct mapping preserves IDE navigation
|
|
14
|
+
: [NonNullable<M>] extends [object]
|
|
15
|
+
? AccessorChainMap<NonNullable<M>> // Fallback for nullable types (e.g. optional properties)
|
|
16
|
+
: {}) & {
|
|
17
|
+
toString(): string;
|
|
18
|
+
valueOf(): M | undefined;
|
|
19
|
+
nameOf(): string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const emptyFn = () => {};
|
|
23
|
+
|
|
24
|
+
export function createAccessorModelProxy<M>(chain: string = ""): AccessorChain<M> {
|
|
25
|
+
let lastOp: string | null = null;
|
|
26
|
+
|
|
27
|
+
const proxy = new Proxy(emptyFn, {
|
|
28
|
+
get: (_, name: string | symbol) => {
|
|
29
|
+
if (typeof name !== "string") return proxy;
|
|
30
|
+
|
|
31
|
+
switch (name) {
|
|
32
|
+
case "isAccessorChain":
|
|
33
|
+
return true;
|
|
34
|
+
|
|
35
|
+
case "toString":
|
|
36
|
+
case "valueOf":
|
|
37
|
+
case "nameOf":
|
|
38
|
+
lastOp = name;
|
|
39
|
+
return proxy;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
let newChain = chain;
|
|
43
|
+
if (newChain.length > 0) newChain += ".";
|
|
44
|
+
newChain += name;
|
|
45
|
+
return createAccessorModelProxy(newChain);
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
apply(): string {
|
|
49
|
+
switch (lastOp) {
|
|
50
|
+
case "nameOf":
|
|
51
|
+
const lastDotIndex = chain.lastIndexOf(".");
|
|
52
|
+
return lastDotIndex > 0 ? chain.substring(lastDotIndex + 1) : chain;
|
|
53
|
+
|
|
54
|
+
default:
|
|
55
|
+
return chain;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
return proxy as unknown as AccessorChain<M>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const createModel = createAccessorModelProxy;
|
|
63
|
+
|
|
64
|
+
export function isAccessorChain<M>(value: unknown): value is AccessorChain<M> {
|
|
65
|
+
return value != null && !!(value as any).isAccessorChain;
|
|
66
|
+
}
|
package/src/index.scss
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@import "charts/index";
|
|
1
|
+
@use "./util/index" as *;
|
|
2
|
+
@use "./ui/index" as *;
|
|
3
|
+
@use "./widgets/index" as *;
|
|
4
|
+
@use "./svg/index" as *;
|
|
5
|
+
@use "./charts/index" as *;
|
package/src/maps.scss
ADDED
package/src/svg/Ellipse.tsx
CHANGED
|
@@ -1,69 +1,76 @@
|
|
|
1
1
|
/**@jsxImportSource react */
|
|
2
|
-
import { Instance } from
|
|
3
|
-
import { RenderingContext } from
|
|
4
|
-
import { Widget } from
|
|
5
|
-
import { NumberProp, StringProp } from
|
|
6
|
-
import {
|
|
2
|
+
import { Instance } from "../ui/Instance";
|
|
3
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
4
|
+
import { Widget } from "../ui/Widget";
|
|
5
|
+
import { NumberProp, StringProp } from "../ui/Prop";
|
|
6
|
+
import {
|
|
7
|
+
TextualBoundedObject,
|
|
8
|
+
TextualBoundedObjectConfig,
|
|
9
|
+
} from "./TextualBoundedObject";
|
|
7
10
|
|
|
8
11
|
export interface EllipseConfig extends TextualBoundedObjectConfig {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Index of the color in the default color palette. Setting this property will set
|
|
14
|
+
* both fill and stroke on the object. Use `style` or a CSS class to remove stroke or fill
|
|
15
|
+
* if they are not necessary.
|
|
16
|
+
*/
|
|
17
|
+
colorIndex?: NumberProp;
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
/** A color used to paint the box. */
|
|
20
|
+
fill?: StringProp;
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
/** A color used to paint the outline of the box. */
|
|
23
|
+
stroke?: StringProp;
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
/** Base CSS class to be applied to the element. Defaults to `ellipse`. */
|
|
26
|
+
baseClass?: string;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
export class Ellipse extends TextualBoundedObject {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
declare baseClass: string;
|
|
31
|
+
declare colorIndex?: NumberProp;
|
|
32
|
+
declare fill?: StringProp;
|
|
33
|
+
declare stroke?: StringProp;
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fill: undefined,
|
|
36
|
-
stroke: undefined,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
35
|
+
constructor(config?: EllipseConfig) {
|
|
36
|
+
super(config);
|
|
37
|
+
}
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
39
|
+
declareData(...args: any[]) {
|
|
40
|
+
super.declareData(...args, {
|
|
41
|
+
colorIndex: undefined,
|
|
42
|
+
fill: undefined,
|
|
43
|
+
stroke: undefined,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
render(context: RenderingContext, instance: Instance, key: string) {
|
|
48
|
+
const { data } = instance;
|
|
49
|
+
const { bounds, colorIndex } = data;
|
|
50
|
+
if (!bounds.valid()) return false;
|
|
51
|
+
return (
|
|
52
|
+
<g key={key} className={data.classNames}>
|
|
53
|
+
<ellipse
|
|
54
|
+
className={this.CSS.element(
|
|
55
|
+
this.baseClass,
|
|
56
|
+
"rect",
|
|
57
|
+
colorIndex != null && "color-" + colorIndex,
|
|
58
|
+
)}
|
|
59
|
+
cx={(bounds.l + bounds.r) / 2}
|
|
60
|
+
cy={(bounds.t + bounds.b) / 2}
|
|
61
|
+
rx={bounds.width() / 2}
|
|
62
|
+
ry={bounds.height() / 2}
|
|
63
|
+
style={data.style}
|
|
64
|
+
fill={data.fill}
|
|
65
|
+
stroke={data.stroke}
|
|
66
|
+
/>
|
|
67
|
+
{this.renderChildren(context, instance)}
|
|
68
|
+
</g>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
64
71
|
}
|
|
65
72
|
|
|
66
|
-
Ellipse.prototype.baseClass =
|
|
67
|
-
Ellipse.prototype.anchors =
|
|
73
|
+
Ellipse.prototype.baseClass = "ellipse";
|
|
74
|
+
Ellipse.prototype.anchors = "0 1 1 0";
|
|
68
75
|
|
|
69
|
-
Widget.alias(
|
|
76
|
+
Widget.alias("ellipse", Ellipse);
|