@ohif/ui-next 3.14.0-beta.97 → 3.14.0-beta.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ohif-ui-next.umd.js +4 -1925
- package/package.json +18 -7
- package/src/__mocks__/fileMock.js +7 -0
- package/src/assets/fonts.css +50 -0
- package/src/assets/styles.css +55 -0
- package/src/assets/woff2/latin.woff2 +0 -0
- package/src/components/Accordion/Accordion.tsx +70 -0
- package/src/components/Accordion/index.ts +3 -0
- package/src/components/AllInOneMenu/BackItem.tsx +32 -0
- package/src/components/AllInOneMenu/DividerItem.tsx +11 -0
- package/src/components/AllInOneMenu/HeaderItem.tsx +15 -0
- package/src/components/AllInOneMenu/IconMenu.tsx +83 -0
- package/src/components/AllInOneMenu/Item.tsx +51 -0
- package/src/components/AllInOneMenu/ItemPanel.tsx +38 -0
- package/src/components/AllInOneMenu/Menu.tsx +231 -0
- package/src/components/AllInOneMenu/PanelSelector.tsx +32 -0
- package/src/components/AllInOneMenu/SubMenu.tsx +36 -0
- package/src/components/AllInOneMenu/index.ts +42 -0
- package/src/components/BackgroundColorSelect/BackgroundColorSelect.tsx +38 -0
- package/src/components/BackgroundColorSelect/index.tsx +1 -0
- package/src/components/Badge/Badge.tsx +38 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Button/Button.tsx +65 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Calendar/Calendar.tsx +258 -0
- package/src/components/Calendar/index.tsx +3 -0
- package/src/components/Card/Card.tsx +83 -0
- package/src/components/Card/index.ts +2 -0
- package/src/components/Checkbox/Checkbox.tsx +27 -0
- package/src/components/Checkbox/index.tsx +3 -0
- package/src/components/CinePlayer/CinePlayer.tsx +187 -0
- package/src/components/CinePlayer/index.ts +5 -0
- package/src/components/Clipboard/Clipboard.tsx +58 -0
- package/src/components/Clipboard/index.tsx +3 -0
- package/src/components/ColorCircle.tsx +12 -0
- package/src/components/Combobox/Combobox.tsx +66 -0
- package/src/components/Combobox/index.ts +3 -0
- package/src/components/Command/Command.tsx +149 -0
- package/src/components/Command/index.ts +23 -0
- package/src/components/ContextMenu/ContextMenu.tsx +202 -0
- package/src/components/ContextMenu/index.ts +35 -0
- package/src/components/ContextMenuViewport/ContextMenuViewport.tsx +47 -0
- package/src/components/ContextMenuViewport/index.ts +1 -0
- package/src/components/DataRow/DataRow.tsx +532 -0
- package/src/components/DataRow/index.ts +1 -0
- package/src/components/DataRow/types.ts +31 -0
- package/src/components/DataTable/ActionOverlayCell.tsx +153 -0
- package/src/components/DataTable/ColumnHeader.tsx +70 -0
- package/src/components/DataTable/DataTable.tsx +532 -0
- package/src/components/DataTable/FilterRow.tsx +52 -0
- package/src/components/DataTable/Pagination.tsx +78 -0
- package/src/components/DataTable/Title.tsx +5 -0
- package/src/components/DataTable/Toolbar.tsx +5 -0
- package/src/components/DataTable/ViewOptions.tsx +86 -0
- package/src/components/DataTable/context.tsx +21 -0
- package/src/components/DataTable/index.ts +5 -0
- package/src/components/DataTable/types.ts +27 -0
- package/src/components/DataTable/useResponsiveColumns.tsx +346 -0
- package/src/components/DateRange/DateRange.tsx +163 -0
- package/src/components/DateRange/index.ts +3 -0
- package/src/components/Dialog/Dialog.tsx +201 -0
- package/src/components/Dialog/index.ts +25 -0
- package/src/components/Dialog/useDraggable.ts +108 -0
- package/src/components/DisplaySetMessageListTooltip/DisplaySetMessageListTooltip.tsx +64 -0
- package/src/components/DisplaySetMessageListTooltip/index.ts +3 -0
- package/src/components/DoubleSlider/DoubleSlider.test.ts +232 -0
- package/src/components/DoubleSlider/DoubleSlider.tsx +211 -0
- package/src/components/DoubleSlider/index.tsx +3 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +213 -0
- package/src/components/DropdownMenu/index.ts +35 -0
- package/src/components/Errorboundary/ErrorBoundary.tsx +345 -0
- package/src/components/Errorboundary/index.tsx +3 -0
- package/src/components/FooterAction/FooterAction.tsx +115 -0
- package/src/components/FooterAction/index.tsx +3 -0
- package/src/components/Header/Header.tsx +140 -0
- package/src/components/Header/index.js +2 -0
- package/src/components/HoverCard/HoverCard.tsx +30 -0
- package/src/components/HoverCard/index.ts +1 -0
- package/src/components/Icons/Icons.tsx +852 -0
- package/src/components/Icons/Sources/ActionNewDialog.tsx +64 -0
- package/src/components/Icons/Sources/Actions.tsx +47 -0
- package/src/components/Icons/Sources/Add.tsx +51 -0
- package/src/components/Icons/Sources/Alert.tsx +32 -0
- package/src/components/Icons/Sources/AlertOutline.tsx +30 -0
- package/src/components/Icons/Sources/ArrowLeftBold.tsx +49 -0
- package/src/components/Icons/Sources/ArrowRight.tsx +25 -0
- package/src/components/Icons/Sources/Cancel.tsx +37 -0
- package/src/components/Icons/Sources/CheckBoxChecked.tsx +39 -0
- package/src/components/Icons/Sources/CheckBoxUnChecked.tsx +25 -0
- package/src/components/Icons/Sources/Checked.tsx +23 -0
- package/src/components/Icons/Sources/ChevronClosed.tsx +40 -0
- package/src/components/Icons/Sources/ChevronLeft.tsx +28 -0
- package/src/components/Icons/Sources/ChevronOpen.tsx +38 -0
- package/src/components/Icons/Sources/Clear.tsx +34 -0
- package/src/components/Icons/Sources/Clipboard.tsx +15 -0
- package/src/components/Icons/Sources/Close.tsx +28 -0
- package/src/components/Icons/Sources/CloudSettings.tsx +34 -0
- package/src/components/Icons/Sources/Code.tsx +7 -0
- package/src/components/Icons/Sources/ColorChange.tsx +100 -0
- package/src/components/Icons/Sources/ContentNext.tsx +35 -0
- package/src/components/Icons/Sources/ContentPrev.tsx +35 -0
- package/src/components/Icons/Sources/Controls.tsx +99 -0
- package/src/components/Icons/Sources/Copy.tsx +44 -0
- package/src/components/Icons/Sources/Database.tsx +33 -0
- package/src/components/Icons/Sources/Delete.tsx +58 -0
- package/src/components/Icons/Sources/DicomTagBrowser.tsx +79 -0
- package/src/components/Icons/Sources/DisplayFillAndOutline.tsx +49 -0
- package/src/components/Icons/Sources/DisplayFillOnly.tsx +40 -0
- package/src/components/Icons/Sources/DisplayOutlineOnly.tsx +40 -0
- package/src/components/Icons/Sources/Download.tsx +75 -0
- package/src/components/Icons/Sources/Export.tsx +53 -0
- package/src/components/Icons/Sources/ExternalLink.tsx +26 -0
- package/src/components/Icons/Sources/EyeHidden.tsx +32 -0
- package/src/components/Icons/Sources/EyeVisible.tsx +28 -0
- package/src/components/Icons/Sources/FeedbackComplete.tsx +35 -0
- package/src/components/Icons/Sources/GearSettings.tsx +59 -0
- package/src/components/Icons/Sources/GroupLayers.tsx +33 -0
- package/src/components/Icons/Sources/Helpers.tsx +398 -0
- package/src/components/Icons/Sources/Hide.tsx +45 -0
- package/src/components/Icons/Sources/IconColorLUT.tsx +103 -0
- package/src/components/Icons/Sources/IconMPR.tsx +55 -0
- package/src/components/Icons/Sources/IconTransferring.tsx +25 -0
- package/src/components/Icons/Sources/IllustrationNotFound.tsx +102 -0
- package/src/components/Icons/Sources/Info.tsx +55 -0
- package/src/components/Icons/Sources/InfoLink.tsx +23 -0
- package/src/components/Icons/Sources/InfoSeries.tsx +52 -0
- package/src/components/Icons/Sources/InvestigationalUse.tsx +82 -0
- package/src/components/Icons/Sources/JumpToSlice.tsx +69 -0
- package/src/components/Icons/Sources/LaunchArrow.tsx +34 -0
- package/src/components/Icons/Sources/LaunchInfo.tsx +38 -0
- package/src/components/Icons/Sources/LayerBackground.tsx +28 -0
- package/src/components/Icons/Sources/LayerForeground.tsx +34 -0
- package/src/components/Icons/Sources/LayerSegmentation.tsx +20 -0
- package/src/components/Icons/Sources/Layout.tsx +433 -0
- package/src/components/Icons/Sources/Link.tsx +58 -0
- package/src/components/Icons/Sources/ListView.tsx +79 -0
- package/src/components/Icons/Sources/LoadingOHIFMark.tsx +21 -0
- package/src/components/Icons/Sources/LoadingSpinner.tsx +49 -0
- package/src/components/Icons/Sources/Lock.tsx +35 -0
- package/src/components/Icons/Sources/Magnifier.tsx +37 -0
- package/src/components/Icons/Sources/Minus.tsx +40 -0
- package/src/components/Icons/Sources/MissingIcon.tsx +6 -0
- package/src/components/Icons/Sources/More.tsx +53 -0
- package/src/components/Icons/Sources/MultiplePatients.tsx +76 -0
- package/src/components/Icons/Sources/NavigationPanelReveal.tsx +25 -0
- package/src/components/Icons/Sources/NotificationInfo.tsx +33 -0
- package/src/components/Icons/Sources/NotificationWarning.tsx +44 -0
- package/src/components/Icons/Sources/OHIFLogo.tsx +72 -0
- package/src/components/Icons/Sources/OHIFLogoColorDarkBackground.tsx +78 -0
- package/src/components/Icons/Sources/OHIFLogoHorizontal.tsx +139 -0
- package/src/components/Icons/Sources/Opacity.tsx +106 -0
- package/src/components/Icons/Sources/OrientationSwitch.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchA.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchC.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchR.tsx +41 -0
- package/src/components/Icons/Sources/OrientationSwitchS.tsx +41 -0
- package/src/components/Icons/Sources/PanelRight.tsx +29 -0
- package/src/components/Icons/Sources/Patient.tsx +58 -0
- package/src/components/Icons/Sources/PatientStudyList.tsx +62 -0
- package/src/components/Icons/Sources/Pause.tsx +26 -0
- package/src/components/Icons/Sources/Pencil.tsx +16 -0
- package/src/components/Icons/Sources/Pin.tsx +50 -0
- package/src/components/Icons/Sources/PinFill.tsx +51 -0
- package/src/components/Icons/Sources/Play.tsx +25 -0
- package/src/components/Icons/Sources/Plus.tsx +29 -0
- package/src/components/Icons/Sources/PowerOff.tsx +19 -0
- package/src/components/Icons/Sources/Redo.tsx +51 -0
- package/src/components/Icons/Sources/Refresh.tsx +42 -0
- package/src/components/Icons/Sources/Rename.tsx +50 -0
- package/src/components/Icons/Sources/Search.tsx +35 -0
- package/src/components/Icons/Sources/SegActions.tsx +594 -0
- package/src/components/Icons/Sources/Series.tsx +47 -0
- package/src/components/Icons/Sources/SeriesPlaceholder.tsx +40 -0
- package/src/components/Icons/Sources/Settings.tsx +105 -0
- package/src/components/Icons/Sources/SettingsStudyList.tsx +28 -0
- package/src/components/Icons/Sources/Show.tsx +67 -0
- package/src/components/Icons/Sources/SidePanelCloseLeft.tsx +75 -0
- package/src/components/Icons/Sources/SidePanelCloseRight.tsx +74 -0
- package/src/components/Icons/Sources/SocialGithub.tsx +39 -0
- package/src/components/Icons/Sources/Sorting.tsx +39 -0
- package/src/components/Icons/Sources/SortingAscending.tsx +28 -0
- package/src/components/Icons/Sources/SortingDescending.tsx +26 -0
- package/src/components/Icons/Sources/SortingNew.tsx +20 -0
- package/src/components/Icons/Sources/SortingNewAscending.tsx +35 -0
- package/src/components/Icons/Sources/SortingNewDescending.tsx +35 -0
- package/src/components/Icons/Sources/StatusAlert.tsx +36 -0
- package/src/components/Icons/Sources/StatusError.tsx +57 -0
- package/src/components/Icons/Sources/StatusLocked.tsx +35 -0
- package/src/components/Icons/Sources/StatusSuccess.tsx +45 -0
- package/src/components/Icons/Sources/StatusTracking.tsx +37 -0
- package/src/components/Icons/Sources/StatusUntracked.tsx +30 -0
- package/src/components/Icons/Sources/StatusWarning.tsx +58 -0
- package/src/components/Icons/Sources/Tab4D.tsx +54 -0
- package/src/components/Icons/Sources/TabContours.tsx +63 -0
- package/src/components/Icons/Sources/TabLinear.tsx +47 -0
- package/src/components/Icons/Sources/TabPatientInfo.tsx +33 -0
- package/src/components/Icons/Sources/TabRoiThreshold.tsx +38 -0
- package/src/components/Icons/Sources/TabSegmentation.tsx +38 -0
- package/src/components/Icons/Sources/TabStudies.tsx +62 -0
- package/src/components/Icons/Sources/Threshold.tsx +38 -0
- package/src/components/Icons/Sources/ThumbnailView.tsx +67 -0
- package/src/components/Icons/Sources/Tools.tsx +3659 -0
- package/src/components/Icons/Sources/Trash.tsx +17 -0
- package/src/components/Icons/Sources/Undo.tsx +51 -0
- package/src/components/Icons/Sources/Upload.tsx +29 -0
- package/src/components/Icons/Sources/ViewportViews.tsx +45 -0
- package/src/components/Icons/Sources/ViewportWindowLevel.tsx +58 -0
- package/src/components/Icons/Sources/WindowLevelAdvanced.tsx +30 -0
- package/src/components/Icons/index.ts +4 -0
- package/src/components/Icons/types.ts +3 -0
- package/src/components/Input/Input.tsx +25 -0
- package/src/components/Input/index.tsx +3 -0
- package/src/components/InputFilter/InputFilter.tsx +200 -0
- package/src/components/InputFilter/index.ts +2 -0
- package/src/components/InputMultiSelect/InputMultiSelect.tsx +370 -0
- package/src/components/InputMultiSelect/index.ts +1 -0
- package/src/components/InputNumber/InputNumber.tsx +439 -0
- package/src/components/InputNumber/index.ts +3 -0
- package/src/components/InvestigationalUseDialog/InvestigationalUseDialog.tsx +98 -0
- package/src/components/InvestigationalUseDialog/index.ts +3 -0
- package/src/components/Label/Label.tsx +24 -0
- package/src/components/Label/index.tsx +3 -0
- package/src/components/Labelling/LabellingFlow.tsx +92 -0
- package/src/components/Labelling/index.ts +2 -0
- package/src/components/LayoutSelector/LayoutSelector.tsx +345 -0
- package/src/components/LayoutSelector/index.ts +4 -0
- package/src/components/LineChart/LineChart.css +40 -0
- package/src/components/LineChart/LineChart.tsx +101 -0
- package/src/components/LineChart/d3LineChart/chart.ts +365 -0
- package/src/components/LineChart/d3LineChart/events.ts +149 -0
- package/src/components/LineChart/d3LineChart/index.ts +3 -0
- package/src/components/LineChart/d3LineChart/lineChart.ts +272 -0
- package/src/components/LineChart/index.ts +1 -0
- package/src/components/LoadingIndicatorProgress/LoadingIndicatorProgress.tsx +29 -0
- package/src/components/LoadingIndicatorProgress/index.ts +2 -0
- package/src/components/LoadingIndicatorTotalPercent/LoadingIndicatorTotalPercent.tsx +49 -0
- package/src/components/LoadingIndicatorTotalPercent/index.ts +2 -0
- package/src/components/MeasurementTable/MeasurementTable.tsx +144 -0
- package/src/components/MeasurementTable/index.js +3 -0
- package/src/components/Modal/Modal.tsx +44 -0
- package/src/components/NavBar/NavBar.tsx +32 -0
- package/src/components/NavBar/index.js +2 -0
- package/src/components/Numeric/Numeric.test.ts +124 -0
- package/src/components/Numeric/Numeric.tsx +576 -0
- package/src/components/Numeric/index.ts +3 -0
- package/src/components/OHIFDialogs/InputDialog.tsx +287 -0
- package/src/components/OHIFDialogs/PresetDialog.tsx +106 -0
- package/src/components/OHIFDialogs/index.ts +2 -0
- package/src/components/OHIFModals/AboutModal.tsx +114 -0
- package/src/components/OHIFModals/AppearanceModal.tsx +38 -0
- package/src/components/OHIFModals/ImageModal.tsx +251 -0
- package/src/components/OHIFModals/UserPreferencesModal.tsx +229 -0
- package/src/components/OHIFModals/index.ts +4 -0
- package/src/components/OHIFPanels/WindowLevel.tsx +162 -0
- package/src/components/OHIFPanels/WindowLevelHistogram.tsx +237 -0
- package/src/components/OHIFPanels/index.ts +3 -0
- package/src/components/OHIFPanels/types.ts +41 -0
- package/src/components/OHIFToolSettings/RowDoubleRange.tsx +67 -0
- package/src/components/OHIFToolSettings/RowInputRange.tsx +65 -0
- package/src/components/OHIFToolSettings/RowSegmentedControl.tsx +77 -0
- package/src/components/OHIFToolSettings/ToolSettings.tsx +253 -0
- package/src/components/OHIFToolSettings/index.ts +1 -0
- package/src/components/OHIFToolbox/ToolboxUI.tsx +104 -0
- package/src/components/OHIFToolbox/index.ts +1 -0
- package/src/components/Onboarding/Onboarding.css +48 -0
- package/src/components/Onboarding/Onboarding.tsx +58 -0
- package/src/components/Onboarding/index.ts +3 -0
- package/src/components/Onboarding/utilities.ts +91 -0
- package/src/components/PanelSection/PanelSection.tsx +70 -0
- package/src/components/PanelSection/index.ts +2 -0
- package/src/components/Popover/Popover.tsx +35 -0
- package/src/components/Popover/index.ts +3 -0
- package/src/components/ProgressDropdown/ProgressDiscreteBar.tsx +24 -0
- package/src/components/ProgressDropdown/ProgressDropdown.tsx +158 -0
- package/src/components/ProgressDropdown/ProgressItem.tsx +27 -0
- package/src/components/ProgressDropdown/ProgressItemDetail.tsx +89 -0
- package/src/components/ProgressDropdown/index.ts +1 -0
- package/src/components/ProgressDropdown/types.ts +9 -0
- package/src/components/ProgressLoadingBar/ProgressLoadingBar.css +26 -0
- package/src/components/ProgressLoadingBar/ProgressLoadingBar.tsx +32 -0
- package/src/components/ProgressLoadingBar/index.ts +2 -0
- package/src/components/Resizable/Resizable.tsx +43 -0
- package/src/components/Resizable/index.ts +3 -0
- package/src/components/ScrollArea/ScrollArea.tsx +127 -0
- package/src/components/ScrollArea/index.tsx +3 -0
- package/src/components/SegmentationTable/AddSegmentRow.tsx +78 -0
- package/src/components/SegmentationTable/AddSegmentationRow.tsx +56 -0
- package/src/components/SegmentationTable/SegmentStatistics.tsx +104 -0
- package/src/components/SegmentationTable/SegmentationCollapsed.tsx +211 -0
- package/src/components/SegmentationTable/SegmentationExpanded.tsx +173 -0
- package/src/components/SegmentationTable/SegmentationHeader.tsx +58 -0
- package/src/components/SegmentationTable/SegmentationLabel.tsx +27 -0
- package/src/components/SegmentationTable/SegmentationSegments.tsx +206 -0
- package/src/components/SegmentationTable/SegmentationTable.tsx +169 -0
- package/src/components/SegmentationTable/SegmentationTableConfig.tsx +194 -0
- package/src/components/SegmentationTable/contexts/SegmentStatisticsContext.tsx +45 -0
- package/src/components/SegmentationTable/contexts/SegmentationExpandedContext.tsx +45 -0
- package/src/components/SegmentationTable/contexts/SegmentationTableContext.tsx +148 -0
- package/src/components/SegmentationTable/contexts/index.ts +15 -0
- package/src/components/SegmentationTable/index.ts +24 -0
- package/src/components/Select/Select.tsx +167 -0
- package/src/components/Select/index.tsx +40 -0
- package/src/components/Separator/Separator.tsx +32 -0
- package/src/components/Separator/index.ts +3 -0
- package/src/components/Separator/index.tsx +3 -0
- package/src/components/SidePanel/SidePanel.tsx +479 -0
- package/src/components/SidePanel/index.ts +2 -0
- package/src/components/Slider/Slider.tsx +24 -0
- package/src/components/Slider/index.tsx +3 -0
- package/src/components/SmartScrollbar/SmartScrollbar.tsx +349 -0
- package/src/components/SmartScrollbar/SmartScrollbarEndpoints.tsx +82 -0
- package/src/components/SmartScrollbar/SmartScrollbarFill.tsx +54 -0
- package/src/components/SmartScrollbar/SmartScrollbarIndicator.tsx +59 -0
- package/src/components/SmartScrollbar/SmartScrollbarTrack.tsx +104 -0
- package/src/components/SmartScrollbar/defaultSmartScrollbarIndicatorConfig.tsx +48 -0
- package/src/components/SmartScrollbar/index.ts +11 -0
- package/src/components/SmartScrollbar/useByteArray.ts +146 -0
- package/src/components/SmartScrollbar/utils.test.ts +124 -0
- package/src/components/SmartScrollbar/utils.ts +168 -0
- package/src/components/Sonner/Sonner.tsx +31 -0
- package/src/components/Sonner/index.ts +4 -0
- package/src/components/StudyBrowser/StudyBrowser.tsx +89 -0
- package/src/components/StudyBrowser/index.ts +2 -0
- package/src/components/StudyBrowserSort/StudyBrowserSort.tsx +87 -0
- package/src/components/StudyBrowserSort/index.ts +3 -0
- package/src/components/StudyBrowserViewOptions/StudyBrowserViewOptions.tsx +50 -0
- package/src/components/StudyBrowserViewOptions/index.ts +3 -0
- package/src/components/StudyItem/StudyItem.tsx +100 -0
- package/src/components/StudyItem/index.ts +2 -0
- package/src/components/StudyList/columns/defaultColumns.tsx +258 -0
- package/src/components/StudyList/components/ActionCell.tsx +19 -0
- package/src/components/StudyList/components/Layout.tsx +206 -0
- package/src/components/StudyList/components/PreviewContainer.tsx +45 -0
- package/src/components/StudyList/components/PreviewContent.tsx +186 -0
- package/src/components/StudyList/components/PreviewHeader.tsx +5 -0
- package/src/components/StudyList/components/PreviewPatientSummary.tsx +224 -0
- package/src/components/StudyList/components/PreviewSeriesList.tsx +64 -0
- package/src/components/StudyList/components/PreviewToggleButton.tsx +69 -0
- package/src/components/StudyList/components/SettingsPopover.tsx +214 -0
- package/src/components/StudyList/components/Table.tsx +247 -0
- package/src/components/StudyList/components/WorkflowMenu.tsx +72 -0
- package/src/components/StudyList/components/WorkflowsProvider.tsx +169 -0
- package/src/components/StudyList/hooks/useDefaultWorkflow.ts +60 -0
- package/src/components/StudyList/index.ts +52 -0
- package/src/components/StudyList/types/types.ts +42 -0
- package/src/components/StudyList/utils/tokenizeModalities.ts +6 -0
- package/src/components/StudySummary/StudySummary.tsx +27 -0
- package/src/components/StudySummary/index.tsx +3 -0
- package/src/components/Switch/Switch.tsx +28 -0
- package/src/components/Switch/index.tsx +3 -0
- package/src/components/Table/Table.tsx +134 -0
- package/src/components/Table/index.ts +11 -0
- package/src/components/Tabs/Tabs.tsx +56 -0
- package/src/components/Tabs/index.ts +3 -0
- package/src/components/Tabs/index.tsx +3 -0
- package/src/components/ThemeWrapper/ThemeWrapper.tsx +5 -0
- package/src/components/ThemeWrapper/index.ts +1 -0
- package/src/components/Thumbnail/Thumbnail.test.ts +71 -0
- package/src/components/Thumbnail/Thumbnail.tsx +351 -0
- package/src/components/Thumbnail/index.ts +2 -0
- package/src/components/ThumbnailList/ThumbnailList.tsx +94 -0
- package/src/components/ThumbnailList/index.ts +2 -0
- package/src/components/Toggle/Toggle.tsx +45 -0
- package/src/components/Toggle/index.ts +3 -0
- package/src/components/Toggle/index.tsx +3 -0
- package/src/components/ToggleGroup/ToggleGroup.tsx +63 -0
- package/src/components/ToggleGroup/index.ts +3 -0
- package/src/components/ToolButton/ToolButton.tsx +134 -0
- package/src/components/ToolButton/ToolButtonList.tsx +243 -0
- package/src/components/ToolButton/index.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +34 -0
- package/src/components/Tooltip/index.ts +3 -0
- package/src/components/Viewport/ImageScrollbar.module.css +89 -0
- package/src/components/Viewport/ImageScrollbar.tsx +71 -0
- package/src/components/Viewport/PatientInfo.tsx +126 -0
- package/src/components/Viewport/ViewportActionArrows.tsx +36 -0
- package/src/components/Viewport/ViewportActionBar.tsx +107 -0
- package/src/components/Viewport/ViewportActionButton.tsx +25 -0
- package/src/components/Viewport/ViewportActionCorners.tsx +171 -0
- package/src/components/Viewport/ViewportGrid.tsx +24 -0
- package/src/components/Viewport/ViewportOverlay.css +32 -0
- package/src/components/Viewport/ViewportOverlay.tsx +54 -0
- package/src/components/Viewport/ViewportPane.tsx +82 -0
- package/src/components/Viewport/index.ts +9 -0
- package/src/components/ViewportDialog/ViewportDialog.tsx +128 -0
- package/src/components/ViewportDialog/index.ts +2 -0
- package/src/components/index.ts +323 -0
- package/src/contextProviders/ActiveThemeProvider.tsx +204 -0
- package/src/contextProviders/CineProvider.tsx +98 -0
- package/src/contextProviders/DialogProvider.tsx +103 -0
- package/src/contextProviders/DragAndDropProvider.tsx +37 -0
- package/src/contextProviders/IconPresentationProvider.tsx +88 -0
- package/src/contextProviders/ImageViewerProvider.tsx +15 -0
- package/src/contextProviders/ManagedDialog.tsx +176 -0
- package/src/contextProviders/ModalProvider.tsx +102 -0
- package/src/contextProviders/NotificationProvider.tsx +246 -0
- package/src/contextProviders/UserAuthenticationProvider.tsx +118 -0
- package/src/contextProviders/ViewportDialogProvider.tsx +42 -0
- package/src/contextProviders/ViewportGridProvider.tsx +556 -0
- package/src/contextProviders/index.ts +26 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useDynamicMaxHeight.ts +105 -0
- package/src/hooks/useSessionStorage.test.js +103 -0
- package/src/hooks/useSessionStorage.tsx +71 -0
- package/src/index.ts +7 -0
- package/src/lib/utils.ts +6 -0
- package/src/tailwind.css +266 -0
- package/src/themes/arctic.json +31 -0
- package/src/themes/deep.json +31 -0
- package/src/themes/index.ts +16 -0
- package/src/themes/midnight.json +31 -0
- package/src/themes/orchid.json +31 -0
- package/src/themes/slate.json +31 -0
- package/src/themes/themes.css +206 -0
- package/src/themes/verdant.json +31 -0
- package/src/types/ActionCorners.ts +18 -0
- package/src/types/AppTypes.ts +24 -0
- package/src/types/ContextMenuItem.ts +9 -0
- package/src/types/Predicate.ts +1 -0
- package/src/types/ThumbnailType.ts +3 -0
- package/src/types/ViewportActionCornersTypes.ts +13 -0
- package/src/types/global.d.ts +4 -0
- package/src/types/index.ts +21 -0
- package/src/utils/formatDICOMDate.test.ts +61 -0
- package/src/utils/formatDICOMDate.ts +65 -0
- package/src/utils/formatDICOMTime.test.ts +62 -0
- package/src/utils/formatDICOMTime.ts +49 -0
- package/src/utils/getToggledClassName.tsx +5 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/parseStudyDateTimestamp.test.ts +47 -0
- package/src/utils/parseStudyDateTimestamp.ts +27 -0
- package/src/utils/roundNumber.ts +43 -0
- package/tailwind.config.js +120 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* It adds attributes to root element from passed attributes list
|
|
3
|
+
*
|
|
4
|
+
* @param {object} root svg element to be changed
|
|
5
|
+
* @param {object} attributes list of attributes to be added on root element
|
|
6
|
+
* @modifies {root}
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
const _addAttributes = (root, attributes = []) => {
|
|
10
|
+
for (const attr of attributes) {
|
|
11
|
+
const { key, value } = attr;
|
|
12
|
+
|
|
13
|
+
if (key && value) {
|
|
14
|
+
if (key === 'class') {
|
|
15
|
+
root.classed(value, true);
|
|
16
|
+
} else {
|
|
17
|
+
root.attr(key, value);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* It formats axis labels. It adds units if existing
|
|
25
|
+
*
|
|
26
|
+
* @param {Object} def
|
|
27
|
+
* @param {string} def.label string representing axis label
|
|
28
|
+
* @param {string} [def.unit] string representing axis unit
|
|
29
|
+
* @return {string} formatted label
|
|
30
|
+
*/
|
|
31
|
+
const _formatAxisLabel = ({ label, unit }) => {
|
|
32
|
+
let formattedLabel = label;
|
|
33
|
+
|
|
34
|
+
if (unit) {
|
|
35
|
+
formattedLabel += `(${unit})`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return formattedLabel;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* It appends chart svg element container to root element
|
|
43
|
+
*
|
|
44
|
+
* @param {object} root svg element to be changed
|
|
45
|
+
* @param {number} width width of container
|
|
46
|
+
* @param {number} height height of container
|
|
47
|
+
* @param {number} translateX value to translate on axis x
|
|
48
|
+
* @param {number} translateY value to translate on axis y
|
|
49
|
+
* @modifies {root}
|
|
50
|
+
*
|
|
51
|
+
* @return {object} appended chart container (svg element)
|
|
52
|
+
*/
|
|
53
|
+
const _addChartContainer = (root, width, height, translateX, translateY) => {
|
|
54
|
+
root.append('rect').attr('class', 'background').attr('width', width).attr('height', height);
|
|
55
|
+
|
|
56
|
+
return root
|
|
57
|
+
.append('g')
|
|
58
|
+
.attr('width', width)
|
|
59
|
+
.attr('height', height)
|
|
60
|
+
.append('g')
|
|
61
|
+
.attr('transform', 'translate(' + translateX + ',' + translateY + ')');
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const _addLegend = (root, width, height, posX, posY) => {
|
|
65
|
+
const legendContainer = root
|
|
66
|
+
.append('g')
|
|
67
|
+
.attr('class', 'legend')
|
|
68
|
+
.attr('transform', 'translate(' + posX + ',' + posY + ')');
|
|
69
|
+
|
|
70
|
+
legendContainer
|
|
71
|
+
.append('rect')
|
|
72
|
+
.attr('class', 'legend-background')
|
|
73
|
+
.attr('width', width)
|
|
74
|
+
.attr('height', height);
|
|
75
|
+
|
|
76
|
+
return legendContainer;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const _setLegendLabels = (root, labels, colors, itemHeight, itemWidth, textEllipses) => {
|
|
80
|
+
const yOffset = itemHeight / 2;
|
|
81
|
+
const textLeft = 20;
|
|
82
|
+
|
|
83
|
+
// Add one dot in the legend for each
|
|
84
|
+
root
|
|
85
|
+
.selectAll('labelDots')
|
|
86
|
+
.data(labels)
|
|
87
|
+
.enter()
|
|
88
|
+
.append('circle')
|
|
89
|
+
.attr('cx', 10)
|
|
90
|
+
.attr('cy', (_d, i) => yOffset + i * itemHeight)
|
|
91
|
+
.attr('r', 5)
|
|
92
|
+
.style('fill', (_d, i) => colors[i]);
|
|
93
|
+
|
|
94
|
+
root
|
|
95
|
+
.selectAll('labelText')
|
|
96
|
+
.data(labels)
|
|
97
|
+
.enter()
|
|
98
|
+
.append('text')
|
|
99
|
+
.attr('x', textLeft)
|
|
100
|
+
.attr('y', (_d, i) => yOffset + i * itemHeight)
|
|
101
|
+
.style('fill', (_d, i) => colors[i])
|
|
102
|
+
.append('tspan')
|
|
103
|
+
.style('alignment-baseline', 'middle')
|
|
104
|
+
.text(d => d)
|
|
105
|
+
.each(textEllipses(itemWidth - textLeft, 1));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* It appends axis svg element to root element
|
|
110
|
+
*
|
|
111
|
+
* @param {object} root svg element to be changed
|
|
112
|
+
* @param {TimecoursePointDef} axisDef definition of given axis
|
|
113
|
+
* @param {number} posX position X to place content
|
|
114
|
+
* @param {number} posY position Y to place content
|
|
115
|
+
* @param {number} axisExtraAttrs list of extra attributes to be added on content
|
|
116
|
+
* @param {function} axisBuilder callback function to create axis graphics
|
|
117
|
+
* @param {boolean} showAxisLabels flag to display labels or not
|
|
118
|
+
* @param {number} labelPosX position X to place label content
|
|
119
|
+
* @param {number} labelPosY position Y to place label content
|
|
120
|
+
* @param {object} labelExtraAttrs list of extra attributes to be added on label content
|
|
121
|
+
* @modifies {root}
|
|
122
|
+
*
|
|
123
|
+
* @return {object} axis svg element
|
|
124
|
+
*/
|
|
125
|
+
const _addAxis = (
|
|
126
|
+
root,
|
|
127
|
+
axisDef,
|
|
128
|
+
posX = 0,
|
|
129
|
+
posY = 0,
|
|
130
|
+
axisExtraAttrs = [],
|
|
131
|
+
axisBuilder,
|
|
132
|
+
showAxisLabels,
|
|
133
|
+
labelPosX,
|
|
134
|
+
labelPosY,
|
|
135
|
+
labelExtraAttrs = [],
|
|
136
|
+
showAxisGrid
|
|
137
|
+
) => {
|
|
138
|
+
const { type } = axisDef;
|
|
139
|
+
const showAxisGridClass = showAxisGrid ? 'grid' : '';
|
|
140
|
+
const translateValue = `${posX}, ${posY}`;
|
|
141
|
+
const axisContent = root
|
|
142
|
+
.append('g')
|
|
143
|
+
.attr('class', `${type} ${showAxisGridClass} axis`)
|
|
144
|
+
.attr('transform', `translate(${translateValue})`);
|
|
145
|
+
|
|
146
|
+
_addAttributes(axisContent, axisExtraAttrs);
|
|
147
|
+
axisContent.call(axisBuilder());
|
|
148
|
+
|
|
149
|
+
if (showAxisLabels) {
|
|
150
|
+
const label = _formatAxisLabel(axisDef);
|
|
151
|
+
// text label for the x axis
|
|
152
|
+
if (label) {
|
|
153
|
+
const labelContent = root
|
|
154
|
+
.append('text')
|
|
155
|
+
.attr('class', 'label axis')
|
|
156
|
+
.attr('x', labelPosX)
|
|
157
|
+
.attr('y', labelPosY)
|
|
158
|
+
.style('text-anchor', 'middle')
|
|
159
|
+
.text(label);
|
|
160
|
+
|
|
161
|
+
_addAttributes(labelContent, labelExtraAttrs);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return axisContent;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* It scales axis graphics
|
|
170
|
+
*
|
|
171
|
+
* @param {object} sourceGraphicsXAxis original d3 graphics to be proccessed (x Axis)
|
|
172
|
+
* @param {object} sourceGraphicsYAxis original d3 graphics to be proccessed (y Axis)
|
|
173
|
+
* @param {object} xAxisGenerator d3 X axis generator
|
|
174
|
+
* @param {object} yAxisGenerator d3 Y axis generator
|
|
175
|
+
* @param {object} newXAxisScale d3 continuos scale for X Axis
|
|
176
|
+
* @param {object} newYAxisScale d3 continuos scale for Y Axis
|
|
177
|
+
* @modifies {sourceGraphicsXAxis|sourceGraphicsYAxis}
|
|
178
|
+
*/
|
|
179
|
+
const _scaleAxisGraphics = (
|
|
180
|
+
sourceGraphicsXAxis,
|
|
181
|
+
sourceGraphicsYAxis,
|
|
182
|
+
xAxisGenerator,
|
|
183
|
+
yAxisGenerator,
|
|
184
|
+
newXAxisScale,
|
|
185
|
+
newYAxisScale
|
|
186
|
+
) => {
|
|
187
|
+
const newXAxis = xAxisGenerator.scale(newXAxisScale);
|
|
188
|
+
const newYAxis = yAxisGenerator.scale(newYAxisScale);
|
|
189
|
+
|
|
190
|
+
sourceGraphicsXAxis.call(newXAxis);
|
|
191
|
+
sourceGraphicsYAxis.call(newYAxis);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* It appends background svg element to root element and also a clip path for chart boundaries
|
|
196
|
+
*
|
|
197
|
+
* @param {object} root svg element to be changed
|
|
198
|
+
* @param {number} width content`s width
|
|
199
|
+
* @param {number} height content`s height
|
|
200
|
+
* @param {boolean} transparent background to be transparent or not
|
|
201
|
+
* @param {number} offset content`s clip offset
|
|
202
|
+
* @modifies {root}
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
const _addChartClipPath = (root, width, height, transparent = false, offset = 6) => {
|
|
206
|
+
const translateOffset = -offset / 2;
|
|
207
|
+
root
|
|
208
|
+
.append('clipPath')
|
|
209
|
+
.attr('id', 'clip')
|
|
210
|
+
.append('rect')
|
|
211
|
+
.attr('transform', `translate(${translateOffset}, ${translateOffset})`)
|
|
212
|
+
.attr('width', width + offset)
|
|
213
|
+
.attr('height', height + offset);
|
|
214
|
+
|
|
215
|
+
root
|
|
216
|
+
.append('rect')
|
|
217
|
+
.attr('class', 'background')
|
|
218
|
+
.attr('width', width)
|
|
219
|
+
.attr('height', height)
|
|
220
|
+
.classed('transparent', transparent);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const _addSeries = (root, seriesIndex, style) => {
|
|
224
|
+
return root
|
|
225
|
+
.append('g')
|
|
226
|
+
.attr('id', `series_${seriesIndex}`)
|
|
227
|
+
.attr('class', 'series')
|
|
228
|
+
.attr('stroke', style.color || '#ffffff');
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* It appends line chart svg element to root element
|
|
233
|
+
*
|
|
234
|
+
* @param {object} root svg element to be changed
|
|
235
|
+
* @param {object} dataset dataset to tie to content
|
|
236
|
+
* @param {string} dAttrValue path d attribute
|
|
237
|
+
* @modifies {root}
|
|
238
|
+
*
|
|
239
|
+
* @return {object} svg line element line
|
|
240
|
+
*/
|
|
241
|
+
const _addLine = (root, dataset, dAttrValue) => {
|
|
242
|
+
return root
|
|
243
|
+
.append('path')
|
|
244
|
+
.attr('clip-path', 'url(#clip)')
|
|
245
|
+
.datum(dataset)
|
|
246
|
+
.attr('class', 'line')
|
|
247
|
+
.attr('d', dAttrValue);
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* It updates line chart svg element with new dataset and dAttrValue value
|
|
252
|
+
*
|
|
253
|
+
* @param {object} root svg element to be changed
|
|
254
|
+
* @param {object} dataset dataset to tie to content
|
|
255
|
+
* @param {string} dAttrValue path d attribute
|
|
256
|
+
* @modifies {root}
|
|
257
|
+
*
|
|
258
|
+
*/
|
|
259
|
+
const _updateLine = (root, dataset = [], dAttrValue) => {
|
|
260
|
+
const line = root.select('.line');
|
|
261
|
+
|
|
262
|
+
if (dataset && dataset.length > 0) {
|
|
263
|
+
line.datum(dataset);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
line.attr('d', dAttrValue);
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* It appends points svg element to root element
|
|
271
|
+
*
|
|
272
|
+
* @param {object} root svg element to be changed
|
|
273
|
+
* @param {object} dataset dataset to tie to content
|
|
274
|
+
* @param {number} cxAttrValue cx attribute
|
|
275
|
+
* @param {number} cyAttrValue cy attribute
|
|
276
|
+
* @modifies {root}
|
|
277
|
+
*
|
|
278
|
+
* @return {object} points svg element
|
|
279
|
+
*
|
|
280
|
+
*/
|
|
281
|
+
const _addPoints = (root, dataset, cxAttrValue, cyAttrValue) => {
|
|
282
|
+
return root
|
|
283
|
+
.selectAll('.dot')
|
|
284
|
+
.data(dataset)
|
|
285
|
+
.enter()
|
|
286
|
+
.append('circle')
|
|
287
|
+
.attr('id', (point, index) => {
|
|
288
|
+
return `point-${index}`;
|
|
289
|
+
})
|
|
290
|
+
.attr('class', 'dot')
|
|
291
|
+
.attr('clip-path', 'url(#clip)')
|
|
292
|
+
.attr('cx', cxAttrValue)
|
|
293
|
+
.attr('cy', cyAttrValue)
|
|
294
|
+
.attr('r', 2);
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* It return points from root parent
|
|
299
|
+
*
|
|
300
|
+
* @param {object} root svg element to be changed
|
|
301
|
+
* @return {object} points svg element
|
|
302
|
+
*
|
|
303
|
+
*/
|
|
304
|
+
const _getPoints = root => {
|
|
305
|
+
return root.selectAll('.dot');
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* It updates points svg element with new dataset, cxAttrValue and cyAttrValue
|
|
310
|
+
*
|
|
311
|
+
* @param {object} root svg element to be changed
|
|
312
|
+
* @param {object} dataset dataset to tie to content
|
|
313
|
+
* @param {number} cxAttrValue cx attribute
|
|
314
|
+
* @param {number} cyAttrValue cy attribute
|
|
315
|
+
* @modifies {root}
|
|
316
|
+
*
|
|
317
|
+
*/
|
|
318
|
+
const _updatePoints = (root, dataset = [], cxAttrValue, cyAttrValue) => {
|
|
319
|
+
const dot = root.selectAll('.dot');
|
|
320
|
+
|
|
321
|
+
dot.data(dataset).attr('cx', cxAttrValue).attr('cy', cyAttrValue);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* It removes children nodes from root param.
|
|
326
|
+
*
|
|
327
|
+
* @param {object} root svg element to remove children content
|
|
328
|
+
* @modifies {root}
|
|
329
|
+
*
|
|
330
|
+
*/
|
|
331
|
+
const _removeChartContents = root => {
|
|
332
|
+
root.selectAll('*').remove();
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
const chart = {
|
|
336
|
+
axis: {
|
|
337
|
+
addNode: _addAxis,
|
|
338
|
+
scaleGraphics: _scaleAxisGraphics,
|
|
339
|
+
},
|
|
340
|
+
series: {
|
|
341
|
+
addNode: _addSeries,
|
|
342
|
+
},
|
|
343
|
+
lines: {
|
|
344
|
+
addNode: _addLine,
|
|
345
|
+
updateNode: _updateLine,
|
|
346
|
+
},
|
|
347
|
+
points: {
|
|
348
|
+
addNode: _addPoints,
|
|
349
|
+
updateNode: _updatePoints,
|
|
350
|
+
getPoints: _getPoints,
|
|
351
|
+
},
|
|
352
|
+
background: {
|
|
353
|
+
addNode: _addChartClipPath,
|
|
354
|
+
},
|
|
355
|
+
container: {
|
|
356
|
+
addNode: _addChartContainer,
|
|
357
|
+
},
|
|
358
|
+
legend: {
|
|
359
|
+
addNode: _addLegend,
|
|
360
|
+
setLabels: _setLegendLabels,
|
|
361
|
+
},
|
|
362
|
+
removeContents: _removeChartContents,
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
export default chart;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import * as d3Shape from 'd3-shape';
|
|
2
|
+
import * as d3Zoom from 'd3-zoom';
|
|
3
|
+
|
|
4
|
+
import chart from './chart';
|
|
5
|
+
|
|
6
|
+
const d3ZoomNativeEvents = [
|
|
7
|
+
'wheel.zoom',
|
|
8
|
+
'mousedown.zoom',
|
|
9
|
+
'dblclick.zoom',
|
|
10
|
+
'touchstart.zoom',
|
|
11
|
+
'touchmove.zoom',
|
|
12
|
+
'touchend.zoom touchcancel.zoom',
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Object to override native zoom events.
|
|
16
|
+
* It defines a specific callback for a event name.
|
|
17
|
+
*
|
|
18
|
+
* @type {Object<string, function>} zoomEvents <zoom d3 event name, callback method>
|
|
19
|
+
*/
|
|
20
|
+
const zoomEvents = {
|
|
21
|
+
'dblclick.zoom': (root, zoom) => {
|
|
22
|
+
_resetZoom(root, zoom);
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* It resets given root
|
|
28
|
+
*
|
|
29
|
+
* @param {object} root svg element to be reset
|
|
30
|
+
* @param {object} zoom d3 zoom object
|
|
31
|
+
*
|
|
32
|
+
* @modifies {root}
|
|
33
|
+
*/
|
|
34
|
+
const _resetZoom = (root, zoom) => {
|
|
35
|
+
if (root) {
|
|
36
|
+
root.transition().duration(750).call(zoom.transform, d3Zoom.zoomIdentity);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const DEFAULT_MAX_ZOOM_SCALE = 20;
|
|
41
|
+
|
|
42
|
+
const _zoom = d3Zoom.zoom().scaleExtent([1, DEFAULT_MAX_ZOOM_SCALE]);
|
|
43
|
+
|
|
44
|
+
const _bindZoom = (
|
|
45
|
+
root,
|
|
46
|
+
gX,
|
|
47
|
+
gY,
|
|
48
|
+
xAxisScale,
|
|
49
|
+
yAxisScale,
|
|
50
|
+
xAxisGenerator,
|
|
51
|
+
yAxisGenerator,
|
|
52
|
+
parseXPoint,
|
|
53
|
+
parseYPoint,
|
|
54
|
+
datasets
|
|
55
|
+
) => {
|
|
56
|
+
_zoom.on('zoom', _zoomListener); // .filter(zoomEventsFilter);
|
|
57
|
+
|
|
58
|
+
_removeListeners();
|
|
59
|
+
_setListeners();
|
|
60
|
+
|
|
61
|
+
function _removeListeners() {
|
|
62
|
+
for (const eventName of d3ZoomNativeEvents) {
|
|
63
|
+
root.on(eventName, null);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _setListeners() {
|
|
68
|
+
const keys = Object.keys(zoomEvents);
|
|
69
|
+
|
|
70
|
+
for (const key of keys) {
|
|
71
|
+
root.call(_zoom).on(key, zoomEvents[key].bind(undefined, root, _zoom));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function _zoomListener(event) {
|
|
76
|
+
const transformedXAxisScale = event.transform.rescaleX(xAxisScale);
|
|
77
|
+
const transformedYAxisScale = event.transform.rescaleY(yAxisScale);
|
|
78
|
+
|
|
79
|
+
chart.axis.scaleGraphics(
|
|
80
|
+
gX,
|
|
81
|
+
gY,
|
|
82
|
+
xAxisGenerator,
|
|
83
|
+
yAxisGenerator,
|
|
84
|
+
transformedXAxisScale,
|
|
85
|
+
transformedYAxisScale
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
datasets.forEach((dataset, seriesIndex) => {
|
|
89
|
+
const seriesContainer = root.select(`#series_${seriesIndex}`);
|
|
90
|
+
// create line
|
|
91
|
+
const line = d3Shape
|
|
92
|
+
.line()
|
|
93
|
+
.x(parseXPoint(transformedXAxisScale))
|
|
94
|
+
.y(parseYPoint(transformedYAxisScale));
|
|
95
|
+
|
|
96
|
+
chart.lines.updateNode(seriesContainer, dataset, line);
|
|
97
|
+
|
|
98
|
+
chart.points.updateNode(
|
|
99
|
+
seriesContainer,
|
|
100
|
+
dataset,
|
|
101
|
+
parseXPoint(transformedXAxisScale),
|
|
102
|
+
parseYPoint(transformedYAxisScale)
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return _zoom;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const bindMouseEvents = (
|
|
111
|
+
root,
|
|
112
|
+
gX,
|
|
113
|
+
gY,
|
|
114
|
+
xAxisScale,
|
|
115
|
+
yAxisScale,
|
|
116
|
+
xAxisGenerator,
|
|
117
|
+
yAxisGenerator,
|
|
118
|
+
parseXPoint,
|
|
119
|
+
parseYPoint,
|
|
120
|
+
datasets
|
|
121
|
+
) => {
|
|
122
|
+
if (!root) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
_bindZoom(
|
|
127
|
+
root,
|
|
128
|
+
gX,
|
|
129
|
+
gY,
|
|
130
|
+
xAxisScale,
|
|
131
|
+
yAxisScale,
|
|
132
|
+
xAxisGenerator,
|
|
133
|
+
yAxisGenerator,
|
|
134
|
+
parseXPoint,
|
|
135
|
+
parseYPoint,
|
|
136
|
+
datasets
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const events = {
|
|
141
|
+
bindMouseEvents,
|
|
142
|
+
external: {
|
|
143
|
+
resetZoom: root => {
|
|
144
|
+
_resetZoom(root, _zoom);
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export default events;
|