-
Notifications
You must be signed in to change notification settings - Fork 122
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
feat: fit functions for null y1 values #416
Merged
Merged
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
a8981d4
feat: fit functions for null y1 values
nickofthyme 6332ec0
fix: nearest fit and add zero fit
nickofthyme c9fd456
fix: cleanup logic
nickofthyme d4a2455
test: fix broken tests
nickofthyme 87041fb
feat: add story docs and usage case
nickofthyme 8b02916
test: update url encoding, add missing screenshots
nickofthyme f270306
WIP
nickofthyme a7e1fe5
feat: Add fitted area clipping logic, update story, add end value fal…
nickofthyme e397a22
WIP
nickofthyme 0b8f73a
fix: clippedRanges logic
nickofthyme 09a9665
feat: add clipping to lines, update story
nickofthyme b3566cc
test: add vrt for fitting functions
nickofthyme 931aa00
WIP
nickofthyme 2624421
Merge branch 'master' into feat/fit-functions
nickofthyme f4332a1
WIP
nickofthyme 448460b
feat: add nearest endValue logic
nickofthyme f7452b8
test: add tests and test helpers for fit function logic
nickofthyme 1dbae94
Merge branch 'master' into feat/fit-functions
nickofthyme 9911881
fix: quick code cleanup
nickofthyme 81db152
feat: add support for ordinal scales
nickofthyme daf9385
test: add/fix tests for ordinal scale fitting functions
nickofthyme f10ed39
test: add more tests around clipping logic
nickofthyme 112cbf4
Merge branch 'master' into feat/fit-functions
nickofthyme b491e32
test: fix VRT with change in storybook story
nickofthyme 615af36
fix: folder directory
nickofthyme 07031d0
Merge branch 'master' into feat/fit-functions
nickofthyme 4d990b2
fix: pr comments
nickofthyme ac9f744
Merge branch 'master' into feat/fit-functions
nickofthyme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// https://github.com/jest-community/jest-extended | ||
import 'jest-extended'; |
This file contains 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
This file contains 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
Binary file added
BIN
+11.7 KB
...ea-chart-fitting-functions-non-stacked-series-visually-looks-correct-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47.3 KB
...hart-stacked-with-separated-specs-same-naming-visually-looks-correct-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.5 KB
...d-charts-fitting-functions-non-stacked-series-visually-looks-correct-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.8 KB
...-bar-series-stories-test-histogram-mode-linear-point-alignment-start-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.1 KB
...harts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.2 KB
...-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.6 KB
...arts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.8 KB
...charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17 KB
...rts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.8 KB
...harts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.1 KB
...a-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.1 KB
...a-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.5 KB
...end-value-set-to-nearest-should-display-correct-fit-for-type-average-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.8 KB
...s-end-value-set-to-nearest-should-display-correct-fit-for-type-carry-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.6 KB
...nd-value-set-to-nearest-should-display-correct-fit-for-type-explicit-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.1 KB
...-end-value-set-to-nearest-should-display-correct-fit-for-type-linear-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.8 KB
...d-value-set-to-nearest-should-display-correct-fit-for-type-lookahead-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.8 KB
...end-value-set-to-nearest-should-display-correct-fit-for-type-nearest-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.1 KB
...ts-end-value-set-to-nearest-should-display-correct-fit-for-type-none-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.1 KB
...ts-end-value-set-to-nearest-should-display-correct-fit-for-type-zero-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.5 KB
...area-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.8 KB
...s-area-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.6 KB
...rea-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.1 KB
...-area-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.9 KB
...ea-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.8 KB
...area-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
...ns-area-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+23.1 KB
...ns-area-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14.6 KB
...nal-dataset-no-end-value-should-display-correct-fit-for-type-average-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14.1 KB
...dinal-dataset-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+19.1 KB
...al-dataset-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+15.1 KB
...inal-dataset-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14.1 KB
...l-dataset-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14.3 KB
...nal-dataset-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+11.4 KB
...rdinal-dataset-no-end-value-should-display-correct-fit-for-type-none-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+22.4 KB
...rdinal-dataset-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+18.1 KB
...urved-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+15.2 KB
...-curved-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+19.6 KB
...rved-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+18.8 KB
...curved-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+17 KB
...ved-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14.8 KB
...urved-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+12.1 KB
...h-curved-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+23.1 KB
...h-curved-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+16.7 KB
...harts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...arts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+17.3 KB
...charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
...rts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+16.2 KB
...harts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+12 KB
...e-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+21.1 KB
...e-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14.6 KB
...line-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...s-line-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...ine-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+15.1 KB
...-line-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...ne-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14.1 KB
...line-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+12 KB
...ns-line-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+21.1 KB
...ns-line-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+16.7 KB
...curve-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...h-curve-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...urve-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+17.3 KB
...-curve-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
...rve-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+16.2 KB
...curve-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+12 KB
...th-curve-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+21.1 KB
...th-curve-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { common } from '../page_objects'; | ||
import { Fit } from '../../src/chart_types/xy_chart/utils/specs'; | ||
|
||
describe('Mixed series stories', () => { | ||
describe('Fitting functions', () => { | ||
describe('Area charts - no endValue', () => { | ||
Object.values(Fit).forEach((fitType) => { | ||
it(`should display correct fit for type - ${fitType}`, async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/mixed-charts--fitting-functions-non-stacked-series&knob-seriesType=area&knob-dataset=all&knob-fitting function=${fitType}&knob-Curve=0&knob-End value=none&knob-Explicit valuve (using Fit.Explicit)=8`, | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Area charts - endValue set to 2', () => { | ||
Object.values(Fit).forEach((fitType) => { | ||
it(`should display correct fit for type - ${fitType}`, async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/mixed-charts--fitting-functions-non-stacked-series&knob-seriesType=area&knob-dataset=all&knob-fitting function=${fitType}&knob-Curve=0&knob-End value=2&knob-Explicit valuve (using Fit.Explicit)=8`, | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Area charts - endValue set to "nearest"', () => { | ||
Object.values(Fit).forEach((fitType) => { | ||
it(`should display correct fit for type - ${fitType}`, async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/mixed-charts--fitting-functions-non-stacked-series&knob-seriesType=area&knob-dataset=all&knob-fitting function=${fitType}&knob-Curve=0&knob-End value=nearest&knob-Explicit valuve (using Fit.Explicit)=8`, | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Area charts - with curved - endValue set to 2', () => { | ||
Object.values(Fit).forEach((fitType) => { | ||
it(`should display correct fit for type - ${fitType}`, async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/mixed-charts--fitting-functions-non-stacked-series&knob-seriesType=area&knob-dataset=all&knob-fitting function=${fitType}&knob-Curve=1&knob-End value=2&knob-Explicit valuve (using Fit.Explicit)=8`, | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Area charts - Ordinal dataset - no endValue', () => { | ||
Object.values(Fit).forEach((fitType) => { | ||
it(`should display correct fit for type - ${fitType}`, async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/mixed-charts--fitting-functions-non-stacked-series&knob-seriesType=area&knob-dataset=ordinal&knob-fitting function=${fitType}&knob-Curve=0&knob-End value=none&knob-Explicit valuve (using Fit.Explicit)=8`, | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Line charts - no endValue', () => { | ||
Object.values(Fit).forEach((fitType) => { | ||
it(`should display correct fit for type - ${fitType}`, async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/mixed-charts--fitting-functions-non-stacked-series&knob-seriesType=line&knob-dataset=all&knob-fitting function=${fitType}&knob-Curve=0&knob-End value=none&knob-Explicit valuve (using Fit.Explicit)=8`, | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Line charts - endValue set to 2', () => { | ||
Object.values(Fit).forEach((fitType) => { | ||
it(`should display correct fit for type - ${fitType}`, async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/mixed-charts--fitting-functions-non-stacked-series&knob-seriesType=line&knob-dataset=all&knob-fitting function=${fitType}&knob-Curve=0&knob-End value=2&knob-Explicit valuve (using Fit.Explicit)=8`, | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Line charts - with curve - endValue set to 2', () => { | ||
Object.values(Fit).forEach((fitType) => { | ||
it(`should display correct fit for type - ${fitType}`, async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/mixed-charts--fitting-functions-non-stacked-series&knob-seriesType=line&knob-dataset=all&knob-fitting function=${fitType}&knob-Curve=1&knob-End value=2&knob-Explicit valuve (using Fit.Explicit)=8`, | ||
); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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