Add angular and dotFill props for line style customization#9
Open
leanthebean wants to merge 1 commit intobenjitaylor:mainfrom
Open
Add angular and dotFill props for line style customization#9leanthebean wants to merge 1 commit intobenjitaylor:mainfrom
leanthebean wants to merge 1 commit intobenjitaylor:mainfrom
Conversation
Three new optional props on the Liveline component: - `angular` (boolean, default false): draws straight line segments between data points instead of the default monotone cubic spline. - `dotFill` (boolean, default false): replaces the gradient fill under the curve with a stippled dot pattern that fades top to bottom. - `dashLine` (boolean, default true): controls the horizontal dashed line drawn at the current value. Set to false to hide it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
51f9605 to
6e8607f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Two new optional props for customizing the line and fill style:
angular— draws straight line segments between data points instead of the default monotone cubic spline. Useful for financial/portfolio charts where interpolation between data points is undesirable.dotFill— replaces the gradient fill under the curve with a stippled dot pattern that fades from top to bottom. Pairs well withangularfor a cleaner aesthetic.Both default to
false, preserving existing behavior.Changes
src/types.ts— addedangularanddotFilltoLivelinePropssrc/draw/line.ts— addeddrawStraight(),drawDottedFill(),CurveStyleinterface; modifiedrenderCurve()to select path/fill strategysrc/draw/index.ts— threadedcurveStylethroughDrawOptionstodrawLine()src/useLivelineEngine.ts— added toEngineConfig, forwarded to draw optionssrc/Liveline.tsx— destructured new props, forwarded to engineAll existing tests pass. No breaking changes.