-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
ENH: Add option to disable MathJax (#19824). #19856
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3df97e3
ENH: Add Styler.disable_mathjax() method (#19824).
f48f587
Revert "ENH: Add Styler.disable_mathjax() method (#19824)."
9d97bfd
ENH: Add display.html.use_mathjax option (#19824).
89659cd
Added release note
95f7d14
Fix release note
5c71bf1
Replace IPython with Jupyter in docs
9b287aa
Move logic from DataFrame to HTMLFormatter
400f211
Add tests for both format and style versions of _repr_html_()
15961e1
Inject tex2jax_ignore into table class attribute in Styler.
771e9a6
issue number
jreback 42224c9
Merge branch 'master' into PR_TOOL_MERGE_PR_19856
jreback File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Inject tex2jax_ignore into table class attribute in Styler.
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I'm not sure about the option affecting
Styler
. Does anyone else (@jorisvandenbossche, @chris-b1) have thoughts?Adding classes to the
Styler
is pretty easy, and you're always able to add them since you're generating the Styler. WithDataFrame._repr_html
, you don't have that option.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true this issue is solved by
df.style.set_table_attributes('class="tex2jax_ignore"')
. One could argue that this PR is unnecessary because the solution is already possible in pandas.But this solution requires knowledge of how MathJax works – something that I've learnt whilst making this PR. The new option
display.html.use_mathjax
is there to make it easier for users to find the solution.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, the changes to frames repr html are great.
I just worry about injecting “noise” into Styler’s generated HTML from a config option, when it’s relatively easy to do that yourself.
That said, an extra class isn’t the worst thing in the world, and it’s simple to toggle on and off. Your current PR is probably fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I could see the argument for not doing it in
Styler
but I agree the PR is fine, especially where it is off by default, and is sort of an obscure thing to look up.