Comments (6)
Hi @jobinnthomas, in your requirements.txt you are using
ipydatagrid==1.1.15
Try updating to the latest release 1.2.1 where I resolved the issue of column widths resetting when setting new data if
auto_fit_columns
is set to True.Here is the PR fixing that issue: #452
Thanks..Yes i can confirm the issue is fixed..I am using the following and it works. You can close the issue.
notebook==7.0.8
voila==0.5.5
ipywidgets==8.1.1
ipydatagrid==1.2.1
ipynb==0.5.1
from ipydatagrid.
hi -
if you set data in the way that you have, i.e.:
mygrid.data = df_new
you are effectively reinitialising the grid - you could give it a whole new dataframe with different col names when doing this.
as such it doesn't resets behaviour you had previously applied.
you can either:
- record the col widths before you set the grid and then reset them after (probs easiest)
- use the
set_cell_value
method to set the values of the cells you want to change. this is probably the "cleanest" method as it just updates the data in-place without re-initialising the whole grid.
from ipydatagrid.
Hi @jobinnthomas, in your requirements.txt you are using ipydatagrid==1.1.15
Try updating to the latest release 1.2.1 where I resolved the issue of column widths resetting when setting new data if auto_fit_columns
is set to True.
Here is the PR fixing that issue: #452
from ipydatagrid.
hi - if you set data in the way that you have, i.e.:
mygrid.data = df_new
you are effectively reinitialising the grid - you could give it a whole new dataframe with different col names when doing this. as such it doesn't resets behaviour you had previously applied. you can either:
- record the col widths before you set the grid and then reset them after (probs easiest)
- use the
set_cell_value
method to set the values of the cells you want to change. this is probably the "cleanest" method as it just updates the data in-place without re-initialising the whole grid.
Thanks for the suggestions.
-
use the set_cell_value method to set the values of the cells you want to change. this is probably the "cleanest" method as it just updates the data in-place without re-initialising the whole grid.
- I do know the number of rows before hands...So maybe I could create the Datagrid with the known number of rows, all
blank and then resize the height of the datgrid to avoid showing them even. Then i could set the cells one by one.
- I do know the number of rows before hands...So maybe I could create the Datagrid with the known number of rows, all
-
record the col widths before you set the grid and then reset them after (probs easiest)
- This does not work............for whatever reason.
from ipydatagrid.
just checked this -
it doesn't look like it resets the col widths if the dataframe is the same
import pandas as pd
import ipydatagrid as DataGrid
df = pd.DataFrame({"a": [1,2], "b": [3,4]})
df1 = pd.DataFrame({"a": [3,4], "b": [5,6]})
gr = DataGrid(df, column_widths = {"a": 20})
gr
gr.data = df1
from ipydatagrid.
Try the example I provided.......Do you see what I see? Run it 15 times and see if the output changes.
If you don't, can you provide me your requirements file.....
from ipydatagrid.
Related Issues (20)
- auto_fit_columns not working when setting data HOT 1
- Nested hierarchies with common entries on level 1 cause issues HOT 4
- Disabling filtering/sorting icon in UI HOT 1
- VScode doesn't display Datagrid HOT 5
- How to create a sortable and filterable Datagrid HOT 3
- Missing NPM publish on 1.2.1 HOT 2
- select function not trigger observe HOT 1
- Exporting Ipydatagrid to html
- Identify column by name in renderer rather than index.
- Any way to control the location of scroll of ipydatagrid HOT 2
- Use var(--something) to color cells HOT 2
- Trying to grid an empty dataframe throws JavaScript error in 1.3.0
- html exports that depend on javascript fetched from cdn no longer render HOT 7
- [Jupyter Notebook] cannot display HOT 2
- dev install as per `README.md` fails HOT 6
- 🐛 `ipydatagrid>=1.3` doesn't support integer pandas column names HOT 2
- Datetime columns are not displayed correctly HOT 1
- data and view not updating when using nested rows and columns
- conditional formatting based on other row
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipydatagrid.