Add line.dash support to scattermap traces by CloudCorpRecords · Pull Request #8135 · plotly/plotly.js · GitHub
Skip to content

Add line.dash support to scattermap traces - #8135

Open
CloudCorpRecords wants to merge 2 commits into
plotly:mainfrom
CloudCorpRecords:scattermap-line-dash
Open

CloudCorpRecords wants to merge 2 commits into
plotly:mainfrom
CloudCorpRecords:scattermap-line-dash

Conversation

@CloudCorpRecords

Copy link
Copy Markdown

Adds line.dash to scattermap traces, closing #6791.

What it does: the standard dash style attribute (solid, dot, dash, longdash, dashdot, longdashdot, or a custom px list) is now available on scattermap lines and is converted to the MapLibre line-dasharray paint property. Dash lengths reuse Drawing.dashStyle, so named styles match SVG rendering, scaled to line-width units because MapLibre scales dasharray values by line width.

Why this shape: PR #7712 bundled this with two unrelated features and was closed with a maintainer request to split it up (emilykl: "feel free to open a separate PR and continue work" on the line-styles part). That attempt also never coerced the attribute (defaults.js passed noDash: true), so trace.line.dash stayed undefined and the conversion never ran. This PR adds the attribute, removes the noDash flag, and converts it.

Tests:

  • test/jasmine/tests/scattermap_test.js: new defaults test (dash defaults to solid, named styles coerce) and new convert test (exact line-dasharray paint values for solid/dash/dot/longdashdot and a custom px list).
  • New image mock test/image/mocks/map_line-dash.json (validated with npm run test-mock); baseline will be generated by CI.
  • Ran: npm run lint, npm run typecheck, npm run test-syntax (all pass); npm run schema regenerated test/plot-schema.json and types.
  • Not run: the karma jasmine suite (no browser in this environment) and the rendered plot. The new jasmine assertions run in CI. Please eyeball the new mock baseline before merging.

Notes:

  • Backwards compatible: default solid sets no line-dasharray, so existing plots render identically.
  • Draftlog draftlogs/NNNN_add.md uses a placeholder number and will be renamed once this PR has a number.

�f426

Implements plotly#6791: scattermap line attributes gain the
standard dash style, converted to the MapLibre line-dasharray paint
property. The earlier attempt (plotly#7712) bundled this with unrelated work
and never coerced the attribute (defaults.js passed noDash: true), so
the feature never took effect. Dash lengths reuse Drawing.dashStyle so
named styles match SVG rendering, scaled to line-width units for
MapLibre. Includes jasmine defaults and convert tests, a new image mock,
regenerated plot schema, and a draftlog entry.

Signed-off-by: Rene Turcios <95189389+CloudCorpRecords@users.noreply.github.com>
Signed-off-by: Rene Turcios <95189389+CloudCorpRecords@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

1 participant