Skip to content

Commit

Permalink
Merge branch 'master' into legend-keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
rshen91 authored Dec 9, 2020
2 parents a5acd93 + bda63f6 commit 547f69d
Show file tree
Hide file tree
Showing 16 changed files with 4,870 additions and 546 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# [24.4.0](https://github.com/elastic/elastic-charts/compare/v24.3.0...v24.4.0) (2020-12-09)


### Bug Fixes

* empty labels on debug state ([#940](https://github.com/elastic/elastic-charts/issues/940)) ([3c823fd](https://github.com/elastic/elastic-charts/commit/3c823fdbc8437c907c02b58c1aa8e084bc7611d1))


### Features

* allow use of functions for y, y0, split and stack accessors ([#943](https://github.com/elastic/elastic-charts/issues/943)) ([22425d3](https://github.com/elastic/elastic-charts/commit/22425d3b9819afde208c651abb6b017839556645))

# [24.3.0](https://github.com/elastic/elastic-charts/compare/v24.2.0...v24.3.0) (2020-12-04)


Expand Down
16 changes: 10 additions & 6 deletions api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1474,11 +1474,11 @@ export type ScaleType = $Values<typeof ScaleType>;
// @public (undocumented)
export interface SeriesAccessors {
markSizeAccessor?: Accessor | AccessorFn;
splitSeriesAccessors?: Accessor[];
stackAccessors?: Accessor[];
splitSeriesAccessors?: (Accessor | AccessorFn)[];
stackAccessors?: (Accessor | AccessorFn)[];
xAccessor: Accessor | AccessorFn;
y0Accessors?: Accessor[];
yAccessors: Accessor[];
y0Accessors?: (Accessor | AccessorFn)[];
yAccessors: (Accessor | AccessorFn)[];
}

// @public (undocumented)
Expand Down Expand Up @@ -1870,7 +1870,11 @@ export interface TooltipValue {
export type TooltipValueFormatter = (data: TooltipValue) => JSX.Element | string;

// @public
export type UnaryAccessorFn<Return = any> = (datum: Datum) => Return;
export interface UnaryAccessorFn<Return = any> {
// (undocumented)
(datum: Datum): Return;
fieldName?: string;
}

// @public (undocumented)
export type UnboundedDomainWithInterval = DomainBase;
Expand Down Expand Up @@ -1933,7 +1937,7 @@ export interface XYChartSeriesIdentifier extends SeriesIdentifier {
// (undocumented)
splitAccessors: Map<string | number, string | number>;
// (undocumented)
yAccessor: string | number;
yAccessor: Accessor;
}

// @public
Expand Down
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.
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.
27 changes: 27 additions & 0 deletions integration/tests/bar_stories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,31 @@ describe('Bar series stories', () => {
});
});
});

describe('functional accessors', () => {
it('functional accessors with fieldName', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/bar-chart--functional-accessors&knob-y fn name=testY&knob-split fn name=testSplit',
);
});

it('functional accessors with fieldName - with tooltip', async () => {
await common.expectChartWithMouseAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/bar-chart--functional-accessors&knob-y fn name=testY&knob-split fn name=testSplit',
{
top: 60,
right: 180,
},
{
screenshotSelector: 'body',
},
);
});

it('y1Accessors and y0Accessors', async () => {
await common.expectChartAtUrlToMatchScreenshot(
'http://localhost:9001/?path=/story/bar-chart--band-bar-chart&knob-fit Y domain=true&knob-use fn accessors=true',
);
});
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@elastic/charts",
"description": "Elastic-Charts data visualization library",
"version": "24.3.0",
"version": "24.4.0",
"author": "Marco Vettorello <[email protected]>",
"license": "Apache-2.0",
"main": "dist/index.js",
Expand Down
Loading

0 comments on commit 547f69d

Please sign in to comment.