@rokkit/chart 1.0.0-next.32 → 1.0.0-next.35
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 +11 -10
- package/src/chart/Swatch.svelte +1 -1
- package/src/chart/Symbol.svelte +3 -0
- package/src/chart/Timer.svelte +1 -1
- package/src/index.js +1 -1
- package/src/plots/RankBarPlot.svelte +1 -1
- package/src/plots/ViolinPlot.svelte +1 -1
- package/src/lib/timer.js +0 -44
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rokkit/chart",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.35",
|
|
4
4
|
"description": "Components for making interactive charts.",
|
|
5
5
|
"author": "Jerry Thomas <me@jerrythomas.name>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,26 +13,27 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@sveltejs/vite-plugin-svelte": "^2.4.
|
|
17
|
-
"@testing-library/svelte": "^
|
|
18
|
-
"@vitest/ui": "~0.
|
|
16
|
+
"@sveltejs/vite-plugin-svelte": "^2.4.2",
|
|
17
|
+
"@testing-library/svelte": "^4.0.3",
|
|
18
|
+
"@vitest/ui": "~0.32.3",
|
|
19
19
|
"js-yaml": "^4.1.0",
|
|
20
20
|
"jsdom": "^22.1.0",
|
|
21
|
-
"svelte": "^
|
|
22
|
-
"typescript": "^5.
|
|
21
|
+
"svelte": "^4.0.1",
|
|
22
|
+
"typescript": "^5.1.6",
|
|
23
23
|
"vite": "^4.3.9",
|
|
24
|
-
"vitest": "~0.
|
|
25
|
-
"shared-config": "1.0.0-next.
|
|
24
|
+
"vitest": "~0.32.3",
|
|
25
|
+
"shared-config": "1.0.0-next.35"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"d3-array": "^3.2.
|
|
28
|
+
"d3-array": "^3.2.4",
|
|
29
29
|
"d3-collection": "^1.0.7",
|
|
30
30
|
"d3-scale": "^4.0.2",
|
|
31
31
|
"d3-shape": "^3.2.0",
|
|
32
32
|
"date-fns": "^2.30.0",
|
|
33
33
|
"ramda": "^0.29.0",
|
|
34
|
+
"rokkit": "latest",
|
|
34
35
|
"yootils": "^0.3.1",
|
|
35
|
-
"@rokkit/core": "1.0.0-next.
|
|
36
|
+
"@rokkit/core": "1.0.0-next.35"
|
|
36
37
|
},
|
|
37
38
|
"files": [
|
|
38
39
|
"src/**/*.js",
|
package/src/chart/Swatch.svelte
CHANGED
package/src/chart/Symbol.svelte
CHANGED
package/src/chart/Timer.svelte
CHANGED
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// export { aes } from './lib/aes'
|
|
2
2
|
// export { timelapse } from './lib/timelapse'
|
|
3
3
|
// export { axisTicks } from './lib/axis'
|
|
4
|
-
export { timer, elapsed } from './lib/timer'
|
|
4
|
+
// export { timer, elapsed } from './lib/timer'
|
|
5
5
|
// export { default as Chart } from './chart/Chart.svelte'
|
|
6
6
|
// export { default as Axis } from './chart/Axis.svelte'
|
|
7
7
|
export { default as Swatch } from './chart/Swatch.svelte'
|
package/src/lib/timer.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { writable } from 'svelte/store'
|
|
2
|
-
|
|
3
|
-
let req
|
|
4
|
-
let prev
|
|
5
|
-
const elapsed = writable(0)
|
|
6
|
-
|
|
7
|
-
const tick = (timestamp) => {
|
|
8
|
-
if (!prev) prev = timestamp
|
|
9
|
-
const diff = Math.round(timestamp - prev)
|
|
10
|
-
|
|
11
|
-
if (diff > 0) {
|
|
12
|
-
prev = timestamp
|
|
13
|
-
}
|
|
14
|
-
elapsed.update((e) => e + diff)
|
|
15
|
-
req = window.requestAnimationFrame(tick)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const timer = {
|
|
19
|
-
start() {
|
|
20
|
-
if (typeof window === 'undefined') return
|
|
21
|
-
else if (!req) {
|
|
22
|
-
prev = null
|
|
23
|
-
req = window.requestAnimationFrame(tick)
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
stop() {
|
|
27
|
-
if (typeof window === 'undefined') return
|
|
28
|
-
else if (req) {
|
|
29
|
-
window.cancelAnimationFrame(req)
|
|
30
|
-
req = null
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
toggle() {
|
|
34
|
-
req ? timer.stop() : timer.start()
|
|
35
|
-
},
|
|
36
|
-
set(val) {
|
|
37
|
-
if (typeof val === 'number') elapsed.set(val)
|
|
38
|
-
},
|
|
39
|
-
reset() {
|
|
40
|
-
timer.set(0)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { timer, elapsed }
|