Skip to content

Commit

Permalink
Renamed those classes too. Cleaner now. Should be too breaking...
Browse files Browse the repository at this point in the history
As with swift's minimal syntax - the chance of anyone referencing
  those by name is very low.
On ObjC, the names stayed the same, for namespacing.
  • Loading branch information
danielgindi committed Aug 14, 2016
1 parent 5e53bf3 commit 3b459cc
Show file tree
Hide file tree
Showing 33 changed files with 173 additions and 169 deletions.
80 changes: 40 additions & 40 deletions Charts/Charts.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions Charts/Classes/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
public var keepPositionOnRotation: Bool = false

/// the object representing the left y-axis
internal var _leftAxis: ChartYAxis!
internal var _leftAxis: YAxis!

/// the object representing the right y-axis
internal var _rightAxis: ChartYAxis!
internal var _rightAxis: YAxis!

internal var _leftYAxisRenderer: YAxisRenderer!
internal var _rightYAxisRenderer: YAxisRenderer!
Expand Down Expand Up @@ -97,8 +97,8 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
{
super.initialize()

_leftAxis = ChartYAxis(position: .Left)
_rightAxis = ChartYAxis(position: .Right)
_leftAxis = YAxis(position: .Left)
_rightAxis = YAxis(position: .Right)

_leftAxisTransformer = Transformer(viewPortHandler: _viewPortHandler)
_rightAxisTransformer = Transformer(viewPortHandler: _viewPortHandler)
Expand Down Expand Up @@ -994,7 +994,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
scaleY: CGFloat,
xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency)
axis: YAxis.AxisDependency)
{
let job = ZoomViewJob(
viewPortHandler: viewPortHandler,
Expand Down Expand Up @@ -1042,7 +1042,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
scaleY: CGFloat,
xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency,
axis: YAxis.AxisDependency,
duration: NSTimeInterval,
easing: ChartEasingFunctionBlock?)
{
Expand Down Expand Up @@ -1084,7 +1084,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
scaleY: CGFloat,
xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency,
axis: YAxis.AxisDependency,
duration: NSTimeInterval,
easingOption: ChartEasingOption)
{
Expand All @@ -1105,7 +1105,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
scaleY: CGFloat,
xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency,
axis: YAxis.AxisDependency,
duration: NSTimeInterval)
{
zoomAndCenterViewAnimated(scaleX: scaleX, scaleY: scaleY, xValue: xValue, yValue: yValue, axis: axis, duration: duration, easingOption: .EaseInOutSine)
Expand Down Expand Up @@ -1174,7 +1174,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
///
/// - parameter yRange:
/// - parameter axis: - the axis for which this limit should apply
public func setVisibleYRangeMaximum(maxYRange: Double, axis: ChartYAxis.AxisDependency)
public func setVisibleYRangeMaximum(maxYRange: Double, axis: YAxis.AxisDependency)
{
let yScale = getAxisRange(axis) / maxYRange
_viewPortHandler.setMinimumScaleY(CGFloat(yScale))
Expand All @@ -1184,7 +1184,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
///
/// - parameter yRange:
/// - parameter axis: - the axis for which this limit should apply
public func setVisibleYRangeMinimum(minYRange: Double, axis: ChartYAxis.AxisDependency)
public func setVisibleYRangeMinimum(minYRange: Double, axis: YAxis.AxisDependency)
{
let yScale = getAxisRange(axis) / minYRange
_viewPortHandler.setMaximumScaleY(CGFloat(yScale))
Expand All @@ -1195,7 +1195,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
/// - parameter minYRange:
/// - parameter maxYRange:
/// - parameter axis:
public func setVisibleYRange(minYRange minYRange: Double, maxYRange: Double, axis: ChartYAxis.AxisDependency)
public func setVisibleYRange(minYRange minYRange: Double, maxYRange: Double, axis: YAxis.AxisDependency)
{
let minScale = getAxisRange(axis) / minYRange
let maxScale = getAxisRange(axis) / maxYRange
Expand All @@ -1221,7 +1221,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
///
/// - parameter yValue:
/// - parameter axis: - which axis should be used as a reference for the y-axis
public func moveViewToY(yValue: Double, axis: ChartYAxis.AxisDependency)
public func moveViewToY(yValue: Double, axis: YAxis.AxisDependency)
{
let yInView = getAxisRange(axis) / Double(_viewPortHandler.scaleY)

Expand All @@ -1241,7 +1241,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
/// - parameter xValue:
/// - parameter yValue:
/// - parameter axis: - which axis should be used as a reference for the y-axis
public func moveViewTo(xValue xValue: Double, yValue: Double, axis: ChartYAxis.AxisDependency)
public func moveViewTo(xValue xValue: Double, yValue: Double, axis: YAxis.AxisDependency)
{
let yInView = getAxisRange(axis) / Double(_viewPortHandler.scaleY)

Expand All @@ -1266,7 +1266,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
public func moveViewToAnimated(
xValue xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency,
axis: YAxis.AxisDependency,
duration: NSTimeInterval,
easing: ChartEasingFunctionBlock?)
{
Expand Down Expand Up @@ -1301,7 +1301,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
public func moveViewToAnimated(
xValue xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency,
axis: YAxis.AxisDependency,
duration: NSTimeInterval,
easingOption: ChartEasingOption)
{
Expand All @@ -1319,7 +1319,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
public func moveViewToAnimated(
xValue xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency,
axis: YAxis.AxisDependency,
duration: NSTimeInterval)
{
moveViewToAnimated(xValue: xValue, yValue: yValue, axis: axis, duration: duration, easingOption: .EaseInOutSine)
Expand All @@ -1334,7 +1334,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
public func centerViewTo(
xValue xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency)
axis: YAxis.AxisDependency)
{
let yInView = getAxisRange(axis) / Double(_viewPortHandler.scaleY)
let xInView = xAxis.axisRange / Double(_viewPortHandler.scaleX)
Expand All @@ -1359,7 +1359,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
public func centerViewToAnimated(
xValue xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency,
axis: YAxis.AxisDependency,
duration: NSTimeInterval,
easing: ChartEasingFunctionBlock?)
{
Expand Down Expand Up @@ -1394,7 +1394,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
public func centerViewToAnimated(
xValue xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency,
axis: YAxis.AxisDependency,
duration: NSTimeInterval,
easingOption: ChartEasingOption)
{
Expand All @@ -1411,7 +1411,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
public func centerViewToAnimated(
xValue xValue: Double,
yValue: Double,
axis: ChartYAxis.AxisDependency,
axis: YAxis.AxisDependency,
duration: NSTimeInterval)
{
centerViewToAnimated(xValue: xValue, yValue: yValue, axis: axis, duration: duration, easingOption: .EaseInOutSine)
Expand Down Expand Up @@ -1447,7 +1447,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
// MARK: - Accessors

/// - returns: The range of the specified axis.
public func getAxisRange(axis: ChartYAxis.AxisDependency) -> Double
public func getAxisRange(axis: YAxis.AxisDependency) -> Double
{
if (axis == .Left)
{
Expand All @@ -1460,7 +1460,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
}

/// - returns: The position (in pixels) the provided Entry has inside the chart view
public func getPosition(e: ChartDataEntry, axis: ChartYAxis.AxisDependency) -> CGPoint
public func getPosition(e: ChartDataEntry, axis: YAxis.AxisDependency) -> CGPoint
{
var vals = CGPoint(x: CGFloat(e.x), y: CGFloat(e.y))

Expand Down Expand Up @@ -1597,14 +1597,14 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
/// (encapsulated in a `CGPoint`). This method transforms pixel coordinates to
/// coordinates / values in the chart. This is the opposite method to
/// `getPixelsForValues(...)`.
public func valueForTouchPoint(pt pt: CGPoint, axis: ChartYAxis.AxisDependency) -> CGPoint
public func valueForTouchPoint(pt pt: CGPoint, axis: YAxis.AxisDependency) -> CGPoint
{
return getTransformer(axis).valueForTouchPoint(pt)
}

/// Transforms the given chart values into pixels. This is the opposite
/// method to `valueForTouchPoint(...)`.
public func pixelForValues(x x: Double, y: Double, axis: ChartYAxis.AxisDependency) -> CGPoint
public func pixelForValues(x x: Double, y: Double, axis: YAxis.AxisDependency) -> CGPoint
{
return getTransformer(axis).pixelForValues(x: x, y: y)
}
Expand Down Expand Up @@ -1656,18 +1656,18 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar

/// - returns: The left y-axis object. In the horizontal bar-chart, this is the
/// top axis.
public var leftAxis: ChartYAxis
public var leftAxis: YAxis
{
return _leftAxis
}

/// - returns: The right y-axis object. In the horizontal bar-chart, this is the
/// bottom axis.
public var rightAxis: ChartYAxis { return _rightAxis; }
public var rightAxis: YAxis { return _rightAxis; }

/// - returns: The y-axis object to the corresponding AxisDependency. In the
/// horizontal bar-chart, LEFT == top, RIGHT == BOTTOM
public func getAxis(axis: ChartYAxis.AxisDependency) -> ChartYAxis
public func getAxis(axis: YAxis.AxisDependency) -> YAxis
{
if (axis == .Left)
{
Expand Down Expand Up @@ -1775,7 +1775,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
public var isAutoScaleMinMaxEnabled : Bool { return autoScaleMinMaxEnabled; }

/// Sets a minimum width to the specified y axis.
public func setYAxisMinWidth(which: ChartYAxis.AxisDependency, width: CGFloat)
public func setYAxisMinWidth(which: YAxis.AxisDependency, width: CGFloat)
{
if (which == .Left)
{
Expand All @@ -1789,7 +1789,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar

/// **default**: 0.0
/// - returns: The (custom) minimum width of the specified Y axis.
public func getYAxisMinWidth(which: ChartYAxis.AxisDependency) -> CGFloat
public func getYAxisMinWidth(which: YAxis.AxisDependency) -> CGFloat
{
if (which == .Left)
{
Expand All @@ -1802,7 +1802,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
}
/// Sets a maximum width to the specified y axis.
/// Zero (0.0) means there's no maximum width
public func setYAxisMaxWidth(which: ChartYAxis.AxisDependency, width: CGFloat)
public func setYAxisMaxWidth(which: YAxis.AxisDependency, width: CGFloat)
{
if (which == .Left)
{
Expand All @@ -1818,7 +1818,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
///
/// **default**: 0.0 (no maximum specified)
/// - returns: The (custom) maximum width of the specified Y axis.
public func getYAxisMaxWidth(which: ChartYAxis.AxisDependency) -> CGFloat
public func getYAxisMaxWidth(which: YAxis.AxisDependency) -> CGFloat
{
if (which == .Left)
{
Expand All @@ -1831,7 +1831,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
}

/// - returns the width of the specified y axis.
public func getYAxisWidth(which: ChartYAxis.AxisDependency) -> CGFloat
public func getYAxisWidth(which: YAxis.AxisDependency) -> CGFloat
{
if (which == .Left)
{
Expand All @@ -1848,7 +1848,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
/// - returns: The Transformer class that contains all matrices and is
/// responsible for transforming values into pixels on the screen and
/// backwards.
public func getTransformer(which: ChartYAxis.AxisDependency) -> Transformer
public func getTransformer(which: YAxis.AxisDependency) -> Transformer
{
if (which == .Left)
{
Expand All @@ -1873,7 +1873,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
}
}

public func isInverted(axis: ChartYAxis.AxisDependency) -> Bool
public func isInverted(axis: YAxis.AxisDependency) -> Bool
{
return getAxis(axis).isInverted
}
Expand Down
12 changes: 6 additions & 6 deletions Charts/Classes/Charts/ChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate
/// - returns: The object representing all x-labels, this method can be used to
/// acquire the XAxis object and modify it (e.g. change the position of the
/// labels)
public var xAxis: ChartXAxis
public var xAxis: XAxis
{
return _xAxis
}
Expand Down Expand Up @@ -86,10 +86,10 @@ public class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate
internal var _drawUnitInChart = false

/// the object representing the labels on the x-axis
internal var _xAxis: ChartXAxis!
internal var _xAxis: XAxis!

/// the legend object containing all data associated with the legend
internal var _legend: ChartLegend!
internal var _legend: Legend!

/// delegate to receive chart events
public weak var delegate: ChartViewDelegate?
Expand Down Expand Up @@ -187,10 +187,10 @@ public class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate
_viewPortHandler = ViewPortHandler()
_viewPortHandler.setChartDimens(width: bounds.size.width, height: bounds.size.height)

_legend = ChartLegend()
_legend = Legend()
_legendRenderer = LegendRenderer(viewPortHandler: _viewPortHandler, legend: _legend)

_xAxis = ChartXAxis()
_xAxis = XAxis()

self.addObserver(self, forKeyPath: "bounds", options: .New, context: nil)
self.addObserver(self, forKeyPath: "frame", options: .New, context: nil)
Expand Down Expand Up @@ -768,7 +768,7 @@ public class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate
}

/// - returns: The Legend object of the chart. This method can be used to get an instance of the legend in order to customize the automatically generated Legend.
public var legend: ChartLegend
public var legend: Legend
{
return _legend
}
Expand Down
8 changes: 4 additions & 4 deletions Charts/Classes/Charts/HorizontalBarChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public class HorizontalBarChartView: BarChartView
return bounds
}

public override func getPosition(e: ChartDataEntry, axis: ChartYAxis.AxisDependency) -> CGPoint
public override func getPosition(e: ChartDataEntry, axis: YAxis.AxisDependency) -> CGPoint
{
var vals = CGPoint(x: CGFloat(e.y), y: CGFloat(e.x))

Expand Down Expand Up @@ -192,19 +192,19 @@ public class HorizontalBarChartView: BarChartView
viewPortHandler.setMinMaxScaleY(minScaleY: CGFloat(minScale), maxScaleY: CGFloat(maxScale))
}

public override func setVisibleYRangeMaximum(maxYRange: Double, axis: ChartYAxis.AxisDependency)
public override func setVisibleYRangeMaximum(maxYRange: Double, axis: YAxis.AxisDependency)
{
let yScale = getAxisRange(axis) / maxYRange
viewPortHandler.setMinimumScaleX(CGFloat(yScale))
}

public override func setVisibleYRangeMinimum(minYRange: Double, axis: ChartYAxis.AxisDependency)
public override func setVisibleYRangeMinimum(minYRange: Double, axis: YAxis.AxisDependency)
{
let yScale = getAxisRange(axis) / minYRange
viewPortHandler.setMaximumScaleX(CGFloat(yScale))
}

public override func setVisibleYRange(minYRange minYRange: Double, maxYRange: Double, axis: ChartYAxis.AxisDependency)
public override func setVisibleYRange(minYRange minYRange: Double, maxYRange: Double, axis: YAxis.AxisDependency)
{
let minScale = getAxisRange(axis) / minYRange
let maxScale = getAxisRange(axis) / maxYRange
Expand Down
2 changes: 1 addition & 1 deletion Charts/Classes/Charts/PieChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public class PieChartView: PieRadarChartViewBase
}

/// This will throw an exception, PieChart has no XAxis object.
public override var xAxis: ChartXAxis
public override var xAxis: XAxis
{
fatalError("PieChart has no XAxis")
}
Expand Down
6 changes: 3 additions & 3 deletions Charts/Classes/Charts/RadarChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class RadarChartView: PieRadarChartViewBase
private var _skipWebLineCount = 0

/// the object reprsenting the y-axis labels
private var _yAxis: ChartYAxis!
private var _yAxis: YAxis!

internal var _yAxisRenderer: YAxisRendererRadarChart!
internal var _xAxisRenderer: XAxisRendererRadarChart!
Expand All @@ -58,7 +58,7 @@ public class RadarChartView: PieRadarChartViewBase
{
super.initialize()

_yAxis = ChartYAxis(position: .Left)
_yAxis = YAxis(position: .Left)

renderer = RadarChartRenderer(chart: self, animator: _animator, viewPortHandler: _viewPortHandler)

Expand Down Expand Up @@ -179,7 +179,7 @@ public class RadarChartView: PieRadarChartViewBase
}

/// - returns: The object that represents all y-labels of the RadarChart.
public var yAxis: ChartYAxis
public var yAxis: YAxis
{
return _yAxis
}
Expand Down
Loading

0 comments on commit 3b459cc

Please sign in to comment.