feat: add basic support for SVG generator.

Add heat map example.
This commit is contained in:
2026-01-07 22:03:22 +08:00
parent da764bd99f
commit 909448d9f5
40 changed files with 3099 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
namespace HotMap.Utils;
public static class UtilsExtensions
{
extension(DateOnly date)
{
public DateOnly GetMonday()
{
return date.DayOfWeek switch
{
DayOfWeek.Monday => date,
DayOfWeek.Sunday => date.AddDays(-6),
_ => date.AddDays(1 - (int)date.DayOfWeek)
};
}
}
extension<T>(IEnumerable<T> enumerable)
{
public IEnumerable<(T, int)> WithIndex()
{
return enumerable.Select((v, i) => (v, i));
}
}
}