mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
XYChart: Point size editor should reflect correct default (5) (#71126)
fix(xychart): reconcile point size editors
This commit is contained in:
parent
2075dc4f2b
commit
d92d3ede79
@ -12,6 +12,8 @@ import { LineStyleEditor } from '../timeseries/LineStyleEditor';
|
||||
|
||||
import { ScatterFieldConfig, ScatterShow } from './types';
|
||||
|
||||
export const DEFAULT_POINT_SIZE = 5;
|
||||
|
||||
export function getScatterFieldConfig(cfg: ScatterFieldConfig): SetFieldConfigOptionsArgs<ScatterFieldConfig> {
|
||||
return {
|
||||
standardOptions: {
|
||||
@ -72,7 +74,7 @@ export function getScatterFieldConfig(cfg: ScatterFieldConfig): SetFieldConfigOp
|
||||
.addSliderInput({
|
||||
path: 'pointSize.fixed',
|
||||
name: 'Point size',
|
||||
defaultValue: cfg.pointSize?.fixed,
|
||||
defaultValue: cfg.pointSize?.fixed ?? DEFAULT_POINT_SIZE,
|
||||
settings: {
|
||||
min: 1,
|
||||
max: 100,
|
||||
|
@ -14,6 +14,8 @@ import {
|
||||
DimensionSupplier,
|
||||
} from 'app/features/dimensions';
|
||||
|
||||
import { DEFAULT_POINT_SIZE } from './config';
|
||||
|
||||
// export enum ScatterLineMode {
|
||||
// None = 'none',
|
||||
// Linear = 'linear',
|
||||
@ -61,7 +63,7 @@ export const defaultScatterConfig: ScatterFieldConfig = {
|
||||
fill: 'solid',
|
||||
},
|
||||
pointSize: {
|
||||
fixed: 5,
|
||||
fixed: DEFAULT_POINT_SIZE,
|
||||
min: 1,
|
||||
max: 20,
|
||||
},
|
||||
|
@ -28,6 +28,7 @@ import { findFieldIndex, getScaledDimensionForField } from 'app/features/dimensi
|
||||
|
||||
import { pointWithin, Quadtree, Rect } from '../barchart/quadtree';
|
||||
|
||||
import { DEFAULT_POINT_SIZE } from './config';
|
||||
import { isGraphable } from './dims';
|
||||
import {
|
||||
DimensionValues,
|
||||
@ -140,7 +141,7 @@ function getScatterSeries(
|
||||
// Size configs
|
||||
//----------------
|
||||
let pointSizeHints = dims.pointSizeConfig;
|
||||
let pointSizeFixed = dims.pointSizeConfig?.fixed ?? y.config.custom?.pointSize?.fixed ?? 5;
|
||||
let pointSizeFixed = dims.pointSizeConfig?.fixed ?? y.config.custom?.pointSize?.fixed ?? DEFAULT_POINT_SIZE;
|
||||
let pointSize: DimensionValues<number> = () => pointSizeFixed;
|
||||
if (dims.pointSizeIndex) {
|
||||
pointSize = (frame) => {
|
||||
|
Loading…
Reference in New Issue
Block a user