Skip to content

Commit

Permalink
feat(heatmap): allow fixed right margin (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 authored Oct 19, 2020
1 parent b6efdf8 commit 16cf73c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ export interface HeatmapConfig {
xAxisLabel: Font & {
name: string;
fontSize: Pixels;
width: Pixels | 'auto';
fill: string;
align: TextAlign;
baseline: TextBaseline;
Expand Down Expand Up @@ -1889,8 +1890,8 @@ export type YDomainRange = YDomainBase & DomainRange;
// Warnings were encountered during analysis:
//
// src/chart_types/heatmap/layout/types/config_types.ts:28:13 - (ae-forgotten-export) The symbol "SizeRatio" needs to be exported by the entry point index.d.ts
// src/chart_types/heatmap/layout/types/config_types.ts:59:5 - (ae-forgotten-export) The symbol "TextAlign" needs to be exported by the entry point index.d.ts
// src/chart_types/heatmap/layout/types/config_types.ts:60:5 - (ae-forgotten-export) The symbol "TextBaseline" needs to be exported by the entry point index.d.ts
// src/chart_types/heatmap/layout/types/config_types.ts:60:5 - (ae-forgotten-export) The symbol "TextAlign" needs to be exported by the entry point index.d.ts
// src/chart_types/heatmap/layout/types/config_types.ts:61:5 - (ae-forgotten-export) The symbol "TextBaseline" needs to be exported by the entry point index.d.ts
// src/chart_types/partition_chart/layout/types/config_types.ts:126:5 - (ae-forgotten-export) The symbol "TimeMs" needs to be exported by the entry point index.d.ts
// src/chart_types/partition_chart/layout/types/config_types.ts:127:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts
// src/chart_types/partition_chart/specs/index.ts:48:13 - (ae-forgotten-export) The symbol "NodeColorAccessor" needs to be exported by the entry point index.d.ts
Expand Down
1 change: 1 addition & 0 deletions src/chart_types/heatmap/layout/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const config: Config = {
xAxisLabel: {
name: 'X Value',
visible: true,
width: 'auto',
fill: 'black',
fontSize: 12,
fontFamily: 'Sans-Serif',
Expand Down
1 change: 1 addition & 0 deletions src/chart_types/heatmap/layout/types/config_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export interface Config {
xAxisLabel: Font & {
name: string;
fontSize: Pixels;
width: Pixels | 'auto';
fill: string;
align: TextAlign;
baseline: TextBaseline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ import { getHeatmapTableSelector } from './get_heatmap_table';
*/
export const getXAxisRightOverflow = createCachedSelector(
[getHeatmapConfigSelector, getHeatmapTableSelector],
({ xAxisLabel: { fontSize, fontFamily, padding, formatter }, timeZone }, { xDomain }): number => {
({ xAxisLabel: { fontSize, fontFamily, padding, formatter, width }, timeZone }, { xDomain }): number => {
if (xDomain.scaleType !== ScaleType.Time) {
return 0;
}
if (typeof width === 'number') {
return width / 2;
}

const timeScale = new ScaleContinuous(
{
type: ScaleType.Time,
Expand Down

0 comments on commit 16cf73c

Please sign in to comment.