@fuzdev/fuz_ui 0.208.0 → 0.209.0
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/EcosystemLinks.svelte +2 -2
- package/dist/ProjectLinks.svelte +3 -32
- package/dist/ProjectLinks.svelte.d.ts.map +1 -1
- package/dist/logos.d.ts +1 -1
- package/dist/logos.d.ts.map +1 -1
- package/dist/logos.js +1 -1
- package/dist/projects.d.ts +0 -3
- package/dist/projects.d.ts.map +1 -1
- package/dist/projects.js +3 -3
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/package.json +6 -6
- package/src/lib/logos.ts +1 -1
- package/src/lib/projects.ts +3 -6
- package/src/lib/sparkline.ts +1 -1
- package/dist/ProjectActivityChart.svelte +0 -137
- package/dist/ProjectActivityChart.svelte.d.ts +0 -30
- package/dist/ProjectActivityChart.svelte.d.ts.map +0 -1
- package/dist/project_stats.d.ts +0 -121
- package/dist/project_stats.d.ts.map +0 -1
- package/dist/project_stats.js +0 -153
- package/dist/project_stats_data.d.ts +0 -3
- package/dist/project_stats_data.d.ts.map +0 -1
- package/dist/project_stats_data.js +0 -476
- package/dist/project_stats_update.task.d.ts +0 -4
- package/dist/project_stats_update.task.d.ts.map +0 -1
- package/dist/project_stats_update.task.js +0 -50
- package/dist/publish.task.d.ts +0 -3
- package/dist/publish.task.d.ts.map +0 -1
- package/dist/publish.task.js +0 -23
- package/src/lib/project_stats.ts +0 -220
- package/src/lib/project_stats_data.ts +0 -479
- package/src/lib/project_stats_update.task.ts +0 -53
- package/src/lib/publish.task.ts +0 -22
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
<ul {...rest}>
|
|
15
15
|
<li>
|
|
16
16
|
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
|
|
17
|
-
<a rel="me" href={FUZ_DEV_URL} class={{ selected: selected === 'fuz.dev' }}>fuz.dev</a>
|
|
18
|
-
|
|
17
|
+
<a rel="me" href={FUZ_DEV_URL} class={{ selected: selected === 'fuz.dev' }}>fuz.dev</a> - the
|
|
18
|
+
Fuz stack homepage{#if selected === 'fuz.dev'}, you are here{/if}
|
|
19
19
|
</li>
|
|
20
20
|
<li>
|
|
21
21
|
GitHub as <a rel="me" href="https://github.com/fuzdev">@fuzdev</a>
|
package/dist/ProjectLinks.svelte
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Svg from './Svg.svelte';
|
|
3
|
-
import Sparkline from './Sparkline.svelte';
|
|
4
3
|
import { project_items, type ProjectItem } from './projects.js';
|
|
5
|
-
import { project_stats_data } from './project_stats_data.js';
|
|
6
|
-
import { project_stats_label, project_stats_to_monthly_series } from './project_stats.js';
|
|
7
|
-
|
|
8
|
-
const { series, max } = project_stats_to_monthly_series(project_stats_data);
|
|
9
|
-
const series_by_name = new Map(series.map((s) => [s.name, s.counts]));
|
|
10
|
-
const label_by_name = new Map(
|
|
11
|
-
project_stats_data.projects.map((p) => [p.name, project_stats_label(p)])
|
|
12
|
-
);
|
|
13
4
|
</script>
|
|
14
5
|
|
|
15
6
|
<h2 class="mt_0 mb_xl2">Packages</h2>
|
|
@@ -18,36 +9,19 @@
|
|
|
18
9
|
{@render package_thumbnail(project_item)}
|
|
19
10
|
{/each}
|
|
20
11
|
</menu>
|
|
21
|
-
<small class="display:block text-align:right">
|
|
22
|
-
the charts show public commit activity<br />since Gro started in August 2019 -<br />most of the
|
|
23
|
-
repos created in 2023-2024 are<br />history-resetting forks from 2020~2023 attempts
|
|
24
|
-
</small>
|
|
25
12
|
|
|
26
13
|
{#snippet package_thumbnail(project_item: ProjectItem)}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<a
|
|
30
|
-
class="thumbnail row align-items:start shade_00 px_md py_xs border_radius_sm mb_lg"
|
|
31
|
-
href={project_item.url}
|
|
32
|
-
>
|
|
14
|
+
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
|
|
15
|
+
<a class="thumbnail row shade_00 px_md py_xs border_radius_sm mb_lg" href={project_item.url}>
|
|
33
16
|
<Svg shrink={false} data={project_item.logo} size="var(--icon_size_lg)" />
|
|
34
17
|
<div class="pl_lg width_atmost_sm">
|
|
35
|
-
<div class="thumbnail-name
|
|
36
|
-
{project_item.name}
|
|
37
|
-
{#if counts}
|
|
38
|
-
{@const stats_label = label_by_name.get(project_item.name)}
|
|
39
|
-
<div class="thumbnail-sparkline pl_md {project_item.color_class}" title={stats_label}>
|
|
40
|
-
<Sparkline values={counts} {max} scale={1 / 3} end_dot label={stats_label} />
|
|
41
|
-
</div>
|
|
42
|
-
{/if}
|
|
43
|
-
</div>
|
|
18
|
+
<div class="thumbnail-name {project_item.color_class}">{project_item.name}</div>
|
|
44
19
|
<div class="thumbnail-description font_size_md text_70 font-weight:500">
|
|
45
20
|
{project_item.description}
|
|
46
21
|
{project_item.glyph}
|
|
47
22
|
</div>
|
|
48
23
|
</div>
|
|
49
24
|
</a>
|
|
50
|
-
<!-- eslint-enable svelte/no-navigation-without-resolve -->
|
|
51
25
|
{/snippet}
|
|
52
26
|
|
|
53
27
|
<style>
|
|
@@ -84,7 +58,4 @@
|
|
|
84
58
|
transparent
|
|
85
59
|
);
|
|
86
60
|
}
|
|
87
|
-
.thumbnail-sparkline {
|
|
88
|
-
margin-left: auto;
|
|
89
|
-
}
|
|
90
61
|
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ProjectLinks.svelte"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProjectLinks.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ProjectLinks.svelte"],"names":[],"mappings":"AAoCA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,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;;;;CAIX,CAAC;AAEpB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"logos.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/logos.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,QAAQ;;;;;;CAgCF,CAAC;AAEpB,eAAO,MAAM,QAAQ;;;;;;CAQF,CAAC;AAEpB,eAAO,MAAM,YAAY;;;;;;CAIN,CAAC;AAEpB,eAAO,MAAM,YAAY;;;;;;;CAKN,CAAC;AAEpB,eAAO,MAAM,WAAW;;;;;;CAIL,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAIP,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAIP,CAAC;AAEpB,eAAO,MAAM,iBAAiB;;;;;;CAIX,CAAC;AAEpB,eAAO,MAAM,cAAc;;;;;;CAIR,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAIP,CAAC;AAEpB,eAAO,MAAM,mBAAmB;;;;;;CAQb,CAAC;AAEpB,eAAO,MAAM,iBAAiB;;;;;;CAQX,CAAC;AAEpB,eAAO,MAAM,aAAa;;;;;;CAwBP,CAAC;AAEpB,eAAO,MAAM,QAAQ;;;;;;CAQF,CAAC;AAEpB,eAAO,MAAM,WAAW;;;;;;;;;CAWL,CAAC;AAEpB,eAAO,MAAM,QAAQ;;;;;;CAQF,CAAC"}
|
package/dist/logos.js
CHANGED
package/dist/projects.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { SvgData } from './svg.js';
|
|
2
2
|
/**
|
|
3
3
|
* Metadata for a project in the fuz.dev ecosystem, rendered by `ProjectLinks`.
|
|
4
|
-
*
|
|
5
|
-
* `name` doubles as the project's repo directory name, so the
|
|
6
|
-
* `project_stats_update` task can locate each repo as a sibling directory.
|
|
7
4
|
*/
|
|
8
5
|
export interface ProjectItem {
|
|
9
6
|
name: string;
|
package/dist/projects.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAkBxC
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/projects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAkBxC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACpB;AAID,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,WAAW,CAa5C,CAAC"}
|
package/dist/projects.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
// TODO when fuz.dev is ready
|
|
3
3
|
// logo_fuz,
|
|
4
|
-
logo_fuz_ui, logo_fuz_code, logo_fuz_blog, logo_fuz_mastodon,
|
|
5
|
-
// TODO ideally this wouldn't duplicate metadata like descriptions, but adding
|
|
4
|
+
logo_fuz_ui, logo_fuz_code, logo_fuz_blog, logo_fuz_mastodon, logo_fuz_repos, logo_fuz_template, logo_fuz_css, logo_fuz_util, logo_gro, logo_svelte_docinfo, logo_fuz_app, logo_tsv } from './logos.js';
|
|
5
|
+
// TODO ideally this wouldn't duplicate metadata like descriptions, but adding fuz_repos to this repo is heavy
|
|
6
6
|
// prettier-ignore
|
|
7
7
|
export const project_items = [
|
|
8
8
|
{ name: 'fuz_app', url: 'https://app.fuz.dev/', logo: logo_fuz_app, description: '[pre-alpha] fullstack app library', glyph: '🗝', color_class: 'color_j_50' },
|
|
@@ -12,7 +12,7 @@ export const project_items = [
|
|
|
12
12
|
{ name: 'fuz_blog', url: 'https://blog.fuz.dev/', logo: logo_fuz_blog, description: 'blog software from scratch with SvelteKit', glyph: '🖊️', color_class: 'color_e_50' },
|
|
13
13
|
{ name: 'fuz_code', url: 'https://code.fuz.dev/', logo: logo_fuz_code, description: 'syntax styling utilities and components for TypeScript, Svelte, Markdown, and more', glyph: '🎨', color_class: 'color_g_50' },
|
|
14
14
|
{ name: 'fuz_mastodon', url: 'https://mastodon.fuz.dev/', logo: logo_fuz_mastodon, description: 'Mastodon components and helpers for Svelte, SvelteKit, and Fuz', glyph: '🦣', color_class: 'color_d_50' },
|
|
15
|
-
{ name: '
|
|
15
|
+
{ name: 'fuz_repos', url: 'https://repos.fuz.dev/', logo: logo_fuz_repos, description: 'a tool for managing many repos', glyph: '🪄', color_class: 'color_a_50' },
|
|
16
16
|
{ name: 'svelte-docinfo', url: 'https://svelte-docinfo.fuz.dev/', logo: logo_svelte_docinfo, description: 'static analysis for TypeScript and Svelte', glyph: '📜', color_class: 'color_i_50' },
|
|
17
17
|
{ name: 'fuz_util', url: 'https://util.fuz.dev/', logo: logo_fuz_util, description: 'utility belt for JS', glyph: '🦕', color_class: 'color_f_50' },
|
|
18
18
|
{ name: 'gro', url: 'https://github.com/fuzdev/gro', logo: logo_gro, description: 'task runner and toolkit extending SvelteKit', glyph: '🌰', color_class: 'color_f_50' },
|
package/dist/sparkline.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pure geometry helpers behind `Sparkline
|
|
2
|
+
* Pure geometry helpers behind `Sparkline`.
|
|
3
3
|
*
|
|
4
4
|
* Computes polyline points, alpha-fade gradient stops, and the end-dot
|
|
5
5
|
* position for a series of values, so components stay thin and the math is
|
package/dist/sparkline.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pure geometry helpers behind `Sparkline
|
|
2
|
+
* Pure geometry helpers behind `Sparkline`.
|
|
3
3
|
*
|
|
4
4
|
* Computes polyline points, alpha-fade gradient stops, and the end-dot
|
|
5
5
|
* position for a series of values, so components stay thin and the math is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.209.0",
|
|
4
4
|
"description": "Svelte UI library",
|
|
5
5
|
"tagline": "friendly user zystem",
|
|
6
6
|
"glyph": "🧶",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@changesets/changelog-git": "^0.2.1",
|
|
65
|
-
"@fuzdev/
|
|
65
|
+
"@fuzdev/blake3-wasm": "^0.2.0",
|
|
66
66
|
"@fuzdev/fuz_code": "^0.48.0",
|
|
67
|
-
"@fuzdev/fuz_css": "^0.
|
|
68
|
-
"@fuzdev/fuz_util": "^0.
|
|
69
|
-
"@fuzdev/gro": "^0.
|
|
67
|
+
"@fuzdev/fuz_css": "^0.64.0",
|
|
68
|
+
"@fuzdev/fuz_util": "^0.69.0",
|
|
69
|
+
"@fuzdev/gro": "^0.212.0",
|
|
70
70
|
"@fuzdev/mdz": "^0.3.0",
|
|
71
71
|
"@ryanatkn/eslint-config": "^0.12.2",
|
|
72
72
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"typescript": "^5.9.3",
|
|
87
87
|
"typescript-eslint": "^8.60.0",
|
|
88
88
|
"vite": "^7.3.6",
|
|
89
|
-
"vitest": "^
|
|
89
|
+
"vitest": "^5.0.0",
|
|
90
90
|
"zod": "^4.3.6"
|
|
91
91
|
},
|
|
92
92
|
"sideEffects": [
|
package/src/lib/logos.ts
CHANGED
|
@@ -100,7 +100,7 @@ export const logo_fuz_mastodon = {
|
|
|
100
100
|
paths: logo_fuz.paths
|
|
101
101
|
} satisfies SvgData;
|
|
102
102
|
|
|
103
|
-
export const
|
|
103
|
+
export const logo_fuz_repos = {
|
|
104
104
|
label: 'a friendly blue spider facing you',
|
|
105
105
|
fill: '#6199d1',
|
|
106
106
|
paths: logo_fuz.paths
|
package/src/lib/projects.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
logo_fuz_code,
|
|
7
7
|
logo_fuz_blog,
|
|
8
8
|
logo_fuz_mastodon,
|
|
9
|
-
|
|
9
|
+
logo_fuz_repos,
|
|
10
10
|
logo_fuz_template,
|
|
11
11
|
logo_fuz_css,
|
|
12
12
|
logo_fuz_util,
|
|
@@ -18,9 +18,6 @@ import {
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Metadata for a project in the fuz.dev ecosystem, rendered by `ProjectLinks`.
|
|
21
|
-
*
|
|
22
|
-
* `name` doubles as the project's repo directory name, so the
|
|
23
|
-
* `project_stats_update` task can locate each repo as a sibling directory.
|
|
24
21
|
*/
|
|
25
22
|
export interface ProjectItem {
|
|
26
23
|
name: string;
|
|
@@ -31,7 +28,7 @@ export interface ProjectItem {
|
|
|
31
28
|
color_class: string;
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
// TODO ideally this wouldn't duplicate metadata like descriptions, but adding
|
|
31
|
+
// TODO ideally this wouldn't duplicate metadata like descriptions, but adding fuz_repos to this repo is heavy
|
|
35
32
|
// prettier-ignore
|
|
36
33
|
export const project_items: Array<ProjectItem> = [
|
|
37
34
|
{name: 'fuz_app', url: 'https://app.fuz.dev/', logo: logo_fuz_app, description: '[pre-alpha] fullstack app library', glyph: '🗝', color_class: 'color_j_50'},
|
|
@@ -41,7 +38,7 @@ export const project_items: Array<ProjectItem> = [
|
|
|
41
38
|
{name: 'fuz_blog', url: 'https://blog.fuz.dev/', logo: logo_fuz_blog, description: 'blog software from scratch with SvelteKit', glyph: '🖊️', color_class: 'color_e_50'},
|
|
42
39
|
{name: 'fuz_code', url: 'https://code.fuz.dev/', logo: logo_fuz_code, description: 'syntax styling utilities and components for TypeScript, Svelte, Markdown, and more', glyph: '🎨', color_class: 'color_g_50'},
|
|
43
40
|
{name: 'fuz_mastodon', url: 'https://mastodon.fuz.dev/', logo: logo_fuz_mastodon, description: 'Mastodon components and helpers for Svelte, SvelteKit, and Fuz', glyph: '🦣', color_class: 'color_d_50'},
|
|
44
|
-
{name: '
|
|
41
|
+
{name: 'fuz_repos', url: 'https://repos.fuz.dev/', logo: logo_fuz_repos, description: 'a tool for managing many repos', glyph: '🪄', color_class: 'color_a_50'},
|
|
45
42
|
{name: 'svelte-docinfo', url: 'https://svelte-docinfo.fuz.dev/', logo: logo_svelte_docinfo, description: 'static analysis for TypeScript and Svelte', glyph: '📜', color_class: 'color_i_50'},
|
|
46
43
|
{name: 'fuz_util', url: 'https://util.fuz.dev/', logo: logo_fuz_util, description: 'utility belt for JS', glyph: '🦕', color_class: 'color_f_50'},
|
|
47
44
|
{name: 'gro', url: 'https://github.com/fuzdev/gro', logo: logo_gro, description: 'task runner and toolkit extending SvelteKit', glyph: '🌰', color_class: 'color_f_50'},
|
package/src/lib/sparkline.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pure geometry helpers behind `Sparkline
|
|
2
|
+
* Pure geometry helpers behind `Sparkline`.
|
|
3
3
|
*
|
|
4
4
|
* Computes polyline points, alpha-fade gradient stops, and the end-dot
|
|
5
5
|
* position for a series of values, so components stay thin and the math is
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { OmitStrict } from '@fuzdev/fuz_util/types.ts';
|
|
3
|
-
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
4
|
-
|
|
5
|
-
import { project_items } from './projects.js';
|
|
6
|
-
import { project_stats_data } from './project_stats_data.js';
|
|
7
|
-
import { project_stats_label, project_stats_to_weekly_series } from './project_stats.js';
|
|
8
|
-
import { sparkline_geometry, type SparklineScale } from './sparkline.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* A large line chart of weekly commit activity with every fuz.dev project
|
|
12
|
-
* drawn over one another, sharing one time window and one scale.
|
|
13
|
-
*
|
|
14
|
-
* Each project's line uses its `color_class` from `project_items` (the
|
|
15
|
-
* `ProjectLinks` grid doubles as the legend), with the same per-point alpha
|
|
16
|
-
* fade and end dot as `Sparkline`. Hovering a line shows the project's
|
|
17
|
-
* stats via a native `title`. The svg scales to its container's width.
|
|
18
|
-
*
|
|
19
|
-
* The background is a light wash of `currentColor` (the inherited text
|
|
20
|
-
* color), overridable with the `--sparkline_bg` custom property.
|
|
21
|
-
*
|
|
22
|
-
* @module
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
width = 800,
|
|
27
|
-
height = 160,
|
|
28
|
-
scale = 1 / 3,
|
|
29
|
-
stroke_width = 2,
|
|
30
|
-
alpha_floor = 0.4,
|
|
31
|
-
label = 'weekly commit activity for all projects, drawn over one another at a shared scale',
|
|
32
|
-
...rest
|
|
33
|
-
}: OmitStrict<SvelteHTMLElements['svg'], 'width' | 'height' | 'scale'> & {
|
|
34
|
-
/**
|
|
35
|
-
* Width of the svg's coordinate space in px; rendering stretches to the container.
|
|
36
|
-
*/
|
|
37
|
-
width?: number;
|
|
38
|
-
/**
|
|
39
|
-
* Height of the svg's coordinate space in px.
|
|
40
|
-
*/
|
|
41
|
-
height?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Vertical scale for the lines' geometry — see `SparklineScale`.
|
|
44
|
-
*/
|
|
45
|
-
scale?: SparklineScale;
|
|
46
|
-
stroke_width?: number;
|
|
47
|
-
/**
|
|
48
|
-
* Stroke alpha at a value of 0, scaling linearly to 1 at the shared max.
|
|
49
|
-
*/
|
|
50
|
-
alpha_floor?: number;
|
|
51
|
-
/**
|
|
52
|
-
* Accessible label for the chart.
|
|
53
|
-
*/
|
|
54
|
-
label?: string;
|
|
55
|
-
} = $props();
|
|
56
|
-
|
|
57
|
-
const chart_id = $props.id();
|
|
58
|
-
|
|
59
|
-
const { series, max } = project_stats_to_weekly_series(project_stats_data);
|
|
60
|
-
const color_class_by_name = new Map(project_items.map((p) => [p.name, p.color_class]));
|
|
61
|
-
const label_by_name = new Map(
|
|
62
|
-
project_stats_data.projects.map((p) => [p.name, project_stats_label(p)])
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
const lines = $derived(
|
|
66
|
-
series.flatMap(({ name, counts }) => {
|
|
67
|
-
const geometry = sparkline_geometry(counts, {
|
|
68
|
-
width,
|
|
69
|
-
height,
|
|
70
|
-
max,
|
|
71
|
-
scale,
|
|
72
|
-
stroke_width,
|
|
73
|
-
alpha_floor,
|
|
74
|
-
end_dot: true
|
|
75
|
-
});
|
|
76
|
-
return geometry
|
|
77
|
-
? [
|
|
78
|
-
{
|
|
79
|
-
name,
|
|
80
|
-
geometry,
|
|
81
|
-
color_class: color_class_by_name.get(name),
|
|
82
|
-
title: label_by_name.get(name)
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
: [];
|
|
86
|
-
})
|
|
87
|
-
);
|
|
88
|
-
</script>
|
|
89
|
-
|
|
90
|
-
<svg {...rest} viewBox="0 0 {width} {height}" role="img" aria-label={label}>
|
|
91
|
-
<defs>
|
|
92
|
-
{#each lines as line, index (line.name)}
|
|
93
|
-
<linearGradient
|
|
94
|
-
id="{chart_id}-{index}"
|
|
95
|
-
class={line.color_class}
|
|
96
|
-
gradientUnits="userSpaceOnUse"
|
|
97
|
-
x1="0"
|
|
98
|
-
y1="0"
|
|
99
|
-
x2={width}
|
|
100
|
-
y2="0"
|
|
101
|
-
>
|
|
102
|
-
{#each line.geometry.stops as stop, stop_index (stop_index)}
|
|
103
|
-
<stop offset={stop.offset} stop-color="currentColor" stop-opacity={stop.opacity} />
|
|
104
|
-
{/each}
|
|
105
|
-
</linearGradient>
|
|
106
|
-
{/each}
|
|
107
|
-
</defs>
|
|
108
|
-
{#each lines as line, index (line.name)}
|
|
109
|
-
<g class={line.color_class}>
|
|
110
|
-
<title>{line.title}</title>
|
|
111
|
-
<polyline
|
|
112
|
-
points={line.geometry.points}
|
|
113
|
-
fill="none"
|
|
114
|
-
stroke="url(#{chart_id}-{index})"
|
|
115
|
-
stroke-width={stroke_width}
|
|
116
|
-
stroke-linejoin="round"
|
|
117
|
-
stroke-linecap="round"
|
|
118
|
-
/>
|
|
119
|
-
<circle
|
|
120
|
-
cx={line.geometry.end_x}
|
|
121
|
-
cy={line.geometry.end_y}
|
|
122
|
-
r={line.geometry.dot_radius}
|
|
123
|
-
fill="currentColor"
|
|
124
|
-
fill-opacity={line.geometry.end_alpha}
|
|
125
|
-
/>
|
|
126
|
-
</g>
|
|
127
|
-
{/each}
|
|
128
|
-
</svg>
|
|
129
|
-
|
|
130
|
-
<style>
|
|
131
|
-
svg {
|
|
132
|
-
width: 100%;
|
|
133
|
-
height: auto;
|
|
134
|
-
background: var(--sparkline_bg, color-mix(in hsl, currentColor 8%, transparent));
|
|
135
|
-
border-radius: var(--border_radius_xs);
|
|
136
|
-
}
|
|
137
|
-
</style>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { OmitStrict } from '@fuzdev/fuz_util/types.ts';
|
|
2
|
-
import type { SvelteHTMLElements } from 'svelte/elements';
|
|
3
|
-
import { type SparklineScale } from './sparkline.js';
|
|
4
|
-
type $$ComponentProps = OmitStrict<SvelteHTMLElements['svg'], 'width' | 'height' | 'scale'> & {
|
|
5
|
-
/**
|
|
6
|
-
* Width of the svg's coordinate space in px; rendering stretches to the container.
|
|
7
|
-
*/
|
|
8
|
-
width?: number;
|
|
9
|
-
/**
|
|
10
|
-
* Height of the svg's coordinate space in px.
|
|
11
|
-
*/
|
|
12
|
-
height?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Vertical scale for the lines' geometry — see `SparklineScale`.
|
|
15
|
-
*/
|
|
16
|
-
scale?: SparklineScale;
|
|
17
|
-
stroke_width?: number;
|
|
18
|
-
/**
|
|
19
|
-
* Stroke alpha at a value of 0, scaling linearly to 1 at the shared max.
|
|
20
|
-
*/
|
|
21
|
-
alpha_floor?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Accessible label for the chart.
|
|
24
|
-
*/
|
|
25
|
-
label?: string;
|
|
26
|
-
};
|
|
27
|
-
declare const ProjectActivityChart: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
28
|
-
type ProjectActivityChart = ReturnType<typeof ProjectActivityChart>;
|
|
29
|
-
export default ProjectActivityChart;
|
|
30
|
-
//# sourceMappingURL=ProjectActivityChart.svelte.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectActivityChart.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ProjectActivityChart.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAK1D,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAExE,KAAK,gBAAgB,GAAI,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,GAAG;IAC9F;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AA2FH,QAAA,MAAM,oBAAoB,sDAAwC,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
|
package/dist/project_stats.d.ts
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types and pure helpers for project commit-activity stats.
|
|
3
|
-
*
|
|
4
|
-
* The committed dataset (`project_stats_data.ts`, written by the
|
|
5
|
-
* `project_stats_update` task) stores daily commit counts per project as the
|
|
6
|
-
* master granularity; coarser scopes like monthly are derived at runtime by
|
|
7
|
-
* rebucketing. All date handling is UTC — `YYYY-MM-DD` strings and "epoch
|
|
8
|
-
* days" (days since the Unix epoch) — so results are deterministic across
|
|
9
|
-
* machines.
|
|
10
|
-
*
|
|
11
|
-
* @module
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Daily commit counts for one project.
|
|
15
|
-
*/
|
|
16
|
-
export interface ProjectCommitStats {
|
|
17
|
-
/**
|
|
18
|
-
* Project name, matching `project_items`.
|
|
19
|
-
*/
|
|
20
|
-
name: string;
|
|
21
|
-
/**
|
|
22
|
-
* UTC date (`YYYY-MM-DD`) of the first day bucket, the day of the first commit.
|
|
23
|
-
*/
|
|
24
|
-
start_date: string;
|
|
25
|
-
/**
|
|
26
|
-
* Commits per UTC day from `start_date` through the snapshot's `end_date`, inclusive.
|
|
27
|
-
*/
|
|
28
|
-
daily_counts: Array<number>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* A snapshot of commit stats across projects, sharing a single `end_date`.
|
|
32
|
-
*/
|
|
33
|
-
export interface ProjectStatsSnapshot {
|
|
34
|
-
/**
|
|
35
|
-
* ISO datetime when the snapshot was collected.
|
|
36
|
-
*/
|
|
37
|
-
generated_at: string;
|
|
38
|
-
/**
|
|
39
|
-
* UTC date (`YYYY-MM-DD`) of the final day bucket, shared by every project.
|
|
40
|
-
*/
|
|
41
|
-
end_date: string;
|
|
42
|
-
projects: Array<ProjectCommitStats>;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A derived series of bucketed counts for one project.
|
|
46
|
-
*/
|
|
47
|
-
export interface ProjectStatsSeries {
|
|
48
|
-
name: string;
|
|
49
|
-
counts: Array<number>;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Converts a UTC `YYYY-MM-DD` date to days since the Unix epoch.
|
|
53
|
-
*/
|
|
54
|
-
export declare const epoch_day_from_date: (date: string) => number;
|
|
55
|
-
/**
|
|
56
|
-
* Converts days since the Unix epoch to a UTC `YYYY-MM-DD` date.
|
|
57
|
-
*/
|
|
58
|
-
export declare const date_from_epoch_day: (epoch_day: number) => string;
|
|
59
|
-
/**
|
|
60
|
-
* Buckets commit timestamps into daily counts from the earliest commit's UTC
|
|
61
|
-
* day through `end_date`, inclusive.
|
|
62
|
-
*
|
|
63
|
-
* @param timestamps - commit times as Unix epoch seconds
|
|
64
|
-
* @param end_date - UTC date (`YYYY-MM-DD`) of the final bucket; later timestamps clamp into it
|
|
65
|
-
* @returns the start date and daily counts, or `null` if `timestamps` is empty
|
|
66
|
-
*/
|
|
67
|
-
export declare const daily_counts_from_timestamps: (timestamps: Array<number>, end_date: string) => {
|
|
68
|
-
start_date: string;
|
|
69
|
-
daily_counts: Array<number>;
|
|
70
|
-
} | null;
|
|
71
|
-
/**
|
|
72
|
-
* Pads `daily_counts` with leading zeros so the series starts at
|
|
73
|
-
* `padded_start_date` instead of `start_date`.
|
|
74
|
-
*
|
|
75
|
-
* Returns the input array unchanged when `padded_start_date` is not earlier
|
|
76
|
-
* than `start_date`.
|
|
77
|
-
*/
|
|
78
|
-
export declare const daily_counts_pad_start: (daily_counts: Array<number>, start_date: string, padded_start_date: string) => Array<number>;
|
|
79
|
-
/**
|
|
80
|
-
* Rebuckets daily counts into calendar-month (UTC) counts.
|
|
81
|
-
*
|
|
82
|
-
* The first and last buckets may cover partial months.
|
|
83
|
-
*/
|
|
84
|
-
export declare const monthly_counts_from_daily: (daily_counts: Array<number>, start_date: string) => Array<number>;
|
|
85
|
-
/**
|
|
86
|
-
* Rebuckets daily counts into 7-day counts, anchored at the end of the series
|
|
87
|
-
* so the newest bucket always covers a full 7 days.
|
|
88
|
-
*
|
|
89
|
-
* The first bucket may cover fewer days when the length isn't a multiple of 7.
|
|
90
|
-
*/
|
|
91
|
-
export declare const weekly_counts_from_daily: (daily_counts: Array<number>) => Array<number>;
|
|
92
|
-
/**
|
|
93
|
-
* Derives aligned monthly series for every project in `snapshot`, sharing one
|
|
94
|
-
* time window and one scale.
|
|
95
|
-
*
|
|
96
|
-
* Each series spans from the earliest project's `start_date` through the
|
|
97
|
-
* snapshot's `end_date` (younger projects are zero-padded at the front), so
|
|
98
|
-
* all series have the same length and bucket boundaries. `max` is the largest
|
|
99
|
-
* monthly count across all projects, for rendering every series at the same
|
|
100
|
-
* vertical scale.
|
|
101
|
-
*/
|
|
102
|
-
export declare const project_stats_to_monthly_series: (snapshot: ProjectStatsSnapshot) => {
|
|
103
|
-
series: Array<ProjectStatsSeries>;
|
|
104
|
-
max: number;
|
|
105
|
-
};
|
|
106
|
-
/**
|
|
107
|
-
* Derives aligned weekly series for every project in `snapshot`, sharing one
|
|
108
|
-
* time window and one scale — the weekly sibling of
|
|
109
|
-
* `project_stats_to_monthly_series`.
|
|
110
|
-
*/
|
|
111
|
-
export declare const project_stats_to_weekly_series: (snapshot: ProjectStatsSnapshot) => {
|
|
112
|
-
series: Array<ProjectStatsSeries>;
|
|
113
|
-
max: number;
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Formats a one-line human-readable summary of a project's commit stats,
|
|
117
|
-
* e.g. `"gro — 2,386 commits since August 7, 2019"`. Used for accessible
|
|
118
|
-
* labels and tooltips.
|
|
119
|
-
*/
|
|
120
|
-
export declare const project_stats_label: (project: ProjectCommitStats) => string;
|
|
121
|
-
//# sourceMappingURL=project_stats.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project_stats.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/project_stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY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