Skip to content

Commit f0e6bc0

Browse files
author
Reed Es
committed
improving README
1 parent 0477a0b commit f0e6bc0

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _SwiftNiceScale_ is part of the [OpenAlloc](https://github.com/openalloc) family
1010

1111
## NiceScale
1212

13-
<img src="https://github.com/openalloc/SwiftNiceScale/blob/main/Images/naive_nice.png" width="1049" height="319"/>
13+
<img src="https://github.com/openalloc/SwiftNiceScale/blob/main/Images/naive_nice.png" width="525" height="160"/>
1414

1515
```swift
1616
let ns = NiceScale(105...543, desiredTicks: 5)
@@ -49,41 +49,45 @@ The initialization values are also available as properties:
4949

5050
Computed properties are lazy, meaning that they are only calculated when first needed.
5151

52+
The basic set of properties...
53+
54+
- `var range: NiceScale<T>.ValueRange` - The calculated ‘nice’ range, which should include the ‘raw’ range used to initialize this object.
55+
5256
- `var extent: T` - The distance between bounds of the range.
5357

54-
- `var hasNegativeRange: Bool` - If true, the range includes negative values.
58+
- `var ticks: Int` - The number of ticks in the range. This may differ from the `desiredTicks` used to initialize the object.
5559

56-
- `var hasPositiveRange: Bool` - If true, the range includes positive values.
60+
- `var tickInterval: T` - The distance between ticks in the range.
5761

58-
- `var negativeExtent: T` - If there’s a negative portion of range, the distance between its lower bound and 0. A non-negative value.
62+
- `var tickValues: [T]` - The values for the ticks in the range.
5963

60-
- `var negativeExtentUnit: T?` - The negativeExtent, expressed as unit value in the range 0…1.
64+
- `var tickFractionDigits: Int` - Number of fractional digits to show in tick label values.
6165

62-
- `var negativeRange: NiceScale<T>.ValueRange` - The portion of the range that is negative. 0…0 if none.
66+
More specialized properties dealing with positive and negative portions of scale...
6367

64-
- `var positiveExtent: T` - If there’s a positive portion of range, the distance between its upper bound and 0. A non-negative value.
68+
- `var hasNegativeRange: Bool` - If true, the range includes negative values.
6569

66-
- `var positiveExtentUnit: T?` - The positiveExtent, expressed as unit value in the range 0…1.
70+
- `var hasPositiveRange: Bool` - If true, the range includes positive values.
6771

68-
- `var positiveRange: NiceScale<T>.ValueRange` - The portion of the range that is positive. 0…0 if none.
72+
- `var negativeRange: NiceScale<T>.ValueRange` - The portion of the range that is negative. `0…0` if none.
6973

70-
- `var range: NiceScale<T>.ValueRange` - The calculated ‘nice’ range, which should include the ‘raw’ range used to initialize this object.
74+
- `var positiveRange: NiceScale<T>.ValueRange` - The portion of the range that is positive. `0…0` if none.
7175

72-
- `var tickFractionDigits: Int` - Number of fractional digits to show in tick label values.
76+
- `var negativeExtent: T` - If there’s a negative portion of range, the distance between its lower bound and 0. A non-negative value.
7377

74-
- `var tickInterval: T` - The distance between ticks in the range.
78+
- `var positiveExtent: T` - If there’s a positive portion of range, the distance between its upper bound and 0. A non-negative value.
7579

76-
- `var tickValues: [T]` - The values for the ticks in the range.
80+
- `var negativeExtentUnit: T?` - The negativeExtent, expressed as unit value in the range `0…1`.
7781

78-
- `var ticks: Int` - The number of ticks in the range. This may differ from the desiredTicks used to initialize the object.
82+
- `var positiveExtentUnit: T?` - The positiveExtent, expressed as unit value in the range `0…1`.
7983

8084
#### Instance Methods
8185

82-
- `func scaleToUnit(T) -> T` - Scale value to 0…1 in the range.
86+
- `func scaleToUnit(T) -> T` - Scale value to `0…1` in the range.
8387

84-
- `func scaleToUnitNegative(T) -> T` - Scale value to 0…1 in the negative portion of range, if any.
88+
- `func scaleToUnitNegative(T) -> T` - Scale value to `0…1` in the negative portion of range, if any.
8589

86-
- `func scaleToUnitPositive(T) -> T` - Scale value to 0…1 in the positive portion of range, if any.
90+
- `func scaleToUnitPositive(T) -> T` - Scale value to `0…1` in the positive portion of range, if any.
8791

8892
## See Also
8993

0 commit comments

Comments
 (0)