You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by gi...@git.apache.org on 2017/10/10 05:30:42 UTC

[GitHub] xiaoyugit commented on a change in pull request #3634: add annotation option and a linear color map for heatmap viz.

xiaoyugit commented on a change in pull request #3634: add annotation option and a linear color map for heatmap viz.
URL: https://github.com/apache/incubator-superset/pull/3634#discussion_r143633061
 
 

 ##########
 File path: superset/assets/visualizations/heatmap.js
 ##########
 @@ -130,6 +130,25 @@ function heatmapVis(slice, payload) {
     .attr('height', height)
     .style('position', 'relative');
 
+  if (fd.show_annotation) {
+    const cells = svg.selectAll('rect')
+      .data(data)
+      .enter()
+      .append('g')
+      .attr('transform', `translate(${margin.left}, ${margin.top})`);
+
+    cells.append('text')
+      .attr('transform',
+        function (d) { return 'translate(' + xRbScale(d.x) + ',' + yRbScale(d.y) + ')'; })
 
 Review comment:
   thx! using => indeed makes it neater.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services