-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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 annotation option and a linear color map for heatmap viz. #3634
add annotation option and a linear color map for heatmap viz. #3634
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.
A few minor things, but otherwise looks good
@@ -1086,6 +1087,14 @@ export const controls = { | |||
description: t('Whether to display the legend (toggles)'), | |||
}, | |||
|
|||
show_annotation: { |
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 term annotation is already used for other purposes, can we just call this show_values
?
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.
noted
@@ -1086,6 +1087,14 @@ export const controls = { | |||
description: t('Whether to display the legend (toggles)'), | |||
}, | |||
|
|||
show_annotation: { | |||
type: 'CheckboxControl', | |||
label: t('Annotation'), |
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.
Show Values
label: t('Annotation'), | ||
renderTrigger: true, | ||
default: false, | ||
description: t('Whether to display the annotation (toggles)'), |
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.
'Whether to display the numerical values within the cells'
|
||
cells.append('text') | ||
.attr('transform', | ||
function (d) { return 'translate(' + xRbScale(d.x) + ',' + yRbScale(d.y) + ')'; }) |
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.
.attr('transform', d => `translate(${xRbScale(d.x}, ${yRbScale(d.y)})`
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.
thx! using => indeed makes it neater.
.attr('x', xRbScale.rangeBand() / 2) | ||
.attr('text-anchor', 'middle') | ||
.attr('dy', '.35em') | ||
.text(function (d) { return valueFormatter(d.v); }) |
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.
.text(d => valueFormatter(d.v))
.attr('dy', '.35em') | ||
.text(function (d) { return valueFormatter(d.v); }) | ||
.attr('font-size', Math.min(yRbScale.rangeBand(), xRbScale.rangeBand()) / 3 + 'px') | ||
.attr('fill', function (d) { return d.v >= payload.data.extents[1] / 2 ? 'white' : 'black'; }); |
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.
arrow function here too
3 similar comments
…t_box * remotes/origin/master: (340 commits) [New Viz] Partition Diagram (apache#3642) Add description for running specific test (apache#3665) Making the sort order for metrics pull from fd for time table viz (apache#3661) Make columns that return an exception on click unsortable. (apache#3417) Adding sort time table (apache#3651) added aihello as superset user. (apache#3647) Fix apache#3612 - reverse sign in difference calculation (apache#3646) Fixing some warnings during tests (apache#3648) [Translations] Restored lost French translations (apache#3645) [sql lab] fix impersonation + template issue (apache#3644) Pin moment.js library since 2.19.0 creates problem (apache#3641) [time_table] adding support for URLs / links (apache#3600) Set tooltip to show extent of sparkData (apache#3626) add explicit message display for 'Fetching Annotation Layer' error (apache#3631) [bugfix] Template rendering failed: '_AppCtxGlobals' object has no attribute 'user' (apache#3637) fix long title text wrapping in editable-title component (apache#3638) [minor] proper tooltip on ControlHeader's instant re-render trigger (apache#3625) add annotation option and a linear color map for heatmap viz. (apache#3634) [bugfix] empty From date filter NoneType error (apache#3633) remove unused imports (apache#3621) ...
…#3634) * add annotation option and a linear color map for heatmap viz. * error fixes. * fixes for requested changes
allow user to put digits on a grid heat map, which is related to #3570 and visualization for churn rate.