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

fix: add theme min radius to point shape #996

Merged
merged 2 commits into from
Jan 29, 2021
Merged
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
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.
1 change: 0 additions & 1 deletion src/chart_types/xy_chart/rendering/area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export function renderArea(
yScale,
panel,
color,
seriesStyle.line,
seriesStyle.point,
hasY0Accessors,
markSizeOptions,
Expand Down
1 change: 0 additions & 1 deletion src/chart_types/xy_chart/rendering/bubble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export function renderBubble(
panel,
color,
seriesStyle.point,
seriesStyle.point,
hasY0Accessors,
markSizeOptions,
pointStyleAccessor,
Expand Down
1 change: 0 additions & 1 deletion src/chart_types/xy_chart/rendering/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export function renderLine(
yScale,
panel,
color,
seriesStyle.line,
seriesStyle.point,
hasY0Accessors,
markSizeOptions,
Expand Down
12 changes: 6 additions & 6 deletions src/chart_types/xy_chart/rendering/points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Scale } from '../../../scales';
import { Color, isNil } from '../../../utils/common';
import { Dimensions } from '../../../utils/dimensions';
import { BandedAccessorType, PointGeometry } from '../../../utils/geometry';
import { LineStyle, PointStyle } from '../../../utils/themes/theme';
import { PointStyle } from '../../../utils/themes/theme';
import { GeometryType, IndexedGeometryMap } from '../utils/indexed_geometry_map';
import { DataSeries, DataSeriesDatum, FilledValues, XYChartSeriesIdentifier } from '../utils/series';
import { PointStyleAccessor, StackMode } from '../utils/specs';
Expand All @@ -35,8 +35,6 @@ import {
YDefinedFn,
} from './utils';

const DEFAULT_RADIUS = 1;

/** @internal */
export function renderPoints(
shift: number,
Expand All @@ -45,7 +43,6 @@ export function renderPoints(
yScale: Scale,
panel: Dimensions,
color: Color,
lineStyle: LineStyle,
pointStyle: PointStyle,
hasY0Accessors: boolean,
markSizeOptions: MarkSizeOptions,
Expand Down Expand Up @@ -113,11 +110,14 @@ export function renderPoints(
const styleOverrides = getPointStyleOverrides(datum, seriesIdentifier, styleAccessor);
const style = buildPointGeometryStyles(color, pointStyle, styleOverrides);
const orphan = isOrphanDataPoint(dataIndex, dataSeries.data.length, yDefined, prev, next);
const radius = markSizeOptions.enabled ? getRadius(mark) : styleOverrides?.radius ?? pointStyle.radius;
// if radius is defined with the mark, limit the minimum radius to the theme radius value
const radius = markSizeOptions.enabled
? Math.max(getRadius(mark), pointStyle.radius)
: styleOverrides?.radius ?? pointStyle.radius;
const pointGeometry: PointGeometry = {
x,
y,
radius: Math.max(radius, DEFAULT_RADIUS),
radius,
color,
style,
value: {
Expand Down