Skip to content

No option for tickformat with '(' (parentheses) sign #5511

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

Closed
OmriAroesti opened this issue Feb 18, 2021 · 4 comments
Closed

No option for tickformat with '(' (parentheses) sign #5511

OmriAroesti opened this issue Feb 18, 2021 · 4 comments
Labels
feature something new
Milestone

Comments

@OmriAroesti
Copy link

As specified here, the formatting is described as the same as d3's formatting language.

However, the d3 documentation this points to mentions that "the sign can be... ( - nothing for zero or positive and parentheses for negative.".

This option, however, is not available to plotly.js.
I see that the d3_format_re is in fact /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i, and does not include the ")" along with "+", "-" and " "(space), so it defaults back to -.

@nicolaskruchten
Copy link
Contributor

This is likely because Plotly.js uses an older (v3) version of d3_format. We will be able to upgrade to the latest formatter soon :)

@alexcjohnson
Copy link
Collaborator

Right - until we manage to upgrade d3-format, the docs should really be pointing to the d3v3 version of the package, as we do in some of the attribute docstrings:

FORMAT_LINK: 'https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format',

@nicolaskruchten
Copy link
Contributor

@archmoj we can close this one right?

@archmoj
Copy link
Contributor

archmoj commented Jul 20, 2021

Resolved by #5125.

@archmoj archmoj closed this as completed Jul 20, 2021
@archmoj archmoj added this to the v2.3.0 milestone Jul 20, 2021
@archmoj archmoj added the feature something new label Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

4 participants