plotly / plotly/plotly.py

holidays on week days behave incorrectly

Open
#3,134 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Hi Folks,

I am having issues when I have holidays on week days.
if I exclude weekends and have a holiday on Friday there is a bug

rangebreaks=[
    # NOTE: Below values are bound (not single values), ie. hide x to y
    dict(bounds=['sat', 'mon']),  # hide weekends, eg. hide sat to before mon
    dict(bounds=[18, 9], pattern='hour'),  # hide hours outside of 9.30am-4pm
    dict(values=["2021-04-02", "2021-12-25"]),  # hide holidays (Christmas and New Year's, etc)
]

(This error originated from the built-in JavaScript code that runs Dash apps. Click to see the full stack trace or open your browser's console.)
TypeError: Cannot read property 'val' of undefined

at u (http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2417931)

at doAutoRange (http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2420435)

at Object.r.doAutoRangeAndConstraints (http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2400288)

at S (http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2374022)

at Object.c.syncOrAsync (http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2287218)

at http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2375512

at Object.c.syncOrAsync (http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2287218)

at Object.r.plot (http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2376077)

at Object.r.newPlot (http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2370936)

at Object.r.react (http://127.0.0.1:8050/_dash-component-suites/dash_core_components/async-plotlyjs.v1_15_0m1611086576.js:2:2380532)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin by reproducing the reported rangebreaks configuration in a Dash app and inspect the browser console when a weekday holiday is included. Trace the failure from the async-plotlyjs bundle's doAutoRange path; done means the Friday holiday is hidden without the TypeError while weekend and hour exclusions still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.