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

chore: merge alpha into master #1403

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module.exports = {
'@typescript-eslint/no-unsafe-return': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/restrict-plus-operands': 0, // rule is broken
'@typescript-eslint/no-unsafe-call': 1,
'@typescript-eslint/no-unsafe-call': 0, // seems to have issues with default import types
'@typescript-eslint/unbound-method': 1,
'@typescript-eslint/no-redeclare': 'off', // we use to declare enum type and object with the same name
'@typescript-eslint/no-shadow': 'off', // we use shadow mostly within the canvas renderer function when we need a new context
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.
19 changes: 19 additions & 0 deletions integration/tests/heatmap_stories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { eachTheme } from '../helpers';
import { common } from '../page_objects';

describe('Heatmap stories', () => {
Expand All @@ -16,10 +17,28 @@ describe('Heatmap stories', () => {
{ left: 300, top: 300 },
);
});

eachTheme.describe((_, themeParams) => {
it('should render basic heatmap', async () => {
await common.expectChartAtUrlToMatchScreenshot(
`http://localhost:9001/?path=/story/heatmap-alpha--basic${themeParams}`,
);
});

it('should render correct brush area', async () => {
await common.expectChartWithDragAtUrlToMatchScreenshot(
`http://localhost:9001/?path=/story/heatmap-alpha--basic${themeParams}`,
{ left: 200, top: 100 },
{ left: 400, top: 250 },
);
});
});

it('should maximize the label with an unique fontSize', async () => {
await page.setViewport({ width: 450, height: 600 });
await common.expectChartAtUrlToMatchScreenshot('http://localhost:9001/?path=/story/heatmap-alpha--categorical');
});

it('should maximize the label fontSize', async () => {
await page.setViewport({ width: 420, height: 600 });
await common.expectChartAtUrlToMatchScreenshot(
Expand Down
18 changes: 18 additions & 0 deletions integration/tests/wordcloud_stories.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { TEMPLATES } from '../../storybook/stories/wordcloud/1_wordcloud.story';
import { common } from '../page_objects';

describe('Scales stories', () => {
it.each(TEMPLATES.filter((t) => t !== 'edit'))('should render %s wordcloud template', async (template) => {
await common.expectChartAtUrlToMatchScreenshot(
`http://localhost:9001/?path=/story/wordcloud-alpha--simple-wordcloud&knob-template=${template}`,
);
});
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"@types/color": "^3.0.1",
"@types/core-js": "^2.5.2",
"@types/d3-array": "^1.2.6",
"@types/d3-cloud": "^1.2.5",
"@types/d3-collection": "^1.0.8",
"@types/d3-interpolate": "^1.3.1",
"@types/d3-scale": "^2.1.1",
Expand Down
102 changes: 0 additions & 102 deletions packages/charts/src/chart_types/heatmap/layout/config/config.ts

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { Box } from '../../../../common/text_utils';
import { Fill, Line, Rect, Stroke } from '../../../../geoms/types';
import { HeatmapBrushEvent } from '../../../../specs/settings';
import { Point } from '../../../../utils/point';
import { LIGHT_THEME } from '../../../../utils/themes/light_theme';
import { HeatmapStyle } from '../../../../utils/themes/theme';
import { PrimitiveValue } from '../../../partition_chart/layout/utils/group_by_rollup';
import { config } from '../config/config';
import { HeatmapCellDatum } from '../viewmodel/viewmodel';
import { Config } from './config_types';

/** @internal */
export interface Value {
Expand Down Expand Up @@ -98,7 +98,7 @@ export type DragShape = ReturnType<PickDragShapeFunction>;

/** @internal */
export type ShapeViewModel = {
config: Config;
theme: HeatmapStyle;
heatmapViewModel: HeatmapViewModel;
pickQuads: PickFunction;
pickDragArea: PickDragFunction;
Expand All @@ -125,8 +125,8 @@ export const nullHeatmapViewModel: HeatmapViewModel = {
};

/** @internal */
export const nullShapeViewModel = (specifiedConfig?: Config): ShapeViewModel => ({
config: specifiedConfig || config,
export const nullShapeViewModel = (): ShapeViewModel => ({
theme: LIGHT_THEME.heatmap,
heatmapViewModel: nullHeatmapViewModel,
pickQuads: () => [],
pickDragArea: () => ({ cells: [], x: [], y: [], chartType: ChartType.Heatmap }),
Expand Down
Loading