Skip to content

More layout meta support#3548

Merged
etpinard merged 4 commits into
masterfrom
more-meta
Feb 15, 2019
Merged

More layout meta support#3548
etpinard merged 4 commits into
masterfrom
more-meta

Conversation

@etpinard

Copy link
Copy Markdown
Contributor

resolves #3541 by adding layout.meta support for:

  • trace.name, both in legend items and hover labels
  • rangeselector buttons label
  • updatemenus buttons label
  • sliders steps label

@VeraZab I also added TEMPLATE_STRING_REGEX to Lib as requested.

cc @plotly/plotly_js

@etpinard etpinard added this to the v1.45.0 milestone Feb 15, 2019
@antoinerg

Copy link
Copy Markdown
Contributor

Original Codepen now fixed with plotly.js from this branch: https://codepen.io/antoinerg/pen/gqQbGK

@antoinerg

antoinerg commented Feb 15, 2019

Copy link
Copy Markdown
Contributor

Thanks @etpinard for the fix!

However, I'm wondering if the metadata in layout.meta is accessible from hovertemplate?

@etpinard

Copy link
Copy Markdown
Contributor Author

However, I'm wondering if the metadata in layout.meta is accessible from hovertemplate?

Not yet.

@antoinerg

Copy link
Copy Markdown
Contributor

This is non-blocking, but I think it would be as simple as adding a 4th argument {meta: meta} when calling Lib.hovertemplateString on this line:

text = Lib.hovertemplateString(hovertemplate, hovertemplateLabels, eventData);
. If you do add it, an additional test would be needed.

If you prefer not to add hovertemplate support in this PR, this is ready to 💃

@etpinard

Copy link
Copy Markdown
Contributor Author

as adding a 4th argument {meta: meta} when calling Lib.hovertemplateString on this line

If it's that easy, then might as well -> a0ff6a1

@antoinerg

Copy link
Copy Markdown
Contributor

If it's that easy, then might as well -> a0ff6a1

Glad that it really was that easy and thanks for improving hovertemplate again 🏅

💃 once the tests pass on CircleCI!

@etpinard
etpinard merged commit 4eaad9b into master Feb 15, 2019
@etpinard
etpinard deleted the more-meta branch February 15, 2019 20:52
@etpinard etpinard mentioned this pull request May 14, 2019
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

Successfully merging this pull request may close these issues.

[Feature] add trace name to be referenced from 'metasrc'

2 participants