diff --git a/.changeset/plain-rings-itch.md b/.changeset/plain-rings-itch.md new file mode 100644 index 000000000..df28d97fd --- /dev/null +++ b/.changeset/plain-rings-itch.md @@ -0,0 +1,5 @@ +--- +'layerchart': patch +--- + +feat: Add Month component diff --git a/docs/src/content/components/Calendar.md b/docs/src/content/components/Calendar.md index b4a845f96..179d2f8fc 100644 --- a/docs/src/content/components/Calendar.md +++ b/docs/src/content/components/Calendar.md @@ -2,39 +2,9 @@ description: Marking component which highlights specific dates or time periods on a chart to emphasize events, milestones, or temporal patterns. category: marks layers: [svg, canvas, html] -related: [] +related: [Month] --- ## Usage :example{ name="basic" showCode } - - diff --git a/docs/src/content/components/Month.md b/docs/src/content/components/Month.md new file mode 100644 index 000000000..b3be937c7 --- /dev/null +++ b/docs/src/content/components/Month.md @@ -0,0 +1,10 @@ +--- +description: Month-based calendar grid visualization for displaying daily data across months with customizable cell sizes, labels, and tooltips. +category: marks +layers: [svg, canvas, html] +related: [Calendar] +--- + +## Usage + +:example{ name="basic" showCode } diff --git a/docs/src/examples/catalog/Chart.json b/docs/src/examples/catalog/Chart.json index fb475f32f..9ee18c199 100644 --- a/docs/src/examples/catalog/Chart.json +++ b/docs/src/examples/catalog/Chart.json @@ -2651,6 +2651,48 @@ "lineNumber": 32, "line": "" }, + { + "example": "90-days", + "component": "Month", + "path": "/docs/components/Month/90-days", + "lineNumber": 22, + "line": "" } ], - "updatedAt": "2026-04-01T13:16:17.567Z" + "updatedAt": "2026-04-01T16:49:30.210Z" } \ No newline at end of file diff --git a/docs/src/examples/catalog/Layer.json b/docs/src/examples/catalog/Layer.json index f3ddfffdb..4688fc8a2 100644 --- a/docs/src/examples/catalog/Layer.json +++ b/docs/src/examples/catalog/Layer.json @@ -2543,6 +2543,48 @@ "lineNumber": 33, "line": "" }, + { + "example": "90-days", + "component": "Month", + "path": "/docs/components/Month/90-days", + "lineNumber": 37, + "line": "" + }, + { + "example": "basic", + "component": "Month", + "path": "/docs/components/Month/basic", + "lineNumber": 39, + "line": "" + }, + { + "example": "custom-cell-size", + "component": "Month", + "path": "/docs/components/Month/custom-cell-size", + "lineNumber": 39, + "line": "" + }, + { + "example": "multiple-years", + "component": "Month", + "path": "/docs/components/Month/multiple-years", + "lineNumber": 37, + "line": "" + }, + { + "example": "without-day-numbers", + "component": "Month", + "path": "/docs/components/Month/without-day-numbers", + "lineNumber": 38, + "line": "" + }, + { + "example": "without-month-labels", + "component": "Month", + "path": "/docs/components/Month/without-month-labels", + "lineNumber": 38, + "line": "" + }, { "example": "repeat-indefinitely", "component": "MotionPath", @@ -3846,5 +3888,5 @@ "line": "" } ], - "updatedAt": "2026-04-01T13:16:18.421Z" + "updatedAt": "2026-04-01T16:49:31.366Z" } \ No newline at end of file diff --git a/docs/src/examples/catalog/Month.json b/docs/src/examples/catalog/Month.json new file mode 100644 index 000000000..00288ca2b --- /dev/null +++ b/docs/src/examples/catalog/Month.json @@ -0,0 +1,212 @@ +{ + "component": "Month", + "examples": [ + { + "name": "90-days", + "title": "90 days", + "path": "/docs/components/Month/90-days", + "components": [ + { + "component": "Chart", + "lineNumber": 22, + "line": "" + }, + { + "component": "Month", + "lineNumber": 38, + "line": "" + }, + { + "component": "Tooltip", + "lineNumber": 41, + "line": "" + } + ] + }, + { + "name": "basic", + "title": "basic", + "path": "/docs/components/Month/basic", + "components": [ + { + "component": "Chart", + "lineNumber": 24, + "line": "" + }, + { + "component": "Month", + "lineNumber": 40, + "line": "" + }, + { + "component": "Tooltip", + "lineNumber": 43, + "line": "" + } + ] + }, + { + "name": "custom-cell-size", + "title": "custom cell size", + "path": "/docs/components/Month/custom-cell-size", + "components": [ + { + "component": "Chart", + "lineNumber": 24, + "line": "" + }, + { + "component": "Month", + "lineNumber": 40, + "line": "" + }, + { + "component": "Tooltip", + "lineNumber": 43, + "line": "" + } + ] + }, + { + "name": "multiple-years", + "title": "multiple years", + "path": "/docs/components/Month/multiple-years", + "components": [ + { + "component": "Chart", + "lineNumber": 22, + "line": "" + }, + { + "component": "Month", + "lineNumber": 38, + "line": "" + }, + { + "component": "Tooltip", + "lineNumber": 41, + "line": "" + } + ] + }, + { + "name": "without-day-numbers", + "title": "without day numbers", + "path": "/docs/components/Month/without-day-numbers", + "components": [ + { + "component": "Chart", + "lineNumber": 23, + "line": "" + }, + { + "component": "Month", + "lineNumber": 39, + "line": "" + }, + { + "component": "Tooltip", + "lineNumber": 42, + "line": "" + } + ] + }, + { + "name": "without-month-labels", + "title": "without month labels", + "path": "/docs/components/Month/without-month-labels", + "components": [ + { + "component": "Chart", + "lineNumber": 23, + "line": "" + }, + { + "component": "Month", + "lineNumber": 39, + "line": "" + }, + { + "component": "Tooltip", + "lineNumber": 42, + "line": "" + } + ] + } + ], + "usage": [ + { + "example": "90-days", + "component": "Month", + "path": "/docs/components/Month/90-days", + "lineNumber": 38, + "line": "" + }, + { + "example": "basic", + "component": "Month", + "path": "/docs/components/Month/basic", + "lineNumber": 40, + "line": "" + }, + { + "example": "custom-cell-size", + "component": "Month", + "path": "/docs/components/Month/custom-cell-size", + "lineNumber": 40, + "line": "" + }, + { + "example": "multiple-years", + "component": "Month", + "path": "/docs/components/Month/multiple-years", + "lineNumber": 38, + "line": "" + }, + { + "example": "without-day-numbers", + "component": "Month", + "path": "/docs/components/Month/without-day-numbers", + "lineNumber": 39, + "line": "" + }, + { + "example": "without-month-labels", + "component": "Month", + "path": "/docs/components/Month/without-month-labels", + "lineNumber": 39, + "line": "" + } + ], + "updatedAt": "2026-04-01T16:49:31.660Z" +} \ No newline at end of file diff --git a/docs/src/examples/catalog/Tooltip.json b/docs/src/examples/catalog/Tooltip.json index 497223ded..61f1b7918 100644 --- a/docs/src/examples/catalog/Tooltip.json +++ b/docs/src/examples/catalog/Tooltip.json @@ -5016,6 +5016,174 @@ "lineNumber": 62, "line": "" }, + { + "example": "90-days", + "component": "Month", + "path": "/docs/components/Month/90-days", + "lineNumber": 41, + "line": "" + }, + { + "example": "90-days", + "component": "Month", + "path": "/docs/components/Month/90-days", + "lineNumber": 43, + "line": "" + }, + { + "example": "90-days", + "component": "Month", + "path": "/docs/components/Month/90-days", + "lineNumber": 46, + "line": "" + }, + { + "example": "90-days", + "component": "Month", + "path": "/docs/components/Month/90-days", + "lineNumber": 47, + "line": "" + }, + { + "example": "basic", + "component": "Month", + "path": "/docs/components/Month/basic", + "lineNumber": 43, + "line": "" + }, + { + "example": "basic", + "component": "Month", + "path": "/docs/components/Month/basic", + "lineNumber": 45, + "line": "" + }, + { + "example": "basic", + "component": "Month", + "path": "/docs/components/Month/basic", + "lineNumber": 48, + "line": "" + }, + { + "example": "basic", + "component": "Month", + "path": "/docs/components/Month/basic", + "lineNumber": 49, + "line": "" + }, + { + "example": "custom-cell-size", + "component": "Month", + "path": "/docs/components/Month/custom-cell-size", + "lineNumber": 43, + "line": "" + }, + { + "example": "custom-cell-size", + "component": "Month", + "path": "/docs/components/Month/custom-cell-size", + "lineNumber": 45, + "line": "" + }, + { + "example": "custom-cell-size", + "component": "Month", + "path": "/docs/components/Month/custom-cell-size", + "lineNumber": 48, + "line": "" + }, + { + "example": "custom-cell-size", + "component": "Month", + "path": "/docs/components/Month/custom-cell-size", + "lineNumber": 49, + "line": "" + }, + { + "example": "multiple-years", + "component": "Month", + "path": "/docs/components/Month/multiple-years", + "lineNumber": 41, + "line": "" + }, + { + "example": "multiple-years", + "component": "Month", + "path": "/docs/components/Month/multiple-years", + "lineNumber": 43, + "line": "" + }, + { + "example": "multiple-years", + "component": "Month", + "path": "/docs/components/Month/multiple-years", + "lineNumber": 46, + "line": "" + }, + { + "example": "multiple-years", + "component": "Month", + "path": "/docs/components/Month/multiple-years", + "lineNumber": 47, + "line": "" + }, + { + "example": "without-day-numbers", + "component": "Month", + "path": "/docs/components/Month/without-day-numbers", + "lineNumber": 42, + "line": "" + }, + { + "example": "without-day-numbers", + "component": "Month", + "path": "/docs/components/Month/without-day-numbers", + "lineNumber": 44, + "line": "" + }, + { + "example": "without-day-numbers", + "component": "Month", + "path": "/docs/components/Month/without-day-numbers", + "lineNumber": 47, + "line": "" + }, + { + "example": "without-day-numbers", + "component": "Month", + "path": "/docs/components/Month/without-day-numbers", + "lineNumber": 48, + "line": "" + }, + { + "example": "without-month-labels", + "component": "Month", + "path": "/docs/components/Month/without-month-labels", + "lineNumber": 42, + "line": "" + }, + { + "example": "without-month-labels", + "component": "Month", + "path": "/docs/components/Month/without-month-labels", + "lineNumber": 44, + "line": "" + }, + { + "example": "without-month-labels", + "component": "Month", + "path": "/docs/components/Month/without-month-labels", + "lineNumber": 47, + "line": "" + }, + { + "example": "without-month-labels", + "component": "Month", + "path": "/docs/components/Month/without-month-labels", + "lineNumber": 48, + "line": "" + }, { "example": "sunburst", "component": "Partition", @@ -6536,5 +6704,5 @@ "line": "" } ], - "updatedAt": "2026-04-01T13:16:19.842Z" + "updatedAt": "2026-04-01T16:49:33.016Z" } \ No newline at end of file diff --git a/docs/src/examples/components/Month/90-days.svelte b/docs/src/examples/components/Month/90-days.svelte new file mode 100644 index 000000000..b9fc664c3 --- /dev/null +++ b/docs/src/examples/components/Month/90-days.svelte @@ -0,0 +1,52 @@ + + + + + + + + + {#snippet children({ data })} + + + {#if data.value != null} + + + + {/if} + {/snippet} + + diff --git a/docs/src/examples/components/Month/basic.svelte b/docs/src/examples/components/Month/basic.svelte new file mode 100644 index 000000000..117877a87 --- /dev/null +++ b/docs/src/examples/components/Month/basic.svelte @@ -0,0 +1,54 @@ + + + + + + + + + {#snippet children({ data })} + + + {#if data.value != null} + + + + {/if} + {/snippet} + + diff --git a/docs/src/examples/components/Month/custom-cell-size.svelte b/docs/src/examples/components/Month/custom-cell-size.svelte new file mode 100644 index 000000000..ffaab1537 --- /dev/null +++ b/docs/src/examples/components/Month/custom-cell-size.svelte @@ -0,0 +1,54 @@ + + + + + + + + + {#snippet children({ data })} + + + {#if data.value != null} + + + + {/if} + {/snippet} + + diff --git a/docs/src/examples/components/Month/multiple-years.svelte b/docs/src/examples/components/Month/multiple-years.svelte new file mode 100644 index 000000000..1a72c5d84 --- /dev/null +++ b/docs/src/examples/components/Month/multiple-years.svelte @@ -0,0 +1,52 @@ + + + + + + + + + {#snippet children({ data })} + + + {#if data.value != null} + + + + {/if} + {/snippet} + + diff --git a/docs/src/examples/components/Month/without-day-numbers.svelte b/docs/src/examples/components/Month/without-day-numbers.svelte new file mode 100644 index 000000000..95ead56ef --- /dev/null +++ b/docs/src/examples/components/Month/without-day-numbers.svelte @@ -0,0 +1,53 @@ + + + + + + + + + {#snippet children({ data })} + + + {#if data.value != null} + + + + {/if} + {/snippet} + + diff --git a/docs/src/examples/components/Month/without-month-labels.svelte b/docs/src/examples/components/Month/without-month-labels.svelte new file mode 100644 index 000000000..d9b97fdd3 --- /dev/null +++ b/docs/src/examples/components/Month/without-month-labels.svelte @@ -0,0 +1,53 @@ + + + + + + + + + {#snippet children({ data })} + + + {#if data.value != null} + + + + {/if} + {/snippet} + + diff --git a/docs/static/screenshots/Month/90-days-dark-240w.webp b/docs/static/screenshots/Month/90-days-dark-240w.webp new file mode 100644 index 000000000..17d2ae1ee Binary files /dev/null and b/docs/static/screenshots/Month/90-days-dark-240w.webp differ diff --git a/docs/static/screenshots/Month/90-days-dark-400w.webp b/docs/static/screenshots/Month/90-days-dark-400w.webp new file mode 100644 index 000000000..68f63f369 Binary files /dev/null and b/docs/static/screenshots/Month/90-days-dark-400w.webp differ diff --git a/docs/static/screenshots/Month/90-days-dark-800w.webp b/docs/static/screenshots/Month/90-days-dark-800w.webp new file mode 100644 index 000000000..279994e12 Binary files /dev/null and b/docs/static/screenshots/Month/90-days-dark-800w.webp differ diff --git a/docs/static/screenshots/Month/90-days-light-240w.webp b/docs/static/screenshots/Month/90-days-light-240w.webp new file mode 100644 index 000000000..7beb65747 Binary files /dev/null and b/docs/static/screenshots/Month/90-days-light-240w.webp differ diff --git a/docs/static/screenshots/Month/90-days-light-400w.webp b/docs/static/screenshots/Month/90-days-light-400w.webp new file mode 100644 index 000000000..fd1563e9d Binary files /dev/null and b/docs/static/screenshots/Month/90-days-light-400w.webp differ diff --git a/docs/static/screenshots/Month/90-days-light-800w.webp b/docs/static/screenshots/Month/90-days-light-800w.webp new file mode 100644 index 000000000..613f315db Binary files /dev/null and b/docs/static/screenshots/Month/90-days-light-800w.webp differ diff --git a/docs/static/screenshots/Month/basic-dark-240w.webp b/docs/static/screenshots/Month/basic-dark-240w.webp new file mode 100644 index 000000000..924a938cc Binary files /dev/null and b/docs/static/screenshots/Month/basic-dark-240w.webp differ diff --git a/docs/static/screenshots/Month/basic-dark-400w.webp b/docs/static/screenshots/Month/basic-dark-400w.webp new file mode 100644 index 000000000..b3b6ffdb5 Binary files /dev/null and b/docs/static/screenshots/Month/basic-dark-400w.webp differ diff --git a/docs/static/screenshots/Month/basic-dark-800w.webp b/docs/static/screenshots/Month/basic-dark-800w.webp new file mode 100644 index 000000000..eb119a320 Binary files /dev/null and b/docs/static/screenshots/Month/basic-dark-800w.webp differ diff --git a/docs/static/screenshots/Month/basic-light-240w.webp b/docs/static/screenshots/Month/basic-light-240w.webp new file mode 100644 index 000000000..447483f62 Binary files /dev/null and b/docs/static/screenshots/Month/basic-light-240w.webp differ diff --git a/docs/static/screenshots/Month/basic-light-400w.webp b/docs/static/screenshots/Month/basic-light-400w.webp new file mode 100644 index 000000000..b998183b9 Binary files /dev/null and b/docs/static/screenshots/Month/basic-light-400w.webp differ diff --git a/docs/static/screenshots/Month/basic-light-800w.webp b/docs/static/screenshots/Month/basic-light-800w.webp new file mode 100644 index 000000000..5395f77b7 Binary files /dev/null and b/docs/static/screenshots/Month/basic-light-800w.webp differ diff --git a/docs/static/screenshots/Month/custom-cell-size-dark-240w.webp b/docs/static/screenshots/Month/custom-cell-size-dark-240w.webp new file mode 100644 index 000000000..68d6cd512 Binary files /dev/null and b/docs/static/screenshots/Month/custom-cell-size-dark-240w.webp differ diff --git a/docs/static/screenshots/Month/custom-cell-size-dark-400w.webp b/docs/static/screenshots/Month/custom-cell-size-dark-400w.webp new file mode 100644 index 000000000..e4cbe9759 Binary files /dev/null and b/docs/static/screenshots/Month/custom-cell-size-dark-400w.webp differ diff --git a/docs/static/screenshots/Month/custom-cell-size-dark-800w.webp b/docs/static/screenshots/Month/custom-cell-size-dark-800w.webp new file mode 100644 index 000000000..bc045fa36 Binary files /dev/null and b/docs/static/screenshots/Month/custom-cell-size-dark-800w.webp differ diff --git a/docs/static/screenshots/Month/custom-cell-size-light-240w.webp b/docs/static/screenshots/Month/custom-cell-size-light-240w.webp new file mode 100644 index 000000000..a30eb8bc9 Binary files /dev/null and b/docs/static/screenshots/Month/custom-cell-size-light-240w.webp differ diff --git a/docs/static/screenshots/Month/custom-cell-size-light-400w.webp b/docs/static/screenshots/Month/custom-cell-size-light-400w.webp new file mode 100644 index 000000000..4b1ee4618 Binary files /dev/null and b/docs/static/screenshots/Month/custom-cell-size-light-400w.webp differ diff --git a/docs/static/screenshots/Month/custom-cell-size-light-800w.webp b/docs/static/screenshots/Month/custom-cell-size-light-800w.webp new file mode 100644 index 000000000..594c7955b Binary files /dev/null and b/docs/static/screenshots/Month/custom-cell-size-light-800w.webp differ diff --git a/docs/static/screenshots/Month/multiple-years-dark-240w.webp b/docs/static/screenshots/Month/multiple-years-dark-240w.webp new file mode 100644 index 000000000..0dfd439ed Binary files /dev/null and b/docs/static/screenshots/Month/multiple-years-dark-240w.webp differ diff --git a/docs/static/screenshots/Month/multiple-years-dark-400w.webp b/docs/static/screenshots/Month/multiple-years-dark-400w.webp new file mode 100644 index 000000000..7ae0e71bc Binary files /dev/null and b/docs/static/screenshots/Month/multiple-years-dark-400w.webp differ diff --git a/docs/static/screenshots/Month/multiple-years-dark-800w.webp b/docs/static/screenshots/Month/multiple-years-dark-800w.webp new file mode 100644 index 000000000..b9f30c3f1 Binary files /dev/null and b/docs/static/screenshots/Month/multiple-years-dark-800w.webp differ diff --git a/docs/static/screenshots/Month/multiple-years-light-240w.webp b/docs/static/screenshots/Month/multiple-years-light-240w.webp new file mode 100644 index 000000000..6791b7316 Binary files /dev/null and b/docs/static/screenshots/Month/multiple-years-light-240w.webp differ diff --git a/docs/static/screenshots/Month/multiple-years-light-400w.webp b/docs/static/screenshots/Month/multiple-years-light-400w.webp new file mode 100644 index 000000000..21d73b075 Binary files /dev/null and b/docs/static/screenshots/Month/multiple-years-light-400w.webp differ diff --git a/docs/static/screenshots/Month/multiple-years-light-800w.webp b/docs/static/screenshots/Month/multiple-years-light-800w.webp new file mode 100644 index 000000000..2b2524fb6 Binary files /dev/null and b/docs/static/screenshots/Month/multiple-years-light-800w.webp differ diff --git a/docs/static/screenshots/Month/without-day-numbers-dark-240w.webp b/docs/static/screenshots/Month/without-day-numbers-dark-240w.webp new file mode 100644 index 000000000..d3112a85b Binary files /dev/null and b/docs/static/screenshots/Month/without-day-numbers-dark-240w.webp differ diff --git a/docs/static/screenshots/Month/without-day-numbers-dark-400w.webp b/docs/static/screenshots/Month/without-day-numbers-dark-400w.webp new file mode 100644 index 000000000..edd1c922b Binary files /dev/null and b/docs/static/screenshots/Month/without-day-numbers-dark-400w.webp differ diff --git a/docs/static/screenshots/Month/without-day-numbers-dark-800w.webp b/docs/static/screenshots/Month/without-day-numbers-dark-800w.webp new file mode 100644 index 000000000..b733bab85 Binary files /dev/null and b/docs/static/screenshots/Month/without-day-numbers-dark-800w.webp differ diff --git a/docs/static/screenshots/Month/without-day-numbers-light-240w.webp b/docs/static/screenshots/Month/without-day-numbers-light-240w.webp new file mode 100644 index 000000000..19164956b Binary files /dev/null and b/docs/static/screenshots/Month/without-day-numbers-light-240w.webp differ diff --git a/docs/static/screenshots/Month/without-day-numbers-light-400w.webp b/docs/static/screenshots/Month/without-day-numbers-light-400w.webp new file mode 100644 index 000000000..3498cc3e9 Binary files /dev/null and b/docs/static/screenshots/Month/without-day-numbers-light-400w.webp differ diff --git a/docs/static/screenshots/Month/without-day-numbers-light-800w.webp b/docs/static/screenshots/Month/without-day-numbers-light-800w.webp new file mode 100644 index 000000000..fd405fe75 Binary files /dev/null and b/docs/static/screenshots/Month/without-day-numbers-light-800w.webp differ diff --git a/docs/static/screenshots/Month/without-month-labels-dark-240w.webp b/docs/static/screenshots/Month/without-month-labels-dark-240w.webp new file mode 100644 index 000000000..cd74e6e06 Binary files /dev/null and b/docs/static/screenshots/Month/without-month-labels-dark-240w.webp differ diff --git a/docs/static/screenshots/Month/without-month-labels-dark-400w.webp b/docs/static/screenshots/Month/without-month-labels-dark-400w.webp new file mode 100644 index 000000000..0cd88ffa9 Binary files /dev/null and b/docs/static/screenshots/Month/without-month-labels-dark-400w.webp differ diff --git a/docs/static/screenshots/Month/without-month-labels-dark-800w.webp b/docs/static/screenshots/Month/without-month-labels-dark-800w.webp new file mode 100644 index 000000000..7afa14a02 Binary files /dev/null and b/docs/static/screenshots/Month/without-month-labels-dark-800w.webp differ diff --git a/docs/static/screenshots/Month/without-month-labels-light-240w.webp b/docs/static/screenshots/Month/without-month-labels-light-240w.webp new file mode 100644 index 000000000..5306f5508 Binary files /dev/null and b/docs/static/screenshots/Month/without-month-labels-light-240w.webp differ diff --git a/docs/static/screenshots/Month/without-month-labels-light-400w.webp b/docs/static/screenshots/Month/without-month-labels-light-400w.webp new file mode 100644 index 000000000..ffa2669d2 Binary files /dev/null and b/docs/static/screenshots/Month/without-month-labels-light-400w.webp differ diff --git a/docs/static/screenshots/Month/without-month-labels-light-800w.webp b/docs/static/screenshots/Month/without-month-labels-light-800w.webp new file mode 100644 index 000000000..43903d313 Binary files /dev/null and b/docs/static/screenshots/Month/without-month-labels-light-800w.webp differ diff --git a/docs/static/screenshots/index.json b/docs/static/screenshots/index.json index f54bf7a50..03b3047bc 100644 --- a/docs/static/screenshots/index.json +++ b/docs/static/screenshots/index.json @@ -1,7 +1,7 @@ { - "generatedAt": "2026-04-01T13:16:15.497Z", - "totalComponents": 69, - "totalExamples": 836, + "generatedAt": "2026-04-01T16:49:28.458Z", + "totalComponents": 70, + "totalExamples": 842, "components": [ { "component": "AnnotationLine", @@ -3193,6 +3193,41 @@ } ] }, + { + "component": "Month", + "examples": [ + { + "name": "90-days", + "path": "/example/Month/90-days", + "checksum": "38666db0aab5d41c08d861cab208f820" + }, + { + "name": "basic", + "path": "/example/Month/basic", + "checksum": "451942bc236fb0e36067f3aec4360371" + }, + { + "name": "custom-cell-size", + "path": "/example/Month/custom-cell-size", + "checksum": "5102a5ac4908a56b2def4291fa3b2d1e" + }, + { + "name": "multiple-years", + "path": "/example/Month/multiple-years", + "checksum": "df3e1f9490addbee71b43676e2c387ad" + }, + { + "name": "without-day-numbers", + "path": "/example/Month/without-day-numbers", + "checksum": "571a6e00733e9fece9397384c95048db" + }, + { + "name": "without-month-labels", + "path": "/example/Month/without-month-labels", + "checksum": "aefe9166f2b6b27f1fc19dc6e05a6bd9" + } + ] + }, { "component": "MotionPath", "examples": [ @@ -4394,7 +4429,7 @@ { "name": "planet-distances", "path": "/example/TransformContext/planet-distances", - "checksum": "7a81c9ed3f074c42b54398de7fcfbf74" + "checksum": "0b74a5edb63bea832249fda121f81b37" }, { "name": "playground", diff --git a/packages/layerchart/src/lib/components/Month.svelte b/packages/layerchart/src/lib/components/Month.svelte new file mode 100644 index 000000000..e26b9cab7 --- /dev/null +++ b/packages/layerchart/src/lib/components/Month.svelte @@ -0,0 +1,273 @@ + + + + + + + {#if children} + {@render children({ cells: allCells.cells, cellSize })} + {:else} + {#each allCells.cells as cell} + tooltip && ctx.tooltip?.show(e, cell.data)} + onpointerleave={(e) => tooltip && ctx.tooltip?.hide()} + {...extractLayerProps(restProps, 'lc-month-cell')} + /> + + {#if showDayNumber} + + {/if} + {/each} + {/if} + + + {#if monthLabel} + {#each monthLabels as label} + + {/each} + {/if} + + + diff --git a/packages/layerchart/src/lib/components/index.ts b/packages/layerchart/src/lib/components/index.ts index 4f06870f1..eab5af5a1 100644 --- a/packages/layerchart/src/lib/components/index.ts +++ b/packages/layerchart/src/lib/components/index.ts @@ -105,6 +105,8 @@ export { default as Link } from './Link.svelte'; export * from './Link.svelte'; export { default as MotionPath } from './MotionPath.svelte'; export * from './MotionPath.svelte'; +export { default as Month } from './Month.svelte'; +export * from './Month.svelte'; export { default as Pack } from './Pack.svelte'; export * from './Pack.svelte'; export { default as Partition } from './Partition.svelte'; diff --git a/packages/layerchart/vite.config.js b/packages/layerchart/vite.config.js index 036b72a67..dc38bfc15 100644 --- a/packages/layerchart/vite.config.js +++ b/packages/layerchart/vite.config.js @@ -4,29 +4,6 @@ import { playwright } from '@vitest/browser-playwright'; /** @type {import('vite').UserConfig} */ const config = defineConfig({ - // Pre-bundle these dependencies to prevent Vite reload during tests - // which causes "Failed to fetch dynamically imported module" errors - // Ref: https://github.com/vitest-dev/vitest/issues/5477 - optimizeDeps: { - include: [ - '@layerstack/tailwind', - '@layerstack/utils', - '@layerstack/svelte-state', - '@layerstack/utils/object', - 'd3-array', - 'd3-color', - 'd3-delaunay', - 'd3-geo', - 'd3-geo-voronoi', - 'd3-interpolate-path', - 'd3-path', - 'd3-scale', - 'd3-shape', - 'd3-quadtree', - 'memoize', - 'runed', - ], - }, plugins: [sveltekit()], ssr: { noExternal: true, // https://github.com/AdrianGonz97/refined-cf-pages-action/issues/26#issuecomment-2878397440