Skip to content
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
2 changes: 1 addition & 1 deletion src/chart/effectScatter/EffectScatterSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type ScatterDataValue = OptionDataValue | OptionDataValue[];
interface EffectScatterStatesOptionMixin {
emphasis?: {
focus?: DefaultEmphasisFocus
scale?: boolean
scale?: boolean | number
}
}
export interface EffectScatterStateOption<TCbParams = never> {
Expand Down
8 changes: 4 additions & 4 deletions src/chart/helper/Symbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ColorString, BlurScope, AnimationOption, ZRColor, AnimationOptionMixin
import SeriesModel from '../../model/Series';
import { PathProps } from 'zrender/src/graphic/Path';
import { SymbolDrawSeriesScope, SymbolDrawItemModelOption } from './SymbolDraw';
import { extend } from 'zrender/src/core/util';
import { extend, isNumber } from 'zrender/src/core/util';
import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle';
import ZRImage from 'zrender/src/graphic/Image';
import { saveOldStyle } from '../../animation/basicTrasition';
Expand Down Expand Up @@ -221,8 +221,8 @@ class Symbol extends graphic.Group {

let labelStatesModels;

let hoverScale;
let cursorStyle;
let hoverScale: SymbolDrawSeriesScope['hoverScale'];
let cursorStyle: SymbolDrawSeriesScope['cursorStyle'];

if (seriesScope) {
emphasisItemStyle = seriesScope.emphasisItemStyle;
Expand Down Expand Up @@ -337,7 +337,7 @@ class Symbol extends graphic.Group {
symbolPath.ensureState('blur').style = blurItemStyle;

if (hoverScale) {
const scaleRatio = Math.max(1.1, 3 / this._sizeY);
const scaleRatio = Math.max(isNumber(hoverScale) ? hoverScale : 1.1, 3 / this._sizeY);
emphasisState.scaleX = this._sizeX * scaleRatio;
emphasisState.scaleY = this._sizeY * scaleRatio;
}
Expand Down
4 changes: 2 additions & 2 deletions src/chart/helper/SymbolDraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export interface SymbolDrawItemModelOption extends SymbolOptionMixin<object>,
StatesOptionMixin<SymbolDrawStateOption, {
emphasis?: {
focus?: DefaultEmphasisFocus
scale?: boolean
scale?: boolean | number
}
}>,
SymbolDrawStateOption {
Expand All @@ -127,7 +127,7 @@ export interface SymbolDrawSeriesScope {

itemModel?: Model<SymbolDrawItemModelOption>

hoverScale?: boolean
hoverScale?: boolean | number

cursorStyle?: string
fadeIn?: boolean
Expand Down
1 change: 1 addition & 0 deletions test/scatter.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.