Package qupath.lib.gui.charts
Class PathObjectScatterChart
java.lang.Object
- All Implemented Interfaces:
- Styleable,- EventTarget
An interactive 
ScatterChart implementation for showing large(ish) numbers of PathObject,
 optionally linked to a QuPathViewer.
 A goal of this class is to reduce expensive chart manipulations, such as adding and removing data points. Instead, data points are reused and updated where possible.
Additionally, the maximum number of data points can be specified, so that the chart can automatically randomly subsample points to show only some.
- Since:
- v0.6.0
- 
Property SummaryPropertiesTypePropertyDescriptionGet a property representing whether to use the entire dataset when calculating axis limits automatically.Get a property representing the maximum number of points that the plot will display.Get a property representing the opacity of all data points.Get a property representing the radius of all data points.Get a property representing the random number generator's seed for subsampling.Properties inherited from class javafx.scene.chart.XYChartalternativeColumnFillVisible, alternativeRowFillVisible, data, horizontalGridLinesVisible, horizontalZeroLineVisible, verticalGridLinesVisible, verticalZeroLineVisibleProperties inherited from class javafx.scene.chart.Chartanimated, legend, legendSide, legendVisible, title, titleSideProperties inherited from class javafx.scene.layout.Regionbackground, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.ParentneedsLayoutProperties inherited from class javafx.scene.NodeaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
- 
Nested Class SummaryNested classes/interfaces inherited from class javafx.scene.chart.XYChartXYChart.Data<X,Y>, XYChart.Series<X, Y> 
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intSeed value to use to specify that no shuffling should be applied before displaying the objects.Fields inherited from class javafx.scene.layout.RegionUSE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.NodeBASELINE_OFFSET_SAME_AS_HEIGHT
- 
Constructor SummaryConstructorsConstructorDescriptionPathObjectScatterChart(QuPathViewer viewer) Create an interactive scatter plot using the current viewer
- 
Method SummaryModifier and TypeMethodDescriptionGet a property representing whether to use the entire dataset when calculating axis limits automatically.protected voiddataItemAdded(XYChart.Series<Number, Number> series, int itemIndex, XYChart.Data<Number, Number> item) protected voiddataItemRemoved(XYChart.Data<Number, Number> item, XYChart.Series<Number, Number> series) booleanGet the value ofautorangeToFullDataProperty()intGet the value ofmaxPointsProperty()doubleGet the value opointOpacityProperty()doubleGet the value ofpointOpacityProperty()intGet the value ofrngSeedProperty().Get a property representing the maximum number of points that the plot will display.Get a property representing the opacity of all data points.Get a property representing the radius of all data points.voidRecalculate the values of all data points.Get a property representing the random number generator's seed for subsampling.voidsetAutorangeToFullData(boolean useFullData) Set the value ofautorangeToFullDataProperty().voidsetData(Collection<? extends PathObject> pathObjects, Function<PathObject, Number> xFun, Function<PathObject, Number> yFun) Set the data to display in the plot.voidsetDataFromTable(Collection<? extends PathObject> pathObjects, PathTableData<PathObject> model, String xMeasurement, String yMeasurement) Set the data to display in the plot from a table model.voidsetMaxPoints(int maxPoints) Set the value ofmaxPointsProperty().voidsetPointOpacity(double pointOpacity) Set the value ofpointOpacityProperty().voidsetPointRadius(double radius) Set the value ofpointOpacityProperty()voidsetRngSeed(int rngSeed) Set the value ofrngSeedProperty().protected voidprotected voidMethods inherited from class javafx.scene.chart.ScatterChartdataItemChanged, layoutPlotChildren, seriesAdded, seriesRemovedMethods inherited from class javafx.scene.chart.XYChartalternativeColumnFillVisibleProperty, alternativeRowFillVisibleProperty, currentDisplayedExtraValueProperty, currentDisplayedXValueProperty, currentDisplayedYValueProperty, dataProperty, getClassCssMetaData, getCssMetaData, getCurrentDisplayedExtraValue, getCurrentDisplayedXValue, getCurrentDisplayedYValue, getData, getDisplayedDataIterator, getDisplayedSeriesIterator, getPlotChildren, getVerticalGridLinesVisible, getXAxis, getYAxis, horizontalGridLinesVisibleProperty, horizontalZeroLineVisibleProperty, isAlternativeColumnFillVisible, isAlternativeRowFillVisible, isHorizontalGridLinesVisible, isHorizontalZeroLineVisible, isVerticalZeroLineVisible, layoutChartChildren, removeDataItemFromDisplay, removeSeriesFromDisplay, seriesChanged, setAlternativeColumnFillVisible, setAlternativeRowFillVisible, setCurrentDisplayedExtraValue, setCurrentDisplayedXValue, setCurrentDisplayedYValue, setData, setHorizontalGridLinesVisible, setHorizontalZeroLineVisible, setVerticalGridLinesVisible, setVerticalZeroLineVisible, verticalGridLinesVisibleProperty, verticalZeroLineVisiblePropertyMethods inherited from class javafx.scene.chart.Chartanimate, animatedProperty, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getAnimated, getChartChildren, getLegend, getLegendSide, getTitle, getTitleSide, isLegendVisible, layoutChildren, legendProperty, legendSideProperty, legendVisibleProperty, requestChartLayout, setAnimated, setLegend, setLegendSide, setLegendVisible, setTitle, setTitleSide, shouldAnimate, titleProperty, titleSidePropertyMethods inherited from class javafx.scene.layout.RegionbackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.ParentgetBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.NodeaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.StyleablegetStyleableNode
- 
Property Details- 
autorangeToFullDataGet a property representing whether to use the entire dataset when calculating axis limits automatically. This is useful whenever we are subsampling data points.- See Also:
 
- 
maxPointsGet a property representing the maximum number of points that the plot will display. Subsampling will be used to ensure only this number of points or fewer are displayed.- See Also:
 
- 
rngSeedGet a property representing the random number generator's seed for subsampling. The default value is #NO_SHUFFLE_SEED which indicates no shuffling should be performed.- See Also:
 
- 
pointOpacityGet a property representing the opacity of all data points. Making points translucent can be helpful when there are a lot of them.- See Also:
 
- 
pointRadiusGet a property representing the radius of all data points.- See Also:
 
 
- 
- 
Field Details- 
NO_SHUFFLE_SEEDpublic static final int NO_SHUFFLE_SEEDSeed value to use to specify that no shuffling should be applied before displaying the objects.- See Also:
 
 
- 
- 
Constructor Details- 
PathObjectScatterChartCreate an interactive scatter plot using the current viewer- Parameters:
- viewer- The QuPath viewer.
 
 
- 
- 
Method Details- 
setAutorangeToFullDatapublic void setAutorangeToFullData(boolean useFullData) Set the value ofautorangeToFullDataProperty().- Parameters:
- useFullData- whether to use the full data when setting the axis autorange
 
- 
autorangeToFullDataPropertyGet a property representing whether to use the entire dataset when calculating axis limits automatically. This is useful whenever we are subsampling data points.- Returns:
- whether to use the full data when setting the axis autorange
- See Also:
 
- 
getAutorangeToFullDatapublic boolean getAutorangeToFullData()Get the value ofautorangeToFullDataProperty()- Returns:
- whether to use the full data when setting the axis autorange
 
- 
setMaxPointspublic void setMaxPoints(int maxPoints) Set the value ofmaxPointsProperty().- Parameters:
- maxPoints- the maximum number of elements
 
- 
maxPointsPropertyGet a property representing the maximum number of points that the plot will display. Subsampling will be used to ensure only this number of points or fewer are displayed.- Returns:
- the maximum number of points to show
- See Also:
 
- 
getMaxPointspublic int getMaxPoints()Get the value ofmaxPointsProperty()- Returns:
- the maximum number of points to show
 
- 
setRngSeedpublic void setRngSeed(int rngSeed) Set the value ofrngSeedProperty().- Parameters:
- rngSeed- the random number generator seed to use
 
- 
rngSeedPropertyGet a property representing the random number generator's seed for subsampling. The default value is #NO_SHUFFLE_SEED which indicates no shuffling should be performed.- Returns:
- the rng seed property
- See Also:
 
- 
getRngSeedpublic int getRngSeed()Get the value ofrngSeedProperty().- Returns:
- the random number generator
 
- 
setPointOpacitypublic void setPointOpacity(double pointOpacity) Set the value ofpointOpacityProperty().- Parameters:
- pointOpacity- the new point opacity
 
- 
pointOpacityPropertyGet a property representing the opacity of all data points. Making points translucent can be helpful when there are a lot of them.- Returns:
- the point opacity property
- See Also:
 
- 
getPointOpacitypublic double getPointOpacity()Get the value opointOpacityProperty()- Returns:
- the point opacity property
 
- 
setPointRadiuspublic void setPointRadius(double radius) Set the value ofpointOpacityProperty()- Parameters:
- radius- the point radius
 
- 
pointRadiusPropertyGet a property representing the radius of all data points.- Returns:
- the point radius property
- See Also:
 
- 
getPointRadiuspublic double getPointRadius()Get the value ofpointOpacityProperty()- Returns:
- the point radius
 
- 
updateLegendprotected void updateLegend()- Overrides:
- updateLegendin class- XYChart<Number,- Number> 
 
- 
refreshDatapublic void refreshData()Recalculate the values of all data points. This may be useful when measurements or classifications may have changed.
- 
setDatapublic void setData(Collection<? extends PathObject> pathObjects, Function<PathObject, Number> xFun, Function<PathObject, Number> yFun) Set the data to display in the plot.- Parameters:
- pathObjects- the objects to display
- xFun- a function to extract the x value to plot
- yFun- a function to extract the y value to plot
 
- 
setDataFromTablepublic void setDataFromTable(Collection<? extends PathObject> pathObjects, PathTableData<PathObject> model, String xMeasurement, String yMeasurement) Set the data to display in the plot from a table model.This calls setData(Collection, Function, Function)in addition to setting the x and y labels.- Parameters:
- pathObjects- the objects to display
- model- the table model containing the measurements
- xMeasurement- the column to use for x values
- yMeasurement- the column to use for y values
 
- 
dataItemAddedprotected void dataItemAdded(XYChart.Series<Number, Number> series, int itemIndex, XYChart.Data<Number, Number> item) - Overrides:
- dataItemAddedin class- ScatterChart<Number,- Number> 
 
- 
dataItemRemovedprotected void dataItemRemoved(XYChart.Data<Number, Number> item, XYChart.Series<Number, Number> series) - Overrides:
- dataItemRemovedin class- ScatterChart<Number,- Number> 
 
- 
updateAxisRangeprotected void updateAxisRange()- Overrides:
- updateAxisRangein class- XYChart<Number,- Number> 
 
 
-