Skip to content
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

style(xy): expose isolated point style #2004

Merged
merged 23 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e3fec40
Align style with line width
markov00 Mar 23, 2023
80eaf68
style: point radius of 0.8 of the line width
markov00 Apr 3, 2023
4de83a0
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Apr 3, 2023
8ecadb6
test: update snapshot tests with new radius value
markov00 Apr 5, 2023
f46d53e
Merge branch 'main' into 2023-03-23_fix_orphan_style
markov00 May 3, 2023
afec3e0
feat: expose style through theme
markov00 May 3, 2023
ea3c1f2
refactor: rename orphan to isolated points
markov00 May 3, 2023
29598f8
refactor: renamed test files
markov00 May 3, 2023
1b189a1
fix: align isolated point styles
markov00 May 3, 2023
199cde6
Merge branch 'main' into 2023-03-23_fix_orphan_style
markov00 May 22, 2023
7096a4d
fix(bubble): disable isolated points
markov00 May 23, 2023
25b5302
fix test and missing theme properties
markov00 May 23, 2023
01a65e4
Merge branch 'main' into 2023-03-23_fix_orphan_style
markov00 May 23, 2023
6758ffe
chore: update vrt screenshots [update-vrt]
markov00 May 23, 2023
8a66ded
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] May 23, 2023
d3078c2
Merge branch 'main' into 2023-03-23_fix_orphan_style
markov00 May 24, 2023
181ad8d
chore: update vrt screenshots [update-vrt]
markov00 May 24, 2023
6cbcdf6
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] May 24, 2023
2199a2e
fix(legend): apply missing color from variant
markov00 May 29, 2023
a435a01
refactor: improve semantics of isolated check
markov00 May 29, 2023
20868e0
refactor: explicitly allow isolated points
markov00 May 29, 2023
d7ccc3e
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] May 29, 2023
8ebf343
Merge branch 'main' into 2023-03-23_fix_orphan_style
nickofthyme May 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
4 changes: 2 additions & 2 deletions e2e/tests/area_stories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ test.describe('Area series stories', () => {
});
});

test.describe('Area with orphan data points', () => {
test.describe('Area with isolated data points', () => {
test('render correctly fit function', async ({ page }) => {
await common.expectChartAtUrlToMatchScreenshot(page)(
'http://localhost:9001/?path=/story/line-chart--test-orphan-data-points&knob-enable fit function=&knob-switch to area=true',
'http://localhost:9001/?path=/story/line-chart--isolated-data-points&knob-enable fit function=&knob-switch to area=true',
);
});
});
Expand Down
6 changes: 5 additions & 1 deletion packages/charts/api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ export interface AreaSeriesStyle {
area: AreaFitStyle;
};
// (undocumented)
isolatedPoint: PointStyle;
// (undocumented)
line: LineStyle;
// (undocumented)
point: PointStyle;
Expand Down Expand Up @@ -1739,6 +1741,8 @@ export interface LineSeriesStyle {
line: LineFitStyle;
};
// (undocumented)
isolatedPoint: PointStyle;
// (undocumented)
line: LineStyle;
// (undocumented)
point: PointStyle;
Expand Down Expand Up @@ -2156,7 +2160,7 @@ export type PointShape = $Values<typeof PointShape>;
export interface PointStyle {
fill?: Color | ColorVariant;
opacity: number;
radius: number;
radius: Pixels;
shape?: PointShape;
stroke?: Color | ColorVariant;
strokeWidth: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function renderAreas(
// now we can render the visible points on top of each the areas/lines
areas.forEach(({ panel, value: area }) => {
const { style, seriesIdentifier, points } = area;
const visiblePoints = style.point.visible ? points : points.filter(({ orphan }) => orphan);
const visiblePoints = style.point.visible ? points : points.filter(({ isolated }) => isolated);
if (visiblePoints.length === 0) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function renderLines(
);
}

const visiblePoints = style.point.visible ? points : points.filter(({ orphan }) => orphan);
const visiblePoints = style.point.visible ? points : points.filter(({ isolated }) => isolated);
if (visiblePoints.length === 0) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`Rendering points - areas Multi series area chart - linear can render fi
[
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -61,7 +61,7 @@ exports[`Rendering points - areas Multi series area chart - linear can render fi
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -123,7 +123,7 @@ exports[`Rendering points - areas Multi series area chart - linear can render se
[
{
"color": "blue",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -180,7 +180,7 @@ exports[`Rendering points - areas Multi series area chart - linear can render se
},
{
"color": "blue",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -242,7 +242,7 @@ exports[`Rendering points - areas Multi series area chart - ordinal can render f
[
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -299,7 +299,7 @@ exports[`Rendering points - areas Multi series area chart - ordinal can render f
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -361,7 +361,7 @@ exports[`Rendering points - areas Multi series area chart - ordinal can render s
[
{
"color": "blue",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -418,7 +418,7 @@ exports[`Rendering points - areas Multi series area chart - ordinal can render s
},
{
"color": "blue",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -480,7 +480,7 @@ exports[`Rendering points - areas Multi series area chart - time can render firs
[
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -537,7 +537,7 @@ exports[`Rendering points - areas Multi series area chart - time can render firs
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -599,7 +599,7 @@ exports[`Rendering points - areas Multi series area chart - time can render seco
[
{
"color": "blue",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -656,7 +656,7 @@ exports[`Rendering points - areas Multi series area chart - time can render seco
},
{
"color": "blue",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -718,7 +718,7 @@ exports[`Rendering points - areas Single series area chart - linear Can render t
[
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -775,7 +775,7 @@ exports[`Rendering points - areas Single series area chart - linear Can render t
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -837,7 +837,7 @@ exports[`Rendering points - areas Single series area chart - ordinal Can render
[
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -894,7 +894,7 @@ exports[`Rendering points - areas Single series area chart - ordinal Can render
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -956,7 +956,7 @@ exports[`Rendering points - areas Single series area chart - time Can render two
[
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -1013,7 +1013,7 @@ exports[`Rendering points - areas Single series area chart - time Can render two
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`Rendering bands - areas Single band area chart Can render two points 1`
[
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -62,7 +62,7 @@ exports[`Rendering bands - areas Single band area chart Can render two points 1`
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -120,7 +120,7 @@ exports[`Rendering bands - areas Single band area chart Can render two points 1`
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -178,7 +178,7 @@ exports[`Rendering bands - areas Single band area chart Can render two points 1`
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -241,7 +241,7 @@ exports[`Rendering bands - areas Single band area chart with null values Can ren
[
{
"color": "red",
"orphan": true,
"isolated": true,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -299,7 +299,7 @@ exports[`Rendering bands - areas Single band area chart with null values Can ren
},
{
"color": "red",
"orphan": true,
"isolated": true,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -357,7 +357,7 @@ exports[`Rendering bands - areas Single band area chart with null values Can ren
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -415,7 +415,7 @@ exports[`Rendering bands - areas Single band area chart with null values Can ren
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -473,7 +473,7 @@ exports[`Rendering bands - areas Single band area chart with null values Can ren
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down Expand Up @@ -531,7 +531,7 @@ exports[`Rendering bands - areas Single band area chart with null values Can ren
},
{
"color": "red",
"orphan": false,
"isolated": false,
"panel": {
"height": 100,
"left": 0,
Expand Down
Loading