-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Old Headless mode has been removed from the Chrome binary #124
Comments
OK, I found why we need dataframe_image/tests/test_df_image.py Lines 87 to 94 in d4601f2
If use new headless or |
Hi |
Due to Chrome completely remove old headless mode, I suggest everyone migrate to playwright mode by modify your
Or wait for me to draft a new release which will make playwright the default choice. |
I tried dfi.export(df, "df_style.png", table_conversion="playwright") |
If you use dfi in an async context, you can use this code instead.
|
I am not in async context. I even don't know what it is (what it is ?)...but it seems to works ! |
One more question. It seems that I loose my layout with this new configuration. Now i have an image with black backround one row out of 2... table_styles = [
{"selector": "thead th", # Style pour les en-têtes de colonnes
"props": [
("background-color", "blue"), # Fond bleu
("color", "white"), # Texte en blanc
("font-weight", "bold"), # Texte en gras
("text-align", "center") # Centrer le texte
]
},
{"selector": "td", # Style général pour toutes les cellules
"props": [("border-right", "0.8px solid black")]
},
{"selector": "td.col0", # Largeur spécifique pour la première colonne
"props": [("width", "200px")]
},
# Appliquer une largeur spécifique à toutes les colonnes de la 2ᵉ à la dernière
{"selector": "td:nth-child(n+2)", # `nth-child(n+2)` cible la 2ᵉ colonne et au-delà
"props": [("width", "70px")]
}
]
perf_indice_stylised = (
perf_indice
.style
.set_properties(**{'text-align': 'center'}) # Centrer le contenu des colonnes
.set_table_styles(table_styles, overwrite=False) # Appliquer les propriétés CSS
.format(col_format, na_rep='') # Appliquer les formats avec valeurs manquantes remplacées par ''
.bar(align=0, vmin=-2.5, vmax=2.5,
height=50, width=50, cmap=custom_cmap,
subset=['Perf 1 sem', 'Perf 1M', 'Perf 3M', 'Perf 6M', 'Perf YTD', 'Perf 1Y', 'Perf 3Y', 'Perf 5Y'])
.hide(axis=0) # Masquer l'index
)
image_path = Path(full_path) / "image.png"
await dfi.export_async(
perf_indice_stylised,
image_path,
table_conversion="playwright_async",
) |
@Jacques2101 lack definition of I tested your code with both playwright versionChrome version |
col_format = {'Dernier prix': '{:.1f}', |
With this code i received an
The file seems to be generated but with a wrong format ` from matplotlib.colors import LinearSegmentedColormap df = pd.DataFrame({ Fonction pour appliquer le style conditionnelcol_format = {'Performance': '{:.1f}%', 'Volatilité': '{:.1f}', } styled_df = (df from pathlib import Path |
Hi, |
I still have this error message. I am using Pandas 2.2.3 ERROR Property: Invalid value for "CSS Level 2.1" property: linear-gradient(90deg, transparent 25%, #add8e6 25%, #add8e6 50%, transparent 50%) no-repeat center [23:3: background] |
@Jacques2101 , You can create a notebook using colab and share it here. |
https://colab.research.google.com/drive/1odS7DjvabmdWTO3_kCAvaMk3L5zD4fOX?usp=sharing Did you have it ? Did you get the same error message ? |
The change was to fix a similar kind of issue... personal view is that we should just revert the headless=old change here, such that it goes back to being just: I don't get an error with the latter in my config, as we did before, when this change was originally needed, although I do observe that the table is being truncated on the top-to-bottom/vertical axis.... perhaps folks can find a fix for the truncation and put it in the same release? |
See this comment, pure |
Did you see the colab file that i sent you ? thx |
@Jacques2101 , Thanks for sharing test code and I have fixed bug in latest commit. You can go to colab to see if it works. Since latest commit is not released yet, run |
I am sorry but i tried :
and i get an error message NotImplementedError I tried also: I also tried:
|
Sorry it seems that with dfi.export(styled_table, image_path, table_conversion='chrome') it works !!! |
DO NOT USE https://colab.research.google.com/drive/1odS7DjvabmdWTO3_kCAvaMk3L5zD4fOX?usp=sharing |
Ok but when i tried : I have an error message which is NotImplementedError But when i did SO WHY DO NOT USE table_conversion='chrome' |
My Chrome updated today (Ubuntu 24.04) and now
dfi.export
is broken with the following error:When using
table_conversion="html2image"
it works, and I also see a warning:"chrome"
also works if I provide achrome_path
pointed at thechrome-headless-shell
.The text was updated successfully, but these errors were encountered: