@symbo.ls/scratch 0.7.0 → 0.7.1
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/package.json +1 -1
- package/src/utils/sequence.js +4 -3
package/package.json
CHANGED
package/src/utils/sequence.js
CHANGED
|
@@ -55,15 +55,16 @@ export const generateSubSequence = (props, sequenceProps) => {
|
|
|
55
55
|
const { key, base, value, ratio, variable, index } = props
|
|
56
56
|
|
|
57
57
|
const next = value * ratio
|
|
58
|
-
const
|
|
58
|
+
const diff = next - value
|
|
59
|
+
const smallscale = diff / 1.618
|
|
59
60
|
|
|
60
61
|
const valueRounded = Math.round(value)
|
|
61
62
|
const nextRounded = Math.round(next)
|
|
62
63
|
const diffRounded = nextRounded - valueRounded
|
|
63
64
|
|
|
64
65
|
let arr = []
|
|
65
|
-
const first =
|
|
66
|
-
const second =
|
|
66
|
+
const first = next - smallscale
|
|
67
|
+
const second = value + smallscale
|
|
67
68
|
const middle = (first + second) / 2
|
|
68
69
|
if (diffRounded > 16) arr = [first, middle, second]
|
|
69
70
|
else arr = [first, second]
|