Slider: update documentation

pull/2953/head
thyttan 2023-10-18 01:05:32 +02:00
parent 4d7bcce070
commit 04c5cbd516
2 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,7 @@
/* Copyright (c) 2023 Bangle.js contributors. See the file LICENSE for copying permission. */ /* Copyright (c) 2023 Bangle.js contributors. See the file LICENSE for copying permission. */
// At time of writing in October 2023 this module is new and things are more likely to change during the coming weeks than in a month or two.
// See Slider.md for documentation // See Slider.md for documentation
/* Minify to 'Slider.min.js' by: // TODO: Should we do this for Slider module? /* Minify to 'Slider.min.js' by: // TODO: Should we do this for Slider module?

View File

@ -1,6 +1,8 @@
Slider Library Slider Library
============== ==============
*At time of writing in October 2023 this module is new and things are more likely to change during the coming weeks than in a month or two.*
> Take a look at README.md for hints on developing with this library. > Take a look at README.md for hints on developing with this library.
Usage Usage
@ -57,7 +59,7 @@ autoProgress: false, // The slider should be able to progress
A slider initiated in the Web IDE terminal window reveals its internals to a degree: A slider initiated in the Web IDE terminal window reveals its internals to a degree:
```js ```js
>slider = require("Slider").create(()=>{}, {autoProgress:true}) slider = require("Slider").create(()=>{}, {autoProgress:true})
={ ={
v: { level: 0, ebLast: 0, dy: 0 }, v: { level: 0, ebLast: 0, dy: 0 },
f: { f: {
@ -69,7 +71,7 @@ A slider initiated in the Web IDE terminal window reveals its internals to a deg
draw: function (level) { ... }, draw: function (level) { ... },
autoUpdate: function () { ... }, autoUpdate: function () { ... },
initAutoValues: function () { ... }, initAutoValues: function () { ... },
startAutoUpdate: function () { ... }, startAutoUpdate: function (intervalSeconds) { ... },
stopAutoUpdate: function () { ... } stopAutoUpdate: function () { ... }
}, },
c: { initLevel: 0, horizontal: false, xStart: 127, width: 44, c: { initLevel: 0, horizontal: false, xStart: 127, width: 44,
@ -79,8 +81,8 @@ A slider initiated in the Web IDE terminal window reveals its internals to a deg
mode: "incr", mode: "incr",
oversizeR: 0, oversizeL: 0, propagateDrag: false, timeout: 1, drawableSlider: true, oversizeR: 0, oversizeL: 0, propagateDrag: false, timeout: 1, drawableSlider: true,
colorFG: 63488, colorBG: 8, rounded: 22, outerBorderSize: 2, innerBorderSize: 2, colorFG: 63488, colorBG: 8, rounded: 22, outerBorderSize: 2, innerBorderSize: 2,
autoProgress: true, _rounded: 18, _xStart: 131, _width: 36, _yStart: 8, autoProgress: true, _rounded: 18, STEP_SIZE: 4.06666666666, _xStart: 131, _width: 36,
_height: 158, STEP_SIZE: 4.06666666666, _yStart: 8, _height: 158,
r: { x: 127, y: 4, x2: 171, y2: 170, r: { x: 127, y: 4, x2: 171, y2: 170,
w: 44, h: 166 }, w: 44, h: 166 },
borderRect: { x: 127, y: 4, w: 44, h: 166, borderRect: { x: 127, y: 4, w: 44, h: 166,
@ -89,7 +91,7 @@ A slider initiated in the Web IDE terminal window reveals its internals to a deg
r: 22 } r: 22 }
} }
} }
> >
``` ```
Tips Tips
---- ----