-
Notifications
You must be signed in to change notification settings - Fork 19
Add weekday column ordering, download functionality, and events calendar example #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
12
commits into
copilot/create-month-view-calendar
from
copilot/order-weekday-columns
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
423f6c8
Initial plan
Copilot 813b9cd
Add collect/sort transform to order weekday columns and enableDownloa...
Copilot 205db58
Use numeric column names (0-6) for weekdays and add currentMonthDays ...
Copilot ed72b9d
Remove aggregate from step3, delete steps 4 and 4b, update treebark t...
Copilot 82587df
added working calendar core display
danmarshall bad0295
Create month-calendar-with-events.idoc.json based on core with events...
Copilot f6eadee
Fix event display in calendar - show event count and first event title
Copilot 0c3768c
Add raw events data tabulator display
Copilot 048dea4
Replace events with diverse set across all days of the week
Copilot 14c2d9b
Fix treebark event display with proper string fields and span tags
Copilot 9de3b00
Fix treebark template - remove $attr, add proper loop over eventTitle...
Copilot 1c42ef3
Revert CSS changes and add eventsAsObjects step to combine event prop...
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
282 changes: 282 additions & 0 deletions
packages/web-deploy/json/month-calendar-core.idoc.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,282 @@ | ||
| { | ||
| "$schema": "../../../docs/schema/idoc_v1.json", | ||
| "title": "Month View Calendar", | ||
| "variables": [ | ||
| { | ||
| "variableId": "selectedYear", | ||
| "type": "number", | ||
| "initialValue": 2025 | ||
| }, | ||
| { | ||
| "variableId": "selectedMonth", | ||
| "type": "number", | ||
| "initialValue": 2 | ||
| }, | ||
| { | ||
| "variableId": "calendarMonthList", | ||
| "type": "object", | ||
| "isArray": true, | ||
| "initialValue": [], | ||
| "calculation": { | ||
| "dataSourceNames": [], | ||
| "dataFrameTransformations": [ | ||
| { | ||
| "type": "sequence", | ||
| "start": -7, | ||
| "stop": 38, | ||
| "as": "dayOffset" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "as": "selectedDate", | ||
| "expr": "datetime(selectedYear, selectedMonth - 1)" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "as": "date", | ||
| "expr": "timeOffset('day', datum.selectedDate, datum.dayOffset)" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "expr": "day(datum.selectedDate)", | ||
| "as": "firstWeekdayOffset" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "as": "dayOfMonth", | ||
| "expr": "date(datum.date)" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "as": "year", | ||
| "expr": "year(datum.date)" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "as": "weekday", | ||
| "expr": "day(datum.date)" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "as": "isSunday", | ||
| "expr": "datum.weekday === 0 ? 1 : 0" | ||
| }, | ||
| { | ||
| "type": "window", | ||
| "ops": [ | ||
| "sum" | ||
| ], | ||
| "fields": [ | ||
| "isSunday" | ||
| ], | ||
| "as": [ | ||
| "sundayCount" | ||
| ], | ||
| "frame": [ | ||
| null, | ||
| 0 | ||
| ] | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "as": "inCurrentMonth", | ||
| "expr": "month(datum.date) === selectedMonth - 1" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "as": "precedingWeek", | ||
| "expr": "datum.weekday - datum.firstWeekdayOffset > datum.dayOffset" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "as": "nextMonth", | ||
| "expr": "datum.dayOfMonth < 32 && datum.dayOffset > 0 && !datum.inCurrentMonth" | ||
| }, | ||
| { | ||
| "type": "formula", | ||
| "expr": "datum.nextMonth && datum.weekday === 0", | ||
| "as": "succeedingSunday" | ||
| }, | ||
| { | ||
| "type": "window", | ||
| "ops": [ | ||
| "sum" | ||
| ], | ||
| "fields": [ | ||
| "succeedingSunday" | ||
| ], | ||
| "as": [ | ||
| "succeedingWeek" | ||
| ], | ||
| "frame": [ | ||
| null, | ||
| 0 | ||
| ] | ||
| }, | ||
| { | ||
| "type": "filter", | ||
| "expr": "!datum.precedingWeek" | ||
| }, | ||
| { | ||
| "type": "filter", | ||
| "expr": "!datum.succeedingWeek" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "variableId": "calendarMonthByWeek", | ||
| "type": "object", | ||
| "isArray": true, | ||
| "initialValue": [], | ||
| "calculation": { | ||
| "dataSourceNames": [ | ||
| "calendarMonthList" | ||
| ], | ||
| "dataFrameTransformations": [ | ||
| { | ||
| "type": "nest", | ||
| "keys": [ | ||
| "sundayCount", | ||
| "weekday" | ||
| ], | ||
| "generate": true | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ], | ||
| "groups": [ | ||
| { | ||
| "groupId": "header", | ||
| "elements": [ | ||
| "# \ud83d\udcc5 Month Calendar", | ||
| "", | ||
| "This example demonstrates how to shape data for a calendar view using Vega transforms. Scroll down to see each step of the data transformation pipeline.", | ||
| { | ||
| "type": "dropdown", | ||
| "variableId": "selectedMonth", | ||
| "label": "Month:", | ||
| "options": [ | ||
| "1", | ||
| "2", | ||
| "3", | ||
| "4", | ||
| "5", | ||
| "6", | ||
| "7", | ||
| "8", | ||
| "9", | ||
| "10", | ||
| "11", | ||
| "12" | ||
| ] | ||
| }, | ||
| { | ||
| "type": "dropdown", | ||
| "variableId": "selectedYear", | ||
| "label": "Year:", | ||
| "options": [ | ||
| "2024", | ||
| "2025", | ||
| "2026" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "groupId": "step1", | ||
| "elements": [ | ||
| "## Step 1: All Days of Calendar Surrounding the Selected Month", | ||
| "Using `sequence` transform to generate all days in the selected month (7 days before and 7 after, then filtered to show Sunday to Saturday).", | ||
| { | ||
| "type": "tabulator", | ||
| "dataSourceName": "calendarMonthList", | ||
| "tabulatorOptions": { | ||
| "autoColumns": true, | ||
| "layout": "fitColumns", | ||
| "maxHeight": "300px" | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "groupId": "calendar", | ||
| "elements": [ | ||
| "## Step 2: Calendar View (Treebark / HTML table)", | ||
| { | ||
| "type": "treebark", | ||
| "variableId": "calendarMonthByWeek", | ||
| "template": { | ||
| "div": [ | ||
| { | ||
| "table": [ | ||
| { | ||
| "thead": [ | ||
| { | ||
| "tr": [ | ||
| { | ||
| "th": "Sun" | ||
| }, | ||
| { | ||
| "th": "Mon" | ||
| }, | ||
| { | ||
| "th": "Tue" | ||
| }, | ||
| { | ||
| "th": "Wed" | ||
| }, | ||
| { | ||
| "th": "Thu" | ||
| }, | ||
| { | ||
| "th": "Fri" | ||
| }, | ||
| { | ||
| "th": "Sat" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "tbody": { | ||
| "$bind": "root.children", | ||
| "$children": [ | ||
| { | ||
| "tr": { | ||
| "$bind": "children", | ||
| "$children": [ | ||
| { | ||
| "td": { | ||
| "$bind": "data.values", | ||
| "$children": [ | ||
| { | ||
| "$if": { | ||
| "$check": "inCurrentMonth", | ||
| "$then": { | ||
| "div": [ | ||
| "{{dayOfMonth}}" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.