Skip to content

Commit 58d5f5b

Browse files
Kinplemelonysfscream
authored andcommitted
refactor(overview): remove special styles for single node
1 parent b3a427c commit 58d5f5b

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

src/hooks/Overview/useNodesGraph.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,14 @@ export interface FlowEdgeData {
2727
export type FlowDataItem = FlowNodeData | FlowEdgeData
2828

2929
export const useCoreNodeSize = (): {
30-
OUTER_SIDE_MULTIPLES: number
3130
INNER_SIDE_MULTIPLES: number
3231
coreNodeHeight: Ref<number>
3332
coreNodeWidth: Ref<number>
3433
SVGHeight: Ref<number>
3534
SVGWidth: Ref<number>
3635
setCoreNodeHeight: (height: number) => void
3736
} => {
38-
const OUTER_SIDE_MULTIPLES = 2
39-
const INNER_SIDE_MULTIPLES = 1 + (OUTER_SIDE_MULTIPLES - 1) / 2
37+
const INNER_SIDE_MULTIPLES = 1.5
4038

4139
const coreNodeHeight = ref(0)
4240
const coreNodeWidth = ref(0)
@@ -49,11 +47,11 @@ export const useCoreNodeSize = (): {
4947
}
5048

5149
const countSVGWidth = () => {
52-
return coreNodeWidth.value * OUTER_SIDE_MULTIPLES
50+
return coreNodeWidth.value * INNER_SIDE_MULTIPLES
5351
}
5452

5553
const countSVGHeight = () => {
56-
return coreNodeHeight.value * OUTER_SIDE_MULTIPLES
54+
return coreNodeHeight.value * INNER_SIDE_MULTIPLES
5755
}
5856

5957
// Height in non-active state (outer circle diameter)
@@ -65,7 +63,6 @@ export const useCoreNodeSize = (): {
6563
}
6664

6765
return {
68-
OUTER_SIDE_MULTIPLES,
6966
INNER_SIDE_MULTIPLES,
7067
coreNodeHeight,
7168
coreNodeWidth,

src/views/Dashboard/components/CoreNode.vue

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
</defs>
1111
<g>
1212
<g v-if="isSelected">
13-
<polygon
14-
v-if="nodesNum === 1"
15-
:points="getPoints(OUTER_SIDE_MULTIPLES)"
16-
:fill="`url(#${id})`"
17-
opacity="0.3"
18-
/>
1913
<polygon :points="getPoints(INNER_SIDE_MULTIPLES)" :fill="`url(#${id})`" opacity="0.6" />
2014
</g>
2115
<polygon :points="getPoints()" :fill="`url(#${id})`" @mouseenter="selectNode" />
@@ -31,13 +25,7 @@ import { PropType, computed, defineProps, watch, defineEmits } from 'vue'
3125
import { Handle } from '@vue-flow/core'
3226
import { NodeStatus } from '@/types/enum'
3327
34-
const {
35-
OUTER_SIDE_MULTIPLES,
36-
INNER_SIDE_MULTIPLES,
37-
coreNodeHeight,
38-
coreNodeWidth,
39-
setCoreNodeHeight,
40-
} = useCoreNodeSize()
28+
const { INNER_SIDE_MULTIPLES, coreNodeHeight, coreNodeWidth, setCoreNodeHeight } = useCoreNodeSize()
4129
4230
const props = defineProps({
4331
height: {

0 commit comments

Comments
 (0)