Skip to content

Built Controls For Color By Category #363

Description

@lhawkman27

Summary/Description

We need to build out controls for the ColorByCategory functionality.
This will replace the colorByCategory styling block in our current JSON Blob control.

  • Dimension selector.
  • Category color mapping UI.
  • Default/null category labels.
  • Category enable/disable behavior.
"colorByCategory": {
    "categoricalColors": [
      {
        "No Visible Damage": {
          "fillColor": [52, 168, 83, 255],
          "legend_entry_name": "No Visible Damage"
        }
      },
      {
        "Inaccessible": {
          "fillColor": [66, 133, 244, 255],
          "legend_entry_name": "Inaccessible"
        }
      },
      {
        "Affected": {
          "fillColor": [178, 134, 207, 255],
          "legend_entry_name": "Affected"
        }
      },
      {
        "Minor": {
          "fillColor": [245, 166, 35, 255],
          "legend_entry_name": "Minor"
        }
      },
      {
        "Major": {
          "fillColor": [220, 53, 69, 255],
          "legend_entry_name": "Major"
        }
      },
      {
        "Destroyed": {
          "fillColor": [0, 0, 0, 255],
          "legend_entry_name": "Destroyed"
        }
      },
      {
        "Other": {
          "fillColor": [128, 128, 128, 255],
          "legend_entry_name": "Other"
        }
      }
    ],
    "defaultLegendName": ["Other"],
    "dimension": "damage_summary"
  },

dimension control: column selector

categoricalColors controls section:
Need some sort of addition control button that allows users to add category entries they want.
category name control - text entry
fillColor control: RGBA Selector or field entries (for R,G,B,A)
legendEntryName control: text entry

defaultLegendName control: text entry

Motivation/Context

The JSON blob has been useful as a fast prototyping surface, but it is now carrying too much product behavior: category coloring, metric coloring, point sizing, legends, text overlay, styling, defaults, maybe more. That makes it hard for users, hard to validate, and easy for MVT/non-MVT behavior to drift.

Acceptance

  • ColorByCategory works as expected.
  • Point/Line/Polygon/GeoJSON and MVT all receive the same category config.
  • Update documentation properly (Wiki, etc...)

Wiki Page for GeoJSON Config:
https://github.com/raft-tech/GeoSet/wiki/GeoSet-Map-Layer#geojson-config

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreCatchall for tasks that are more like chores than real workenhancementNew feature or request

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions