Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8197

Make zero counts in heatmap PNG transparent

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • spatial
    • None

    Description

      It would be useful to have transparent zero values so that I can overlay the image as a layer on a map.

      The change just requires altering two methods in SpatialHeatmapFacets.java as follows:

      static void writeCountAtColumnRow(BufferedImage image, int rows, int c, int r, int val)
      {
            image.setRGB(c, rows - 1 - r, val == 0 ? 0 : val ^ 0xFF_00_00_00);
      }
      
      static int getCountAtColumnRow(BufferedImage image, int rows, int c, int r)
      {
            int val = image.getRGB(c, rows - 1 - r);
            return val == 0 ? 0 : val ^ 0xFF_00_00_00;
      }
      

      Attachments

        1. transparency.patch
          1.0 kB
          Neil Ireson

        Activity

          People

            Unassigned Unassigned
            neilireson Neil Ireson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: