Skip to content

Commit

Permalink
opt: opt overlay default style
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Nov 5, 2023
1 parent 5232934 commit 3380a19
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 27 deletions.
12 changes: 6 additions & 6 deletions src/common/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,14 @@ function getDefaultOverlayStyle (): OverlayStyle {
weight: 'normal',
borderStyle: LineType.Solid,
borderDashedValue: [2, 2],
borderSize: 0,
borderSize: 1,
borderRadius: 2,
borderColor: '#1677FF',
paddingLeft: 0,
paddingRight: 0,
paddingTop: 0,
paddingBottom: 0,
backgroundColor: 'transparent'
paddingLeft: 4,
paddingRight: 4,
paddingTop: 4,
paddingBottom: 4,
backgroundColor: '#1677FF'
},
rectText: {
style: PolygonType.Fill,
Expand Down
7 changes: 6 additions & 1 deletion src/extension/overlay/priceLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ const priceLine: OverlayTemplate = {
{
type: 'text',
ignoreEvent: true,
attrs: { x: coordinates[0].x, y: coordinates[0].y, text: formatThousands(value.toFixed(precision.price), thousandsSeparator), baseline: 'bottom' }
attrs: {
x: coordinates[0].x,
y: coordinates[0].y,
text: formatThousands(value.toFixed(precision.price), thousandsSeparator),
baseline: 'bottom'
}
}
]
}
Expand Down
10 changes: 0 additions & 10 deletions src/extension/overlay/simpleAnnotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ const simpleAnnotation: OverlayTemplate = {
name: 'simpleAnnotation',
totalStep: 2,
styles: {
text: {
borderSize: 1,
borderRadius: 2,
borderColor: '#1677FF',
paddingLeft: 4,
paddingRight: 4,
paddingTop: 4,
paddingBottom: 4,
backgroundColor: '#1677FF'
},
line: { style: LineType.Dashed }
},
createPointFigures: ({ overlay, coordinates }) => {
Expand Down
13 changes: 3 additions & 10 deletions src/extension/overlay/simpleTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,13 @@ import { OverlayTemplate } from '../../component/Overlay'

import { isFunction, isValid } from '../../common/utils/typeChecks'

import { LineType } from '../../common/Options'

const simpleTag: OverlayTemplate = {
name: 'simpleTag',
totalStep: 2,
styles: {
text: {
borderSize: 1,
borderRadius: 2,
borderColor: '#1677FF',
paddingLeft: 4,
paddingRight: 4,
paddingTop: 4,
paddingBottom: 4,
backgroundColor: '#1677FF'
}
line: { style: LineType.Dashed }
},
createPointFigures: ({ bounding, coordinates }) => {
return {
Expand Down

1 comment on commit 3380a19

@liihuu
Copy link
Member Author

@liihuu liihuu commented on 3380a19 Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.