Skip to content
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

Advanced Styling Options #104

Open
annehaley opened this issue Feb 18, 2025 · 0 comments
Open

Advanced Styling Options #104

annehaley opened this issue Feb 18, 2025 · 0 comments

Comments

@annehaley
Copy link
Collaborator

A user will be able to create and save multiple LayerStyle objects; a LayerStyle is related to a single Layer object. A user can duplicate a LayerStyle object to apply it to a new Layer. A LayerStyle is also associated with a single Project. The LayerStyle contains all its style specifications in a single JSON field.

Style spec

  • is_default
    • Boolean value; checkbox widget
    • When many LayerStyle objects exist for the same Layer, only one may have this value set to True.
  • default_frame
    • Integer value, default 0
    • Negative integers are also acceptable to specify an index from the end of the frames (like for most recent timestep)
  • opacity
    • Float between 0 and 1
    • Slider widget with numeric input, step of 0.1
  • legend_spec
    • Nested object
    • We’ll need to explore what this subspec requires as we learn more about the Legend implementation, but loosely, this field specifies what widgets appear in the Legend panel when this style is active.
    • Legend widgets may include an opacity slider, frame slider, sequential colormap bar, qualitative colormap keys, etc.
  • color
    • A user can select a single color or a premade colormap from matplotlib.
    • For future work, we could also allow a user to create their own colormaps.
      • All user-created colormaps should be normalized (defined on a 0-1 range) and applied to any data proportionally
    • When this style is applied to raster data:
      • The user sees a colormap range slider with two numeric inputs on either side.
      • For multiband images, the user should see a checkbox to specify different color choices for different bands
    • When this style is applied to vector data:
      • If the color choice is not a single color, the user must select a property to color by
        • We populate the list of property choices with properties that exist on all features. Each property choice has a label of “sequential” or “qualitative” according to the values found in the data. When a sequential colormap is selected, the qualitative properties are disabled in the list with a visible warning of why. When a qualitative colormap is selected, sequential properties are disabled.
        • If any null values are found in the data for the selected property, the user must select how to color those features
          • The user can select a single color for the features that have a null value for the selected property, or they can choose that those features are invisible
      • By default, the color choice is applied to all feature types
      • For vector data with more than one feature type, the user will see a checkbox to specify different color choices for each feature type: polygon, line, and point.
        • When the checkbox is enabled, the user can make separate color choices for each present type, or they can disable visibility of that feature type entirely.
  • size
    • A user can select a single integer size or choose a range of sizes
    • When this style is applied to raster data, the size options are disabled. Size does not apply to raster data.
    • When this style is applied to vector data:
      • If the size choice is a single value, the user may also enable zoom sizing, where the size of features will change according to the current map zoom level, multiplied by a factor of the single size value.
      • If the size choice is a range, the user must select a property to size by. We populate a list of property choices with numeric properties that exist on all features.
      • If any null values are found in the data for the selected property, the user must select how to size those features.
        • The user can select a single size for the features that have a null value for the selected property, or they can choose that those features are invisible
      • By default, the size choice is applied to all feature types
      • For vector data with more than one feature type, the user will see a checkbox to specify different size choices for each feature type: polygon, line, point.
        • When the checkbox is enabled, the user can make separate size choices for each present type, or they can disable visibility of that feature type entirely.
        • For points, size denotes radius. For lines, size denotes line width. For polygons, size denotes border line width.
  • text
    • This option may be something for future work that we can leave out for now.
    • This option would only be available for vector data; it would be disabled when the style is applied to raster data.
    • The user could select a property from a list of properties that exist on all vector features. The values of that property would appear as labels over the vector features on the map.
  • filters
    • This option is a general specification for which data is shown
    • When this style is applied to raster data, the user can specify clamping
      • The user sees a range slider with two numeric inputs on either side. The range slider’s extents are determined by the min and max of the raster data, just like the colormap range slider.
      • The user must specify what to do with values that lie outside the clamped range. They have two options: black or transparent.
    • When this style is applied to vector data, the user can specify any number of property filters.
      • The user can add any number of rows to a table of filters. Each row has a column for “property name” and a column for “values to include”.
      • For now, we will limit this to single exact match filtering. The cell for “values to include” will provide a single-select dropdown of values that exist for the given property if values are strings and a slider if the values are numeric.
      • For now, all row entries will be combined with AND logic.
      • In the future, we can expand this to more advanced filter types, like value ranges and OR logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant