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

feat: small multiples for XY charts (alpha) #793

Merged
merged 37 commits into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
bbf23fc
feat: small-multiples for xy axis chart
markov00 Aug 17, 2020
d8c22dc
refactor: test adapted to new set of types
markov00 Oct 15, 2020
c68a3cc
test: refactor commented out tests
markov00 Oct 16, 2020
3cd5738
Merge branch 'master' into 2020_08_17-small-multiples
markov00 Oct 16, 2020
024cb2c
fix: translate point rendering to correct panel
markov00 Oct 16, 2020
7c79d79
fix: grid lines
markov00 Oct 19, 2020
849be06
fix: grid lines
markov00 Oct 20, 2020
d9ecdf3
WIP
markov00 Oct 23, 2020
f43ca65
fix: tooltip positioning on panels
markov00 Oct 23, 2020
6324237
fix: rotation
markov00 Oct 29, 2020
00a0a42
fix: line annotations
markov00 Oct 30, 2020
f7b961d
fix: rect annotations
markov00 Oct 30, 2020
1775933
Merge branch 'master' into 2020_08_17-small-multiples
markov00 Oct 30, 2020
c33c90e
test: align mocks to new types
markov00 Oct 30, 2020
2cc55a1
build: fix linting
markov00 Oct 30, 2020
54db5f3
docs: update API report
markov00 Oct 30, 2020
51161b3
fix: bar value per panel
markov00 Oct 30, 2020
524a5e8
fix: annotation marker pos
markov00 Oct 30, 2020
7f42203
fix: simplified types
markov00 Nov 3, 2020
d9797ff
docs: add storybook examples
markov00 Nov 3, 2020
923339d
fix: missing clip on rendering geoms
markov00 Nov 3, 2020
53f26b1
test: update VRTs
markov00 Nov 3, 2020
480dd1b
docs: revert playground changes
markov00 Nov 3, 2020
3cbf086
fix: clean types and remove flatMap
markov00 Nov 3, 2020
fd5fff9
refactor: cleanup code
markov00 Nov 3, 2020
90ab7ef
refactor: clean up code
markov00 Nov 3, 2020
08bb9cc
test: removed duplicated VRTs
markov00 Nov 5, 2020
c030397
docs: fix API report
markov00 Nov 5, 2020
5bfda72
refactor: addressing review feedbacks
markov00 Nov 5, 2020
1b90cfe
fix: logic on merge domain with no dataseries
markov00 Nov 5, 2020
cd935e7
fix: wrong fix on merge domain
markov00 Nov 5, 2020
5dade3a
fix: disable clipping to line rendering to match master
markov00 Nov 6, 2020
d356ace
docs: restore master VRTs
markov00 Nov 6, 2020
7dd4f48
test: fix vrts after removing clippings on lines
markov00 Nov 6, 2020
e91488d
Merge branch 'master' into 2020_08_17-small-multiples
nickofthyme Nov 6, 2020
80a7649
docs: add legend knob on small multiple stories
markov00 Nov 6, 2020
95aba23
test: adding vrts for small multiples
markov00 Nov 6, 2020
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
51 changes: 49 additions & 2 deletions api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,28 @@ export interface GroupBrushExtent {
groupId: GroupId;
}

// @alpha (undocumented)
export const GroupBy: React.FunctionComponent<GroupByProps>;

// @alpha (undocumented)
export type GroupByAccessor = (spec: Spec, datum: any) => string | number;

// @alpha (undocumented)
export type GroupByProps = Pick<GroupBySpec, 'id' | 'by' | 'sort'>;

// Warning: (ae-forgotten-export) The symbol "Predicate" needs to be exported by the entry point index.d.ts
//
// @alpha (undocumented)
export type GroupBySort = Predicate;

// @alpha (undocumented)
export interface GroupBySpec extends Spec {
// (undocumented)
by: GroupByAccessor;
// (undocumented)
sort: GroupBySort;
}

// @public (undocumented)
export type GroupId = string;

Expand Down Expand Up @@ -935,8 +957,6 @@ export interface HeatmapSpec extends Spec {
xAccessor: Accessor | AccessorFn;
// (undocumented)
xScaleType: SeriesScales['xScaleType'];
// Warning: (ae-forgotten-export) The symbol "Predicate" needs to be exported by the entry point index.d.ts
//
// (undocumented)
xSortPredicate: Predicate;
// (undocumented)
Expand Down Expand Up @@ -1635,6 +1655,27 @@ export interface SimplePadding {
outer: number;
}

// @alpha (undocumented)
export const SmallMultiples: React.FunctionComponent<SmallMultiplesProps>;

// Warning: (ae-forgotten-export) The symbol "DefaultSmallMultiplesProps" needs to be exported by the entry point index.d.ts
nickofthyme marked this conversation as resolved.
Show resolved Hide resolved
//
// @alpha (undocumented)
export type SmallMultiplesProps = Partial<Omit<SmallMultiplesSpec, DefaultSmallMultiplesProps>>;

// @alpha (undocumented)
export interface SmallMultiplesSpec extends Spec {
// (undocumented)
splitHorizontally?: string;
// (undocumented)
splitVertically?: string;
// (undocumented)
style?: {
verticalPanelPadding?: [number, number];
horizontalPanelPadding?: [number, number];
};
}

// Warning: (ae-missing-release-tag) "Spec" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
Expand All @@ -1655,6 +1696,8 @@ export const SpecTypes: Readonly<{
Axis: "axis";
Annotation: "annotation";
Settings: "settings";
IndexOrder: "index_order";
SmallMultiples: "small_multiples";
}>;

// @public (undocumented)
Expand Down Expand Up @@ -1871,6 +1914,10 @@ export interface XYChartSeriesIdentifier extends SeriesIdentifier {
// (undocumented)
seriesKeys: (string | number)[];
// (undocumented)
smHorizontalAccessorValue?: string | number;
// (undocumented)
smVerticalAccessorValue?: string | number;
// (undocumented)
splitAccessors: Map<string | number, string | number>;
// (undocumented)
yAccessor: string | number;
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

import { MockAnnotationLineProps } from '../../../../mocks/annotations/annotations';
import { MockSeriesSpec, MockAnnotationSpec, MockGlobalSpec } from '../../../../mocks/specs';
import { MockStore } from '../../../../mocks/store';
import { ScaleType } from '../../../../scales/constants';
Expand Down Expand Up @@ -51,14 +52,15 @@ function expectAnnotationAtPosition(
MockStore.addSpecs([settings, ...specs, annotation], store);
const annotations = computeAnnotationDimensionsSelector(store.getState());
expect(annotations.get(annotation.id)).toEqual([
{
MockAnnotationLineProps.default({
details: { detailsText: undefined, headerText: `${indexPosition}` },
linePathPoints: {
start: { x1: expectedLinePosition, y1: 0 },
end: { x2: expectedLinePosition, y2: 100 },
x1: expectedLinePosition,
y1: 0,
x2: expectedLinePosition,
y2: 100,
},
marker: undefined,
},
}),
]);
}

Expand Down Expand Up @@ -144,14 +146,15 @@ describe('Render vertical line annotation within', () => {
MockStore.addSpecs([settings, spec, annotation], store);
const annotations = computeAnnotationDimensionsSelector(store.getState());
expect(annotations.get(annotation.id)).toEqual([
{
MockAnnotationLineProps.default({
linePathPoints: {
start: { x1: 95, y1: 0 },
end: { x2: 95, y2: 100 },
x1: 95,
y1: 0,
x2: 95,
y2: 100,
},
details: { detailsText: 'foo', headerText: '9.5' },
marker: undefined,
},
}),
]);
});
});
Loading