Skip to content

[BUG] plotly histogram x-axis & y-axis labels not showing #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
francesbelleza opened this issue Apr 10, 2025 · 1 comment · May be fixed by #714
Open

[BUG] plotly histogram x-axis & y-axis labels not showing #656

francesbelleza opened this issue Apr 10, 2025 · 1 comment · May be fixed by #714
Labels
bug Something isn't working

Comments

@francesbelleza
Copy link

Description of Bug

Histogram x-axis and y-axis labels are not showing on the dashboard using the function plotly(). I've checked the Plotly documents to double check my code, but my syntax is correct. When I run Plotly's function fig.show(), my specific graph's x and y-axis labels show. I looked at Preswald's interface/componenets.py in class def plotly(fig, size) and didn't see any code dedicated to label handling.

Screenshot of component.py , class plotly()
Image

To Reproduce

Sample script given on Prewald's website produces the same problem:
Image

Expected Behavior

Histogram x-axis and y-axis labels showing in their respective sides.

Screenshots

1. Screenshot x and y-axis labels not showing:
Image

2. Screenshot and code where x-axis & y-axis show
Instead of running plotly(fig), I ran fig.show().
Image

Environment:

  • MacOS
  • Chrome
  • Version 134.0.6998.118
@francesbelleza francesbelleza added the bug Something isn't working label Apr 10, 2025
@kundyzs
Copy link

kundyzs commented Apr 17, 2025

Hey! I tried solving this problem by adding label handling to plotly function in components.py but I think the issue is in the frontend part. I "preswald run" by setting the level to DEBUG and it clearly shows that the function is being called correctly but does not display in the application. I saw this error in the console:
Uncaught TypeError: Cannot read properties of undefined (reading 'Plots')
at index-Cx_a7Az3.js:4284:336549
at x (index-Cx_a7Az3.js:4284:335364)
Checked the frontend code and ensured that plotly.js is being imported and attached to the global window object in main.jsx.
I'm guessing the issue might be related to how the frontend integrates plotly.js or react-plotly.js. Could this be a version mismatch or a problem with how plotly.js is bundled in the frontend? Any guidance or suggestions would be greatly appreciated!

@ckkhot ckkhot linked a pull request Apr 26, 2025 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants