cx 26.0.1 → 26.0.2
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/Bar.d.ts +29 -0
- package/build/charts/Bar.js +74 -0
- package/build/charts/BarGraph.d.ts +29 -0
- package/build/charts/BarGraph.js +86 -0
- package/build/charts/BubbleGraph.d.ts +54 -0
- package/build/charts/BubbleGraph.js +80 -0
- package/build/charts/Chart.d.ts +31 -0
- package/build/charts/Chart.js +62 -0
- package/build/charts/ColorMap.d.ts +59 -0
- package/build/charts/ColorMap.js +97 -0
- package/build/charts/Column.d.ts +32 -0
- package/build/charts/Column.js +81 -0
- package/build/charts/ColumnBarBase.d.ts +92 -0
- package/build/charts/ColumnBarBase.js +144 -0
- package/build/charts/ColumnBarGraphBase.d.ts +91 -0
- package/build/charts/ColumnBarGraphBase.js +106 -0
- package/build/charts/ColumnGraph.d.ts +30 -0
- package/build/charts/ColumnGraph.js +94 -0
- package/build/charts/Grid.d.ts +2 -0
- package/build/charts/Grid.js +3 -0
- package/build/charts/Gridlines.d.ts +34 -0
- package/build/charts/Gridlines.js +42 -0
- package/build/charts/Legend.d.ts +73 -0
- package/build/charts/Legend.js +138 -0
- package/build/charts/LegendEntry.d.ts +60 -0
- package/build/charts/LegendEntry.js +101 -0
- package/build/charts/LineGraph.d.ts +111 -0
- package/build/charts/LineGraph.js +253 -0
- package/build/charts/Marker.d.ts +133 -0
- package/build/charts/Marker.js +275 -0
- package/build/charts/MarkerLine.d.ts +65 -0
- package/build/charts/MarkerLine.js +108 -0
- package/build/charts/MouseTracker.d.ts +34 -0
- package/build/charts/MouseTracker.js +55 -0
- package/build/charts/Pie.d.ts +4 -0
- package/build/charts/Pie.js +5 -0
- package/build/charts/PieChart.d.ts +158 -0
- package/build/charts/PieChart.js +445 -0
- package/build/charts/PieLabel.d.ts +34 -0
- package/build/charts/PieLabel.js +47 -0
- package/build/charts/PieLabelsContainer.d.ts +15 -0
- package/build/charts/PieLabelsContainer.js +54 -0
- package/build/charts/Range.d.ts +94 -0
- package/build/charts/Range.js +160 -0
- package/build/charts/RangeMarker.d.ts +65 -0
- package/build/charts/RangeMarker.js +143 -0
- package/build/charts/ScatterGraph.d.ts +72 -0
- package/build/charts/ScatterGraph.js +133 -0
- package/build/charts/Swimlane.d.ts +47 -0
- package/build/charts/Swimlane.js +113 -0
- package/build/charts/Swimlanes.d.ts +57 -0
- package/build/charts/Swimlanes.js +83 -0
- package/build/charts/axis/Axis.d.ts +141 -0
- package/build/charts/axis/Axis.js +215 -0
- package/build/charts/axis/CategoryAxis.d.ts +35 -0
- package/build/charts/axis/CategoryAxis.js +240 -0
- package/build/charts/axis/NumericAxis.d.ts +57 -0
- package/build/charts/axis/NumericAxis.js +316 -0
- package/build/charts/axis/Stack.d.ts +16 -0
- package/build/charts/axis/Stack.js +57 -0
- package/build/charts/axis/TimeAxis.d.ts +50 -0
- package/build/charts/axis/TimeAxis.js +554 -0
- package/build/charts/axis/index.d.ts +4 -0
- package/build/charts/axis/index.js +4 -0
- package/build/charts/helpers/MinMaxFinder.d.ts +36 -0
- package/build/charts/helpers/MinMaxFinder.js +37 -0
- package/build/charts/helpers/PointReducer.d.ts +41 -0
- package/build/charts/helpers/PointReducer.js +55 -0
- package/build/charts/helpers/SnapPointFinder.d.ts +58 -0
- package/build/charts/helpers/SnapPointFinder.js +65 -0
- package/build/charts/helpers/ValueAtFinder.d.ts +33 -0
- package/build/charts/helpers/ValueAtFinder.js +46 -0
- package/build/charts/helpers/index.d.ts +4 -0
- package/build/charts/helpers/index.js +4 -0
- package/build/charts/index.d.ts +26 -0
- package/build/charts/index.js +26 -0
- package/build/charts/shapes.d.ts +13 -0
- package/build/charts/shapes.js +62 -0
- package/build/data/AggregateFunction.d.ts +60 -0
- package/build/data/AggregateFunction.js +155 -0
- package/build/data/ArrayElementView.d.ts +33 -0
- package/build/data/ArrayElementView.js +65 -0
- package/build/data/ArrayElementView.spec.d.ts +1 -0
- package/build/data/ArrayElementView.spec.js +81 -0
- package/build/data/ArrayRef.d.ts +9 -0
- package/build/data/ArrayRef.js +29 -0
- package/build/data/AugmentedViewBase.d.ts +18 -0
- package/build/data/AugmentedViewBase.js +72 -0
- package/build/data/Binding.d.ts +23 -0
- package/build/data/Binding.js +78 -0
- package/build/data/Binding.spec.d.ts +1 -0
- package/build/data/Binding.spec.js +61 -0
- package/build/data/ExposedRecordView.d.ts +24 -0
- package/build/data/ExposedRecordView.js +76 -0
- package/build/data/ExposedValueView.d.ts +20 -0
- package/build/data/ExposedValueView.js +68 -0
- package/build/data/Expression.d.ts +12 -0
- package/build/data/Expression.js +201 -0
- package/build/data/Expression.spec.d.ts +1 -0
- package/build/data/Expression.spec.js +196 -0
- package/build/data/Grouper.d.ts +29 -0
- package/build/data/Grouper.js +138 -0
- package/build/data/Grouper.spec.d.ts +1 -0
- package/build/data/Grouper.spec.js +48 -0
- package/build/data/NestedDataView.d.ts +21 -0
- package/build/data/NestedDataView.js +24 -0
- package/build/data/ReadOnlyDataView.d.ts +13 -0
- package/build/data/ReadOnlyDataView.js +25 -0
- package/build/data/Ref.d.ts +23 -0
- package/build/data/Ref.js +79 -0
- package/build/data/Ref.spec.d.ts +1 -0
- package/build/data/Ref.spec.js +72 -0
- package/build/data/Selector.d.ts +8 -0
- package/build/data/Selector.js +1 -0
- package/build/data/Store.d.ts +12 -0
- package/build/data/Store.js +41 -0
- package/build/data/Store.spec.d.ts +1 -0
- package/build/data/Store.spec.js +19 -0
- package/build/data/StoreProxy.d.ts +6 -0
- package/build/data/StoreProxy.js +14 -0
- package/build/data/StoreRef.d.ts +22 -0
- package/build/data/StoreRef.js +47 -0
- package/build/data/StoreRef.spec.d.ts +1 -0
- package/build/data/StoreRef.spec.js +22 -0
- package/build/data/StringTemplate.d.ts +9 -0
- package/build/data/StringTemplate.js +81 -0
- package/build/data/StringTemplate.spec.d.ts +1 -0
- package/build/data/StringTemplate.spec.js +112 -0
- package/build/data/StructuredSelector.d.ts +12 -0
- package/build/data/StructuredSelector.js +131 -0
- package/build/data/StructuredSelector.spec.d.ts +1 -0
- package/build/data/StructuredSelector.spec.js +102 -0
- package/build/data/SubscribableView.d.ts +15 -0
- package/build/data/SubscribableView.js +52 -0
- package/build/data/View.d.ts +125 -0
- package/build/data/View.js +163 -0
- package/build/data/View.spec.d.ts +1 -0
- package/build/data/View.spec.js +44 -0
- package/build/data/ZoomIntoPropertyView.d.ts +15 -0
- package/build/data/ZoomIntoPropertyView.js +34 -0
- package/build/data/ZoomIntoPropertyView.spec.d.ts +1 -0
- package/build/data/ZoomIntoPropertyView.spec.js +54 -0
- package/build/data/comparer.d.ts +11 -0
- package/build/data/comparer.js +55 -0
- package/build/data/comparer.spec.d.ts +1 -0
- package/build/data/comparer.spec.js +50 -0
- package/build/data/computable.d.ts +10 -0
- package/build/data/computable.js +46 -0
- package/build/data/computable.spec.d.ts +1 -0
- package/build/data/computable.spec.js +56 -0
- package/build/data/createAccessorModelProxy.d.ts +17 -0
- package/build/data/createAccessorModelProxy.js +37 -0
- package/build/data/createAccessorModelProxy.spec.d.ts +1 -0
- package/build/data/createAccessorModelProxy.spec.js +30 -0
- package/build/data/createStructuredSelector.d.ts +9 -0
- package/build/data/createStructuredSelector.js +40 -0
- package/build/data/createStructuredSelector.spec.d.ts +1 -0
- package/build/data/createStructuredSelector.spec.js +42 -0
- package/build/data/defaultCompare.d.ts +1 -0
- package/build/data/defaultCompare.js +12 -0
- package/build/data/diff/diffArrays.d.ts +12 -0
- package/build/data/diff/diffArrays.js +34 -0
- package/build/data/diff/diffs.spec.d.ts +1 -0
- package/build/data/diff/diffs.spec.js +45 -0
- package/build/data/diff/index.d.ts +1 -0
- package/build/data/diff/index.js +1 -0
- package/build/data/enableFatArrowExpansion.d.ts +1 -0
- package/build/data/enableFatArrowExpansion.js +5 -0
- package/build/data/getAccessor.d.ts +11 -0
- package/build/data/getAccessor.js +51 -0
- package/build/data/getAccessor.spec.d.ts +1 -0
- package/build/data/getAccessor.spec.js +10 -0
- package/build/data/getSelector.d.ts +3 -0
- package/build/data/getSelector.js +60 -0
- package/build/data/getSelector.spec.d.ts +1 -0
- package/build/data/getSelector.spec.js +36 -0
- package/build/data/index.d.ts +29 -0
- package/build/data/index.js +29 -0
- package/build/data/isSelector.d.ts +1 -0
- package/build/data/isSelector.js +19 -0
- package/build/data/ops/append.d.ts +1 -0
- package/build/data/ops/append.js +7 -0
- package/build/data/ops/append.spec.d.ts +1 -0
- package/build/data/ops/append.spec.js +24 -0
- package/build/data/ops/filter.d.ts +1 -0
- package/build/data/ops/filter.js +8 -0
- package/build/data/ops/filter.spec.d.ts +1 -0
- package/build/data/ops/filter.spec.js +25 -0
- package/build/data/ops/findTreeNode.d.ts +1 -0
- package/build/data/ops/findTreeNode.js +13 -0
- package/build/data/ops/findTreeNode.spec.d.ts +1 -0
- package/build/data/ops/findTreeNode.spec.js +20 -0
- package/build/data/ops/findTreePath.d.ts +1 -0
- package/build/data/ops/findTreePath.js +15 -0
- package/build/data/ops/index.d.ts +10 -0
- package/build/data/ops/index.js +10 -0
- package/build/data/ops/insertElement.d.ts +1 -0
- package/build/data/ops/insertElement.js +3 -0
- package/build/data/ops/merge.d.ts +1 -0
- package/build/data/ops/merge.js +10 -0
- package/build/data/ops/merge.spec.d.ts +1 -0
- package/build/data/ops/merge.spec.js +23 -0
- package/build/data/ops/moveElement.d.ts +1 -0
- package/build/data/ops/moveElement.js +20 -0
- package/build/data/ops/removeTreeNodes.d.ts +1 -0
- package/build/data/ops/removeTreeNodes.js +4 -0
- package/build/data/ops/removeTreeNodes.spec.d.ts +1 -0
- package/build/data/ops/removeTreeNodes.spec.js +35 -0
- package/build/data/ops/updateArray.d.ts +1 -0
- package/build/data/ops/updateArray.js +23 -0
- package/build/data/ops/updateArray.spec.d.ts +1 -0
- package/build/data/ops/updateArray.spec.js +33 -0
- package/build/data/ops/updateTree.d.ts +1 -0
- package/build/data/ops/updateTree.js +14 -0
- package/build/data/ops/updateTree.spec.d.ts +1 -0
- package/build/data/ops/updateTree.spec.js +44 -0
- package/build/data/test-types.d.ts +1 -0
- package/build/data/test-types.js +2 -0
- package/build/hooks/createLocalStorageRef.d.ts +2 -0
- package/build/hooks/createLocalStorageRef.js +22 -0
- package/build/hooks/index.d.ts +8 -0
- package/build/hooks/index.js +8 -0
- package/build/hooks/invokeCallback.d.ts +2 -0
- package/build/hooks/invokeCallback.js +8 -0
- package/build/hooks/invokeCallback.spec.d.ts +1 -0
- package/build/hooks/invokeCallback.spec.js +44 -0
- package/build/hooks/resolveCallback.d.ts +2 -0
- package/build/hooks/resolveCallback.js +13 -0
- package/build/hooks/resolveCallback.spec.d.ts +1 -0
- package/build/hooks/resolveCallback.spec.js +35 -0
- package/build/hooks/store.d.ts +11 -0
- package/build/hooks/store.js +38 -0
- package/build/hooks/store.spec.d.ts +1 -0
- package/build/hooks/store.spec.js +48 -0
- package/build/hooks/useEffect.d.ts +2 -0
- package/build/hooks/useEffect.js +13 -0
- package/build/hooks/useInterval.d.ts +1 -0
- package/build/hooks/useInterval.js +7 -0
- package/build/hooks/useState.d.ts +2 -0
- package/build/hooks/useState.js +17 -0
- package/build/hooks/useTrigger.d.ts +3 -0
- package/build/hooks/useTrigger.js +22 -0
- package/build/hooks/useTrigger.spec.d.ts +1 -0
- package/build/hooks/useTrigger.spec.js +59 -0
- package/build/index.d.ts +7 -0
- package/build/index.js +7 -0
- package/build/jsx-runtime.d.ts +31 -0
- package/build/jsx-runtime.js +27 -0
- package/build/locale/de-de.d.ts +1 -0
- package/build/locale/de-de.js +62 -0
- package/build/locale/en-us.d.ts +1 -0
- package/build/locale/en-us.js +62 -0
- package/build/locale/es-es.d.ts +1 -0
- package/build/locale/es-es.js +62 -0
- package/build/locale/fr-fr.d.ts +1 -0
- package/build/locale/fr-fr.js +62 -0
- package/build/locale/nl-nl.d.ts +1 -0
- package/build/locale/nl-nl.js +62 -0
- package/build/locale/pt-pt.d.ts +1 -0
- package/build/locale/pt-pt.js +62 -0
- package/build/locale/sr-latn-ba.d.ts +1 -0
- package/build/locale/sr-latn-ba.js +62 -0
- package/build/svg/BoundedObject.d.ts +39 -0
- package/build/svg/BoundedObject.js +51 -0
- package/build/svg/ClipRect.d.ts +11 -0
- package/build/svg/ClipRect.js +18 -0
- package/build/svg/Ellipse.d.ts +27 -0
- package/build/svg/Ellipse.js +22 -0
- package/build/svg/Line.d.ts +26 -0
- package/build/svg/Line.js +19 -0
- package/build/svg/NonOverlappingRect.d.ts +12 -0
- package/build/svg/NonOverlappingRect.js +17 -0
- package/build/svg/NonOverlappingRectGroup.d.ts +15 -0
- package/build/svg/NonOverlappingRectGroup.js +38 -0
- package/build/svg/Rectangle.d.ts +40 -0
- package/build/svg/Rectangle.js +27 -0
- package/build/svg/Svg.d.ts +49 -0
- package/build/svg/Svg.js +132 -0
- package/build/svg/Text.d.ts +48 -0
- package/build/svg/Text.js +60 -0
- package/build/svg/TextualBoundedObject.d.ts +7 -0
- package/build/svg/TextualBoundedObject.js +22 -0
- package/build/svg/index.d.ts +11 -0
- package/build/svg/index.js +11 -0
- package/build/svg/util/Rect.d.ts +31 -0
- package/build/svg/util/Rect.js +83 -0
- package/build/svg/util/index.d.ts +1 -0
- package/build/svg/util/index.js +1 -0
- package/build/ui/CSS.d.ts +10 -0
- package/build/ui/CSS.js +77 -0
- package/build/ui/CSSHelper.d.ts +5 -0
- package/build/ui/CSSHelper.js +15 -0
- package/build/ui/Container.d.ts +55 -0
- package/build/ui/Container.js +160 -0
- package/build/ui/ContentResolver.d.ts +51 -0
- package/build/ui/ContentResolver.js +71 -0
- package/build/ui/Controller.d.ts +64 -0
- package/build/ui/Controller.js +110 -0
- package/build/ui/Controller.spec.d.ts +1 -0
- package/build/ui/Controller.spec.js +251 -0
- package/build/ui/Culture.d.ts +39 -0
- package/build/ui/Culture.js +124 -0
- package/build/ui/Cx.d.ts +57 -0
- package/build/ui/Cx.js +277 -0
- package/build/ui/Cx.spec.d.ts +1 -0
- package/build/ui/Cx.spec.js +153 -0
- package/build/ui/DataProxy.d.ts +24 -0
- package/build/ui/DataProxy.js +26 -0
- package/build/ui/DataProxy.spec.d.ts +1 -0
- package/build/ui/DataProxy.spec.js +208 -0
- package/build/ui/DetachedScope.d.ts +61 -0
- package/build/ui/DetachedScope.js +84 -0
- package/build/ui/FocusManager.d.ts +16 -0
- package/build/ui/FocusManager.js +149 -0
- package/build/ui/Format.d.ts +4 -0
- package/build/ui/Format.js +96 -0
- package/build/ui/HoverSync.d.ts +30 -0
- package/build/ui/HoverSync.js +129 -0
- package/build/ui/Instance.d.ts +219 -0
- package/build/ui/Instance.js +613 -0
- package/build/ui/IsolatedScope.d.ts +19 -0
- package/build/ui/IsolatedScope.js +31 -0
- package/build/ui/IsolatedScope.spec.d.ts +1 -0
- package/build/ui/IsolatedScope.spec.js +42 -0
- package/build/ui/Localization.d.ts +9 -0
- package/build/ui/Localization.js +63 -0
- package/build/ui/Prop.d.ts +83 -0
- package/build/ui/Prop.js +1 -0
- package/build/ui/PureContainer.d.ts +9 -0
- package/build/ui/PureContainer.js +9 -0
- package/build/ui/RenderingContext.d.ts +19 -0
- package/build/ui/RenderingContext.js +84 -0
- package/build/ui/Repeater.d.ts +73 -0
- package/build/ui/Repeater.js +99 -0
- package/build/ui/Repeater.spec.d.ts +1 -0
- package/build/ui/Repeater.spec.js +109 -0
- package/build/ui/Rescope.d.ts +18 -0
- package/build/ui/Rescope.js +31 -0
- package/build/ui/Rescope.spec.d.ts +1 -0
- package/build/ui/Rescope.spec.js +134 -0
- package/build/ui/ResizeManager.d.ts +5 -0
- package/build/ui/ResizeManager.js +24 -0
- package/build/ui/Restate.d.ts +44 -0
- package/build/ui/Restate.js +142 -0
- package/build/ui/Restate.spec.d.ts +1 -0
- package/build/ui/Restate.spec.js +257 -0
- package/build/ui/StaticText.d.ts +5 -0
- package/build/ui/StaticText.js +7 -0
- package/build/ui/StructuredInstanceDataAccessor.d.ts +13 -0
- package/build/ui/StructuredInstanceDataAccessor.js +30 -0
- package/build/ui/Text.d.ts +10 -0
- package/build/ui/Text.js +21 -0
- package/build/ui/VDOM.d.ts +20 -0
- package/build/ui/VDOM.js +3 -0
- package/build/ui/Widget.d.ts +111 -0
- package/build/ui/Widget.js +170 -0
- package/build/ui/ZIndexManager.d.ts +4 -0
- package/build/ui/ZIndexManager.js +9 -0
- package/build/ui/adapter/ArrayAdapter.d.ts +48 -0
- package/build/ui/adapter/ArrayAdapter.js +148 -0
- package/build/ui/adapter/ArrayAdapter.spec.d.ts +1 -0
- package/build/ui/adapter/ArrayAdapter.spec.js +44 -0
- package/build/ui/adapter/DataAdapter.d.ts +30 -0
- package/build/ui/adapter/DataAdapter.js +13 -0
- package/build/ui/adapter/GroupAdapter.d.ts +57 -0
- package/build/ui/adapter/GroupAdapter.js +137 -0
- package/build/ui/adapter/TreeAdapter.d.ts +51 -0
- package/build/ui/adapter/TreeAdapter.js +98 -0
- package/build/ui/adapter/TreeAdapter.spec.d.ts +1 -0
- package/build/ui/adapter/TreeAdapter.spec.js +71 -0
- package/build/ui/adapter/index.d.ts +4 -0
- package/build/ui/adapter/index.js +4 -0
- package/build/ui/app/History.d.ts +18 -0
- package/build/ui/app/History.js +109 -0
- package/build/ui/app/Url.d.ts +13 -0
- package/build/ui/app/Url.js +86 -0
- package/build/ui/app/Url.spec.d.ts +1 -0
- package/build/ui/app/Url.spec.js +43 -0
- package/build/ui/app/index.d.ts +4 -0
- package/build/ui/app/index.js +4 -0
- package/build/ui/app/startAppLoop.d.ts +10 -0
- package/build/ui/app/startAppLoop.js +53 -0
- package/build/ui/app/startHotAppLoop.d.ts +11 -0
- package/build/ui/app/startHotAppLoop.js +22 -0
- package/build/ui/batchUpdates.d.ts +5 -0
- package/build/ui/batchUpdates.js +60 -0
- package/build/ui/bind.d.ts +3 -0
- package/build/ui/bind.js +7 -0
- package/build/ui/createFunctionalComponent.d.ts +2 -0
- package/build/ui/createFunctionalComponent.js +58 -0
- package/build/ui/createFunctionalComponent.spec.d.ts +1 -0
- package/build/ui/createFunctionalComponent.spec.js +272 -0
- package/build/ui/expr.d.ts +11 -0
- package/build/ui/expr.js +17 -0
- package/build/ui/flattenProps.d.ts +1 -0
- package/build/ui/flattenProps.js +18 -0
- package/build/ui/index.d.ts +40 -0
- package/build/ui/index.js +41 -0
- package/build/ui/keyboardShortcuts.d.ts +10 -0
- package/build/ui/keyboardShortcuts.js +27 -0
- package/build/ui/layout/Content.d.ts +14 -0
- package/build/ui/layout/Content.js +15 -0
- package/build/ui/layout/ContentPlaceholder.d.ts +35 -0
- package/build/ui/layout/ContentPlaceholder.js +105 -0
- package/build/ui/layout/ContentPlaceholder.spec.d.ts +1 -0
- package/build/ui/layout/ContentPlaceholder.spec.js +333 -0
- package/build/ui/layout/FirstVisibleChildLayout.d.ts +7 -0
- package/build/ui/layout/FirstVisibleChildLayout.js +58 -0
- package/build/ui/layout/FirstVisibleChildLayout.spec.d.ts +1 -0
- package/build/ui/layout/FirstVisibleChildLayout.spec.js +101 -0
- package/build/ui/layout/LabelsLeftLayout.d.ts +17 -0
- package/build/ui/layout/LabelsLeftLayout.js +50 -0
- package/build/ui/layout/LabelsTopLayout.d.ts +36 -0
- package/build/ui/layout/LabelsTopLayout.js +97 -0
- package/build/ui/layout/UseParentLayout.d.ts +4 -0
- package/build/ui/layout/UseParentLayout.js +5 -0
- package/build/ui/layout/exploreChildren.d.ts +4 -0
- package/build/ui/layout/exploreChildren.js +27 -0
- package/build/ui/layout/index.d.ts +7 -0
- package/build/ui/layout/index.js +7 -0
- package/build/ui/selection/KeySelection.d.ts +37 -0
- package/build/ui/selection/KeySelection.js +125 -0
- package/build/ui/selection/PropertySelection.d.ts +26 -0
- package/build/ui/selection/PropertySelection.js +51 -0
- package/build/ui/selection/Selection.d.ts +35 -0
- package/build/ui/selection/Selection.js +75 -0
- package/build/ui/selection/index.d.ts +3 -0
- package/build/ui/selection/index.js +3 -0
- package/build/ui/tpl.d.ts +3 -0
- package/build/ui/tpl.js +5 -0
- package/build/util/Component.d.ts +149 -0
- package/build/util/Component.js +109 -0
- package/build/util/Console.d.ts +4 -0
- package/build/util/Console.js +10 -0
- package/build/util/DOM.d.ts +24 -0
- package/build/util/DOM.js +64 -0
- package/build/util/Debug.d.ts +25 -0
- package/build/util/Debug.js +42 -0
- package/build/util/Format.d.ts +14 -0
- package/build/util/Format.js +229 -0
- package/build/util/Format.spec.d.ts +1 -0
- package/build/util/Format.spec.js +58 -0
- package/build/util/GlobalCacheIdentifier.d.ts +4 -0
- package/build/util/GlobalCacheIdentifier.js +9 -0
- package/build/util/KeyCode.d.ts +21 -0
- package/build/util/KeyCode.js +21 -0
- package/build/util/SubscriberList.d.ts +39 -0
- package/build/util/SubscriberList.js +70 -0
- package/build/util/Timing.d.ts +15 -0
- package/build/util/Timing.js +49 -0
- package/build/util/TraversalStack.d.ts +8 -0
- package/build/util/TraversalStack.js +37 -0
- package/build/util/TraversalStack.spec.d.ts +1 -0
- package/build/util/TraversalStack.spec.js +43 -0
- package/build/util/addEventListenerWithOptions.d.ts +17 -0
- package/build/util/addEventListenerWithOptions.js +8 -0
- package/build/util/browserSupportsPassiveEventHandlers.d.ts +5 -0
- package/build/util/browserSupportsPassiveEventHandlers.js +20 -0
- package/build/util/calculateNaturalElementHeight.d.ts +1 -0
- package/build/util/calculateNaturalElementHeight.js +24 -0
- package/build/util/capitalize.d.ts +1 -0
- package/build/util/capitalize.js +5 -0
- package/build/util/coalesce.d.ts +1 -0
- package/build/util/coalesce.js +7 -0
- package/build/util/color/hslToRgb.d.ts +8 -0
- package/build/util/color/hslToRgb.js +38 -0
- package/build/util/color/index.d.ts +4 -0
- package/build/util/color/index.js +4 -0
- package/build/util/color/parseColor.d.ts +57 -0
- package/build/util/color/parseColor.js +114 -0
- package/build/util/color/rgbToHex.d.ts +8 -0
- package/build/util/color/rgbToHex.js +14 -0
- package/build/util/color/rgbToHsl.d.ts +8 -0
- package/build/util/color/rgbToHsl.js +35 -0
- package/build/util/date/dateDiff.d.ts +7 -0
- package/build/util/date/dateDiff.js +10 -0
- package/build/util/date/diff.d.ts +7 -0
- package/build/util/date/diff.js +11 -0
- package/build/util/date/encodeDate.d.ts +1 -0
- package/build/util/date/encodeDate.js +7 -0
- package/build/util/date/encodeDateWithTimezoneOffset.d.ts +1 -0
- package/build/util/date/encodeDateWithTimezoneOffset.js +16 -0
- package/build/util/date/index.d.ts +11 -0
- package/build/util/date/index.js +11 -0
- package/build/util/date/lowerBoundCheck.d.ts +8 -0
- package/build/util/date/lowerBoundCheck.js +12 -0
- package/build/util/date/maxDate.d.ts +6 -0
- package/build/util/date/maxDate.js +13 -0
- package/build/util/date/minDate.d.ts +6 -0
- package/build/util/date/minDate.js +13 -0
- package/build/util/date/monthStart.d.ts +6 -0
- package/build/util/date/monthStart.js +8 -0
- package/build/util/date/parseDateInvariant.d.ts +2 -0
- package/build/util/date/parseDateInvariant.js +18 -0
- package/build/util/date/sameDate.d.ts +7 -0
- package/build/util/date/sameDate.js +11 -0
- package/build/util/date/upperBoundCheck.d.ts +8 -0
- package/build/util/date/upperBoundCheck.js +12 -0
- package/build/util/date/upperBoundCheck.spec.d.ts +1 -0
- package/build/util/date/upperBoundCheck.spec.js +22 -0
- package/build/util/date/zeroTime.d.ts +7 -0
- package/build/util/date/zeroTime.js +9 -0
- package/build/util/debounce.d.ts +5 -0
- package/build/util/debounce.js +15 -0
- package/build/util/dummyCallback.d.ts +1 -0
- package/build/util/dummyCallback.js +1 -0
- package/build/util/escapeSpecialRegexCharacters.d.ts +6 -0
- package/build/util/escapeSpecialRegexCharacters.js +8 -0
- package/build/util/eventCallbacks.d.ts +7 -0
- package/build/util/eventCallbacks.js +6 -0
- package/build/util/expandFatArrows.d.ts +1 -0
- package/build/util/expandFatArrows.js +104 -0
- package/build/util/findScrollableParent.d.ts +1 -0
- package/build/util/findScrollableParent.js +16 -0
- package/build/util/getActiveElement.d.ts +1 -0
- package/build/util/getActiveElement.js +4 -0
- package/build/util/getParentFrameBoundingClientRect.d.ts +1 -0
- package/build/util/getParentFrameBoundingClientRect.js +13 -0
- package/build/util/getScrollerBoundingClientRect.d.ts +1 -0
- package/build/util/getScrollerBoundingClientRect.js +10 -0
- package/build/util/getSearchQueryPredicate.d.ts +2 -0
- package/build/util/getSearchQueryPredicate.js +54 -0
- package/build/util/getSearchQueryPredicate.spec.d.ts +1 -0
- package/build/util/getSearchQueryPredicate.spec.js +33 -0
- package/build/util/getTopLevelBoundingClientRect.d.ts +1 -0
- package/build/util/getTopLevelBoundingClientRect.js +6 -0
- package/build/util/getVendorPrefix.d.ts +1 -0
- package/build/util/getVendorPrefix.js +22 -0
- package/build/util/hasKey.d.ts +4 -0
- package/build/util/hasKey.js +14 -0
- package/build/util/index.d.ts +55 -0
- package/build/util/index.js +55 -0
- package/build/util/innerTextTrim.d.ts +6 -0
- package/build/util/innerTextTrim.js +10 -0
- package/build/util/isArray.d.ts +1 -0
- package/build/util/isArray.js +3 -0
- package/build/util/isDataRecord.d.ts +1 -0
- package/build/util/isDataRecord.js +4 -0
- package/build/util/isDefined.d.ts +1 -0
- package/build/util/isDefined.js +3 -0
- package/build/util/isDigit.d.ts +6 -0
- package/build/util/isDigit.js +8 -0
- package/build/util/isFunction.d.ts +1 -0
- package/build/util/isFunction.js +3 -0
- package/build/util/isNonEmptyArray.d.ts +1 -0
- package/build/util/isNonEmptyArray.js +3 -0
- package/build/util/isNumber.d.ts +1 -0
- package/build/util/isNumber.js +3 -0
- package/build/util/isObject.d.ts +1 -0
- package/build/util/isObject.js +3 -0
- package/build/util/isPromise.d.ts +1 -0
- package/build/util/isPromise.js +5 -0
- package/build/util/isString.d.ts +1 -0
- package/build/util/isString.js +3 -0
- package/build/util/isTextInputElement.d.ts +1 -0
- package/build/util/isTextInputElement.js +3 -0
- package/build/util/isTouchDevice.d.ts +1 -0
- package/build/util/isTouchDevice.js +6 -0
- package/build/util/isTouchEvent.d.ts +2 -0
- package/build/util/isTouchEvent.js +43 -0
- package/build/util/isUndefined.d.ts +1 -0
- package/build/util/isUndefined.js +3 -0
- package/build/util/isValidIdentifierName.d.ts +1 -0
- package/build/util/isValidIdentifierName.js +4 -0
- package/build/util/isValidIdentifierName.spec.d.ts +1 -0
- package/build/util/isValidIdentifierName.spec.js +28 -0
- package/build/util/onIdleCallback.d.ts +1 -0
- package/build/util/onIdleCallback.js +13 -0
- package/build/util/parseStyle.d.ts +2 -0
- package/build/util/parseStyle.js +22 -0
- package/build/util/quote.d.ts +2 -0
- package/build/util/quote.js +5 -0
- package/build/util/reverseSlice.d.ts +1 -0
- package/build/util/reverseSlice.js +10 -0
- package/build/util/routeAppend.d.ts +1 -0
- package/build/util/routeAppend.js +16 -0
- package/build/util/routeAppend.spec.d.ts +1 -0
- package/build/util/routeAppend.spec.js +14 -0
- package/build/util/scrollElementIntoView.d.ts +1 -0
- package/build/util/scrollElementIntoView.js +28 -0
- package/build/util/shallowEquals.d.ts +1 -0
- package/build/util/shallowEquals.js +30 -0
- package/build/util/test/createTestRenderer.d.ts +5 -0
- package/build/util/test/createTestRenderer.js +10 -0
- package/build/util/throttle.d.ts +9 -0
- package/build/util/throttle.js +19 -0
- package/build/util/validatedDebounce.d.ts +3 -0
- package/build/util/validatedDebounce.js +18 -0
- package/build/widgets/AccessorBindings.spec.d.ts +1 -0
- package/build/widgets/AccessorBindings.spec.js +40 -0
- package/build/widgets/Button.d.ts +57 -0
- package/build/widgets/Button.js +105 -0
- package/build/widgets/CxCredit.d.ts +11 -0
- package/build/widgets/CxCredit.js +25 -0
- package/build/widgets/DocumentTitle.d.ts +27 -0
- package/build/widgets/DocumentTitle.js +57 -0
- package/build/widgets/FlexBox.d.ts +79 -0
- package/build/widgets/FlexBox.js +77 -0
- package/build/widgets/Heading.d.ts +16 -0
- package/build/widgets/Heading.js +24 -0
- package/build/widgets/HighlightedSearchText.d.ts +18 -0
- package/build/widgets/HighlightedSearchText.js +32 -0
- package/build/widgets/HtmlElement.d.ts +46 -0
- package/build/widgets/HtmlElement.js +253 -0
- package/build/widgets/HtmlElement.spec.d.ts +1 -0
- package/build/widgets/HtmlElement.spec.js +38 -0
- package/build/widgets/Icon.d.ts +29 -0
- package/build/widgets/Icon.js +39 -0
- package/build/widgets/List.d.ts +122 -0
- package/build/widgets/List.js +510 -0
- package/build/widgets/ProgressBar.d.ts +20 -0
- package/build/widgets/ProgressBar.js +29 -0
- package/build/widgets/Resizer.d.ts +30 -0
- package/build/widgets/Resizer.js +111 -0
- package/build/widgets/Sandbox.d.ts +40 -0
- package/build/widgets/Sandbox.js +54 -0
- package/build/widgets/Section.d.ts +52 -0
- package/build/widgets/Section.js +93 -0
- package/build/widgets/autoFocus.d.ts +1 -0
- package/build/widgets/autoFocus.js +9 -0
- package/build/widgets/cx.d.ts +2 -0
- package/build/widgets/cx.js +53 -0
- package/build/widgets/drag-drop/DragHandle.d.ts +12 -0
- package/build/widgets/drag-drop/DragHandle.js +23 -0
- package/build/widgets/drag-drop/DragSource.d.ts +55 -0
- package/build/widgets/drag-drop/DragSource.js +135 -0
- package/build/widgets/drag-drop/DropZone.d.ts +103 -0
- package/build/widgets/drag-drop/DropZone.js +173 -0
- package/build/widgets/drag-drop/index.d.ts +4 -0
- package/build/widgets/drag-drop/index.js +4 -0
- package/build/widgets/drag-drop/ops.d.ts +55 -0
- package/build/widgets/drag-drop/ops.js +292 -0
- package/build/widgets/enableAllInternalDependencies.d.ts +1 -0
- package/build/widgets/enableAllInternalDependencies.js +10 -0
- package/build/widgets/form/Calendar.d.ts +130 -0
- package/build/widgets/form/Calendar.js +445 -0
- package/build/widgets/form/Checkbox.d.ts +46 -0
- package/build/widgets/form/Checkbox.js +157 -0
- package/build/widgets/form/ColorField.d.ts +49 -0
- package/build/widgets/form/ColorField.js +310 -0
- package/build/widgets/form/ColorPicker.d.ts +46 -0
- package/build/widgets/form/ColorPicker.js +304 -0
- package/build/widgets/form/DateField.d.ts +8 -0
- package/build/widgets/form/DateField.js +12 -0
- package/build/widgets/form/DateTimeField.d.ts +98 -0
- package/build/widgets/form/DateTimeField.js +474 -0
- package/build/widgets/form/DateTimePicker.d.ts +17 -0
- package/build/widgets/form/DateTimePicker.js +248 -0
- package/build/widgets/form/Field.d.ts +140 -0
- package/build/widgets/form/Field.js +369 -0
- package/build/widgets/form/FieldGroup.d.ts +5 -0
- package/build/widgets/form/FieldGroup.js +5 -0
- package/build/widgets/form/FieldIcon.d.ts +22 -0
- package/build/widgets/form/FieldIcon.js +41 -0
- package/build/widgets/form/HelpText.d.ts +6 -0
- package/build/widgets/form/HelpText.js +10 -0
- package/build/widgets/form/Label.d.ts +27 -0
- package/build/widgets/form/Label.js +74 -0
- package/build/widgets/form/LabeledContainer.d.ts +30 -0
- package/build/widgets/form/LabeledContainer.js +48 -0
- package/build/widgets/form/LookupField.d.ts +124 -0
- package/build/widgets/form/LookupField.js +907 -0
- package/build/widgets/form/MonthField.d.ts +104 -0
- package/build/widgets/form/MonthField.js +423 -0
- package/build/widgets/form/MonthPicker.d.ts +125 -0
- package/build/widgets/form/MonthPicker.js +557 -0
- package/build/widgets/form/NumberField.d.ts +63 -0
- package/build/widgets/form/NumberField.js +361 -0
- package/build/widgets/form/Radio.d.ts +43 -0
- package/build/widgets/form/Radio.js +131 -0
- package/build/widgets/form/Select.d.ts +40 -0
- package/build/widgets/form/Select.js +183 -0
- package/build/widgets/form/Slider.d.ts +68 -0
- package/build/widgets/form/Slider.js +264 -0
- package/build/widgets/form/Switch.d.ts +41 -0
- package/build/widgets/form/Switch.js +94 -0
- package/build/widgets/form/TextArea.d.ts +20 -0
- package/build/widgets/form/TextArea.js +128 -0
- package/build/widgets/form/TextField.d.ts +49 -0
- package/build/widgets/form/TextField.js +202 -0
- package/build/widgets/form/TimeField.d.ts +3 -0
- package/build/widgets/form/TimeField.js +8 -0
- package/build/widgets/form/TimeList.d.ts +1 -0
- package/build/widgets/form/TimeList.js +89 -0
- package/build/widgets/form/UploadButton.d.ts +17 -0
- package/build/widgets/form/UploadButton.js +163 -0
- package/build/widgets/form/ValidationError.d.ts +27 -0
- package/build/widgets/form/ValidationError.js +33 -0
- package/build/widgets/form/ValidationGroup.d.ts +63 -0
- package/build/widgets/form/ValidationGroup.js +58 -0
- package/build/widgets/form/ValidationGroup.spec.d.ts +1 -0
- package/build/widgets/form/ValidationGroup.spec.js +62 -0
- package/build/widgets/form/Validator.d.ts +8 -0
- package/build/widgets/form/Validator.js +19 -0
- package/build/widgets/form/Wheel.d.ts +61 -0
- package/build/widgets/form/Wheel.js +178 -0
- package/build/widgets/form/index.d.ts +28 -0
- package/build/widgets/form/index.js +28 -0
- package/build/widgets/grid/Grid.d.ts +517 -0
- package/build/widgets/grid/Grid.js +2756 -0
- package/build/widgets/grid/GridCell.d.ts +68 -0
- package/build/widgets/grid/GridCell.js +61 -0
- package/build/widgets/grid/GridCellEditor.d.ts +10 -0
- package/build/widgets/grid/GridCellEditor.js +29 -0
- package/build/widgets/grid/GridRow.d.ts +87 -0
- package/build/widgets/grid/GridRow.js +192 -0
- package/build/widgets/grid/GridRowLine.d.ts +27 -0
- package/build/widgets/grid/GridRowLine.js +24 -0
- package/build/widgets/grid/Pagination.d.ts +23 -0
- package/build/widgets/grid/Pagination.js +73 -0
- package/build/widgets/grid/TreeNode.d.ts +42 -0
- package/build/widgets/grid/TreeNode.js +82 -0
- package/build/widgets/grid/createGridCellEditor.d.ts +2 -0
- package/build/widgets/grid/createGridCellEditor.js +6 -0
- package/build/widgets/grid/index.d.ts +10 -0
- package/build/widgets/grid/index.js +10 -0
- package/build/widgets/icons/calendar.d.ts +2 -0
- package/build/widgets/icons/calendar.js +5 -0
- package/build/widgets/icons/check.d.ts +2 -0
- package/build/widgets/icons/check.js +5 -0
- package/build/widgets/icons/clear.d.ts +2 -0
- package/build/widgets/icons/clear.js +5 -0
- package/build/widgets/icons/close.d.ts +2 -0
- package/build/widgets/icons/close.js +5 -0
- package/build/widgets/icons/cx.d.ts +2 -0
- package/build/widgets/icons/cx.js +5 -0
- package/build/widgets/icons/drop-down.d.ts +2 -0
- package/build/widgets/icons/drop-down.js +5 -0
- package/build/widgets/icons/file.d.ts +2 -0
- package/build/widgets/icons/file.js +5 -0
- package/build/widgets/icons/folder-open.d.ts +2 -0
- package/build/widgets/icons/folder-open.js +5 -0
- package/build/widgets/icons/folder.d.ts +2 -0
- package/build/widgets/icons/folder.js +5 -0
- package/build/widgets/icons/forward.d.ts +2 -0
- package/build/widgets/icons/forward.js +5 -0
- package/build/widgets/icons/index.d.ts +12 -0
- package/build/widgets/icons/index.js +12 -0
- package/build/widgets/icons/loading.d.ts +2 -0
- package/build/widgets/icons/loading.js +14 -0
- package/build/widgets/icons/menu.d.ts +2 -0
- package/build/widgets/icons/menu.js +5 -0
- package/build/widgets/icons/pixel-picker.d.ts +2 -0
- package/build/widgets/icons/pixel-picker.js +5 -0
- package/build/widgets/icons/registry.d.ts +9 -0
- package/build/widgets/icons/registry.js +40 -0
- package/build/widgets/icons/search.d.ts +2 -0
- package/build/widgets/icons/search.js +5 -0
- package/build/widgets/icons/sort-asc.d.ts +2 -0
- package/build/widgets/icons/sort-asc.js +5 -0
- package/build/widgets/icons/square.d.ts +2 -0
- package/build/widgets/icons/square.js +5 -0
- package/build/widgets/index.d.ts +36 -0
- package/build/widgets/index.js +37 -0
- package/build/widgets/nav/Link.d.ts +6 -0
- package/build/widgets/nav/Link.js +6 -0
- package/build/widgets/nav/LinkButton.d.ts +45 -0
- package/build/widgets/nav/LinkButton.js +110 -0
- package/build/widgets/nav/Menu.d.ts +48 -0
- package/build/widgets/nav/Menu.js +336 -0
- package/build/widgets/nav/MenuItem.d.ts +68 -0
- package/build/widgets/nav/MenuItem.js +364 -0
- package/build/widgets/nav/MenuSpacer.d.ts +13 -0
- package/build/widgets/nav/MenuSpacer.js +11 -0
- package/build/widgets/nav/RedirectRoute.d.ts +14 -0
- package/build/widgets/nav/RedirectRoute.js +30 -0
- package/build/widgets/nav/Route.d.ts +40 -0
- package/build/widgets/nav/Route.js +94 -0
- package/build/widgets/nav/Route.spec.d.ts +1 -0
- package/build/widgets/nav/Route.spec.js +15 -0
- package/build/widgets/nav/Scroller.d.ts +55 -0
- package/build/widgets/nav/Scroller.js +125 -0
- package/build/widgets/nav/Submenu.d.ts +3 -0
- package/build/widgets/nav/Submenu.js +3 -0
- package/build/widgets/nav/Tab.d.ts +40 -0
- package/build/widgets/nav/Tab.js +66 -0
- package/build/widgets/nav/index.d.ts +10 -0
- package/build/widgets/nav/index.js +10 -0
- package/build/widgets/overlay/ContextMenu.d.ts +9 -0
- package/build/widgets/overlay/ContextMenu.js +31 -0
- package/build/widgets/overlay/Dropdown.d.ts +120 -0
- package/build/widgets/overlay/Dropdown.js +522 -0
- package/build/widgets/overlay/FlyweightTooltipTracker.d.ts +22 -0
- package/build/widgets/overlay/FlyweightTooltipTracker.js +39 -0
- package/build/widgets/overlay/MsgBox.d.ts +25 -0
- package/build/widgets/overlay/MsgBox.js +67 -0
- package/build/widgets/overlay/Overlay.d.ts +183 -0
- package/build/widgets/overlay/Overlay.js +597 -0
- package/build/widgets/overlay/Toast.d.ts +27 -0
- package/build/widgets/overlay/Toast.js +76 -0
- package/build/widgets/overlay/Tooltip.d.ts +55 -0
- package/build/widgets/overlay/Tooltip.js +307 -0
- package/build/widgets/overlay/Window.d.ts +65 -0
- package/build/widgets/overlay/Window.js +154 -0
- package/build/widgets/overlay/alerts.d.ts +12 -0
- package/build/widgets/overlay/alerts.js +31 -0
- package/build/widgets/overlay/captureMouse.d.ts +57 -0
- package/build/widgets/overlay/captureMouse.js +147 -0
- package/build/widgets/overlay/createHotPromiseWindowFactory.d.ts +10 -0
- package/build/widgets/overlay/createHotPromiseWindowFactory.js +54 -0
- package/build/widgets/overlay/index.d.ts +11 -0
- package/build/widgets/overlay/index.js +11 -0
- package/build/widgets/overlay/tooltip-ops.d.ts +73 -0
- package/build/widgets/overlay/tooltip-ops.js +34 -0
- package/dist/manifest.js +844 -844
- package/dist/util.js +0 -1
- package/dist/widgets.js +1 -2
- package/package.json +2 -2
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { Widget } from "../ui/Widget";
|
|
4
|
+
import { isArray } from "../util/isArray";
|
|
5
|
+
import { parseStyle } from "../util/parseStyle";
|
|
6
|
+
export class LineGraph extends Widget {
|
|
7
|
+
constructor(config) {
|
|
8
|
+
super(config);
|
|
9
|
+
}
|
|
10
|
+
declareData(...args) {
|
|
11
|
+
super.declareData(...args, {
|
|
12
|
+
data: undefined,
|
|
13
|
+
colorIndex: undefined,
|
|
14
|
+
colorMap: undefined,
|
|
15
|
+
class: {
|
|
16
|
+
structured: true,
|
|
17
|
+
},
|
|
18
|
+
className: {
|
|
19
|
+
structured: true,
|
|
20
|
+
},
|
|
21
|
+
lineStyle: {
|
|
22
|
+
structured: true,
|
|
23
|
+
},
|
|
24
|
+
areaStyle: {
|
|
25
|
+
structured: true,
|
|
26
|
+
},
|
|
27
|
+
area: undefined,
|
|
28
|
+
line: undefined,
|
|
29
|
+
y0: undefined,
|
|
30
|
+
name: undefined,
|
|
31
|
+
active: true,
|
|
32
|
+
stack: undefined,
|
|
33
|
+
stacked: undefined,
|
|
34
|
+
smooth: undefined,
|
|
35
|
+
smoothingRatio: undefined,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
prepareData(context, instance) {
|
|
39
|
+
let { data } = instance;
|
|
40
|
+
if (data.name && !data.colorName)
|
|
41
|
+
data.colorName = data.name;
|
|
42
|
+
if (data.smooth && data.smoothingRatio != null) {
|
|
43
|
+
if (data.smoothingRatio < 0)
|
|
44
|
+
data.smoothingRatio = 0;
|
|
45
|
+
if (data.smoothingRatio > 0.4)
|
|
46
|
+
data.smoothingRatio = 0.4;
|
|
47
|
+
}
|
|
48
|
+
super.prepareData(context, instance);
|
|
49
|
+
}
|
|
50
|
+
explore(context, instance) {
|
|
51
|
+
let { data } = instance;
|
|
52
|
+
instance.colorMap = data.colorMap && context.getColorMap && context.getColorMap(data.colorMap);
|
|
53
|
+
if (instance.colorMap && data.colorName)
|
|
54
|
+
instance.colorMap.acknowledge(data.colorName);
|
|
55
|
+
if (data.active) {
|
|
56
|
+
instance.axes = context.axes;
|
|
57
|
+
instance.xAxis = instance.axes[this.xAxis];
|
|
58
|
+
instance.yAxis = instance.axes[this.yAxis];
|
|
59
|
+
super.explore(context, instance);
|
|
60
|
+
if (isArray(data.data)) {
|
|
61
|
+
data.data.forEach((p) => {
|
|
62
|
+
let x = p[this.xField];
|
|
63
|
+
instance.xAxis.acknowledge(x);
|
|
64
|
+
if (data.stacked) {
|
|
65
|
+
instance.yAxis.stacknowledge(data.stack, x, this.y0Field ? p[this.y0Field] : data.y0);
|
|
66
|
+
instance.yAxis.stacknowledge(data.stack, x, p[this.yField]);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
instance.yAxis.acknowledge(p[this.yField]);
|
|
70
|
+
if (data.area) {
|
|
71
|
+
if (!this.hiddenBase)
|
|
72
|
+
instance.yAxis.acknowledge(this.y0Field ? p[this.y0Field] : data.y0);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
prepare(context, instance) {
|
|
80
|
+
let { data, colorMap } = instance;
|
|
81
|
+
if (colorMap && data.colorName) {
|
|
82
|
+
data.colorIndex = colorMap.map(data.colorName);
|
|
83
|
+
if (instance.cache("colorIndex", data.colorIndex))
|
|
84
|
+
instance.markShouldUpdate(context);
|
|
85
|
+
}
|
|
86
|
+
if (data.active) {
|
|
87
|
+
if (instance.axes[this.xAxis].shouldUpdate || instance.axes[this.yAxis].shouldUpdate)
|
|
88
|
+
instance.markShouldUpdate(context);
|
|
89
|
+
}
|
|
90
|
+
if (data.name && context.addLegendEntry) {
|
|
91
|
+
context.addLegendEntry(this.legend, {
|
|
92
|
+
name: data.name,
|
|
93
|
+
active: data.active,
|
|
94
|
+
colorIndex: data.colorIndex,
|
|
95
|
+
disabled: data.disabled,
|
|
96
|
+
style: {
|
|
97
|
+
...parseStyle(data.style),
|
|
98
|
+
...parseStyle(data.areaStyle),
|
|
99
|
+
...parseStyle(data.lineStyle),
|
|
100
|
+
},
|
|
101
|
+
shape: this.legendShape,
|
|
102
|
+
onClick: (e) => {
|
|
103
|
+
this.onLegendClick(e, instance);
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (data.active) {
|
|
108
|
+
if (context.pointReducer && isArray(data.data)) {
|
|
109
|
+
data.data.forEach((p, index) => {
|
|
110
|
+
if (data.area && this.y0Field)
|
|
111
|
+
context.pointReducer(p[this.xField], p[this.y0Field], data.name, p, data.data, index);
|
|
112
|
+
context.pointReducer(p[this.xField], p[this.yField], data.name, p, data.data, index);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
instance.lineSpans = this.calculateLineSpans(context, instance);
|
|
117
|
+
}
|
|
118
|
+
onLegendClick(e, instance) {
|
|
119
|
+
let allActions = this.legendAction == "auto";
|
|
120
|
+
let { data } = instance;
|
|
121
|
+
if (allActions || this.legendAction == "toggle")
|
|
122
|
+
instance.set("active", !data.active);
|
|
123
|
+
}
|
|
124
|
+
calculateLineSpans(context, instance) {
|
|
125
|
+
let { data, xAxis, yAxis } = instance;
|
|
126
|
+
let spans = [];
|
|
127
|
+
let span = [];
|
|
128
|
+
if (!data.active)
|
|
129
|
+
return null;
|
|
130
|
+
isArray(data.data) &&
|
|
131
|
+
data.data.forEach((p) => {
|
|
132
|
+
let ax = p[this.xField], ay = p[this.yField], ay0 = this.y0Field ? p[this.y0Field] : data.y0, x, y, y0;
|
|
133
|
+
if (ax != null && ay != null && ay0 != null) {
|
|
134
|
+
x = xAxis.map(ax);
|
|
135
|
+
y0 = data.stacked ? yAxis.stack(data.stack, ax, ay0) : yAxis.map(ay0);
|
|
136
|
+
y = data.stacked ? yAxis.stack(data.stack, ax, ay) : yAxis.map(ay);
|
|
137
|
+
}
|
|
138
|
+
if (x != null && y != null && y0 != null)
|
|
139
|
+
span.push({ x, y, y0 });
|
|
140
|
+
else if (span.length > 0) {
|
|
141
|
+
spans.push(span);
|
|
142
|
+
span = [];
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
if (span.length > 0)
|
|
146
|
+
spans.push(span);
|
|
147
|
+
return spans;
|
|
148
|
+
}
|
|
149
|
+
render(context, instance, key) {
|
|
150
|
+
let { data, lineSpans } = instance;
|
|
151
|
+
if (!lineSpans)
|
|
152
|
+
return null;
|
|
153
|
+
let stateMods = {
|
|
154
|
+
["color-" + data.colorIndex]: data.colorIndex != null,
|
|
155
|
+
};
|
|
156
|
+
let line, area;
|
|
157
|
+
const r = data.smoothingRatio;
|
|
158
|
+
let linePath = "";
|
|
159
|
+
if (data.line) {
|
|
160
|
+
lineSpans.forEach((span) => {
|
|
161
|
+
span.forEach((p, i) => {
|
|
162
|
+
linePath +=
|
|
163
|
+
i == 0
|
|
164
|
+
? `M ${p.x} ${p.y}`
|
|
165
|
+
: !data.smooth || span.length < 2
|
|
166
|
+
? `L ${p.x} ${p.y}`
|
|
167
|
+
: this.getCurvedPathSegment(p, span, i - 1, i - 2, i - 1, i + 1, r);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
line = (_jsx("path", { className: this.CSS.element(this.baseClass, "line", stateMods), style: this.CSS.parseStyle(data.lineStyle), d: linePath }));
|
|
171
|
+
}
|
|
172
|
+
if (data.area) {
|
|
173
|
+
let areaPath = "";
|
|
174
|
+
lineSpans.forEach((span) => {
|
|
175
|
+
let closePath = "";
|
|
176
|
+
span.forEach((p, i) => {
|
|
177
|
+
let segment = "";
|
|
178
|
+
if (i == 0) {
|
|
179
|
+
segment = `M ${p.x} ${p.y}`;
|
|
180
|
+
// closing point
|
|
181
|
+
closePath =
|
|
182
|
+
!data.smooth || span.length < 2
|
|
183
|
+
? `L ${p.x} ${p.y0}`
|
|
184
|
+
: this.getCurvedPathSegment(p, span, i + 1, i + 2, i + 1, i - 1, r, "y0");
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
if (!data.smooth) {
|
|
188
|
+
segment = `L ${p.x} ${p.y}`;
|
|
189
|
+
closePath = `L ${p.x} ${p.y0}` + closePath;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
segment = this.getCurvedPathSegment(p, span, i - 1, i - 2, i - 1, i + 1, r, "y");
|
|
193
|
+
// closing point
|
|
194
|
+
if (i < span.length - 1)
|
|
195
|
+
closePath = this.getCurvedPathSegment(p, span, i + 1, i + 2, i + 1, i - 1, r, "y0") + closePath;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
areaPath += segment;
|
|
199
|
+
});
|
|
200
|
+
areaPath += `L ${span[span.length - 1].x} ${span[span.length - 1].y0}`;
|
|
201
|
+
areaPath += closePath;
|
|
202
|
+
areaPath += "Z";
|
|
203
|
+
});
|
|
204
|
+
area = (_jsx("path", { className: this.CSS.element(this.baseClass, "area", stateMods), style: this.CSS.parseStyle(data.areaStyle), d: areaPath }));
|
|
205
|
+
}
|
|
206
|
+
return (_jsxs("g", { className: data.classNames, children: [line, area] }, key));
|
|
207
|
+
}
|
|
208
|
+
getCurvedPathSegment(p, points, i1, i2, j1, j2, r, yField = "y") {
|
|
209
|
+
const [sx, sy] = this.getControlPoint({ cp: points[i1], pp: points[i2], r, np: p, yField });
|
|
210
|
+
const [ex, ey] = this.getControlPoint({ cp: p, pp: points[j1], np: points[j2], r, reverse: true, yField });
|
|
211
|
+
return `C ${sx} ${sy}, ${ex} ${ey}, ${p.x} ${p[yField]}`;
|
|
212
|
+
}
|
|
213
|
+
getControlPoint({ cp, pp, np, r, reverse, yField = "y", }) {
|
|
214
|
+
// When 'current' is the first or last point of the array 'previous' or 'next' don't exist. Replace with 'current'.
|
|
215
|
+
const p = pp || cp;
|
|
216
|
+
const n = np || cp;
|
|
217
|
+
// Properties of the opposed-line
|
|
218
|
+
let { angle, length } = this.getLineInfo(p.x, p[yField], n.x, n[yField]);
|
|
219
|
+
// If it is end-control-point, add PI to the angle to go backward
|
|
220
|
+
angle = angle + (reverse ? Math.PI : 0);
|
|
221
|
+
length = length * r;
|
|
222
|
+
// The control point position is relative to the current point
|
|
223
|
+
const x = cp.x + Math.cos(angle) * length;
|
|
224
|
+
const y = cp[yField] + Math.sin(angle) * length;
|
|
225
|
+
return [x, y];
|
|
226
|
+
}
|
|
227
|
+
getLineInfo(p1x, p1y, p2x, p2y) {
|
|
228
|
+
const lengthX = p2x - p1x;
|
|
229
|
+
const lengthY = p2y - p1y;
|
|
230
|
+
return {
|
|
231
|
+
length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)),
|
|
232
|
+
angle: Math.atan2(lengthY, lengthX),
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
LineGraph.prototype.xAxis = "x";
|
|
237
|
+
LineGraph.prototype.yAxis = "y";
|
|
238
|
+
LineGraph.prototype.area = false;
|
|
239
|
+
LineGraph.prototype.line = true;
|
|
240
|
+
LineGraph.prototype.xField = "x";
|
|
241
|
+
LineGraph.prototype.yField = "y";
|
|
242
|
+
LineGraph.prototype.baseClass = "linegraph";
|
|
243
|
+
LineGraph.prototype.y0 = 0;
|
|
244
|
+
LineGraph.prototype.y0Field = false;
|
|
245
|
+
LineGraph.prototype.active = true;
|
|
246
|
+
LineGraph.prototype.legend = "legend";
|
|
247
|
+
LineGraph.prototype.legendAction = "auto";
|
|
248
|
+
LineGraph.prototype.legendShape = "rect";
|
|
249
|
+
LineGraph.prototype.stack = "stack";
|
|
250
|
+
LineGraph.prototype.hiddenBase = false;
|
|
251
|
+
LineGraph.prototype.smooth = false;
|
|
252
|
+
LineGraph.prototype.smoothingRatio = 0.05;
|
|
253
|
+
Widget.alias("line-graph", LineGraph);
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { BoundedObject, BoundedObjectConfig, BoundedObjectInstance } from "../svg/BoundedObject";
|
|
3
|
+
import { Rect } from "../svg/util/Rect";
|
|
4
|
+
import { TooltipParentInstance, TooltipConfig } from "../widgets/overlay/tooltip-ops";
|
|
5
|
+
import { Selection } from "../ui/selection/Selection";
|
|
6
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
7
|
+
import { NumberProp, BooleanProp, StringProp, StructuredProp } from "../ui/Prop";
|
|
8
|
+
import { Instance } from "../ui/Instance";
|
|
9
|
+
export interface MarkerConfig extends BoundedObjectConfig {
|
|
10
|
+
/** The `x` value binding or expression. */
|
|
11
|
+
x?: NumberProp | StringProp;
|
|
12
|
+
/** The `y` value binding or expression. */
|
|
13
|
+
y?: NumberProp;
|
|
14
|
+
/** Used to indicate if the data should affect axis span. */
|
|
15
|
+
affectsAxes?: boolean;
|
|
16
|
+
/** Shape kind. `circle`, `square`, `triangle`, etc. */
|
|
17
|
+
shape?: StringProp;
|
|
18
|
+
/** Disabled state. */
|
|
19
|
+
disabled?: BooleanProp;
|
|
20
|
+
/** Index of a color from the standard palette of colors. 0-15. */
|
|
21
|
+
colorIndex?: NumberProp | StringProp;
|
|
22
|
+
/** Used to automatically assign a color based on the `name` and the contextual `ColorMap` widget. */
|
|
23
|
+
colorMap?: StringProp;
|
|
24
|
+
/** Name used to resolve the color. If not provided, `name` is used instead. */
|
|
25
|
+
colorName?: StringProp;
|
|
26
|
+
/** Color index to use for the legend entry. */
|
|
27
|
+
legendColorIndex?: NumberProp;
|
|
28
|
+
/** Name of the item as it will appear in the legend. */
|
|
29
|
+
name?: StringProp;
|
|
30
|
+
/** Used to indicate if an item is active or not. Inactive items are shown only in the legend. */
|
|
31
|
+
active?: BooleanProp;
|
|
32
|
+
/** X offset. */
|
|
33
|
+
xOffset?: number;
|
|
34
|
+
/** Y offset. */
|
|
35
|
+
yOffset?: number;
|
|
36
|
+
/** Size of the shape in pixels. */
|
|
37
|
+
size?: NumberProp;
|
|
38
|
+
/**
|
|
39
|
+
* Name of the horizontal axis. The value should match one of the horizontal axes set
|
|
40
|
+
* in the `axes` configuration of the parent `Chart` component. Default value is `x`.
|
|
41
|
+
*/
|
|
42
|
+
xAxis?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Name of the vertical axis. The value should match one of the vertical axes set
|
|
45
|
+
* in the `axes` configuration if the parent `Chart` component. Default value is `y`.
|
|
46
|
+
*/
|
|
47
|
+
yAxis?: string;
|
|
48
|
+
/** Set to `true` to make the shape draggable along the X axis. */
|
|
49
|
+
draggableX?: boolean;
|
|
50
|
+
/** Set to `true` to make the shape draggable along the Y axis. */
|
|
51
|
+
draggableY?: boolean;
|
|
52
|
+
/** Set to `true` to make the shape draggable along the X and Y axis. */
|
|
53
|
+
draggable?: boolean;
|
|
54
|
+
/** Constrain the marker position to min/max values of the X axis during drag operations. */
|
|
55
|
+
constrainX?: boolean;
|
|
56
|
+
/** Constrain the marker position to min/max values of the Y axis during drag operations. */
|
|
57
|
+
constrainY?: boolean;
|
|
58
|
+
/** When set to `true`, it is equivalent to setting `constrainX` and `constrainY` to true. */
|
|
59
|
+
constrain?: boolean;
|
|
60
|
+
/** Name of the legend to be used. Default is `legend`. */
|
|
61
|
+
legend?: string;
|
|
62
|
+
/** Action to perform on legend item click. Default is `auto`. */
|
|
63
|
+
legendAction?: string;
|
|
64
|
+
/** Tooltip configuration. For more info see Tooltips. */
|
|
65
|
+
tooltip?: StringProp | StructuredProp;
|
|
66
|
+
/** Set to true to hide the marker. The marker will still participate in axis range calculations. */
|
|
67
|
+
hidden?: boolean;
|
|
68
|
+
/** Indicate that markers should be stacked horizontally. Default value is `false`. */
|
|
69
|
+
stackedX?: BooleanProp;
|
|
70
|
+
/** Indicate that markers should be stacked vertically. Default value is `false`. */
|
|
71
|
+
stackedY?: BooleanProp;
|
|
72
|
+
/** Name of the stack. If multiple stacks are used, each should have a unique name. Default value is `stack`. */
|
|
73
|
+
stack?: StringProp;
|
|
74
|
+
/**
|
|
75
|
+
* Applies to rectangular shapes. The horizontal corner radius of the rect. Defaults to ry if ry is specified.
|
|
76
|
+
* Value type: <length>|<percentage>;
|
|
77
|
+
* If unit is not specified, it defaults to `px`.
|
|
78
|
+
*/
|
|
79
|
+
rx?: StringProp | NumberProp;
|
|
80
|
+
/**
|
|
81
|
+
* Applies to rectangular shapes. The vertical corner radius of the rect. Defaults to rx if rx is specified.
|
|
82
|
+
* Value type: <length>|<percentage>;
|
|
83
|
+
* If unit is not specified, it defaults to `px`.
|
|
84
|
+
*/
|
|
85
|
+
ry?: StringProp | NumberProp;
|
|
86
|
+
/** Selection configuration. */
|
|
87
|
+
selection?: any;
|
|
88
|
+
/** Click event handler. */
|
|
89
|
+
onClick?: (e: React.MouseEvent, instance: Instance) => void;
|
|
90
|
+
}
|
|
91
|
+
export interface MarkerInstance extends BoundedObjectInstance, TooltipParentInstance {
|
|
92
|
+
axes: Record<string, any>;
|
|
93
|
+
xAxis: any;
|
|
94
|
+
yAxis: any;
|
|
95
|
+
colorMap: any;
|
|
96
|
+
}
|
|
97
|
+
export declare class Marker extends BoundedObject {
|
|
98
|
+
baseClass: string;
|
|
99
|
+
xAxis: string;
|
|
100
|
+
yAxis: string;
|
|
101
|
+
xOffset: number;
|
|
102
|
+
yOffset: number;
|
|
103
|
+
size: number;
|
|
104
|
+
draggableX: boolean;
|
|
105
|
+
draggableY: boolean;
|
|
106
|
+
draggable: boolean;
|
|
107
|
+
constrainX: boolean;
|
|
108
|
+
constrainY: boolean;
|
|
109
|
+
constrain: boolean;
|
|
110
|
+
legend: string;
|
|
111
|
+
legendAction: string;
|
|
112
|
+
shape: string;
|
|
113
|
+
hidden: boolean;
|
|
114
|
+
affectsAxes: boolean;
|
|
115
|
+
stackedY: boolean;
|
|
116
|
+
stackedX: boolean;
|
|
117
|
+
stack: string;
|
|
118
|
+
selection: Selection;
|
|
119
|
+
tooltip: TooltipConfig;
|
|
120
|
+
onClick: MarkerConfig["onClick"];
|
|
121
|
+
constructor(config: MarkerConfig);
|
|
122
|
+
init(): void;
|
|
123
|
+
declareData(...args: any[]): void;
|
|
124
|
+
prepareData(context: RenderingContext, instance: MarkerInstance): void;
|
|
125
|
+
calculateBounds(context: RenderingContext, instance: MarkerInstance): Rect;
|
|
126
|
+
explore(context: RenderingContext, instance: MarkerInstance): void;
|
|
127
|
+
prepare(context: RenderingContext, instance: MarkerInstance): void;
|
|
128
|
+
onLegendClick(e: MouseEvent, instance: MarkerInstance): void;
|
|
129
|
+
render(context: RenderingContext, instance: MarkerInstance, key: string): React.ReactNode;
|
|
130
|
+
handleMouseDown(e: React.MouseEvent | React.TouchEvent, instance: MarkerInstance): void;
|
|
131
|
+
handleClick(e: React.MouseEvent, instance: MarkerInstance): void;
|
|
132
|
+
handleDragMove(e: MouseEvent | TouchEvent, instance: MarkerInstance, captureData: any): void;
|
|
133
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { VDOM } from "../ui/Widget";
|
|
4
|
+
import { BoundedObject } from "../svg/BoundedObject";
|
|
5
|
+
import { Rect } from "../svg/util/Rect";
|
|
6
|
+
import { tooltipMouseMove, tooltipMouseLeave, tooltipParentWillUnmount, tooltipParentWillReceiveProps, tooltipParentDidMount, tooltipParentDidUpdate, } from "../widgets/overlay/tooltip-ops";
|
|
7
|
+
import { captureMouseOrTouch, getCursorPos } from "../widgets/overlay/captureMouse";
|
|
8
|
+
import { closest } from "../util/DOM";
|
|
9
|
+
import { Selection } from "../ui/selection/Selection";
|
|
10
|
+
import { getShape } from "./shapes";
|
|
11
|
+
import { getTopLevelBoundingClientRect } from "../util/getTopLevelBoundingClientRect";
|
|
12
|
+
export class Marker extends BoundedObject {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
super(config);
|
|
15
|
+
}
|
|
16
|
+
init() {
|
|
17
|
+
this.selection = Selection.create(this.selection);
|
|
18
|
+
if (this.draggable) {
|
|
19
|
+
this.draggableX = true;
|
|
20
|
+
this.draggableY = true;
|
|
21
|
+
}
|
|
22
|
+
if (this.constrain) {
|
|
23
|
+
this.constrainX = true;
|
|
24
|
+
this.constrainY = true;
|
|
25
|
+
}
|
|
26
|
+
super.init();
|
|
27
|
+
}
|
|
28
|
+
declareData(...args) {
|
|
29
|
+
var selection = this.selection.configureWidget(this);
|
|
30
|
+
super.declareData(...args, selection, {
|
|
31
|
+
x: undefined,
|
|
32
|
+
y: undefined,
|
|
33
|
+
size: undefined,
|
|
34
|
+
shape: undefined,
|
|
35
|
+
disabled: undefined,
|
|
36
|
+
colorMap: undefined,
|
|
37
|
+
colorIndex: undefined,
|
|
38
|
+
colorName: undefined,
|
|
39
|
+
legendColorIndex: undefined,
|
|
40
|
+
name: undefined,
|
|
41
|
+
active: true,
|
|
42
|
+
stack: undefined,
|
|
43
|
+
stackedX: undefined,
|
|
44
|
+
stackedY: undefined,
|
|
45
|
+
rx: undefined,
|
|
46
|
+
ry: undefined,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
prepareData(context, instance) {
|
|
50
|
+
instance.axes = context.axes;
|
|
51
|
+
instance.xAxis = context.axes[this.xAxis];
|
|
52
|
+
instance.yAxis = context.axes[this.yAxis];
|
|
53
|
+
let { data } = instance;
|
|
54
|
+
data.selected = this.selection.isInstanceSelected(instance);
|
|
55
|
+
data.stateMods = {
|
|
56
|
+
selected: data.selected,
|
|
57
|
+
disabled: data.disabled,
|
|
58
|
+
selectable: !this.selection.isDummy,
|
|
59
|
+
"draggable-x": this.draggableX && !this.draggableY,
|
|
60
|
+
"draggable-y": this.draggableY && !this.draggableX,
|
|
61
|
+
"draggable-xy": this.draggableY && this.draggableX,
|
|
62
|
+
};
|
|
63
|
+
if (data.name && !data.colorName)
|
|
64
|
+
data.colorName = data.name;
|
|
65
|
+
super.prepareData(context, instance);
|
|
66
|
+
}
|
|
67
|
+
calculateBounds(context, instance) {
|
|
68
|
+
let { data, xAxis, yAxis } = instance;
|
|
69
|
+
let x, y;
|
|
70
|
+
if (data.x == null || data.y == null) {
|
|
71
|
+
let bounds = super.calculateBounds(context, instance);
|
|
72
|
+
x = (bounds.l + bounds.r) / 2;
|
|
73
|
+
y = (bounds.t + bounds.b) / 2;
|
|
74
|
+
}
|
|
75
|
+
if (data.x != null)
|
|
76
|
+
x = data.stackedX ? xAxis.stack(data.stack, data.y, data.x) : xAxis.map(data.x);
|
|
77
|
+
if (data.y != null)
|
|
78
|
+
y = data.stackedY ? yAxis.stack(data.stack, data.x, data.y) : yAxis.map(data.y);
|
|
79
|
+
return new Rect({
|
|
80
|
+
l: x - data.size / 2,
|
|
81
|
+
r: x + data.size / 2,
|
|
82
|
+
t: y - data.size / 2,
|
|
83
|
+
b: y + data.size / 2,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
explore(context, instance) {
|
|
87
|
+
let { data, xAxis, yAxis } = instance;
|
|
88
|
+
instance.colorMap = data.colorMap && context.getColorMap && context.getColorMap(data.colorMap);
|
|
89
|
+
if (instance.colorMap && data.colorName)
|
|
90
|
+
instance.colorMap.acknowledge(data.colorName);
|
|
91
|
+
if (data.active) {
|
|
92
|
+
if (this.affectsAxes) {
|
|
93
|
+
if (xAxis && data.x != null) {
|
|
94
|
+
if (data.stackedX)
|
|
95
|
+
xAxis.stacknowledge(data.stack, data.y, data.x);
|
|
96
|
+
else
|
|
97
|
+
xAxis.acknowledge(data.x, 0, this.xOffset);
|
|
98
|
+
}
|
|
99
|
+
if (yAxis && data.y != null) {
|
|
100
|
+
if (data.stackedY)
|
|
101
|
+
yAxis.stacknowledge(data.stack, data.x, data.y);
|
|
102
|
+
else
|
|
103
|
+
yAxis.acknowledge(data.y, 0, this.yOffset);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
super.explore(context, instance);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
prepare(context, instance) {
|
|
110
|
+
let { data, xAxis, yAxis, colorMap } = instance;
|
|
111
|
+
if (colorMap && data.colorName) {
|
|
112
|
+
data.colorIndex = colorMap.map(data.colorName);
|
|
113
|
+
if (instance.cache("colorIndex", data.colorIndex))
|
|
114
|
+
instance.markShouldUpdate(context);
|
|
115
|
+
}
|
|
116
|
+
if (data.active) {
|
|
117
|
+
if (xAxis && xAxis.shouldUpdate)
|
|
118
|
+
instance.markShouldUpdate(context);
|
|
119
|
+
if (yAxis && yAxis.shouldUpdate)
|
|
120
|
+
instance.markShouldUpdate(context);
|
|
121
|
+
if (context.pointReducer)
|
|
122
|
+
context.pointReducer(data.x, data.y, data.name, data);
|
|
123
|
+
}
|
|
124
|
+
super.prepare(context, instance);
|
|
125
|
+
if (data.name && context.addLegendEntry)
|
|
126
|
+
context.addLegendEntry(this.legend, {
|
|
127
|
+
name: data.name,
|
|
128
|
+
active: data.active,
|
|
129
|
+
colorIndex: data.legendColorIndex || data.colorIndex,
|
|
130
|
+
disabled: data.disabled,
|
|
131
|
+
selected: data.selected,
|
|
132
|
+
style: data.style,
|
|
133
|
+
shape: data.shape,
|
|
134
|
+
onClick: (e) => {
|
|
135
|
+
this.onLegendClick(e, instance);
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
onLegendClick(e, instance) {
|
|
140
|
+
let allActions = this.legendAction == "auto";
|
|
141
|
+
let { data } = instance;
|
|
142
|
+
if (allActions || this.legendAction == "toggle")
|
|
143
|
+
if (instance.set("active", !data.active))
|
|
144
|
+
return;
|
|
145
|
+
if (allActions || this.legendAction == "select")
|
|
146
|
+
this.handleClick(e, instance);
|
|
147
|
+
}
|
|
148
|
+
render(context, instance, key) {
|
|
149
|
+
let { data } = instance;
|
|
150
|
+
if (!data.active || data.x === null || data.y === null)
|
|
151
|
+
return null;
|
|
152
|
+
return (_jsx(MarkerComponent, { instance: instance, data: instance.data, shouldUpdate: instance.shouldUpdate, children: this.renderChildren(context, instance) }, key));
|
|
153
|
+
}
|
|
154
|
+
handleMouseDown(e, instance) {
|
|
155
|
+
if (this.draggableX || this.draggableY) {
|
|
156
|
+
let svgEl = closest(e.target, (el) => el.tagName == "svg");
|
|
157
|
+
if (svgEl)
|
|
158
|
+
captureMouseOrTouch(e, (e, captureData) => {
|
|
159
|
+
this.handleDragMove(e, instance, captureData);
|
|
160
|
+
}, undefined, { svgEl, el: e.target }, e.target.style.cursor);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
if (!this.selection.isDummy)
|
|
164
|
+
this.selection.selectInstance(instance);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
handleClick(e, instance) {
|
|
168
|
+
if (this.onClick)
|
|
169
|
+
instance.invoke("onClick", e, instance);
|
|
170
|
+
}
|
|
171
|
+
handleDragMove(e, instance, captureData) {
|
|
172
|
+
let cursor = getCursorPos(e);
|
|
173
|
+
let svgBounds = getTopLevelBoundingClientRect(captureData.svgEl);
|
|
174
|
+
let { xAxis, yAxis } = instance;
|
|
175
|
+
if (this.draggableX && xAxis) {
|
|
176
|
+
let x = xAxis.trackValue(cursor.clientX - svgBounds.left, this.xOffset);
|
|
177
|
+
if (this.constrainX)
|
|
178
|
+
x = xAxis.constrainValue(x);
|
|
179
|
+
instance.set("x", xAxis.encodeValue(x));
|
|
180
|
+
}
|
|
181
|
+
if (this.draggableY && yAxis) {
|
|
182
|
+
let y = yAxis.trackValue(cursor.clientY - svgBounds.top, this.yOffset);
|
|
183
|
+
if (this.constrainY)
|
|
184
|
+
y = yAxis.constrainValue(y);
|
|
185
|
+
instance.set("y", yAxis.encodeValue(y));
|
|
186
|
+
}
|
|
187
|
+
tooltipMouseMove(e, instance, this.tooltip, { target: captureData.el });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
Marker.prototype.xOffset = 0;
|
|
191
|
+
Marker.prototype.yOffset = 0;
|
|
192
|
+
Marker.prototype.size = 5;
|
|
193
|
+
Marker.prototype.anchors = "0.5 0.5 0.5 0.5";
|
|
194
|
+
Marker.prototype.xAxis = "x";
|
|
195
|
+
Marker.prototype.yAxis = "y";
|
|
196
|
+
Marker.prototype.baseClass = "marker";
|
|
197
|
+
Marker.prototype.draggableX = false;
|
|
198
|
+
Marker.prototype.draggableY = false;
|
|
199
|
+
Marker.prototype.draggable = false;
|
|
200
|
+
Marker.prototype.constrainX = false;
|
|
201
|
+
Marker.prototype.constrainY = false;
|
|
202
|
+
Marker.prototype.constrain = false;
|
|
203
|
+
Marker.prototype.legend = "legend";
|
|
204
|
+
Marker.prototype.legendAction = "auto";
|
|
205
|
+
Marker.prototype.shape = "circle";
|
|
206
|
+
Marker.prototype.styled = true;
|
|
207
|
+
Marker.prototype.hidden = false;
|
|
208
|
+
Marker.prototype.affectsAxes = true;
|
|
209
|
+
Marker.prototype.stackedY = false;
|
|
210
|
+
Marker.prototype.stackedX = false;
|
|
211
|
+
Marker.prototype.stack = "stack";
|
|
212
|
+
BoundedObject.alias("marker", Marker);
|
|
213
|
+
class MarkerComponent extends VDOM.Component {
|
|
214
|
+
shouldComponentUpdate(props) {
|
|
215
|
+
return props.shouldUpdate ?? true;
|
|
216
|
+
}
|
|
217
|
+
render() {
|
|
218
|
+
let { instance, children, data } = this.props;
|
|
219
|
+
let widget = instance.widget;
|
|
220
|
+
let { CSS, baseClass } = widget;
|
|
221
|
+
let { bounds, shape } = data;
|
|
222
|
+
let shapeRenderer = getShape(shape);
|
|
223
|
+
let shapeProps = {
|
|
224
|
+
className: CSS.element(baseClass, "shape", {
|
|
225
|
+
["color-" + data.colorIndex]: data.colorIndex != null,
|
|
226
|
+
selected: data.selected,
|
|
227
|
+
}),
|
|
228
|
+
style: data.style,
|
|
229
|
+
cx: (bounds.l + bounds.r) / 2,
|
|
230
|
+
cy: (bounds.t + bounds.b) / 2,
|
|
231
|
+
r: data.size / 2,
|
|
232
|
+
onMouseMove: (e) => {
|
|
233
|
+
tooltipMouseMove(e, instance, widget.tooltip);
|
|
234
|
+
},
|
|
235
|
+
onMouseLeave: (e) => {
|
|
236
|
+
tooltipMouseLeave(e, instance, widget.tooltip);
|
|
237
|
+
},
|
|
238
|
+
onMouseDown: (e) => {
|
|
239
|
+
widget.handleMouseDown(e, instance);
|
|
240
|
+
},
|
|
241
|
+
onTouchStart: (e) => {
|
|
242
|
+
widget.handleMouseDown(e, instance);
|
|
243
|
+
},
|
|
244
|
+
onClick: (e) => {
|
|
245
|
+
widget.handleClick(e, instance);
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
if (shape == "rect" || shape == "square" || shape == "bar" || shape == "column") {
|
|
249
|
+
shapeProps.rx = data.rx;
|
|
250
|
+
shapeProps.ry = data.ry;
|
|
251
|
+
}
|
|
252
|
+
if (widget.tooltip) {
|
|
253
|
+
shapeProps.ref = (c) => {
|
|
254
|
+
this.el = c;
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
return (_jsxs("g", { className: data.classNames, children: [!widget.hidden &&
|
|
258
|
+
shapeRenderer((bounds.l + bounds.r) / 2, (bounds.t + bounds.b) / 2, data.size, shapeProps), children] }));
|
|
259
|
+
}
|
|
260
|
+
componentWillUnmount() {
|
|
261
|
+
tooltipParentWillUnmount(this.props.instance);
|
|
262
|
+
}
|
|
263
|
+
UNSAFE_componentWillReceiveProps(props) {
|
|
264
|
+
let widget = props.instance.widget;
|
|
265
|
+
tooltipParentWillReceiveProps(this.el, props.instance, widget.tooltip);
|
|
266
|
+
}
|
|
267
|
+
componentDidMount() {
|
|
268
|
+
let widget = this.props.instance.widget;
|
|
269
|
+
tooltipParentDidMount(this.el, this.props.instance, widget.tooltip);
|
|
270
|
+
}
|
|
271
|
+
componentDidUpdate() {
|
|
272
|
+
let widget = this.props.instance.widget;
|
|
273
|
+
tooltipParentDidUpdate(this.el, this.props.instance, widget.tooltip);
|
|
274
|
+
}
|
|
275
|
+
}
|