-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix tag cloud visualization failing on formatted values #21001
Conversation
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.
… visualization generation timing
Had another look at that one. Actually we are showing the value when hovering over a word from the tag cloud. So this change now actually causes the value to be displayed unformatted there. So solving this properly won't be possible unless we implement another hack that fetches the data twice, so we are able to calculate with it and display it formatted. Overall this is another case why #20701 and/or #20702 would be such important to implement, as currently we need to produce more and more technical debts to fix such issues... (ping @Stan-vw) |
Huge upvote for #20701 / #20702 👍 Everytime we encounter this problem and implement a workaround we've creating more work for later. I've implemented a hack which avoids reloading the datatable, it works like this:
This allows the tag cloud to be built properly when using currency or other formatted values and still show the correctly formatted values when hovering. I know the |
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.
The workaround seems to work. At least for custom reports, as they are using mainly processed metrics, which are correctly formatted.
Metrics in other reports aren't formatted. But that hadn't been the case before already. That another problem of formatting some metrics in the post processor, but all other metrics in the view. But that's not something we need to solve here.
* Change the cloud tag visualization to generate before metric formatting filters * Use request parameter to avoid formatting metrics instead of changing visualization generation timing * Reapply metric formatting after storing tag cloud size values
) * Change the cloud tag visualization to generate before metric formatting filters * Use request parameter to avoid formatting metrics instead of changing visualization generation timing * Reapply metric formatting after storing tag cloud size values Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
Description:
When using the tag cloud data visualization on currency values an error is shown.
"message":"Unsupported operand types: string \/ string","file":"\/var\/www\/html\/plugins\/CoreVisualizations\/Visualizations\/Cloud.php","line":197,
This is because the tag cloud is generated after the datatable filters are applied, so when the data includes currency values the visualization fails to compute tag sizes because it cannot parse formatted currency values.
This PR changes the point where the tag cloud data is generated to happen before the metric formatting filters are applied.
Ref PG-2896
Review