Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# pip-docs Mini Runners

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`.

## Available runners

| Runner | Description | Command |
| --- | --- | --- |
| `runners/full_calendar` | Dash FullCalendar showcase (interactive builder, advanced workflows, API modal demo) | `python runners/full_calendar/run.py` |

## Running a runner

1. Create/activate a virtual environment (recommended):
```bash
cd pip-docs
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
```
2. Install only the deps needed for the runner you want to test:
```bash
pip install -r runners/full_calendar/requirements.txt
```
3. Start the Dash app:
```bash
python runners/full_calendar/run.py
```
The app listens on `http://127.0.0.1:8059` by default.

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.

## Adding a new runner

1. Create `runners/<feature-name>/run.py` and add a minimal `requirements.txt`.
2. In `run.py`, import `Path`/`sys`, push the repo root onto `sys.path`, and point Dash at `assets_folder=.../assets`.
3. Document the runner in the table above so contributors know how to start it.

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.).
111 changes: 111 additions & 0 deletions assets/fullcalendar_dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
.dark-calendar {
--fc-page-bg-color: #101113;
--fc-neutral-bg-color: #1a1b1e;
--fc-neutral-text-color: #f1f3f5;
--fc-border-color: #2c2e33;
--fc-button-text-color: #f1f3f5;
--fc-button-bg-color: #2c2e33;
--fc-button-border-color: #373a40;
--fc-event-text-color: #f8f9fa;
background-color: #101113;
padding: 0.75rem;
border-radius: 12px;
border: 1px solid #2c2e33;
}

.dark-calendar .fc,
.dark-calendar .fc-multimonth,
.dark-calendar .fc-multimonth-day,
.dark-calendar .fc-daygrid,
.dark-calendar .fc-daygrid-day {
background-color: rgba(255, 255, 255, 0);
color: #f1f3f5;
}

.dark-calendar .fc .fc-multimonth,
.dark-calendar .fc .fc-multimonth-grid,
.dark-calendar .fc .fc-multimonth-month {
background-color: #101113;
color: #f1f3f5;
}

.dark-calendar .fc .fc-multimonth-view,
.dark-calendar .fc .fc-multimonth-view .fc-scrollgrid,
.dark-calendar .fc .fc-multimonth-view table,
.dark-calendar .fc .fc-multimonth-view td,
.dark-calendar .fc .fc-multimonth-view th {
background-color: #101113;
color: #f1f3f5;
border-color: #2c2e33;
}

.dark-calendar .fc .fc-multimonth .fc-scrollgrid,
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-section,
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-section > td,
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-sync-table,
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-sync-inner {
background-color: #101113;
color: #f1f3f5;
border-color: #2c2e33;
}

.dark-calendar .fc .fc-multimonth .fc-scrollgrid-section-header,
.dark-calendar .fc .fc-multimonth .fc-scrollgrid-section-header td,
.dark-calendar .fc .fc-multimonth .fc-col-header-cell {
background-color: #101113;
color: #f8f9fa;
border-color: #2c2e33;
}

.dark-calendar .fc .fc-multimonth .fc-col-header-cell-cushion {
color: #f8f9fa;
}

.dark-calendar .fc-multimonth-month,
.dark-calendar .fc-multimonth-daygrid,
.dark-calendar .fc-multimonth-daygrid td,
.dark-calendar .fc-multimonth-dayframe {
background-color: #16181c;
border-color: #2c2e33;
}

.dark-calendar .fc-theme-standard td,
.dark-calendar .fc-theme-standard th {
border-color: #2c2e33;
}

.dark-calendar .fc-toolbar-title,
.dark-calendar .fc-col-header-cell-cushion,
.dark-calendar .fc-daygrid-day-number,
.dark-calendar .fc-multimonth-title,
.dark-calendar .fc-multimonth-daygrid .fc-daygrid-day-number,
.dark-calendar .fc-list-event-title,
.dark-calendar .fc-list-day-text {
color: #f8f9fa;
}

.dark-calendar .fc-button {
background-color: #2c2e33;
border-color: #373a40;
color: #f1f3f5;
}

.dark-calendar .fc-button:hover {
background-color: #3d3f44;
}

.dark-calendar .fc-multimonth-title {
background-color: transparent;
border-color: #2c2e33;
color: #f8f9fa;
}

.dark-calendar .fc-list-empty,
.dark-calendar .fc-multimonth-singlecol {
background-color: #16181c;
}

.dark-calendar .fc-event,
.dark-calendar .fc-h-event {
border: none;
}
Binary file added data/__pycache__/api.cpython-313.pyc
Binary file not shown.
65 changes: 53 additions & 12 deletions data/api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from datetime import datetime, timedelta

import requests


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

def format_event(event):
return {
"title": event['title'],
"start": event['start'],
"end": event['end'],
"className": event['className'],
"context": event['context']
"title": event["title"],
"start": event["start"],
"end": event["end"],
"className": event.get("className"),
"extendedProps": {"context": event.get("context", "")},
}


def get_events_by_category(category):
url_events = f"https://geomapindex.com/api/events/category/{category}"
response = requests.get(url_events)
if response.status_code == 200:
try:
response = requests.get(url_events, timeout=5)
response.raise_for_status()
events_data = response.json()
formatted_events = [format_event(event) for event in events_data]
return formatted_events
else:
return f"Error: {response.status_code}, {response.text}"
except Exception:
return _fallback_events(category)

formatted_events = []
for event in events_data:
try:
formatted_events.append(format_event(event))
except KeyError:
continue

return formatted_events or _fallback_events(category)


def _fallback_events(category):
"""Return deterministic demo events when the remote API isn't reachable."""
category_label = category.title() if isinstance(category, str) else "Dash"
today = datetime.utcnow().date()

sample = [
{
"title": f"{category_label} Kickoff",
"start": today.strftime("%Y-%m-%d"),
"end": today.strftime("%Y-%m-%d"),
"className": "bg-gradient-success",
"context": "Intro call for the upcoming milestone.",
},
{
"title": "Architecture Review",
"start": (today + timedelta(days=2)).strftime("%Y-%m-%dT15:00:00"),
"end": (today + timedelta(days=2)).strftime("%Y-%m-%dT16:00:00"),
"className": "bg-gradient-info",
"context": "Deep dive on infrastructure changes.",
},
{
"title": "Release Window",
"start": (today + timedelta(days=4)).strftime("%Y-%m-%dT21:00:00"),
"end": (today + timedelta(days=4)).strftime("%Y-%m-%dT23:00:00"),
"className": "bg-gradient-warning",
"context": "Blue/green deployment slot.",
},
]
return [format_event(event) for event in sample]


if __name__ == "__main__":
Expand All @@ -36,4 +77,4 @@ def get_events_by_category(category):
for event in events:
print(event)
else:
print(events)
print(events)
Binary file not shown.
39 changes: 24 additions & 15 deletions docs/dash_dynamic_grid_layout/intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import json
import random
import string
import full_calendar_component as fcc
import dash_fullcalendar as dcal

# Sample data for the graph
df = px.data.iris()
Expand Down Expand Up @@ -121,20 +121,29 @@ def generate_random_string(length):
id="draggable-color-picker",
),
dgl.DraggableWrapper(
fcc.FullCalendarComponent(
id="api_calendar",
initialView='dayGridMonth',
headerToolbar={
"left": "prev,next today",
"center": "",
"right": "",
html.Div(
dcal.FullCalendar(
id="api_calendar",
initialView='dayGridMonth',
headerToolbar={
"left": "prev,next today",
"center": "",
"right": "",
},
initialDate=f"{formatted_date}",
editable=True,
selectable=True,
events=[],
nowIndicator=True,
navLinks=True,
),
className="dark-calendar",
style={
"--fc-page-bg-color": "#101113",
"--fc-neutral-bg-color": "#1a1b1e",
"--fc-neutral-text-color": "#f1f3f5",
"--fc-border-color": "#2c2e33",
},
initialDate=f"{formatted_date}",
editable=True,
selectable=True,
events=[],
nowIndicator=True,
navLinks=True,
),
id="draggable-calendar"
),
Expand Down Expand Up @@ -229,4 +238,4 @@ def remove_component(key, layout):
del items[i]
break
return items
return no_update
return no_update
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading