Giter VIP home page Giter VIP logo

Comments (8)

ssanderson avatar ssanderson commented on July 18, 2024

ping @TimShawver @blink1073. Do you guys have a sense of what would need to change to make our sizing behavior more well-behaved?

from qgrid.

ellisonbg avatar ellisonbg commented on July 18, 2024

I have some ideas. In general, the widget-area div has the flex box
information. From a width perspective, the QGridWidget can set its flexbox
attributes to just grow to fit its parent rather than sizing itself in px.
Although you might want to size the height in px. We are making changes to
ipywidget that will improve the access to the flexbox stuff on the python
side. I might be able to take a crack at this.

On Mon, Nov 2, 2015 at 7:52 PM, Scott Sanderson [email protected]
wrote:

ping @TimShawver https://github.com/TimShawver @blink1073
https://github.com/blink1073. Do you guys have a sense of what would
need to change to make our sizing behavior more well-behaved?


Reply to this email directly or view it on GitHub
#44 (comment).

Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]

from qgrid.

aggFTW avatar aggFTW commented on July 18, 2024

@ellisonbg, what code were you using when you ran into this issue?

I'm currently doing this. Notice that I skipped using the QGrid widget and I'm just using display() to render the pandas df:

def on_render_table(*args):
        with output:
            output.clear_output()

            data = viz.data
            if isinstance(data, pd.Series):
                df = pd.DataFrame(data)
            else:
                df = data
            # display(get_qgrid_widget(df))

            display(data)

Both display(get_gqrid_widget(df) and display(data) exceed the width of the widget -- the qgrid widget actually displays in the bottom while the pandas df exceeds the width.

The only difference I see between the two calls is that output.clear_ouput() has no effect for the qgrid_widget; it just appends the new one below.

How should we be rendering them inside output to avoid such problems?

from qgrid.

aggFTW avatar aggFTW commented on July 18, 2024

For the display(data) one, I see this:

screen shot 2015-11-02 at 5 12 00 pm

from qgrid.

aggFTW avatar aggFTW commented on July 18, 2024

After clicking two times on Table (which activates the on_render_table I showed) the display(get_qgrid_widget(df) shows this (notice the duplicated widget):

screen shot 2015-11-02 at 5 12 58 pm

from qgrid.

ellisonbg avatar ellisonbg commented on July 18, 2024

For the overall widget you will want to next everything in a heirarchy of
HBox ad VBox widgets and they toggle the visible attribute to hide and show
parts of it based on the button clicks. By doing that you can control the
visibility at a very fine grained level. You can't get this with display
and clear_output.

But that side of things is separate for the sizing of the QGridWidget.

On Mon, Nov 2, 2015 at 8:15 PM, Alejandro Guerrero Gonzalez <
[email protected]> wrote:

After clicking two times on Table (which activates the on_render_table I
showed) the display(get_qgrid_widget(df) shows this (notice the
duplicated widget):

[image: screen shot 2015-11-02 at 5 12 58 pm]
https://cloud.githubusercontent.com/assets/654204/10899003/330e3bea-8185-11e5-9113-f66b33857f0b.png


Reply to this email directly or view it on GitHub
#44 (comment).

Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]

from qgrid.

blink1073 avatar blink1073 commented on July 18, 2024

I'm afraid I'm of little use here. What I did was a straight up hack, and I've dealt very little with CSS.

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

I think this might be fixed in the new qgrid 1.0 beta, but it's hard to tell because this is so old that I imagine a lot has changed in the notebook since it was filed (and a lot has changed in qgrid too). I'm going to close it since I'm not really sure how to test it...please open a new issue if someone finds a repro case in which qgrid 1.0 is not sizing itself correctly.

from qgrid.

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.