marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
6.81k stars 241 forks source link

calendar widget #2621

Open v1gnesh opened 1 week ago

v1gnesh commented 1 week ago

Description

marimo already has a date picker which shows a mini calendar. For the use case of planning maintenance slots (for servers, etc.), say I've produced a dataframe with a date column, start, end time, event description. It would be really useful to see these as dots (with a bubble showing description on hover) in a full year calendar.

Suggested solution

Please consider creating a full year view widget.

Alternative

No response

Additional context

No response

AdamRJensen commented 1 week ago

Could you sketch up an example or find a screen-shot from another service offering this?

v1gnesh commented 1 week ago

Not sure if it's me or the docs page... but I only see mo.ui.date selector working in the marimo docs page. Don't see a usable range selector item.

Here's an example of showing a block for each month. Marking isn't present (as is requested), and it shows in 2 columns (we can do 4 columns, so it'll be 3 rows covering a whole year), however, I hope this is useful as a reference. https://www.wolframalpha.com/input?i=full+year+calendar+with+2nd+tuesdays+marked

AdamRJensen commented 6 days ago

Not sure if it's me or the docs page... but I only see mo.ui.date selector working in the marimo docs page. Don't see a usable range selector item. There's provided an example in the documentation, although not an interactive one. But it works well:

date_range = mo.ui.date_range(
    start=dt.date(2023, 1, 1), stop=dt.date(2023, 12, 31)
)

Image

v1gnesh commented 6 days ago

It looks a little squished for me:

Image

AdamRJensen commented 3 hours ago

It looks a little squished for me:

I think that is because the cell isn't very tall. For a normal full notebook this wouldn't be an issue.

v1gnesh commented 2 hours ago

Ah okay. Okay, so you get the idea right... a full year view of monthly calendars, with dates marked to indicate some sort of activity. The marking itself is based on a dataframe that is obtained in a previous step, based on whatever logic one wants. This year-view activity calendar will be very useful :)

AdamRJensen commented 2 hours ago

Ah okay. Okay, so you get the idea right... a full year view of monthly calendars, with dates marked to indicate some sort of activity. The marking itself is based on a dataframe that is obtained in a previous step, based on whatever logic one wants. This year-view activity calendar will be very useful :)

Given the early development state of Mario, I'd say it's unlikely to see such custom Widgets in the near future. I'm sure a PR would be welcome though.