feat: fit functions for null y1 values#416
Conversation
Codecov Report
@@ Coverage Diff @@
## master #416 +/- ##
=========================================
Coverage ? 78.16%
=========================================
Files ? 91
Lines ? 4301
Branches ? 870
=========================================
Hits ? 3362
Misses ? 926
Partials ? 13
Continue to review full report at Codecov.
|
markov00
left a comment
There was a problem hiding this comment.
Tested locally and everything looks fine.
I've just two minor concerns:
- the static
Explicitvalue is not taken in consideration as part of the data domain - I'd like to add a small change on the
endValueto allow either a value and the nearest point to avoid having to specify a value that maybe is not in the range
|
Still need to add support for ordinal scale type |
| testEnvironment: 'jest-environment-jsdom-fourteen', | ||
| setupFilesAfterEnv: ['<rootDir>/scripts/setup_enzyme.ts'], | ||
| setupFilesAfterEnv: ['jest-extended', '<rootDir>/scripts/setup_enzyme.ts', '<rootDir>/scripts/custom_matchers.ts'], | ||
| coveragePathIgnorePatterns: ['<rootDir>/src/mocks/', '<rootDir>/node_modules/'], |
There was a problem hiding this comment.
@markov00 I don't know why the coverage went down to 78% but it does not appear to be because of my code changes. Maybe this is causing some issues. Any thoughts?
There was a problem hiding this comment.
I think the current coverage only cover the modules/files imported on each test. Adding the coveragePathIgnorePatterns maybe count also the missing modules without a test file importing them
markov00
left a comment
There was a problem hiding this comment.
LGTM, just few minor comments to fix before merging
|
🎉 This PR is included in version 14.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [14.1.0](elastic/elastic-charts@v14.0.0...v14.1.0) (2019-11-13) ### Features * fit functions for null y1 values ([opensearch-project#416](elastic/elastic-charts#416)) ([6462cff](elastic/elastic-charts@6462cff)), closes [opensearch-project#450](elastic/elastic-charts#450) [opensearch-project#388](elastic/elastic-charts#388)
Summary
Add fit functions below to fill
nully1values (y0nullvalues not yet supported)Works for ONLY non-stacked series. Stacked series requires another approach having to account for the fitted value of lower series.
[2, null null, 8][2, 2, 2, 8][2, 2, 8, 8][2, 8, 8, 8][2, 5, 5, 8][2, 4, 6, 8]nullvalues with0[2, 0, 0, 8]x), that should be used instead[2, x, x, 8]Related to fix #388
Usage
within a series spec definition, define the
fittype.when using the explicit type you must provide a value like so...
By default, indeterminate endvalues, values not able to be fitted, are set to
null. To set a specific value rather thannull, you can pass anendValueprop like so...Demos
[Non-stacked]Assuming the following data
Fit.None[default]Fit.CarryFit.NearestFit.LookaheadFit.AverageFit.LinearFit.ZeroFit.Explicitwith value set to4Curved Linear
Also Works with

curvesUsing
endValueThe
endValueproperty allows you to set the endnullpoint values to a specific value. This value is only used in the case where the fitting function does not have sufficient information to determine the fitted value. For example, usingFit.Averagerequires both the trailing and leading non-null boundaries, thus if the endpoints are both null the value can not be found for either.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.src/index.ts(and stories only import from../srcexcept for test data & storybook)