Skip to content
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

add python conveniences to mathtext #11466

Merged
merged 32 commits into from Aug 31, 2021

Conversation

IuryPiva
Copy link
Contributor

@IuryPiva IuryPiva commented Aug 2, 2021

Implemented suggestions from #11395

a user could use:

  • p.xaxis_label = r"$\sin(x)$"
  • p.xaxis_label = MathText(text=r"\sin(x)")
  • p.xaxis_label = MathText(r"\sin(x)")
    any of the above example will result in the same sin(x) rendered as LaTeX

The examples below will result in $sin(x)$ rendered as LaTeX

  • p.xaxis_label = MathText(r"$\sin(x)$")
  • p.xaxis_label = MathText(text=r"$\sin(x)$")

The examples below will result in $sin(x)$ rendered as plain text

  • p.xaxis_label = PlainText(r"$\sin(x)$")
  • p.xaxis_label = PlainText(text=r"$\sin(x)$")

@IuryPiva IuryPiva added tag: codebase Improvements to code quality without affecting any functionality. status: ready labels Aug 2, 2021
@IuryPiva IuryPiva added this to In Progress in CZI R3: LaTeX, maintenance and exports via automation Aug 2, 2021
@IuryPiva IuryPiva added this to the 2.4 milestone Aug 2, 2021
bokeh/models/axes.py Outdated Show resolved Hide resolved
@mattpap mattpap added status: WIP type: feature tag: API: models and removed tag: codebase Improvements to code quality without affecting any functionality. status: ready labels Aug 2, 2021
@IuryPiva

This comment has been minimized.

@bryevdv

This comment has been minimized.

@lgtm-com
Copy link

lgtm-com bot commented Aug 16, 2021

This pull request introduces 1 alert when merging 54383c9 into 5c2921f - view on LGTM.com

new alerts:

  • 1 for Redundant assignment

@lgtm-com
Copy link

lgtm-com bot commented Aug 16, 2021

This pull request introduces 1 alert when merging 16ffd26 into 47811e5 - view on LGTM.com

new alerts:

  • 1 for Redundant assignment

@lgtm-com
Copy link

lgtm-com bot commented Aug 26, 2021

This pull request introduces 1 alert when merging 7f0c81c into 62999ef - view on LGTM.com

new alerts:

  • 1 for Redundant assignment

@lgtm-com
Copy link

lgtm-com bot commented Aug 26, 2021

This pull request introduces 1 alert when merging 95d2017 into af6af09 - view on LGTM.com

new alerts:

  • 1 for Redundant assignment

IuryPiva and others added 4 commits August 27, 2021 15:24
Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>
Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>
Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>
@bryevdv
Copy link
Member

bryevdv commented Aug 27, 2021

cc @mattpap note that this breaks Dask tests:

>       assert p.axis[1].axis_label == "Cache Size (non-standard)"
E       AssertionError: assert PlainText(id='1329', ...) == 'Cache Size (non-standard)'
E         +PlainText(id='1329', ...)
E         -'Cache Size (non-standard)'

I'm not sure if actual code is affected. We really need to provide some compatibility pathway

bokeh/models/text.py Outdated Show resolved Hide resolved
@bryevdv
Copy link
Member

bryevdv commented Aug 30, 2021

LGTM @mattpap I'll plan to merge tomorrow unless you have more comments (or merge first)

@mattpap mattpap merged commit d3fce05 into branch-2.4 Aug 31, 2021
CZI R3: LaTeX, maintenance and exports automation moved this from In Progress to Done Aug 31, 2021
@mattpap mattpap deleted the iurypiva/python-conveniences-mathtext branch August 31, 2021 12:23
bryevdv added a commit that referenced this pull request Dec 13, 2021
* add python conveniences to mathtext

* use accepts to convert conveniences to mathtext

* transform mathstring into mathtext and ignore transform with plaintext

* wip: use plain text to ignore mathtext conversion

* implement textlike property

* docstrings

* remove redundant mathtext interpretation

* remove redundant mathtext interpretation

* implement bokehjs textlike type

* remove textlike conversions on type definition

* remove needless model initialization

* return default

* use first arg if available

* add plain text to models

* add tests for mathtext with $

* default axis_label to plain_text

* update docs

* default axis_label to null

* fix unwanted value transformation for non strings

* add new properties tests

* Use single triple quotes for docstrings

Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>

* single quote for docstrings

Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>

* remove .

Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>

* combine math_text.py and plain_text.py into text.py

* update docs

* update docs

* change MathString to return string instead of PlainText model

* update mathtext import

* move text related models to umbrella model text

Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants