Skip to content

Commit 510596d

Browse files
Merge pull request #1 from ScottTpirate/main
@ScottTpirate feat: add standalone full-calendar runner and all-day selection support
2 parents b6397d3 + a06dcce commit 510596d

22 files changed

+1586
-513
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# pip-docs Mini Runners
2+
3+
This repository powers the Pip Install Python Components docs site. To make it easier to test an individual page without installing the full dependency set, each standalone Dash demo lives in its own “runner” folder with a minimal `requirements.txt`.
4+
5+
## Available runners
6+
7+
| Runner | Description | Command |
8+
| --- | --- | --- |
9+
| `runners/full_calendar` | Dash FullCalendar showcase (interactive builder, advanced workflows, API modal demo) | `python runners/full_calendar/run.py` |
10+
11+
## Running a runner
12+
13+
1. Create/activate a virtual environment (recommended):
14+
```bash
15+
cd pip-docs
16+
python -m venv .venv
17+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
18+
```
19+
2. Install only the deps needed for the runner you want to test:
20+
```bash
21+
pip install -r runners/full_calendar/requirements.txt
22+
```
23+
3. Start the Dash app:
24+
```bash
25+
python runners/full_calendar/run.py
26+
```
27+
The app listens on `http://127.0.0.1:8059` by default.
28+
29+
Each runner automatically adds the repo root to `PYTHONPATH` and reuses the shared `assets/` directory, so the demos behave the same way they do inside the full docs build.
30+
31+
## Adding a new runner
32+
33+
1. Create `runners/<feature-name>/run.py` and add a minimal `requirements.txt`.
34+
2. In `run.py`, import `Path`/`sys`, push the repo root onto `sys.path`, and point Dash at `assets_folder=.../assets`.
35+
3. Document the runner in the table above so contributors know how to start it.
36+
37+
This pattern keeps the install footprint tiny when you only need to verify one page, while preserving the standard docs structure (Markdown pages, components, data helpers, shared assets, etc.).

assets/fullcalendar_dark.css

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
.dark-calendar {
2+
--fc-page-bg-color: #101113;
3+
--fc-neutral-bg-color: #1a1b1e;
4+
--fc-neutral-text-color: #f1f3f5;
5+
--fc-border-color: #2c2e33;
6+
--fc-button-text-color: #f1f3f5;
7+
--fc-button-bg-color: #2c2e33;
8+
--fc-button-border-color: #373a40;
9+
--fc-event-text-color: #f8f9fa;
10+
background-color: #101113;
11+
padding: 0.75rem;
12+
border-radius: 12px;
13+
border: 1px solid #2c2e33;
14+
}
15+
16+
.dark-calendar .fc,
17+
.dark-calendar .fc-multimonth,
18+
.dark-calendar .fc-multimonth-day,
19+
.dark-calendar .fc-daygrid,
20+
.dark-calendar .fc-daygrid-day {
21+
background-color: rgba(255, 255, 255, 0);
22+
color: #f1f3f5;
23+
}
24+
25+
.dark-calendar .fc .fc-multimonth,
26+
.dark-calendar .fc .fc-multimonth-grid,
27+
.dark-calendar .fc .fc-multimonth-month {
28+
background-color: #101113;
29+
color: #f1f3f5;
30+
}
31+
32+
.dark-calendar .fc .fc-multimonth-view,
33+
.dark-calendar .fc .fc-multimonth-view .fc-scrollgrid,
34+
.dark-calendar .fc .fc-multimonth-view table,
35+
.dark-calendar .fc .fc-multimonth-view td,
36+
.dark-calendar .fc .fc-multimonth-view th {
37+
background-color: #101113;
38+
color: #f1f3f5;
39+
border-color: #2c2e33;
40+
}
41+
42+
.dark-calendar .fc .fc-multimonth .fc-scrollgrid,
43+
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-section,
44+
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-section > td,
45+
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-sync-table,
46+
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-sync-inner {
47+
background-color: #101113;
48+
color: #f1f3f5;
49+
border-color: #2c2e33;
50+
}
51+
52+
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-section-header,
53+
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-section-header td,
54+
.dark-calendar .fc .fc-multimonth .fc-col-header-cell {
55+
background-color: #101113;
56+
color: #f8f9fa;
57+
border-color: #2c2e33;
58+
}
59+
60+
.dark-calendar .fc .fc-multimonth .fc-col-header-cell-cushion {
61+
color: #f8f9fa;
62+
}
63+
64+
.dark-calendar .fc-multimonth-month,
65+
.dark-calendar .fc-multimonth-daygrid,
66+
.dark-calendar .fc-multimonth-daygrid td,
67+
.dark-calendar .fc-multimonth-dayframe {
68+
background-color: #16181c;
69+
border-color: #2c2e33;
70+
}
71+
72+
.dark-calendar .fc-theme-standard td,
73+
.dark-calendar .fc-theme-standard th {
74+
border-color: #2c2e33;
75+
}
76+
77+
.dark-calendar .fc-toolbar-title,
78+
.dark-calendar .fc-col-header-cell-cushion,
79+
.dark-calendar .fc-daygrid-day-number,
80+
.dark-calendar .fc-multimonth-title,
81+
.dark-calendar .fc-multimonth-daygrid .fc-daygrid-day-number,
82+
.dark-calendar .fc-list-event-title,
83+
.dark-calendar .fc-list-day-text {
84+
color: #f8f9fa;
85+
}
86+
87+
.dark-calendar .fc-button {
88+
background-color: #2c2e33;
89+
border-color: #373a40;
90+
color: #f1f3f5;
91+
}
92+
93+
.dark-calendar .fc-button:hover {
94+
background-color: #3d3f44;
95+
}
96+
97+
.dark-calendar .fc-multimonth-title {
98+
background-color: transparent;
99+
border-color: #2c2e33;
100+
color: #f8f9fa;
101+
}
102+
103+
.dark-calendar .fc-list-empty,
104+
.dark-calendar .fc-multimonth-singlecol {
105+
background-color: #16181c;
106+
}
107+
108+
.dark-calendar .fc-event,
109+
.dark-calendar .fc-h-event {
110+
border: none;
111+
}
3.26 KB
Binary file not shown.

data/api.py

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from datetime import datetime, timedelta
2+
13
import requests
24

35

@@ -9,23 +11,62 @@ def get_events():
911

1012
def format_event(event):
1113
return {
12-
"title": event['title'],
13-
"start": event['start'],
14-
"end": event['end'],
15-
"className": event['className'],
16-
"context": event['context']
14+
"title": event["title"],
15+
"start": event["start"],
16+
"end": event["end"],
17+
"className": event.get("className"),
18+
"extendedProps": {"context": event.get("context", "")},
1719
}
1820

1921

2022
def get_events_by_category(category):
2123
url_events = f"https://geomapindex.com/api/events/category/{category}"
22-
response = requests.get(url_events)
23-
if response.status_code == 200:
24+
try:
25+
response = requests.get(url_events, timeout=5)
26+
response.raise_for_status()
2427
events_data = response.json()
25-
formatted_events = [format_event(event) for event in events_data]
26-
return formatted_events
27-
else:
28-
return f"Error: {response.status_code}, {response.text}"
28+
except Exception:
29+
return _fallback_events(category)
30+
31+
formatted_events = []
32+
for event in events_data:
33+
try:
34+
formatted_events.append(format_event(event))
35+
except KeyError:
36+
continue
37+
38+
return formatted_events or _fallback_events(category)
39+
40+
41+
def _fallback_events(category):
42+
"""Return deterministic demo events when the remote API isn't reachable."""
43+
category_label = category.title() if isinstance(category, str) else "Dash"
44+
today = datetime.utcnow().date()
45+
46+
sample = [
47+
{
48+
"title": f"{category_label} Kickoff",
49+
"start": today.strftime("%Y-%m-%d"),
50+
"end": today.strftime("%Y-%m-%d"),
51+
"className": "bg-gradient-success",
52+
"context": "Intro call for the upcoming milestone.",
53+
},
54+
{
55+
"title": "Architecture Review",
56+
"start": (today + timedelta(days=2)).strftime("%Y-%m-%dT15:00:00"),
57+
"end": (today + timedelta(days=2)).strftime("%Y-%m-%dT16:00:00"),
58+
"className": "bg-gradient-info",
59+
"context": "Deep dive on infrastructure changes.",
60+
},
61+
{
62+
"title": "Release Window",
63+
"start": (today + timedelta(days=4)).strftime("%Y-%m-%dT21:00:00"),
64+
"end": (today + timedelta(days=4)).strftime("%Y-%m-%dT23:00:00"),
65+
"className": "bg-gradient-warning",
66+
"context": "Blue/green deployment slot.",
67+
},
68+
]
69+
return [format_event(event) for event in sample]
2970

3071

3172
if __name__ == "__main__":
@@ -36,4 +77,4 @@ def get_events_by_category(category):
3677
for event in events:
3778
print(event)
3879
else:
39-
print(events)
80+
print(events)
7.56 KB
Binary file not shown.

docs/dash_dynamic_grid_layout/intro.py

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import json
1111
import random
1212
import string
13-
import full_calendar_component as fcc
13+
import dash_fullcalendar as dcal
1414

1515
# Sample data for the graph
1616
df = px.data.iris()
@@ -121,20 +121,29 @@ def generate_random_string(length):
121121
id="draggable-color-picker",
122122
),
123123
dgl.DraggableWrapper(
124-
fcc.FullCalendarComponent(
125-
id="api_calendar",
126-
initialView='dayGridMonth',
127-
headerToolbar={
128-
"left": "prev,next today",
129-
"center": "",
130-
"right": "",
124+
html.Div(
125+
dcal.FullCalendar(
126+
id="api_calendar",
127+
initialView='dayGridMonth',
128+
headerToolbar={
129+
"left": "prev,next today",
130+
"center": "",
131+
"right": "",
132+
},
133+
initialDate=f"{formatted_date}",
134+
editable=True,
135+
selectable=True,
136+
events=[],
137+
nowIndicator=True,
138+
navLinks=True,
139+
),
140+
className="dark-calendar",
141+
style={
142+
"--fc-page-bg-color": "#101113",
143+
"--fc-neutral-bg-color": "#1a1b1e",
144+
"--fc-neutral-text-color": "#f1f3f5",
145+
"--fc-border-color": "#2c2e33",
131146
},
132-
initialDate=f"{formatted_date}",
133-
editable=True,
134-
selectable=True,
135-
events=[],
136-
nowIndicator=True,
137-
navLinks=True,
138147
),
139148
id="draggable-calendar"
140149
),
@@ -229,4 +238,4 @@ def remove_component(key, layout):
229238
del items[i]
230239
break
231240
return items
232-
return no_update
241+
return no_update
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)