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,445 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { Widget } from "../ui/Widget";
|
|
4
|
+
import { Container } from "../ui/Container";
|
|
5
|
+
import { BoundedObject } from "../svg/BoundedObject";
|
|
6
|
+
import { Rect } from "../svg/util/Rect";
|
|
7
|
+
import { Selection } from "../ui/selection/Selection";
|
|
8
|
+
import { tooltipMouseMove, tooltipMouseLeave } from "../widgets/overlay/tooltip-ops";
|
|
9
|
+
import { isNumber } from "../util/isNumber";
|
|
10
|
+
import { shallowEquals } from "../util/shallowEquals";
|
|
11
|
+
import { withHoverSync } from "../ui/HoverSync";
|
|
12
|
+
export class PieChart extends BoundedObject {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
super(config);
|
|
15
|
+
}
|
|
16
|
+
declareData(...args) {
|
|
17
|
+
super.declareData(...args, {
|
|
18
|
+
angle: undefined,
|
|
19
|
+
startAngle: undefined,
|
|
20
|
+
clockwise: undefined,
|
|
21
|
+
gap: undefined,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
explore(context, instance) {
|
|
25
|
+
if (!instance.pie)
|
|
26
|
+
instance.pie = new PieCalculator();
|
|
27
|
+
let { data } = instance;
|
|
28
|
+
instance.pie.reset(data.angle, data.startAngle, data.clockwise, data.gap);
|
|
29
|
+
context.push("pie", instance.pie);
|
|
30
|
+
super.explore(context, instance);
|
|
31
|
+
}
|
|
32
|
+
exploreCleanup(context, instance) {
|
|
33
|
+
context.pop("pie");
|
|
34
|
+
}
|
|
35
|
+
prepare(context, instance) {
|
|
36
|
+
this.prepareBounds(context, instance);
|
|
37
|
+
let { data, pie } = instance;
|
|
38
|
+
pie.measure(data.bounds);
|
|
39
|
+
let hash = pie.hash();
|
|
40
|
+
instance.cache("hash", hash);
|
|
41
|
+
pie.shouldUpdate = !shallowEquals(hash, instance.cached.hash);
|
|
42
|
+
if (!pie.shouldUpdate)
|
|
43
|
+
instance.markShouldUpdate(context);
|
|
44
|
+
super.prepare(context, instance);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
PieChart.prototype.anchors = "0 1 1 0";
|
|
48
|
+
class PieCalculator {
|
|
49
|
+
angleTotal = 0;
|
|
50
|
+
startAngle = 0;
|
|
51
|
+
clockwise = false;
|
|
52
|
+
gap = 0;
|
|
53
|
+
stacks = {};
|
|
54
|
+
cx = 0;
|
|
55
|
+
cy = 0;
|
|
56
|
+
R = 0;
|
|
57
|
+
shouldUpdate = false;
|
|
58
|
+
reset(angle, startAngle, clockwise, gap) {
|
|
59
|
+
if (angle == 360)
|
|
60
|
+
angle = 359.99; // really hacky way to draw full circles
|
|
61
|
+
this.angleTotal = (angle / 180) * Math.PI;
|
|
62
|
+
this.startAngle = (startAngle / 180) * Math.PI;
|
|
63
|
+
this.clockwise = clockwise;
|
|
64
|
+
this.gap = gap;
|
|
65
|
+
this.stacks = {};
|
|
66
|
+
}
|
|
67
|
+
acknowledge(stack, value, r, r0, percentageRadius) {
|
|
68
|
+
let s = this.stacks[stack];
|
|
69
|
+
if (!s)
|
|
70
|
+
s = this.stacks[stack] = {
|
|
71
|
+
total: 0,
|
|
72
|
+
r0s: this.gap > 0 ? [] : null,
|
|
73
|
+
r0ps: this.gap > 0 ? [] : null,
|
|
74
|
+
gap: 0,
|
|
75
|
+
angleFactor: 0,
|
|
76
|
+
lastAngle: 0,
|
|
77
|
+
};
|
|
78
|
+
if (value > 0) {
|
|
79
|
+
s.total += value;
|
|
80
|
+
if (this.gap > 0 && r0 > 0)
|
|
81
|
+
if (percentageRadius)
|
|
82
|
+
s.r0ps.push(r0);
|
|
83
|
+
else
|
|
84
|
+
s.r0s.push(r0);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
hash() {
|
|
88
|
+
return {
|
|
89
|
+
angleTotal: this.angleTotal,
|
|
90
|
+
startAngle: this.startAngle,
|
|
91
|
+
clockwise: this.clockwise,
|
|
92
|
+
stacks: Object.keys(this.stacks)
|
|
93
|
+
.map((s) => `${this.stacks[s].angleFactor}`)
|
|
94
|
+
.join(":"),
|
|
95
|
+
cx: this.cx,
|
|
96
|
+
cy: this.cy,
|
|
97
|
+
R: this.R,
|
|
98
|
+
gap: this.gap,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
measure(rect) {
|
|
102
|
+
this.R = Math.max(0, Math.min(rect.width(), rect.height())) / 2;
|
|
103
|
+
for (let s in this.stacks) {
|
|
104
|
+
let stack = this.stacks[s];
|
|
105
|
+
let gapAngleTotal = 0;
|
|
106
|
+
stack.gap = this.gap;
|
|
107
|
+
if (this.gap > 0) {
|
|
108
|
+
// gap cannot be larger of two times the smallest r0
|
|
109
|
+
for (let index = 0; index < stack.r0s.length; index++)
|
|
110
|
+
if (2 * stack.r0s[index] < stack.gap)
|
|
111
|
+
stack.gap = 2 * stack.r0s[index];
|
|
112
|
+
for (let index = 0; index < stack.r0ps.length; index++) {
|
|
113
|
+
let r0 = (stack.r0ps[index] * this.R) / 100;
|
|
114
|
+
if (2 * r0 < stack.gap)
|
|
115
|
+
stack.gap = 2 * r0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
while (stack.gap > 0) {
|
|
119
|
+
for (let index = 0; index < stack.r0s.length; index++)
|
|
120
|
+
gapAngleTotal += 2 * Math.asin(stack.gap / stack.r0s[index] / 2);
|
|
121
|
+
for (let index = 0; index < stack.r0ps.length; index++)
|
|
122
|
+
gapAngleTotal += 2 * Math.asin(stack.gap / ((stack.r0ps[index] * this.R) / 100) / 2);
|
|
123
|
+
if (gapAngleTotal < 0.25 * this.angleTotal)
|
|
124
|
+
break;
|
|
125
|
+
stack.gap = stack.gap * 0.95;
|
|
126
|
+
gapAngleTotal = 0;
|
|
127
|
+
}
|
|
128
|
+
if (gapAngleTotal == 0)
|
|
129
|
+
stack.gap = 0;
|
|
130
|
+
stack.angleFactor = stack.total > 0 ? (this.angleTotal - gapAngleTotal) / stack.total : 0;
|
|
131
|
+
stack.lastAngle = this.startAngle;
|
|
132
|
+
}
|
|
133
|
+
this.cx = (rect.l + rect.r) / 2;
|
|
134
|
+
this.cy = (rect.t + rect.b) / 2;
|
|
135
|
+
}
|
|
136
|
+
map(stack, value, r, r0, percentageRadius) {
|
|
137
|
+
if (percentageRadius) {
|
|
138
|
+
r = (r * this.R) / 100;
|
|
139
|
+
r0 = (r0 * this.R) / 100;
|
|
140
|
+
}
|
|
141
|
+
let s = this.stacks[stack];
|
|
142
|
+
let angle = value * s.angleFactor;
|
|
143
|
+
let startAngle = s.lastAngle;
|
|
144
|
+
let clockFactor = this.clockwise ? -1 : 1;
|
|
145
|
+
let gapAngle = r0 > 0 && s.gap > 0 ? 2 * Math.asin(s.gap / r0 / 2) : 0;
|
|
146
|
+
s.lastAngle += clockFactor * (angle + gapAngle);
|
|
147
|
+
let endAngle = startAngle + clockFactor * (angle + gapAngle);
|
|
148
|
+
return {
|
|
149
|
+
startAngle,
|
|
150
|
+
endAngle: startAngle + clockFactor * (angle + gapAngle),
|
|
151
|
+
angle,
|
|
152
|
+
midAngle: (startAngle + endAngle) / 2,
|
|
153
|
+
gap: s.gap,
|
|
154
|
+
cx: this.cx,
|
|
155
|
+
cy: this.cy,
|
|
156
|
+
R: this.R,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function createSvgArc(cx, cy, r0 = 0, r, startAngle, endAngle, br = 0, gap = 0) {
|
|
161
|
+
let gap2 = gap / 2;
|
|
162
|
+
if (startAngle > endAngle) {
|
|
163
|
+
let s = startAngle;
|
|
164
|
+
startAngle = endAngle;
|
|
165
|
+
endAngle = s;
|
|
166
|
+
}
|
|
167
|
+
let path = [];
|
|
168
|
+
// limit br size based on r and r0
|
|
169
|
+
if (br > (r - r0) / 2)
|
|
170
|
+
br = (r - r0) / 2;
|
|
171
|
+
if (br > 0) {
|
|
172
|
+
if (r0 > 0) {
|
|
173
|
+
let innerBr = br;
|
|
174
|
+
let innerSmallArcAngle = Math.asin((br + gap2) / (r0 + br));
|
|
175
|
+
// adjust br according to the available area
|
|
176
|
+
if (innerSmallArcAngle > (endAngle - startAngle) / 2) {
|
|
177
|
+
innerSmallArcAngle = (endAngle - startAngle) / 2;
|
|
178
|
+
let sin = Math.sin(innerSmallArcAngle);
|
|
179
|
+
innerBr = Math.max((r0 * sin - gap2) / (1 - sin), 0);
|
|
180
|
+
}
|
|
181
|
+
let innerHipDiagonal = (r0 + innerBr) * Math.cos(innerSmallArcAngle);
|
|
182
|
+
let innerSmallArc1XFrom = cx + Math.cos(endAngle) * innerHipDiagonal + Math.cos(endAngle - Math.PI / 2) * gap2;
|
|
183
|
+
let innerSmallArc1YFrom = cy - Math.sin(endAngle) * innerHipDiagonal - Math.sin(endAngle - Math.PI / 2) * gap2;
|
|
184
|
+
// move from the first small inner arc
|
|
185
|
+
path.push(move(innerSmallArc1XFrom, innerSmallArc1YFrom));
|
|
186
|
+
let innerSmallArc1XTo = cx + Math.cos(endAngle - innerSmallArcAngle) * r0;
|
|
187
|
+
let innerSmallArc1YTo = cy - Math.sin(endAngle - innerSmallArcAngle) * r0;
|
|
188
|
+
// add first small inner arc
|
|
189
|
+
path.push(arc(innerBr, innerBr, 0, 0, 0, innerSmallArc1XTo, innerSmallArc1YTo));
|
|
190
|
+
// SECOND ARC
|
|
191
|
+
let innerArcXTo = cx + Math.cos(startAngle + innerSmallArcAngle) * r0;
|
|
192
|
+
let innerArcYTo = cy - Math.sin(startAngle + innerSmallArcAngle) * r0;
|
|
193
|
+
// add large inner arc
|
|
194
|
+
path.push(arc(r0, r0, 0, largeArcFlag(endAngle - innerSmallArcAngle - startAngle - innerSmallArcAngle), 1, innerArcXTo, innerArcYTo));
|
|
195
|
+
let innerSmallArc2XTo = cx + Math.cos(startAngle) * innerHipDiagonal + Math.cos(startAngle + Math.PI / 2) * gap2;
|
|
196
|
+
let innerSmallArc2YTo = cy - Math.sin(startAngle) * innerHipDiagonal - Math.sin(startAngle + Math.PI / 2) * gap2;
|
|
197
|
+
// add second small inner arc
|
|
198
|
+
path.push(arc(innerBr, innerBr, 0, 0, 0, innerSmallArc2XTo, innerSmallArc2YTo));
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
path.push(move(cx, cy));
|
|
202
|
+
}
|
|
203
|
+
let outerBr = br;
|
|
204
|
+
let outerSmallArcAngle = Math.asin((br + gap2) / (r - br));
|
|
205
|
+
// tweak br according to the available area
|
|
206
|
+
if (outerSmallArcAngle > (endAngle - startAngle) / 2) {
|
|
207
|
+
outerSmallArcAngle = (endAngle - startAngle) / 2;
|
|
208
|
+
let sin = Math.sin(outerSmallArcAngle);
|
|
209
|
+
outerBr = Math.max((r * sin - gap2) / (1 + sin), 0);
|
|
210
|
+
}
|
|
211
|
+
let outerHipDiagonal = Math.cos(outerSmallArcAngle) * (r - outerBr);
|
|
212
|
+
let outerSmallArc1XFrom = cx + Math.cos(startAngle) * outerHipDiagonal + Math.cos(startAngle + Math.PI / 2) * gap2;
|
|
213
|
+
let outerSmallArc1YFrom = cy - Math.sin(startAngle) * outerHipDiagonal - Math.sin(startAngle + Math.PI / 2) * gap2;
|
|
214
|
+
let outerSmallArc1XTo = cx + Math.cos(startAngle + outerSmallArcAngle) * r;
|
|
215
|
+
let outerSmallArc1YTo = cy - Math.sin(startAngle + outerSmallArcAngle) * r;
|
|
216
|
+
let outerLargeArcXTo = cx + Math.cos(endAngle - outerSmallArcAngle) * r;
|
|
217
|
+
let outerLargeArcYTo = cy - Math.sin(endAngle - outerSmallArcAngle) * r;
|
|
218
|
+
let outerSmallArc2XTo = cx + Math.cos(endAngle) * outerHipDiagonal + Math.cos(endAngle - Math.PI / 2) * gap2;
|
|
219
|
+
let outerSmallArc2YTo = cy - Math.sin(endAngle) * outerHipDiagonal - Math.sin(endAngle - Math.PI / 2) * gap2;
|
|
220
|
+
path.push(line(outerSmallArc1XFrom, outerSmallArc1YFrom), arc(outerBr, outerBr, 0, 0, 0, outerSmallArc1XTo, outerSmallArc1YTo), arc(r, r, 0, largeArcFlag(endAngle - outerSmallArcAngle - startAngle - outerSmallArcAngle), 0, outerLargeArcXTo, outerLargeArcYTo), arc(outerBr, outerBr, 0, 0, 0, outerSmallArc2XTo, outerSmallArc2YTo));
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
if (r0 > 0) {
|
|
224
|
+
let innerGapAngle = r0 > 0 && gap2 > 0 ? Math.asin(gap2 / r0) : 0;
|
|
225
|
+
let innerStartAngle = startAngle + innerGapAngle;
|
|
226
|
+
let innerEndAngle = endAngle - innerGapAngle;
|
|
227
|
+
let startX = cx + Math.cos(innerEndAngle) * r0;
|
|
228
|
+
let startY = cy - Math.sin(innerEndAngle) * r0;
|
|
229
|
+
path.push(move(startX, startY));
|
|
230
|
+
let innerArcToX = cx + Math.cos(innerStartAngle) * r0;
|
|
231
|
+
let innerArcToY = cy - Math.sin(innerStartAngle) * r0;
|
|
232
|
+
path.push(arc(r0, r0, 0, largeArcFlag(innerStartAngle - innerEndAngle), 1, innerArcToX, innerArcToY));
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
path.push(move(cx, cy));
|
|
236
|
+
}
|
|
237
|
+
let outerGapAngle = r > 0 && gap2 > 0 ? Math.asin(gap2 / r) : 0;
|
|
238
|
+
let outerStartAngle = startAngle + outerGapAngle;
|
|
239
|
+
let outerEndAngle = endAngle - outerGapAngle;
|
|
240
|
+
let lineToX = cx + Math.cos(outerStartAngle) * r;
|
|
241
|
+
let lineToY = cy - Math.sin(outerStartAngle) * r;
|
|
242
|
+
path.push(line(lineToX, lineToY));
|
|
243
|
+
let arcToX = cx + Math.cos(outerEndAngle) * r;
|
|
244
|
+
let arcToY = cy - Math.sin(outerEndAngle) * r;
|
|
245
|
+
path.push(arc(r, r, 0, largeArcFlag(outerEndAngle - outerStartAngle), 0, arcToX, arcToY));
|
|
246
|
+
}
|
|
247
|
+
path.push(z());
|
|
248
|
+
return path.join(" ");
|
|
249
|
+
}
|
|
250
|
+
PieChart.prototype.anchors = "0 1 1 0";
|
|
251
|
+
PieChart.prototype.angle = 360;
|
|
252
|
+
PieChart.prototype.startAngle = 0;
|
|
253
|
+
PieChart.prototype.gap = 0;
|
|
254
|
+
Widget.alias("pie-slice");
|
|
255
|
+
export class PieSlice extends Container {
|
|
256
|
+
constructor(config) {
|
|
257
|
+
super(config);
|
|
258
|
+
}
|
|
259
|
+
init() {
|
|
260
|
+
this.selection = Selection.create(this.selection);
|
|
261
|
+
if (this.borderRadius)
|
|
262
|
+
this.br = this.borderRadius;
|
|
263
|
+
super.init();
|
|
264
|
+
}
|
|
265
|
+
declareData(...args) {
|
|
266
|
+
let selection = this.selection.configureWidget(this);
|
|
267
|
+
super.declareData(...args, selection, {
|
|
268
|
+
active: true,
|
|
269
|
+
r0: undefined,
|
|
270
|
+
r: undefined,
|
|
271
|
+
colorIndex: undefined,
|
|
272
|
+
colorMap: undefined,
|
|
273
|
+
colorName: undefined,
|
|
274
|
+
offset: undefined,
|
|
275
|
+
value: undefined,
|
|
276
|
+
disabled: undefined,
|
|
277
|
+
innerPointRadius: undefined,
|
|
278
|
+
outerPointRadius: undefined,
|
|
279
|
+
name: undefined,
|
|
280
|
+
stack: undefined,
|
|
281
|
+
legend: undefined,
|
|
282
|
+
hoverId: undefined,
|
|
283
|
+
br: undefined,
|
|
284
|
+
legendDisplayText: undefined,
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
prepareData(context, instance) {
|
|
288
|
+
let { data } = instance;
|
|
289
|
+
if (data.name && !data.colorName)
|
|
290
|
+
data.colorName = data.name;
|
|
291
|
+
super.prepareData(context, instance);
|
|
292
|
+
}
|
|
293
|
+
explore(context, instance) {
|
|
294
|
+
instance.pie = context.pie;
|
|
295
|
+
if (!instance.pie)
|
|
296
|
+
throw new Error("Pie.Slice must be placed inside a Pie.");
|
|
297
|
+
let { data } = instance;
|
|
298
|
+
instance.valid = isNumber(data.value) && data.value > 0;
|
|
299
|
+
instance.colorMap = data.colorMap && context.getColorMap && context.getColorMap(data.colorMap);
|
|
300
|
+
if (instance.colorMap && data.colorName)
|
|
301
|
+
instance.colorMap.acknowledge(data.colorName);
|
|
302
|
+
instance.hoverSync = context.hoverSync;
|
|
303
|
+
if (instance.valid && data.active) {
|
|
304
|
+
instance.pie.acknowledge(data.stack, data.value, data.r, data.r0, this.percentageRadius);
|
|
305
|
+
super.explore(context, instance);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
prepare(context, instance) {
|
|
309
|
+
let { data, segment, pie, colorMap } = instance;
|
|
310
|
+
if (colorMap && data.colorName) {
|
|
311
|
+
data.colorIndex = colorMap.map(data.colorName);
|
|
312
|
+
if (instance.cache("colorIndex", data.colorIndex))
|
|
313
|
+
instance.markShouldUpdate(context);
|
|
314
|
+
}
|
|
315
|
+
if (instance.valid && data.active) {
|
|
316
|
+
let seg = pie.map(data.stack, data.value, data.r, data.r0, this.percentageRadius);
|
|
317
|
+
if (!segment ||
|
|
318
|
+
instance.shouldUpdate ||
|
|
319
|
+
seg.startAngle != segment.startAngle ||
|
|
320
|
+
seg.endAngle != segment.endAngle ||
|
|
321
|
+
pie.shouldUpdate) {
|
|
322
|
+
if (data.offset > 0) {
|
|
323
|
+
seg.ox = seg.cx + Math.cos(seg.midAngle) * data.offset;
|
|
324
|
+
seg.oy = seg.cy - Math.sin(seg.midAngle) * data.offset;
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
seg.ox = seg.cx;
|
|
328
|
+
seg.oy = seg.cy;
|
|
329
|
+
}
|
|
330
|
+
seg.radiusMultiplier = 1;
|
|
331
|
+
if (this.percentageRadius)
|
|
332
|
+
seg.radiusMultiplier = seg.R / 100;
|
|
333
|
+
let innerR = data.innerPointRadius != null ? data.innerPointRadius : data.r0;
|
|
334
|
+
let outerR = data.outerPointRadius != null ? data.outerPointRadius : data.r;
|
|
335
|
+
let ix = seg.ox + Math.cos(seg.midAngle) * innerR * seg.radiusMultiplier;
|
|
336
|
+
let iy = seg.oy - Math.sin(seg.midAngle) * innerR * seg.radiusMultiplier;
|
|
337
|
+
let ox = seg.ox + Math.cos(seg.midAngle) * outerR * seg.radiusMultiplier;
|
|
338
|
+
let oy = seg.oy - Math.sin(seg.midAngle) * outerR * seg.radiusMultiplier;
|
|
339
|
+
instance.segment = seg;
|
|
340
|
+
instance.bounds = new Rect({
|
|
341
|
+
l: ix,
|
|
342
|
+
r: ox,
|
|
343
|
+
t: iy,
|
|
344
|
+
b: oy,
|
|
345
|
+
});
|
|
346
|
+
instance.markShouldUpdate(context);
|
|
347
|
+
}
|
|
348
|
+
context.push("parentRect", instance.bounds);
|
|
349
|
+
}
|
|
350
|
+
if (data.name && data.legend && context.addLegendEntry)
|
|
351
|
+
context.addLegendEntry(data.legend, {
|
|
352
|
+
name: data.name,
|
|
353
|
+
active: data.active,
|
|
354
|
+
colorIndex: data.colorIndex,
|
|
355
|
+
disabled: data.disabled,
|
|
356
|
+
selected: this.selection.isInstanceSelected(instance),
|
|
357
|
+
style: data.style,
|
|
358
|
+
shape: this.legendShape,
|
|
359
|
+
hoverId: data.hoverId,
|
|
360
|
+
hoverChannel: this.hoverChannel,
|
|
361
|
+
hoverSync: instance.hoverSync,
|
|
362
|
+
displayText: data.legendDisplayText,
|
|
363
|
+
value: data.value,
|
|
364
|
+
onClick: (e) => {
|
|
365
|
+
this.onLegendClick(e, instance);
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
prepareCleanup(context, instance) {
|
|
370
|
+
if (instance.valid && instance.data.active) {
|
|
371
|
+
context.pop("parentRect");
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
onLegendClick(e, instance) {
|
|
375
|
+
let allActions = this.legendAction == "auto";
|
|
376
|
+
let { data } = instance;
|
|
377
|
+
if (allActions || this.legendAction == "toggle")
|
|
378
|
+
if (instance.set("active", !data.active))
|
|
379
|
+
return;
|
|
380
|
+
if (allActions || this.legendAction == "select")
|
|
381
|
+
this.handleClick(e, instance);
|
|
382
|
+
}
|
|
383
|
+
render(context, instance, key) {
|
|
384
|
+
let { segment, data } = instance;
|
|
385
|
+
if (!instance.valid || !data.active)
|
|
386
|
+
return null;
|
|
387
|
+
return withHoverSync(key, instance.hoverSync, this.hoverChannel, data.hoverId, ({ hover, onMouseMove, onMouseLeave }) => {
|
|
388
|
+
let stateMods = {
|
|
389
|
+
selected: this.selection.isInstanceSelected(instance),
|
|
390
|
+
disabled: data.disabled,
|
|
391
|
+
selectable: !this.selection.isDummy,
|
|
392
|
+
[`color-${data.colorIndex}`]: data.colorIndex != null,
|
|
393
|
+
hover,
|
|
394
|
+
};
|
|
395
|
+
let d = createSvgArc(segment.ox, segment.oy, data.r0 * segment.radiusMultiplier, data.r * segment.radiusMultiplier, segment.startAngle, segment.endAngle, data.br, segment.gap);
|
|
396
|
+
return (_jsxs("g", { className: data.classNames, children: [_jsx("path", { className: this.CSS.element(this.baseClass, "slice", stateMods), style: data.style, d: d, onMouseMove: (e) => {
|
|
397
|
+
onMouseMove(e, instance);
|
|
398
|
+
tooltipMouseMove(e, instance, this.tooltip);
|
|
399
|
+
}, onMouseLeave: (e) => {
|
|
400
|
+
onMouseLeave(e, instance);
|
|
401
|
+
tooltipMouseLeave(e, instance, this.tooltip);
|
|
402
|
+
}, onClick: (e) => {
|
|
403
|
+
this.handleClick(e, instance);
|
|
404
|
+
} }), this.renderChildren(context, instance)] }, key));
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
handleClick(e, instance) {
|
|
408
|
+
if (!this.selection.isDummy) {
|
|
409
|
+
this.selection.selectInstance(instance, {
|
|
410
|
+
toggle: e.ctrlKey,
|
|
411
|
+
});
|
|
412
|
+
e.stopPropagation();
|
|
413
|
+
e.preventDefault();
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function move(x, y) {
|
|
418
|
+
return `M ${x} ${y}`;
|
|
419
|
+
}
|
|
420
|
+
function line(x, y) {
|
|
421
|
+
return `L ${x} ${y}`;
|
|
422
|
+
}
|
|
423
|
+
function z() {
|
|
424
|
+
return "Z";
|
|
425
|
+
}
|
|
426
|
+
function arc(rx, ry, xRotation, largeArc, sweep, x, y) {
|
|
427
|
+
return `A ${rx} ${ry} ${xRotation} ${largeArc} ${sweep} ${x} ${y}`;
|
|
428
|
+
}
|
|
429
|
+
function largeArcFlag(angle) {
|
|
430
|
+
return angle > Math.PI || angle < -Math.PI ? 1 : 0;
|
|
431
|
+
}
|
|
432
|
+
PieSlice.prototype.offset = 0;
|
|
433
|
+
PieSlice.prototype.r0 = 0;
|
|
434
|
+
PieSlice.prototype.r = 50;
|
|
435
|
+
PieSlice.prototype.percentageRadius = true;
|
|
436
|
+
PieSlice.prototype.baseClass = "pieslice";
|
|
437
|
+
PieSlice.prototype.legend = "legend";
|
|
438
|
+
PieSlice.prototype.active = true;
|
|
439
|
+
PieSlice.prototype.stack = "stack";
|
|
440
|
+
PieSlice.prototype.legendAction = "auto";
|
|
441
|
+
PieSlice.prototype.legendShape = "circle";
|
|
442
|
+
PieSlice.prototype.hoverChannel = "default";
|
|
443
|
+
PieSlice.prototype.styled = true;
|
|
444
|
+
PieSlice.prototype.br = 0;
|
|
445
|
+
Widget.alias("pie-chart", PieChart);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { BoundedObject, BoundedObjectConfig, BoundedObjectInstance } from "../svg/BoundedObject";
|
|
3
|
+
import { Rect } from "../svg/util/Rect";
|
|
4
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
5
|
+
import { NumberProp, StringProp, StyleProp } from "../ui/Prop";
|
|
6
|
+
export interface PieLabelConfig extends BoundedObjectConfig {
|
|
7
|
+
/** Distance from the pie center. Default is `100`. */
|
|
8
|
+
distance?: NumberProp;
|
|
9
|
+
/** Style for the connecting line. */
|
|
10
|
+
lineStyle?: StyleProp;
|
|
11
|
+
/** Stroke color for the connecting line. */
|
|
12
|
+
lineStroke?: StringProp;
|
|
13
|
+
/** CSS class for the connecting line. */
|
|
14
|
+
lineClass?: StringProp;
|
|
15
|
+
/** Color index for the connecting line. */
|
|
16
|
+
lineColorIndex?: NumberProp;
|
|
17
|
+
}
|
|
18
|
+
export interface PieLabelInstance extends BoundedObjectInstance {
|
|
19
|
+
originalBounds: Rect;
|
|
20
|
+
actualBounds: Rect;
|
|
21
|
+
parentRect: Rect;
|
|
22
|
+
}
|
|
23
|
+
export declare class PieLabel extends BoundedObject {
|
|
24
|
+
baseClass: string;
|
|
25
|
+
distance: number;
|
|
26
|
+
lineStyle: any;
|
|
27
|
+
constructor(config: PieLabelConfig);
|
|
28
|
+
init(): void;
|
|
29
|
+
declareData(...args: any[]): void;
|
|
30
|
+
calculateBounds(context: RenderingContext, instance: PieLabelInstance): Rect;
|
|
31
|
+
prepare(context: RenderingContext, instance: PieLabelInstance): void;
|
|
32
|
+
prepareCleanup(context: RenderingContext, instance: PieLabelInstance): void;
|
|
33
|
+
render(context: RenderingContext, instance: PieLabelInstance, key: string): React.ReactNode;
|
|
34
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BoundedObject } from "../svg/BoundedObject";
|
|
3
|
+
import { Rect } from "../svg/util/Rect";
|
|
4
|
+
import { parseStyle } from "../util/parseStyle";
|
|
5
|
+
export class PieLabel extends BoundedObject {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super(config);
|
|
8
|
+
}
|
|
9
|
+
init() {
|
|
10
|
+
this.lineStyle = parseStyle(this.lineStyle);
|
|
11
|
+
super.init();
|
|
12
|
+
}
|
|
13
|
+
declareData(...args) {
|
|
14
|
+
super.declareData(...args, {
|
|
15
|
+
distance: undefined,
|
|
16
|
+
lineStyle: { structured: true },
|
|
17
|
+
lineStroke: undefined,
|
|
18
|
+
lineClass: { structured: true },
|
|
19
|
+
lineColorIndex: undefined,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
calculateBounds(context, instance) {
|
|
23
|
+
var { data } = instance;
|
|
24
|
+
var bounds = Rect.add(Rect.add(Rect.multiply(instance.parentRect, data.anchors), data.offset), data.margin);
|
|
25
|
+
instance.originalBounds = bounds;
|
|
26
|
+
instance.actualBounds = context.placePieLabel(bounds, data.distance);
|
|
27
|
+
return new Rect({ t: 0, r: bounds.width(), b: bounds.height(), l: 0 });
|
|
28
|
+
}
|
|
29
|
+
prepare(context, instance) {
|
|
30
|
+
super.prepare(context, instance);
|
|
31
|
+
if (!context.registerPieLabel)
|
|
32
|
+
throw new Error("PieLabel components are allowed only within PieLabelsContainer components.");
|
|
33
|
+
let right = instance.parentRect.r > instance.parentRect.l;
|
|
34
|
+
context.push("textDirection", right ? "right" : "left");
|
|
35
|
+
context.registerPieLabel(instance);
|
|
36
|
+
}
|
|
37
|
+
prepareCleanup(context, instance) {
|
|
38
|
+
context.pop("textDirection");
|
|
39
|
+
}
|
|
40
|
+
render(context, instance, key) {
|
|
41
|
+
let { originalBounds, actualBounds, data } = instance;
|
|
42
|
+
return (_jsxs("g", { className: data.classNames, children: [_jsx("line", { className: this.CSS.element(this.baseClass, "line", data.lineColorIndex != null && "color-" + data.lineColorIndex), x1: actualBounds.l < originalBounds.l ? actualBounds.r : actualBounds.l, y1: (actualBounds.t + actualBounds.b) / 2, x2: (originalBounds.l + originalBounds.r) / 2, y2: (originalBounds.t + originalBounds.b) / 2, stroke: data.lineStroke, style: data.lineStyle }), _jsx("g", { transform: `translate(${instance.actualBounds.l} ${instance.actualBounds.t})`, children: this.renderChildren(context, instance) })] }, key));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
PieLabel.prototype.distance = 100;
|
|
46
|
+
PieLabel.prototype.baseClass = "pielabel";
|
|
47
|
+
PieLabel.prototype.styled = true;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BoundedObject, BoundedObjectConfig, BoundedObjectInstance } from "../svg/BoundedObject";
|
|
2
|
+
import { RenderingContext } from "../ui/RenderingContext";
|
|
3
|
+
import { PieLabelInstance } from "./PieLabel";
|
|
4
|
+
export interface PieLabelsContainerConfig extends BoundedObjectConfig {
|
|
5
|
+
}
|
|
6
|
+
export interface PieLabelsContainerInstance extends BoundedObjectInstance {
|
|
7
|
+
leftLabels: PieLabelInstance[];
|
|
8
|
+
rightLabels: PieLabelInstance[];
|
|
9
|
+
}
|
|
10
|
+
export declare class PieLabelsContainer extends BoundedObject {
|
|
11
|
+
constructor(config: PieLabelsContainerConfig);
|
|
12
|
+
prepare(context: RenderingContext, instance: PieLabelsContainerInstance): void;
|
|
13
|
+
prepareCleanup(context: RenderingContext, instance: PieLabelsContainerInstance): void;
|
|
14
|
+
distributeLabels(labels: PieLabelInstance[], instance: PieLabelsContainerInstance): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BoundedObject } from "../svg/BoundedObject";
|
|
2
|
+
import { Rect } from "../svg/util/Rect";
|
|
3
|
+
export class PieLabelsContainer extends BoundedObject {
|
|
4
|
+
constructor(config) {
|
|
5
|
+
super(config);
|
|
6
|
+
}
|
|
7
|
+
prepare(context, instance) {
|
|
8
|
+
super.prepare(context, instance);
|
|
9
|
+
let { bounds } = instance.data;
|
|
10
|
+
let cx2 = bounds.l + bounds.r;
|
|
11
|
+
context.push("placePieLabel", (labelBounds, distance) => {
|
|
12
|
+
let clone = new Rect(labelBounds);
|
|
13
|
+
let w = clone.r - clone.l;
|
|
14
|
+
if (clone.l + clone.r > cx2) {
|
|
15
|
+
clone.r = Math.min(clone.r + distance, bounds.r);
|
|
16
|
+
clone.l = clone.r - w;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
clone.l = Math.max(bounds.l, clone.l - distance);
|
|
20
|
+
clone.r = clone.l + w;
|
|
21
|
+
}
|
|
22
|
+
return clone;
|
|
23
|
+
});
|
|
24
|
+
instance.leftLabels = [];
|
|
25
|
+
instance.rightLabels = [];
|
|
26
|
+
context.push("registerPieLabel", (label) => {
|
|
27
|
+
if (label.actualBounds.l + label.actualBounds.r < cx2)
|
|
28
|
+
instance.leftLabels.push(label);
|
|
29
|
+
else
|
|
30
|
+
instance.rightLabels.push(label);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
prepareCleanup(context, instance) {
|
|
34
|
+
context.pop("placePieLabel");
|
|
35
|
+
context.pop("registerPieLabel");
|
|
36
|
+
super.prepareCleanup(context, instance);
|
|
37
|
+
this.distributeLabels(instance.leftLabels, instance);
|
|
38
|
+
this.distributeLabels(instance.rightLabels, instance);
|
|
39
|
+
}
|
|
40
|
+
distributeLabels(labels, instance) {
|
|
41
|
+
labels.sort((a, b) => a.actualBounds.t + a.actualBounds.b - (b.actualBounds.t + b.actualBounds.b));
|
|
42
|
+
let totalHeight = labels.reduce((h, l) => h + l.actualBounds.height(), 0);
|
|
43
|
+
let { bounds } = instance.data;
|
|
44
|
+
let avgHeight = Math.min(totalHeight, bounds.height()) / labels.length;
|
|
45
|
+
let at = bounds.t;
|
|
46
|
+
for (let i = 0; i < labels.length; i++) {
|
|
47
|
+
let ab = labels[i].actualBounds;
|
|
48
|
+
ab.t = Math.max(at, Math.min(ab.t, bounds.b - (labels.length - i) * avgHeight));
|
|
49
|
+
ab.b = ab.t + avgHeight;
|
|
50
|
+
at = ab.b;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
PieLabelsContainer.prototype.anchors = "0 1 1 0";
|