-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9238946
commit faebcc7
Showing
18 changed files
with
289 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<template> | ||
<path stroke="red" fill="transparent" :d="path"></path> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import useData from '@/composables/useData'; | ||
import useGanttWidth from '@/composables/useGanttWidth'; | ||
import useStyle from '@/composables/useStyle'; | ||
import { LinkItem } from '@/models/data/links'; | ||
import { computed, PropType } from 'vue'; | ||
const props = defineProps({ | ||
link: { | ||
type: Object as PropType<LinkItem>, | ||
default: () => ({}) | ||
} | ||
}); | ||
const { $data } = useData(); | ||
const { ganttColumnWidth, currentMillisecond } = useGanttWidth(); | ||
const { rowHeight } = useStyle(); | ||
const x = computed( | ||
() => | ||
(props.link.fromRow.end.intervalTo($data.start) / | ||
currentMillisecond.value) * | ||
ganttColumnWidth.value | ||
); | ||
const y = computed( | ||
() => props.link.fromRow.flatIndex * rowHeight.value + rowHeight.value / 2 | ||
); | ||
const x2 = computed( | ||
() => | ||
(props.link.toRow.start.intervalTo($data.start) / | ||
currentMillisecond.value) * | ||
ganttColumnWidth.value | ||
); | ||
const y2 = computed( | ||
() => props.link.toRow.flatIndex * rowHeight.value + rowHeight.value / 2 | ||
); | ||
const path = computed( | ||
() => | ||
`M ${x.value + 10} ${y.value} H ${x.value + 50} V ${ | ||
y.value + rowHeight.value / 2 | ||
} H ${x2.value - 10} V ${y2.value}` | ||
); | ||
</script> | ||
|
||
<style scoped lang="scss"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.