Skip to content

Comments

Feat: add scale logarithmic#592

Merged
zibs merged 5 commits intoFormidableLabs:mainfrom
MichelBahl:feat/add-scale-logarithmic
Jul 21, 2025
Merged

Feat: add scale logarithmic#592
zibs merged 5 commits intoFormidableLabs:mainfrom
MichelBahl:feat/add-scale-logarithmic

Conversation

@MichelBahl
Copy link
Contributor

Description

allows users to pass in a axisOptions -> axisScales -> linear | log prop to enable the usage of lagarithsm charts

Type of Change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Enhance an example -> example/app/line-chart.tsx

Checklist:

  • I have included a changeset if this change will require a version change to one of the packages.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have run yarn run check:code and all checks pass
  • I have created a changeset for new features, patches, or major changes
  • I have added tests that prove my fix is effective or that my feature works
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@changeset-bot
Copy link

changeset-bot bot commented Jul 2, 2025

🦋 Changeset detected

Latest commit: 79e6906

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
victory-native Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
victory-native-xl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2025 1:54pm

Copy link
Contributor

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 logarithmic scale support to the charting library, allowing users to specify scale types (linear or logarithmic) for both X and Y axes through axisOptions configuration.

  • Introduces AxisScaletype and AxisScales types to support scale configuration
  • Extends the makeScale function to handle both linear and logarithmic scales using d3-scale
  • Updates chart components to pass through and utilize axis scale options

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/src/types.ts Adds type definitions for axis scales configuration
lib/src/cartesian/utils/makeScale.ts Core implementation of scale selection between linear and logarithmic
lib/src/cartesian/utils/transformInputData.ts Integrates axis scales into data transformation pipeline
lib/src/cartesian/components/CartesianAxis.tsx Adds default axis scale configuration
lib/src/cartesian/CartesianChart.tsx Updates chart component to support new scale types
example/hooks/useOptionsReducer.ts Adds state management for axis scales in example
example/app/line-chart.tsx Demonstrates logarithmic scale usage in example
.vscode/settings.json IDE configuration changes
Comments suppressed due to low confidence (1)

lib/src/types.ts:19

  • The AxisScales type is duplicated in both types.ts and transformInputData.ts. Consider removing the duplicate definition in transformInputData.ts and importing from types.ts to maintain a single source of truth.
  xMax: number;

@zibs
Copy link
Contributor

zibs commented Jul 21, 2025

Thanks @MichelBahl

@zibs zibs merged commit 1fc5598 into FormidableLabs:main Jul 21, 2025
3 checks passed
@fmd-ci fmd-ci mentioned this pull request Jul 21, 2025
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.

2 participants