From b667271529f26b656f48a0025d100c4cdf32c598 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Tue, 6 Jul 2021 10:21:07 -0600 Subject: [PATCH] rename AxisNode to AxisArrowNode, https://github.com/phetsims/bamboo/issues/38 --- js/{AxisNode.js => AxisArrowNode.js} | 11 +++++------ js/demo/DemoLinePlot.js | 6 +++--- js/demo/DemoLinearEquationPlot.js | 6 +++--- js/demo/DemoMultiplePlots.js | 6 +++--- js/demo/DemoScatterPlot.js | 6 +++--- js/demo/DemoUpDownArrowPlot.js | 4 ++-- 6 files changed, 19 insertions(+), 20 deletions(-) rename js/{AxisNode.js => AxisArrowNode.js} (85%) diff --git a/js/AxisNode.js b/js/AxisArrowNode.js similarity index 85% rename from js/AxisNode.js rename to js/AxisArrowNode.js index 40ada6b..8fd225c 100644 --- a/js/AxisNode.js +++ b/js/AxisArrowNode.js @@ -1,9 +1,8 @@ // Copyright 2020-2021, University of Colorado Boulder /** - * Shows a line that depicts an axis. This is typically bolder than any grid line (if any), and typically at x=0 or - * y=0, but those defaults can be overridden with options. It has a double sided arrow, but those won't be shown if - * this is added to the clipping area of a chart. + * AxisArrowNode shows an axis with arrows at one or both ends. An axis is typically bolder than any grid line (if any), + * and typically at x=0 or y=0, but those defaults can be overridden with options. * * @author Sam Reid (PhET Interactive Simulations) */ @@ -13,7 +12,7 @@ import Orientation from '../../phet-core/js/Orientation.js'; import ArrowNode from '../../scenery-phet/js/ArrowNode.js'; import bamboo from './bamboo.js'; -class AxisNode extends ArrowNode { +class AxisArrowNode extends ArrowNode { /** * @param {ChartTransform} chartTransform @@ -77,5 +76,5 @@ class AxisNode extends ArrowNode { } } -bamboo.register( 'AxisNode', AxisNode ); -export default AxisNode; \ No newline at end of file +bamboo.register( 'AxisArrowNode', AxisArrowNode ); +export default AxisArrowNode; \ No newline at end of file diff --git a/js/demo/DemoLinePlot.js b/js/demo/DemoLinePlot.js index ddc98a4..214c5d1 100644 --- a/js/demo/DemoLinePlot.js +++ b/js/demo/DemoLinePlot.js @@ -17,7 +17,7 @@ import PhetFont from '../../../scenery-phet/js/PhetFont.js'; import PlusMinusZoomButtonGroup from '../../../scenery-phet/js/PlusMinusZoomButtonGroup.js'; import Node from '../../../scenery/js/nodes/Node.js'; import Text from '../../../scenery/js/nodes/Text.js'; -import AxisNode from '../AxisNode.js'; +import AxisArrowNode from '../AxisArrowNode.js'; import bamboo from '../bamboo.js'; import ChartRectangle from '../ChartRectangle.js'; import ChartTransform from '../ChartTransform.js'; @@ -95,8 +95,8 @@ class DemoLinePlot extends Node { new GridLineSet( chartTransform, Orientation.VERTICAL, 0.5, { stroke: 'lightGray' } ), // Axes nodes are clipped in the chart - new AxisNode( chartTransform, Orientation.HORIZONTAL ), - new AxisNode( chartTransform, Orientation.VERTICAL ), + new AxisArrowNode( chartTransform, Orientation.HORIZONTAL ), + new AxisArrowNode( chartTransform, Orientation.VERTICAL ), // Some data new LinePlot( chartTransform, createDataSet( -2, 2, 5 ), { stroke: 'red', lineWidth: 2 } ), diff --git a/js/demo/DemoLinearEquationPlot.js b/js/demo/DemoLinearEquationPlot.js index 3b7d993..ee0f835 100644 --- a/js/demo/DemoLinearEquationPlot.js +++ b/js/demo/DemoLinearEquationPlot.js @@ -20,7 +20,7 @@ import RichText from '../../../scenery/js/nodes/RichText.js'; import Text from '../../../scenery/js/nodes/Text.js'; import VBox from '../../../scenery/js/nodes/VBox.js'; import VSlider from '../../../sun/js/VSlider.js'; -import AxisNode from '../AxisNode.js'; +import AxisArrowNode from '../AxisArrowNode.js'; import bamboo from '../bamboo.js'; import ChartRectangle from '../ChartRectangle.js'; import ChartTransform from '../ChartTransform.js'; @@ -130,12 +130,12 @@ class DemoLinearEquationPlot extends Node { // Axes const axisFont = new PhetFont( 16 ); - const xAxis = new AxisNode( chartTransform, Orientation.HORIZONTAL ); + const xAxis = new AxisArrowNode( chartTransform, Orientation.HORIZONTAL ); const xAxisLabel = new RichText( xSymbol, { font: axisFont, leftCenter: chartRectangle.rightCenter.plusXY( 4, 0 ) } ); - const yAxis = new AxisNode( chartTransform, Orientation.VERTICAL ); + const yAxis = new AxisArrowNode( chartTransform, Orientation.VERTICAL ); const yAxisLabel = new RichText( ySymbol, { font: axisFont, centerBottom: chartRectangle.centerTop.minusXY( 0, 4 ) diff --git a/js/demo/DemoMultiplePlots.js b/js/demo/DemoMultiplePlots.js index 2e35e76..b2b2569 100644 --- a/js/demo/DemoMultiplePlots.js +++ b/js/demo/DemoMultiplePlots.js @@ -20,7 +20,7 @@ import Node from '../../../scenery/js/nodes/Node.js'; import Text from '../../../scenery/js/nodes/Text.js'; import VBox from '../../../scenery/js/nodes/VBox.js'; import VerticalAquaRadioButtonGroup from '../../../sun/js/VerticalAquaRadioButtonGroup.js'; -import AxisNode from '../AxisNode.js'; +import AxisArrowNode from '../AxisArrowNode.js'; import BarPlot from '../BarPlot.js'; import ChartTransform from '../ChartTransform.js'; import ChartRectangle from '../ChartRectangle.js'; @@ -97,8 +97,8 @@ class DemoMultiplePlots extends VBox { chartClip, // axes nodes not clipped - new AxisNode( chartTransform, Orientation.VERTICAL ), - new AxisNode( chartTransform, Orientation.HORIZONTAL ), + new AxisArrowNode( chartTransform, Orientation.VERTICAL ), + new AxisArrowNode( chartTransform, Orientation.HORIZONTAL ), // Tick marks outside the chart new TickMarkSet( chartTransform, Orientation.HORIZONTAL, 2, { edge: 'min' } ), diff --git a/js/demo/DemoScatterPlot.js b/js/demo/DemoScatterPlot.js index 00606c8..917d0fe 100644 --- a/js/demo/DemoScatterPlot.js +++ b/js/demo/DemoScatterPlot.js @@ -9,7 +9,7 @@ import Orientation from '../../../phet-core/js/Orientation.js'; import Node from '../../../scenery/js/nodes/Node.js'; import VBox from '../../../scenery/js/nodes/VBox.js'; import HSlider from '../../../sun/js/HSlider.js'; -import AxisNode from '../AxisNode.js'; +import AxisArrowNode from '../AxisArrowNode.js'; import BarPlot from '../BarPlot.js'; import ChartTransform from '../ChartTransform.js'; import ChartRectangle from '../ChartRectangle.js'; @@ -88,8 +88,8 @@ class DemoScatterPlot extends VBox { new GridLineSet( chartTransform, Orientation.VERTICAL, 0.2, { stroke: 'black' } ), // axes nodes not clipped - new AxisNode( chartTransform, Orientation.VERTICAL ), - new AxisNode( chartTransform, Orientation.HORIZONTAL ), + new AxisArrowNode( chartTransform, Orientation.VERTICAL ), + new AxisArrowNode( chartTransform, Orientation.HORIZONTAL ), // Tick marks outside the chart new TickMarkSet( chartTransform, Orientation.VERTICAL, 0.2, { edge: 'min' } ), diff --git a/js/demo/DemoUpDownArrowPlot.js b/js/demo/DemoUpDownArrowPlot.js index 280c796..007105d 100644 --- a/js/demo/DemoUpDownArrowPlot.js +++ b/js/demo/DemoUpDownArrowPlot.js @@ -9,7 +9,7 @@ import Range from '../../../dot/js/Range.js'; import Vector2 from '../../../dot/js/Vector2.js'; import Orientation from '../../../phet-core/js/Orientation.js'; -import AxisNode from '../AxisNode.js'; +import AxisArrowNode from '../AxisArrowNode.js'; import bamboo from '../bamboo.js'; import ChartRectangle from '../ChartRectangle.js'; import ChartTransform from '../ChartTransform.js'; @@ -57,7 +57,7 @@ class DemoUpDownArrowPlot extends Node { return { fill: c }; } } ); - const xAxis = new AxisNode( chartTransform, Orientation.HORIZONTAL ); + const xAxis = new AxisArrowNode( chartTransform, Orientation.HORIZONTAL ); // anything you want clipped goes in here const chartClip = new Node( {