[Feature]: A line stroke coloured along the line (start colour to end colour)

Open
#2,524 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

Start by locating layer.lineStrokes, layer.symbolBy, and the Strokes section of the pane in the RustGIS codebase; the issue does not name specific files or tests. Read how line stroke colors and legend symbols are currently produced. Done means strokes can interpolate two colors by distance from first to last vertex, expressions can supply per-origin colors, and the legend shows the same fade.

Written by the indexing model from the issue text.

Description

What's missing

A stroke has one colour (layer.lineStrokes, layer.symbolBy). A flow line can't fade from its origin's colour to its destination's, which is how a reader tells the direction without arrowheads. QGIS has this as the interpolated line and the gradient in its line symbols.

Proposal

A stroke property "gradient": {"from": "#RRGGBBAA", "to": "#RRGGBBAA"} in layer.lineStrokes, and in the Strokes section of the pane:

  • the colour changes along the line's length, from its first vertex to its last;
  • from and to can also come from an expression (layer.symbolBy), for one colour per origin;
  • the legend shows the stroke as a short line with the same fade.

Choices in this proposal

  • By distance along the line, not by vertex: it doesn't change with how densely a line is drawn.
  • Two colours, no ramp of stops: it covers flow direction; a ramp of stops can come later if asked for.
Dominant language
Rust
Stars
1.9k
Forks
268
Avg merge
11h 1m
Merged PRs (30d)
942

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opengeos/RustGIS

All issues in opengeos/RustGIS

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.