Skip to content

Commit

Permalink
fix: add theme min radius to point shape (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 authored Jan 29, 2021
1 parent 1392b7d commit eb37175
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 9 deletions.
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

0 comments on commit eb37175

Please sign in to comment.