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(heatmap): small multiples #1933

Merged
merged 79 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
57f77e6
refactor: cleanup and rearrange sm utils
nickofthyme Jan 24, 2023
b6aec1d
docs: add heatmap sm story
nickofthyme Jan 24, 2023
bdee7d1
refactor: heatmap grid, axes layout to respect panels
nickofthyme Jan 24, 2023
c473220
Merge branch 'main' into heatmap-sm
nickofthyme Jan 24, 2023
58cdde7
fix: bad merge upstream
nickofthyme Jan 25, 2023
24c6c5c
fix: xAxisLabel text measuring logic to respect panels
nickofthyme Jan 25, 2023
fdb9d56
chore: correctly render axes and panel titles
nickofthyme Jan 26, 2023
413aaf5
fix: chart width offset from panel title
nickofthyme Jan 27, 2023
56152cb
fix(heatmap): interactions for hover and tooltips
nickofthyme Feb 3, 2023
9be3031
Merge branch 'main' into heatmap-sm
nickofthyme Feb 7, 2023
7198345
fix: type and functional issues with merge
nickofthyme Feb 8, 2023
e03fdeb
fix: confine burshing to single panel
nickofthyme Feb 8, 2023
a84ce9e
fix: broken eslint import/order rule
nickofthyme Feb 8, 2023
cf0c5ed
fix: brushing on sm panels, cleanup naming
nickofthyme Feb 8, 2023
39b4338
chore: permit single value brush inputs
nickofthyme Feb 9, 2023
2bf23f3
fix: remove unused onBrushEnd prop from Heatmap spec
nickofthyme Feb 9, 2023
7322fb7
chore: share heatmap selection logic
nickofthyme Feb 9, 2023
5cb9283
fix: tooltip offset and placement
nickofthyme Feb 10, 2023
4a106fc
chore: remove h and v values from Cell in lieu of datum values
nickofthyme Feb 10, 2023
1cdb488
fix: heatmap pagination and title placement
nickofthyme Feb 15, 2023
d9676c6
test: add visual regression tests for new sm configs
nickofthyme Feb 15, 2023
18dd6b0
Merge branch 'main' into heatmap-sm
nickofthyme Feb 15, 2023
02b4494
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Feb 15, 2023
55c327d
test: fix vrt url params for sb actions
nickofthyme Feb 15, 2023
f4b0e45
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Feb 15, 2023
6c92f2d
Merge branch 'main' into heatmap-sm
nickofthyme Feb 21, 2023
c4dd835
chore(heatmap): add panel context to debug state
nickofthyme Feb 21, 2023
b617194
chore: add knobs for partition order options
nickofthyme Feb 22, 2023
29a8c58
fix: brush and click interactions
nickofthyme Feb 24, 2023
4713acd
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Feb 24, 2023
73891f7
fix: api changes
nickofthyme Feb 28, 2023
63bf240
fix: jest test imports
nickofthyme Feb 28, 2023
29fc183
Merge remote-tracking branch 'origin/heatmap-sm' into heatmap-sm
nickofthyme Feb 28, 2023
70ad688
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Feb 28, 2023
b583dd4
Merge branch 'main' into heatmap-sm
nickofthyme Feb 28, 2023
7bb0da7
Revert "fix: broken eslint import/order rule"
nickofthyme Feb 28, 2023
b16295f
revert: eslint import sort order auto fixes
nickofthyme Feb 28, 2023
511a2a9
Merge branch 'main' into heatmap-sm
nickofthyme Mar 1, 2023
8418eaa
ci: add missing deps
nickofthyme Mar 2, 2023
5e28b18
chore: restore deleted public directory
nickofthyme Mar 2, 2023
858c3db
fix: debug state cellFontSize
nickofthyme Mar 2, 2023
48a62a5
chore: update type exports
nickofthyme Mar 2, 2023
c73adf3
chore: refactor clamp changes
nickofthyme Mar 2, 2023
1799936
chore: code change suggestions
nickofthyme Mar 2, 2023
cd5b765
chore: remove stale comment
nickofthyme Mar 2, 2023
bc92698
chore: improve sm value types
nickofthyme Mar 2, 2023
697e53c
refactor: remove all cell size constraints and pagination props [upda…
nickofthyme Mar 7, 2023
b4687cf
chore: add note about todo cleanup
nickofthyme Mar 7, 2023
93c57b8
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Mar 7, 2023
c865acc
fix: cursor hover for time scales
nickofthyme Mar 7, 2023
42fb1cd
Merge remote-tracking branch 'origin/heatmap-sm' into heatmap-sm
nickofthyme Mar 7, 2023
8857c44
chore: remove isNullDomain in favor of hasSMDomain
nickofthyme Mar 7, 2023
e7e4395
fix: single value select for time scale
nickofthyme Mar 7, 2023
51df811
chore: add note about outer sm style padding
nickofthyme Mar 7, 2023
1de22e4
fix: sm pointer selection between panels
nickofthyme Mar 7, 2023
8d8648e
chore: update api changes
nickofthyme Mar 7, 2023
d4ad2ed
test: update tests with removed style options
nickofthyme Mar 7, 2023
939748e
test(VRT): improve test cases, seed sampleSize function
nickofthyme Mar 8, 2023
2a977df
Merge branch 'main' into heatmap-sm
nickofthyme Mar 8, 2023
225a39e
fix: duplicate test titles
nickofthyme Mar 8, 2023
0c94fe6
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Mar 8, 2023
639a7c4
test: fix story knobs to account for 0 count sm
nickofthyme Mar 8, 2023
d4e083d
Merge remote-tracking branch 'origin/heatmap-sm' into heatmap-sm
nickofthyme Mar 8, 2023
59281af
test: fix story knob params [update-vrt]
nickofthyme Mar 8, 2023
e8ffab3
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Mar 8, 2023
804b9a1
test: update wait selector of zero dimension case
nickofthyme Mar 8, 2023
5767b34
Merge remote-tracking branch 'origin/heatmap-sm' into heatmap-sm
nickofthyme Mar 8, 2023
8f85aba
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Mar 8, 2023
3062165
test(vrt): cleanup stale screenshots [update-vrt]
nickofthyme Mar 9, 2023
d4cdd83
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Mar 9, 2023
641cc2e
test: remove old screenshots
nickofthyme Mar 9, 2023
1ad1a41
fix: conditional waitSelector
nickofthyme Mar 9, 2023
b5e9654
Merge remote-tracking branch 'origin/heatmap-sm' into heatmap-sm
nickofthyme Mar 9, 2023
6c649c5
test: update click tests for heatmap sm [update-vrt]
nickofthyme Mar 9, 2023
c3117e4
test(vrt): update screenshots [skip ci]
elastic-datavis[bot] Mar 9, 2023
e6c0b42
test: final test without updating vrts
nickofthyme Mar 9, 2023
72d6199
Merge remote-tracking branch 'origin/heatmap-sm' into heatmap-sm
nickofthyme Mar 9, 2023
10ade62
chore: remove old commented code
nickofthyme Mar 9, 2023
f8c4879
Merge remote-tracking branch 'upstream/main' into heatmap-sm
nickofthyme Mar 9, 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.
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.
Diff not rendered.
Diff not rendered.
Diff not rendered.
89 changes: 89 additions & 0 deletions e2e/tests/heatmap_stories.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,95 @@ test.describe('Heatmap stories', () => {
);
});

test.describe('Small multiples', () => {
const titleOptions = {
panel: ' without panel titles',
axes: ' without axes titles',
both: ' without any titles',
};

pwEach.test<{
vSplit: number | null;
hSplit: number | null;
density?: number;
timeData?: boolean;
hiddenTitles?: 'panel' | 'axes' | 'both';
}>([
{ vSplit: 2, hSplit: 2 },
{ vSplit: 2, hSplit: 2, timeData: true },
{ vSplit: 3, hSplit: 3 },
{ vSplit: 1, hSplit: 3 },
{ vSplit: null, hSplit: 3 },
{ vSplit: 0, hSplit: 3 },
{ vSplit: 3, hSplit: 1 },
{ vSplit: 3, hSplit: 0 },
{ vSplit: 3, hSplit: null },
{ vSplit: 2, hSplit: 2, hiddenTitles: 'axes' },
{ vSplit: 2, hSplit: 2, hiddenTitles: 'panel' },
{ vSplit: 2, hSplit: 2, hiddenTitles: 'both' },
{ vSplit: 2, hSplit: 2, hiddenTitles: 'both', timeData: true },
])(
({ vSplit, hSplit, hiddenTitles, timeData }) => {
const titleText = (hiddenTitles && titleOptions[hiddenTitles]) ?? '';
const timeDataText = timeData ? ' - time data' : '';
return `should render ${vSplit} x ${hSplit} trellis${titleText}${timeDataText}`;
},
async (page, { vSplit, hSplit, density = 30, hiddenTitles, timeData = false }) => {
const showAxesTitles = hiddenTitles !== 'axes' && hiddenTitles !== 'both';
const showPanelTitles = hiddenTitles !== 'panel' && hiddenTitles !== 'both';
await common.expectChartAtUrlToMatchScreenshot(page)(
`http://localhost:9001/?path=/story/small-multiples-alpha--heatmap&globals=background:white;theme:light&knob-Hide_left=true&knob-Hide_right=true&knob-Hide_top=true&knob-Horizontal inner pad=0.1&knob-Horizontal inner pad_SmallMultiples Styles=0.05&knob-Horizontal outer pad=0&knob-Horizontal outer pad_SmallMultiples Styles=0&knob-Persist cells selection=true&knob-Show Legend=true&knob-Show axes title_SmallMultiples Styles=${showAxesTitles}&knob-Show axes panel titles_SmallMultiples Styles=${showPanelTitles}&knob-Show grid line_bottom=true&knob-Show grid line_left=true&knob-Show x axis title_SmallMultiples Styles=true&knob-Show y axis title_SmallMultiples Styles=true&knob-Time data=${timeData}&knob-Title_bottom=Hosts - Bottom&knob-Title_left=Metrics - Left&knob-Title_right=Metrics - Right&knob-Title_top=Hosts - Top&knob-Vertical inner pad=0.3&knob-Vertical inner pad_SmallMultiples Styles=0.1&knob-Vertical outer pad=0&knob-Vertical outer pad_SmallMultiples Styles=0&knob-categories_Data=4&knob-cell%20density(%)_Data=${density}&knob-density(%)_Data=100&knob-density_Data=2&knob-group count_Data=9&knob-h - split count_Data=${
hSplit ?? 0
}&knob-h - split_Data=${Number.isFinite(hSplit)}&knob-number of groups_Data=4&knob-v - split count_Data=${
vSplit ?? 0
}&knob-v - split_Data=${Number.isFinite(
vSplit,
)}&knob-Debug=&knob-Enable debug state=true&knob-cell density(%)_Data=75&knob-xScaleType_Data=linear&knob-Grid stroke_SmallMultiples Styles=1`,
{
waitSelector: (vSplit ?? 1) * (hSplit ?? 1) === 0 ? '.echReactiveChart_noResults' : undefined,
},
);
},
);

test('should render tooltip over correct panel', async ({ page }) => {
await common.expectChartWithMouseAtUrlToMatchScreenshot(page)(
'http://localhost:9001/?path=/story/small-multiples-alpha--heatmap&globals=theme:light&knob-Hide_left=true&knob-Hide_right=true&knob-Hide_top=true&knob-Horizontal inner pad=0.1&knob-Horizontal inner pad_SmallMultiples Styles=0.05&knob-Horizontal outer pad=0&knob-Horizontal outer pad_SmallMultiples Styles=0&knob-Persist cells selection=true&knob-Show Legend=true&knob-Show axes title_SmallMultiples Styles=true&knob-Show axis panel titles=true&knob-Show axis panel titles_SmallMultiples Styles=true&knob-Show grid line_bottom=true&knob-Show grid line_left=true&knob-Show x axis title_SmallMultiples Styles=true&knob-Show y axis title_SmallMultiples Styles=true&knob-Time data=true&knob-Title_bottom=Hosts - Bottom&knob-Title_left=Metrics - Left&knob-Title_right=Metrics - Right&knob-Title_top=Hosts - Top&knob-Vertical inner pad=0.3&knob-Vertical inner pad_SmallMultiples Styles=0.1&knob-Vertical outer pad=0&knob-Vertical outer pad_SmallMultiples Styles=0&knob-categories_Data=4&knob-cell%20density(%)_Data[0]=20&knob-cell%20density(%)_Data[1]=20,60,20,20,50,20,5,25,20,25,50,50,50,50,25,20,20&knob-density(%)_Data=100&knob-density_Data=2&knob-group count_Data=9&knob-h - split count_Data=2&knob-h - split_Data=true&knob-number of groups_Data=4&knob-v - split count_Data=2&knob-v - split_Data=true&knob-Debug=&knob-cell density(%)_Data=100',
{ left: 464, top: 212 },
);
});

test('should constrain brush to active panel', async ({ page }) => {
await common.expectChartWithDragAtUrlToMatchScreenshot(page)(
'http://localhost:9001/?path=/story/small-multiples-alpha--heatmap&globals=background:white;theme:light&knob-Enable%20debug%20state=true&knob-Grid%20stroke_SmallMultiples%20Styles=1&knob-Horizontal%20inner%20pad_SmallMultiples%20Styles=0.05&knob-Horizontal%20outer%20pad_SmallMultiples%20Styles=0&knob-Persist%20cells%20selection=true&knob-Show%20axes%20panel%20titles_SmallMultiples%20Styles=true&knob-Show%20axes%20title_SmallMultiples%20Styles=true&knob-Vertical%20inner%20pad_SmallMultiples%20Styles=0.1&knob-Vertical%20outer%20pad_SmallMultiples%20Styles=0&knob-categories_Data=4&knob-cell%20density(%)_Data=75&knob-h%20-%20split%20count_Data=2&knob-h%20-%20split_Data=true&knob-v%20-%20split%20count_Data=2&knob-v%20-%20split_Data=true&knob-xScaleType_Data=linear',
{ left: 320, top: 100 },
{ left: 630, top: 245 },
);
});

test('should brush panel with time data', async ({ page }) => {
await common.expectChartWithDragAtUrlToMatchScreenshot(page)(
'http://localhost:9001/?path=/story/small-multiples-alpha--heatmap&globals=background:white;theme:light&knob-Hide_left=true&knob-Hide_right=true&knob-Hide_top=true&knob-Horizontal inner pad=0.1&knob-Horizontal inner pad_SmallMultiples Styles=0.05&knob-Horizontal outer pad=0&knob-Horizontal outer pad_SmallMultiples Styles=0&knob-Persist cells selection=true&knob-Show Legend=&knob-Show axes title_SmallMultiples Styles=true&knob-Show axis panel titles=true&knob-Show axis panel titles_SmallMultiples Styles=true&knob-Show grid line_bottom=true&knob-Show grid line_left=true&knob-Show x axis title_SmallMultiples Styles=true&knob-Show y axis title_SmallMultiples Styles=true&knob-Time data=true&knob-Title_bottom=Hosts - Bottom&knob-Title_left=Metrics - Left&knob-Title_right=Metrics - Right&knob-Title_top=Hosts - Top&knob-Vertical inner pad=0.3&knob-Vertical inner pad_SmallMultiples Styles=0.1&knob-Vertical outer pad=0&knob-Vertical outer pad_SmallMultiples Styles=0&knob-categories_Data=4&knob-group count_Data=9&knob-h - split count_Data=2&knob-h - split_Data=true&knob-number of groups_Data=4&knob-v - split count_Data=2&knob-v - split_Data=true&knob-Debug=&knob-Enable debug state=true&knob-xScaleType_Data=linear&knob-Show axes panel titles_SmallMultiples Styles=true&knob-Grid stroke_SmallMultiples Styles=1&knob-cell density(%)_Data=50',
{ left: 520, top: 210 },
{ left: 710, top: 280 },
);
});

test('should select single cell on click with time data', async ({ page }) => {
await common.expectChartWithClickAtUrlToMatchScreenshot(page)(
'http://localhost:9001/?path=/story/small-multiples-alpha--heatmap&globals=background:white;theme:light&knob-Enable debug state=true&knob-Grid stroke_SmallMultiples Styles=1&knob-Hide_left=true&knob-Hide_right=true&knob-Hide_top=true&knob-Horizontal inner pad=0.1&knob-Horizontal inner pad_SmallMultiples Styles=0.05&knob-Horizontal outer pad=0&knob-Horizontal outer pad_SmallMultiples Styles=0&knob-Persist cells selection=true&knob-Show axes panel titles_SmallMultiples Styles=true&knob-Show axes title_SmallMultiples Styles=true&knob-Show axis panel titles=true&knob-Show axis panel titles_SmallMultiples Styles=true&knob-Show grid line_bottom=true&knob-Show grid line_left=true&knob-Show x axis title_SmallMultiples Styles=true&knob-Show y axis title_SmallMultiples Styles=true&knob-Time data=true&knob-Title_bottom=Hosts - Bottom&knob-Title_left=Metrics - Left&knob-Title_right=Metrics - Right&knob-Title_top=Hosts - Top&knob-Vertical inner pad=0.3&knob-Vertical inner pad_SmallMultiples Styles=0.1&knob-Vertical outer pad=0&knob-Vertical outer pad_SmallMultiples Styles=0&knob-categories_Data=4&knob-group count_Data=9&knob-h - split count_Data=2&knob-h - split_Data=true&knob-number of groups_Data=4&knob-v - split count_Data=2&knob-v - split_Data=true&knob-xScaleType_Data=linear&knob-Debug=&knob-Show Legend=&knob-cell density(%)_Data=100',
{ left: 340, top: 250 },
);
});

test('should select single cell on click with categorical data', async ({ page }) => {
await common.expectChartWithClickAtUrlToMatchScreenshot(page)(
'http://localhost:9001/?path=/story/small-multiples-alpha--heatmap&globals=background:white;theme:light&knob-Enable debug state=true&knob-Grid stroke_SmallMultiples Styles=1&knob-Hide_left=true&knob-Hide_right=true&knob-Hide_top=true&knob-Horizontal inner pad=0.1&knob-Horizontal inner pad_SmallMultiples Styles=0.05&knob-Horizontal outer pad=0&knob-Horizontal outer pad_SmallMultiples Styles=0&knob-Persist cells selection=true&knob-Show axes panel titles_SmallMultiples Styles=true&knob-Show axes title_SmallMultiples Styles=true&knob-Show axis panel titles=true&knob-Show axis panel titles_SmallMultiples Styles=true&knob-Show grid line_bottom=true&knob-Show grid line_left=true&knob-Show x axis title_SmallMultiples Styles=true&knob-Show y axis title_SmallMultiples Styles=true&knob-Time data=false&knob-Title_bottom=Hosts - Bottom&knob-Title_left=Metrics - Left&knob-Title_right=Metrics - Right&knob-Title_top=Hosts - Top&knob-Vertical inner pad=0.3&knob-Vertical inner pad_SmallMultiples Styles=0.1&knob-Vertical outer pad=0&knob-Vertical outer pad_SmallMultiples Styles=0&knob-categories_Data=4&knob-group count_Data=9&knob-h - split count_Data=2&knob-h - split_Data=true&knob-number of groups_Data=4&knob-v - split count_Data=2&knob-v - split_Data=true&knob-xScaleType_Data=linear&knob-Debug=&knob-Show Legend=&knob-cell density(%)_Data=100',
{ left: 340, top: 250 },
);
});
});

eachTheme.describe(({ theme, urlParam }) => {
test(`should highlight band on legend hover - ${theme}`, async ({ page }) => {
await common.expectChartWithMouseAtUrlToMatchScreenshot(page)(
Expand Down
Loading