Skip to content

customdata not working anymore after update from 2.1.0 to 3.3.1 #242

Answered by dbuezas
MrSplit asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, that's a breaking change I didn't document because the default cases are covered by the new defaults. Sorry for that.
The reason behind the change is performance, this was using quite a bit of ram because the custom data needed to be replicated for each datapoint.

You have two options:

  1. bring back the old data
customdata: $ex ys.map(()=>meta)
hovertemplate: >-
          <b>%{customdata.friendly_name}</b><br><i>%{x}</i><br>
          %{y:.1f}%{customdata.unit_of_measurement} <extra></extra>
  1. Or efficiently: (this is better)
hovertemplate: |
    $ex `<b>${get(".name")}</b><br><i>%{x}</i><br>
    %{y:.1f} ${get(".unit_of_measurement")}
    <extra></extra>`

get(".name") means "look at …

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@dbuezas
Comment options

@dbuezas
Comment options

@dbuezas
Comment options

@MrSplit
Comment options

@dbuezas
Comment options

Answer selected by dbuezas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants