Giter VIP home page Giter VIP logo

Comments (2)

tmlmt avatar tmlmt commented on July 24, 2024 1

Thanks for looking at it, @falkoschindler !

Indeed, it seems that responsiveness in plotly is very minimal: the only place there is mention of it in the code is:
https://github.com/plotly/plotly.js/blob/7ffcdd7d602d52e8a0e75d766ae18fe8e9eb54fb/src/plot_api/plot_api.js#L169-L180

The plot gets resized with an event listener, but plots for small sizes don't seem to take care of this sort of things:
An issue was posted 4 years ago and hasn't been followed up since: plotly/plotly.js#5109

I guess it's an upstream issue so the issue can be closed here. Perhaps it could be useful to add a few words in the docs: I've added it to my list here

from nicegui.

falkoschindler avatar falkoschindler commented on July 24, 2024

Hi @tmlmt,

I wonder what { responsive: true } is actually supposed to do. I checked a plain HTML example and the plot resizes nicely, but the title isn't wrapped:

<html>
  <head>
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
  </head>
  <body>
    <div id="plot"></div>
    <script>
      Plotly.newPlot("plot", [], { title: "My long title which I want to be responsive" }, { responsive: true });
      window.onresize = () => Plotly.Plots.resize("plot");
    </script>
  </body>
</html>

Even though your Python version doesn't resize automatically, you can easily add .classes('w-full') to set the width to 100%.

from nicegui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.