@fundar/data-chart-telling 0.0.1 → 0.0.3
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/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/plots/markers/DeltaMarker.svelte +9 -9
- package/package.json +76 -75
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,11 @@ export { default as TimelineLayout } from './layout/timeline/TimelineLayout.svel
|
|
|
14
14
|
export { default as FacetLayout } from './layout/facet/FacetLayout.svelte';
|
|
15
15
|
export { default as LegendLayout } from './layout/legend/LegendLayout.svelte';
|
|
16
16
|
export { default as Tooltip } from './layout/tooltip/Tooltip.svelte';
|
|
17
|
+
export { default as DeltaMarker } from './plots/markers/DeltaMarker.svelte';
|
|
18
|
+
export { default as DotMarker } from './plots/markers/DotMarker.svelte';
|
|
17
19
|
export { default as HoverMarker } from './plots/markers/HoverMarker.svelte';
|
|
20
|
+
export { default as PeakMarker } from './plots/markers/PeakMarker.svelte';
|
|
21
|
+
export { default as TextMarker } from './plots/markers/TextMarker.svelte';
|
|
18
22
|
export { setConfiguration, getConfiguration, resetConfiguration, configToCssVars, cssVarsStyle, DEFAULT_CONFIG, } from './configuration/config.svelte';
|
|
19
23
|
export { THEMES } from './configuration/themes';
|
|
20
24
|
export type { ThemeName } from './configuration/themes';
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,12 @@ export { default as TimelineLayout } from './layout/timeline/TimelineLayout.svel
|
|
|
19
19
|
export { default as FacetLayout } from './layout/facet/FacetLayout.svelte';
|
|
20
20
|
export { default as LegendLayout } from './layout/legend/LegendLayout.svelte';
|
|
21
21
|
export { default as Tooltip } from './layout/tooltip/Tooltip.svelte';
|
|
22
|
+
// Markers
|
|
23
|
+
export { default as DeltaMarker } from './plots/markers/DeltaMarker.svelte';
|
|
24
|
+
export { default as DotMarker } from './plots/markers/DotMarker.svelte';
|
|
22
25
|
export { default as HoverMarker } from './plots/markers/HoverMarker.svelte';
|
|
26
|
+
export { default as PeakMarker } from './plots/markers/PeakMarker.svelte';
|
|
27
|
+
export { default as TextMarker } from './plots/markers/TextMarker.svelte';
|
|
23
28
|
export { setConfiguration, getConfiguration, resetConfiguration, configToCssVars, cssVarsStyle, DEFAULT_CONFIG, } from './configuration/config.svelte';
|
|
24
29
|
export { THEMES } from './configuration/themes';
|
|
25
30
|
// ── Utils ─────────────────────────────────────────────────────────────────────
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
</script>
|
|
63
63
|
|
|
64
64
|
{#if resolved}
|
|
65
|
-
{@const fromVis = clamp(resolved
|
|
66
|
-
{@const toVis = clamp(resolved
|
|
67
|
-
{@const textPt = pt(resolved
|
|
65
|
+
{@const fromVis = clamp(resolved?.from ?? 0)}
|
|
66
|
+
{@const toVis = clamp(resolved?.to ?? 0)}
|
|
67
|
+
{@const textPt = pt(resolved?.at ?? 0, textVaryCoord(fromVis, toVis))}
|
|
68
68
|
|
|
69
69
|
<Line
|
|
70
|
-
data={[pt(resolved
|
|
70
|
+
data={[pt(resolved?.at ?? 0, fromVis), pt(resolved?.at ?? 0, toVis)]}
|
|
71
71
|
x={(p) => p.x}
|
|
72
72
|
y={(p) => p.y}
|
|
73
73
|
stroke={strokeStyle?.stroke ?? 'currentColor'}
|
|
@@ -77,19 +77,19 @@
|
|
|
77
77
|
strokeLinecap={strokeStyle?.strokeLinecap ?? 'round'}
|
|
78
78
|
/>
|
|
79
79
|
<DotMarker
|
|
80
|
-
x={pt(resolved
|
|
81
|
-
y={pt(resolved
|
|
80
|
+
x={pt(resolved?.at ?? 0, fromVis).x}
|
|
81
|
+
y={pt(resolved?.at ?? 0, fromVis).y}
|
|
82
82
|
style={{ dotRadius: 4, dotFill: strokeStyle?.stroke, dotStroke: strokeStyle?.stroke, dotStrokeWidth: 2, ...dotStyle }}
|
|
83
83
|
/>
|
|
84
84
|
<DotMarker
|
|
85
|
-
x={pt(resolved
|
|
86
|
-
y={pt(resolved
|
|
85
|
+
x={pt(resolved?.at ?? 0, toVis).x}
|
|
86
|
+
y={pt(resolved?.at ?? 0, toVis).y}
|
|
87
87
|
style={{ dotRadius: 4, dotFill: strokeStyle?.stroke, dotStroke: strokeStyle?.stroke, dotStrokeWidth: 2, ...dotStyle }}
|
|
88
88
|
/>
|
|
89
89
|
<TextMarker
|
|
90
90
|
x={textPt.x}
|
|
91
91
|
y={textPt.y}
|
|
92
|
-
text={(formatDiff ?? ((v: number) => v.toFixed(1)))(resolved
|
|
92
|
+
text={(formatDiff ?? ((v: number) => v.toFixed(1)))(resolved?.diff ?? 0)}
|
|
93
93
|
style={{
|
|
94
94
|
fontWeight: 'bold',
|
|
95
95
|
fontSize: 14,
|
package/package.json
CHANGED
|
@@ -1,76 +1,77 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
2
|
+
"name": "@fundar/data-chart-telling",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "svelte-package",
|
|
7
|
+
"prepack": "svelte-package && publint",
|
|
8
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
9
|
+
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
|
10
|
+
"lint": "prettier --check . && eslint .",
|
|
11
|
+
"format": "prettier --write .",
|
|
12
|
+
"test": "vitest run --project=unit --project=browser",
|
|
13
|
+
"test:stories": "vitest run --project=storybook",
|
|
14
|
+
"storybook": "storybook dev -p 6006",
|
|
15
|
+
"build-storybook": "storybook build"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": [
|
|
21
|
+
"**/*.css"
|
|
22
|
+
],
|
|
23
|
+
"svelte": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"svelte": "./dist/index.js",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"d3-interpolate": "^3.0.1"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"svelte": "^5.0.0",
|
|
37
|
+
"svelteplot": "^0.14.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/compat": "^2.0.4",
|
|
41
|
+
"@eslint/js": "^10.0.1",
|
|
42
|
+
"@sveltejs/package": "^2.5.7",
|
|
43
|
+
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
44
|
+
"@types/d3-interpolate": "^3.0.4",
|
|
45
|
+
"@types/node": "^22",
|
|
46
|
+
"@vitest/browser": "^4.1.7",
|
|
47
|
+
"@vitest/browser-playwright": "^4.1.7",
|
|
48
|
+
"eslint": "^10.2.0",
|
|
49
|
+
"eslint-config-prettier": "^10.1.8",
|
|
50
|
+
"eslint-plugin-svelte": "^3.17.0",
|
|
51
|
+
"globals": "^17.4.0",
|
|
52
|
+
"playwright": "^1.60.0",
|
|
53
|
+
"prettier": "^3.8.1",
|
|
54
|
+
"prettier-plugin-svelte": "^3.5.1",
|
|
55
|
+
"publint": "^0.3.18",
|
|
56
|
+
"svelte": "^5.55.2",
|
|
57
|
+
"svelte-check": "^4.4.6",
|
|
58
|
+
"svelteplot": "^0.14.0",
|
|
59
|
+
"typescript": "^6.0.2",
|
|
60
|
+
"typescript-eslint": "^8.58.1",
|
|
61
|
+
"vite": "^8.0.7",
|
|
62
|
+
"vitest": "^4.1.3",
|
|
63
|
+
"vitest-browser-svelte": "^2.1.1",
|
|
64
|
+
"storybook": "^10.4.1",
|
|
65
|
+
"@storybook/svelte-vite": "^10.4.1",
|
|
66
|
+
"@storybook/addon-svelte-csf": "^5.1.2",
|
|
67
|
+
"@chromatic-com/storybook": "^5.2.1",
|
|
68
|
+
"@storybook/addon-vitest": "^10.4.1",
|
|
69
|
+
"@storybook/addon-a11y": "^10.4.1",
|
|
70
|
+
"@storybook/addon-docs": "^10.4.1",
|
|
71
|
+
"eslint-plugin-storybook": "^10.4.1",
|
|
72
|
+
"@vitest/coverage-v8": "4.1.7"
|
|
73
|
+
},
|
|
74
|
+
"keywords": [
|
|
75
|
+
"svelte"
|
|
76
|
+
]
|
|
77
|
+
}
|