Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add setPlotDefaults and getPlotDefaults hooks#219

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gka merged 7 commits intomainfromfeat/hook-plot-defaults
Oct 5, 2025

Conversation

@gka
Copy link
Contributor

@gkagka commentedOct 5, 2025
edited
Loading

This pull request refactors how default plot settings are managed and accessed across the codebase. It introduces a newgetPlotDefaults andsetPlotDefaults hook, replacing the previous use of Svelte's context API for plot defaults. All mark components now use this new hook to retrieve their default settings, leading to a more consistent and maintainable approach. Additionally, related imports and type usages have been updated for clarity and efficiency.

resolves#218

@gkagka requested a review fromCopilotOctober 5, 2025 12:24
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This PR refactors default plot settings management by introducing newgetPlotDefaults andsetPlotDefaults hooks to replace the previous Svelte context API approach. The new hooks provide a more consistent and maintainable way to manage plot defaults across all mark components.

  • ReplacessetContext('svelteplot/defaults', ...) withsetPlotDefaults(...)
  • Updates all mark components to usegetPlotDefaults() instead ofgetContext<PlotDefaults>('svelteplot/_defaults')
  • Adds backward compatibility with deprecation warnings for the old context-based approach

Reviewed Changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
src/lib/hooks/plotDefaults.tsNew hook implementation with backward compatibility
src/lib/index.tsExports the new hooks for public API
src/lib/core/Plot.svelteUpdated to use new hook system
src/lib/marks/*.svelteAll mark components updated to usegetPlotDefaults()
src/tests/plot.test.svelteUpdated test to use newsetPlotDefaults hook
Documentation filesUpdated examples and references to use new hook syntax
Comments suppressed due to low confidence (1)

src/lib/marks/Brush.svelte:1

  • TheBrush type has duplicatey2 property on lines 56 and 58. Line 56 should likely bex2 instead ofy2.
<!--

@gkagka added this to the1.0 milestoneOct 5, 2025
@netlify
Copy link

netlifybot commentedOct 5, 2025
edited
Loading

Deploy Preview forsvelteplot ready!

NameLink
🔨 Latest commitbdf66ee
🔍 Latest deploy loghttps://app.netlify.com/projects/svelteplot/deploys/68e26890fccd91000817aa0d
😎 Deploy Previewhttps://deploy-preview-219--svelteplot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify project configuration.

@github-actions
Copy link

📦 Preview package for this PR is published!

Version:0.4.7-pr-219.0

Install it with:

npm install svelteplot@pr-219# or install the specific versionnpm install svelteplot@0.4.7-pr-219.0
github-actions[bot] reacted with thumbs up emojigithub-actions[bot] reacted with rocket emoji

@gkagka closed thisOct 5, 2025
@gkagka reopened thisOct 5, 2025
@gkagka merged commitc26e998 intomainOct 5, 2025
11 checks passed
@github-actions
Copy link

📦 Preview package for this PR is published!

Version:0.4.7-pr-219.1

Install it with:

npm install svelteplot@pr-219# or install the specific versionnpm install svelteplot@0.4.7-pr-219.1
github-actions[bot] reacted with thumbs up emojigithub-actions[bot] reacted with rocket emoji

@gkagka mentioned this pull requestOct 5, 2025
2 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

1.0

Development

Successfully merging this pull request may close these issues.

Introduce setPlotDefaults and getPlotDefaults hooks

2 participants

@gka

[8]ページ先頭

©2009-2025 Movatter.jp