Feat/reuse link wrapper #109
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #108
This pull request increases support for linkable mark elements, simplifying mark rendering, and expanding the example gallery. The most important changes include the introduction of the
Anchor
helper component, updates to mark types to support link-related properties, and the addition of new examples showcasing these features.Enhancements to mark rendering:
Anchor
helper component: Introducedsrc/lib/marks/helpers/Anchor.svelte
to wrap mark elements in<a>
tags whenhref
and related properties are provided. This enables linkable marks with attributes liketarget
,rel
, anddownload
.Anchor
component into various mark files (Area.svelte
,Dot.svelte
,Geo.svelte
,RectPath.svelte
) to render linkable elements conditionally. [1] [2] [3] [4]Type updates for linkable marks:
LinkableMarkProps
: Added a new type insrc/lib/types.ts
to define properties likehref
,target
,rel
, anddownload
for linkable marks. This type was integrated into multiple mark definitions, includingBarXMarkProps
,BarYMarkProps
, andSphereMarkProps
. [1] [2] [3] [4]Expanded example gallery:
linked-bars.svelte
,earthquakes.svelte
, andregression/_index.svelte
to demonstrate the functionality of linkable marks and other features. These examples showcase linked bar charts, earthquake maps with clickable markers, and regression-related visualizations. [1] [2] [3]src/routes/examples/+layout.ts
to include new datasets likeearthquakes
andcars
for the examples.