Skip to content
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
53 changes: 33 additions & 20 deletions packages/charts/api/charts.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ export interface AngleFromTo {
x1: Radian;
}

// @alpha (undocumented)
export interface AnimKeyframe {
// (undocumented)
easingFunction: EasingFunction;
// Warning: (ae-forgotten-export) The symbol "StaticConfig" needs to be exported by the entry point index.d.ts
//
// (undocumented)
keyframeConfig: Partial<StaticConfig>;
// (undocumented)
time: number;
}

// @public
export const AnnotationDomainType: Readonly<{
XDomain: "xDomain";
Expand Down Expand Up @@ -607,23 +619,9 @@ export const DEFAULT_ANNOTATION_LINE_STYLE: LineAnnotationStyle;
// @public (undocumented)
export const DEFAULT_ANNOTATION_RECT_STYLE: RectAnnotationStyle;

// Warning: (ae-forgotten-export) The symbol "Margins" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const DEFAULT_CHART_MARGINS: Margins;

// @public (undocumented)
export const DEFAULT_CHART_PADDING: Margins;

// @public (undocumented)
export const DEFAULT_GEOMETRY_STYLES: SharedGeometryStateStyle;

// @public
export const DEFAULT_GLOBAL_ID = "__global__";

// @public (undocumented)
export const DEFAULT_MISSING_COLOR = "red";

// @public (undocumented)
export const DEFAULT_SETTINGS_SPEC: SettingsSpec;

Expand Down Expand Up @@ -697,6 +695,9 @@ export type DomainPaddingUnit = $Values<typeof DomainPaddingUnit>;
// @public (undocumented)
export type DomainRange = LowerBoundedDomain | UpperBoundedDomain | CompleteBoundedDomain | UnboundedDomainWithInterval;

// @alpha (undocumented)
export type EasingFunction = (x: Ratio) => Ratio;

// @public (undocumented)
export type ElementClickListener = (elements: Array<XYChartElementEvent | PartitionElementEvent | HeatmapElementEvent | WordCloudElementEvent>) => void;

Expand Down Expand Up @@ -1349,6 +1350,9 @@ export interface LogScaleOptions {
// @public (undocumented)
export type LowerBoundedDomain = DomainBase & LowerBound;

// @public
export type Margins = PerSideDistance;

// @public
export type MarkBuffer = number | ((radius: number) => number);

Expand Down Expand Up @@ -1413,8 +1417,6 @@ export type OrdinalDomain = (number | string)[];
// @public (undocumented)
export type OutOfRoomCallback = (wordCount: number, renderedWordCount: number, renderedWords: string[]) => void;

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

Expand All @@ -1433,8 +1435,6 @@ export type PartialTheme = RecursivePartial<Theme>;
// @public (undocumented)
export const Partition: React_2.FunctionComponent<SpecRequiredProps_7 & SpecOptionalProps_7>;

// Warning: (ae-forgotten-export) The symbol "StaticConfig" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export interface PartitionConfig extends StaticConfig {
// @alpha (undocumented)
Expand Down Expand Up @@ -1494,6 +1494,18 @@ export const PATH_KEY = "path";
// @public (undocumented)
export function pathAccessor(n: ArrayEntry): LegendPath;

// @public
export interface PerSideDistance {
// (undocumented)
bottom: number;
// (undocumented)
left: number;
// (undocumented)
right: number;
// (undocumented)
top: number;
}

// @public
export const Placement: Readonly<{
Top: "top";
Expand Down Expand Up @@ -2135,6 +2147,9 @@ export type TickStyle = StrokeStyle & Visible & {
// @public (undocumented)
export function timeFormatter(format: string): TickFormatter;

// @public (undocumented)
export type TimeMs = number;

// @public
export function toEntries<T extends Record<string, string>, S>(array: T[], accessor: keyof T, staticValue: S): Record<string, S>;

Expand Down Expand Up @@ -2417,8 +2432,6 @@ export type YDomainRange = YDomainBase & DomainRange & LogScaleOptions;
// src/chart_types/heatmap/layout/types/config_types.ts:20: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:51: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:52: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:139: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:140:5 - (ae-forgotten-export) The symbol "AnimKeyframe" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/

import { Color } from '../../../../common/color';
import { Pixels, SizeRatio } from '../../../../common/geometry';
import { FontFamily } from '../../../../common/text_utils';
import { Color } from '../../../../utils/common';

// todo switch to `io-ts` style, generic way of combining static and runtime type info
/** @public */
Expand Down
3 changes: 2 additions & 1 deletion packages/charts/src/chart_types/goal_chart/specs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import React from 'react';

import { ChartType } from '../..';
import { Color } from '../../../common/color';
import { Spec } from '../../../specs';
import { SpecType } from '../../../specs/constants';
import { getConnect, specComponentFactory } from '../../../state/spec_factory';
import { Color, LabelAccessor, RecursivePartial } from '../../../utils/common';
import { LabelAccessor, RecursivePartial } from '../../../utils/common';
import { Config } from '../layout/types/config_types';
import { defaultGoalSpec } from '../layout/types/viewmodel_types';
import { GoalSubtype } from './constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { Colors } from '../../../../common/color';
import { TooltipInfo } from '../../../../components/tooltip/types';
import { createCustomCachedSelector } from '../../../../state/create_selector';
import { BandViewModel } from '../../layout/types/viewmodel_types';
Expand All @@ -20,7 +21,7 @@ const EMPTY_TOOLTIP = Object.freeze({
const getBandColor = (value: number, bands: BandViewModel[]) =>
bands.find(({ value: v }) => {
return v >= value;
})?.fillColor ?? 'white';
})?.fillColor ?? Colors.White.rgba;

/** @internal */
export const getTooltipInfoSelector = createCustomCachedSelector(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { Colors } from '../../../../common/color';
import { Config } from '../types/config_types';

/** @internal */
Expand All @@ -22,7 +23,7 @@ export const config: Config = {

brushArea: {
visible: true,
fill: 'black', // black === transparent
fill: Colors.Black.rgba,
stroke: '#69707D', // euiColorDarkShade,
strokeWidth: 2,
},
Expand All @@ -44,7 +45,7 @@ export const config: Config = {
fontSize: 12,
fontFamily: 'Sans-Serif',
fontStyle: 'normal',
textColor: 'black',
textColor: Colors.Black.rgba,
fontVariant: 'normal',
fontWeight: 'normal',
textOpacity: 1,
Expand All @@ -60,7 +61,7 @@ export const config: Config = {
fontSize: 12,
fontFamily: 'Sans-Serif',
fontStyle: 'normal',
textColor: 'black',
textColor: Colors.Black.rgba,
fontVariant: 'normal',
fontWeight: 'normal',
textOpacity: 1,
Expand Down Expand Up @@ -92,7 +93,7 @@ export const config: Config = {
fontSize: 10,
fontFamily: 'Sans-Serif',
fontStyle: 'normal',
textColor: 'black',
textColor: Colors.Black.rgba,
fontVariant: 'normal',
fontWeight: 'normal',
textOpacity: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/

import { Color } from '../../../../common/color';
import { Pixels, SizeRatio } from '../../../../common/geometry';
import { Font, FontFamily, TextAlign, TextBaseline } from '../../../../common/text_utils';
import { Color } from '../../../../utils/common';
import { Cell } from './viewmodel_types';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { Colors } from '../../../../common/color';
import { Font } from '../../../../common/text_utils';
import { clearCanvas, renderLayers, withContext } from '../../../../renderers/canvas';
import { renderMultiLine } from '../../../xy_chart/renderer/canvas/primitives/line';
Expand Down Expand Up @@ -92,7 +93,7 @@ export function renderCanvas2d(
fontStyle: config.yAxisLabel.fontStyle ? config.yAxisLabel.fontStyle : 'normal',
fontVariant: 'normal',
fontWeight: 'normal',
textColor: 'black',
textColor: Colors.Black.rgba,
textOpacity: 1,
};
const { padding } = config.yAxisLabel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
* Side Public License, v 1.
*/

import { Colors } from '../../../common/color';
import { getPredicateFn } from '../../../common/predicate';
import { Color, safeFormat, ValueFormatter } from '../../../utils/common';
import { safeFormat, ValueFormatter } from '../../../utils/common';
import { ColorBand, HeatmapBandsColorScale } from '../specs/heatmap';
import { ColorScale } from '../state/selectors/get_color_scale';

const TRANSPARENT_COLOR: Color = 'rgba(0, 0, 0, 0)';

function defaultColorBandFormatter(valueFormatter?: ValueFormatter) {
return (startValue: number, endValue: number) => {
const finiteStart = Number.isFinite(startValue);
Expand Down Expand Up @@ -50,6 +49,6 @@ function getBandScale(bands: ColorBand[]): ColorScale {
return color;
}
}
return TRANSPARENT_COLOR;
return Colors.Transparent.rgba;
};
}
3 changes: 2 additions & 1 deletion packages/charts/src/chart_types/heatmap/specs/heatmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
import React from 'react';

import { ChartType } from '../..';
import { Color } from '../../../common/color';
import { Predicate } from '../../../common/predicate';
import { ScaleType } from '../../../scales/constants';
import { SeriesScales, Spec } from '../../../specs';
import { SpecType } from '../../../specs/constants';
import { getConnect, specComponentFactory } from '../../../state/spec_factory';
import { Accessor, AccessorFn } from '../../../utils/accessor';
import { Color, Datum, RecursivePartial } from '../../../utils/common';
import { Datum, RecursivePartial } from '../../../utils/common';
import { config } from '../layout/config/config';
import { Config } from '../layout/types/config_types';
import { X_SCALE_DEFAULT } from './scale_defaults';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Side Public License, v 1.
*/

import { Color } from '../../../../common/color';
import { createCustomCachedSelector } from '../../../../state/create_selector';
import { Color } from '../../../../utils/common';
import { getBandsColorScale } from '../../scales/band_color_scale';
import { ColorBand } from '../../specs/heatmap';
import { getHeatmapSpecSelector } from './get_heatmap_spec';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { Colors } from '../../../../common/color';
import { RGBtoString } from '../../../../common/color_library_wrappers';
import { TooltipInfo } from '../../../../components/tooltip/types';
import { createCustomCachedSelector } from '../../../../state/create_selector';
Expand Down Expand Up @@ -38,7 +39,7 @@ export const getTooltipInfoSelector = createCustomCachedSelector(
// X-axis value
tooltipInfo.values.push({
label: config.xAxisLabel.name,
color: 'transparent',
color: Colors.Transparent.rgba,
isHighlighted: false,
isVisible: true,
seriesIdentifier: {
Expand All @@ -53,7 +54,7 @@ export const getTooltipInfoSelector = createCustomCachedSelector(
// Y-axis value
tooltipInfo.values.push({
label: config.yAxisLabel.name,
color: 'transparent',
color: Colors.Transparent.rgba,
isHighlighted: false,
isVisible: true,
seriesIdentifier: {
Expand Down Expand Up @@ -83,7 +84,7 @@ export const getTooltipInfoSelector = createCustomCachedSelector(
} else {
tooltipInfo.values.push({
label: ``,
color: 'transparent',
color: Colors.Transparent.rgba,
isHighlighted: false,
isVisible: true,
seriesIdentifier: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

import { $Values as Values } from 'utility-types';

import { Color } from '../../../../common/color';
import { Distance, Pixels, Radian, Radius, Ratio, SizeRatio, TimeMs } from '../../../../common/geometry';
import { Font, FontFamily, PartialFont, TextContrast } from '../../../../common/text_utils';
import { Color, StrokeStyle, ValueFormatter } from '../../../../utils/common';
import { StrokeStyle, ValueFormatter } from '../../../../utils/common';
import { PerSideDistance } from '../../../../utils/dimensions';

/** @public */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import { CategoryKey } from '../../../../common/category';
import { Colors, Color } from '../../../../common/color';
import {
Coordinate,
Distance,
Expand All @@ -20,7 +21,6 @@ import {
import { Font, VerticalAlignments } from '../../../../common/text_utils';
import { GroupByAccessor } from '../../../../specs';
import { LegendPath } from '../../../../state/actions/legend';
import { Color } from '../../../../utils/common';
import { ContinuousDomainFocus } from '../../renderer/canvas/partition';
import { Layer } from '../../specs';
import { config, MODEL_KEY, ValueGetterName } from '../config';
Expand Down Expand Up @@ -140,7 +140,7 @@ const defaultFont: Font = {
fontVariant: 'normal',
fontFamily: '',
fontWeight: 'normal',
textColor: 'black',
textColor: Colors.Black.rgba,
textOpacity: 1,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { Color } from '../../../../common/color';
import { getOnPaperColorSet } from '../../../../common/color_calcs';
import { TAU } from '../../../../common/constants';
import {
Expand All @@ -17,7 +18,7 @@ import {
trueBearingToStandardPositionAngle,
} from '../../../../common/geometry';
import { cutToLength, fitText, Font, measureOneBoxWidth, TextMeasure } from '../../../../common/text_utils';
import { Color, ValueFormatter } from '../../../../utils/common';
import { ValueFormatter } from '../../../../utils/common';
import { Point } from '../../../../utils/point';
import { Config, LinkLabelConfig } from '../types/config_types';
import { LinkLabelVM, RawTextGetter, ShapeTreeNode, ValueGetterFunction } from '../types/viewmodel_types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
* Side Public License, v 1.
*/

import { Color } from '../../../../common/color';
import { measureText } from '../../../../common/text_utils';
import { SmallMultiplesStyle } from '../../../../specs';
import { Color, identity, mergePartial, RecursivePartial } from '../../../../utils/common';
import { identity, mergePartial, RecursivePartial } from '../../../../utils/common';
import { Dimensions } from '../../../../utils/dimensions';
import { Layer, PartitionSpec } from '../../specs';
import { config as defaultConfig, VALUE_GETTERS } from '../config';
Expand Down
Loading