Skip to content

feat: allow disabling of axis labels using text={false} or text={null} #95

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

Merged
merged 3 commits into from
May 29, 2025

Conversation

gka
Copy link
Contributor

@gka gka commented May 29, 2025

resolves #77

This pull request introduces a new text property to the AxisX and AxisY components, enabling users to toggle tick labels on or off. The changes improve flexibility in axis customization and include updates to related helper components, examples, and tests.

Examples and Documentation:

  • Added a new example showcasing how to use the text property to create minor tick lines without labels.

Testing Improvements:

  • Added a test case to validate the behavior of the text property in AxisX, ensuring tick labels are omitted when text is set to null.

@gka gka requested a review from Copilot May 29, 2025 11:42
Copy link

netlify bot commented May 29, 2025

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit dead08e
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/68384ade14bf3d0008f82467
😎 Deploy Preview https://deploy-preview-95--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 your Netlify project configuration.

Copy link
Contributor

@Copilot Copilot AI 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 adds a new text prop to AxisX and AxisY to allow disabling tick labels, updates internal helpers to respect this flag, and provides examples and tests illustrating the feature.

  • Introduce text prop in AxisX, AxisY, and their base helpers.
  • Wrap label rendering in BaseAxisX.svelte and BaseAxisY.svelte with if (text) guards.
  • Add a Svelte example (major-minor.svelte) and a unit test for AxisX.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/marks/helpers/BaseAxisX.svelte Added text prop and conditional label rendering (plus leftover debug).
src/lib/marks/helpers/BaseAxisY.svelte Added text prop and wrapped label loops in if (text).
src/lib/marks/AxisX.svelte Exposed text prop to the base helper.
src/lib/marks/AxisY.svelte Exposed text prop to the base helper.
src/tests/axisX.test.ts New test verifying labels are omitted when text is null.
src/routes/examples/axis/major-minor.svelte Example showing major and minor ticks with labels disabled.

Copy link

📦 Preview package for this PR is published!

Version: 0.2.9-pr-95.0

Install it with:

npm install svelteplot@pr-95
# or install the specific version
npm install svelteplot@0.2.9-pr-95.0

Copy link

📦 Preview package for this PR is published!

Version: 0.2.9-pr-95.1

Install it with:

npm install svelteplot@pr-95
# or install the specific version
npm install svelteplot@0.2.9-pr-95.1

@gka gka merged commit e46635d into main May 29, 2025
8 checks passed
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.

Axis does not have text channel
1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy