brunorosilva / plotly-calplot

The easiest and best looking Calendar Heatmap you'll find, made with Plotly.
https://pypi.org/project/plotly-calplot/
104 stars 10 forks source link

Extension to calendar for picking dates #16

Open schwabts opened 1 year ago

schwabts commented 1 year ago

As commented here to bendichter/plotly_activity_chart.py I need options for

  1. Choosing between horizontal and vertical display,
  2. In addition to month names on one side I'll need week numbers according to the preferred standard as given e.g. by epiweeks,
  3. highlighting holidays pulled from different selected holiday calendars (e.g. bank holidays or national holidays for different countries), cf. holidays on PyPI.

But the most important feature for me would be to be able to select dates as if this was a component like a dropdown.

brunorosilva commented 1 year ago

Hey, @schwabts

Thanks for the feedback. I'll prioritize some of these features ASAP, starting with 1 and 3.

As for the dropdown component for filtering dates I'm not so sure it fits in the scope of this project. Have you tried using Dash dropdowns or Streamlit dates filter? Here's an example with my Todoist Analytics dashboard. Code. image

schwabts commented 1 year ago

Well, "as if this was a component like a dropdown" may not have been a good wording. What I was trying to say was that while I define callbacks for dropdowns e.g. by

@callback(
    Output('label', 'children'),
    Input('dropdown', 'value'),
)
def update(dropdown_value):
    return f'You have selected {value}'

I would like to define them for plotly-calplot by something like

@callback(
    Output('label', 'children'),
    Input('calplot', 'value'),
)
def update(date_value):
    date_string = date.fromisoformat(date_value).strftime('%B %d, %Y')
    return f'You have selected the date {date_string}'

Rf. dcc.Dropdown and dcc.DatePickerSingle

I'm also not sure if this project could be the right one to look at given the requirements of my use case. Therefore this issue is kind of a question, too.

The point is I am currently already using a Dash dropdown offering to choose from a long list of single dates. I would be happier with a more compact display showing a long list of weeks each of which would be a row of seven tiles and I simply haven't found any sort of calendar which is more compact.

Last not least, including week numbers could be considered a matter of personal taste but it would be extremely helpful for my use case.

brunorosilva commented 1 year ago

solved

  1. Choosing between horizontal and vertical display <- dealt with in release v0.1.14

not solved

  1. In addition to month names on one side I'll need week numbers according to the preferred standard as given e.g. by epiweeks
  2. highlighting holidays pulled from different selected holiday calendars (e.g. bank holidays or national holidays for different countries), cf. holidays on PyPI.