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
11 changes: 9 additions & 2 deletions src/components/Plan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { findNodeById } from "@/services/help-service"
import { HighlightType, NodeProp } from "@/enums"
import { json_, pgsql_ } from "@/filters"
import { setDefaultProps } from "vue-tippy"
import { store } from "@/store.ts"
import { store } from "@/store"

setDefaultProps({
theme: "bootstrap",
Expand Down Expand Up @@ -107,7 +107,7 @@ const layout = flextree({
) => Math.pow(nodeA.path(nodeB).length, 1.5),
})

const tree = ref(layout.hierarchy({}))
const tree = ref<FlexHierarchyPointNode<Node>>()
Comment thread
pgiraud marked this conversation as resolved.

onMounted(() => {
watch(() => [props.planSource, props.planQuery], parseAndShow, {
Expand Down Expand Up @@ -146,6 +146,10 @@ function parseAndShow() {
}

function doLayout() {
if (tree.value === undefined){
return
}

layoutRootNode.value = layout(tree.value)

const mainLayoutExtent = getLayoutExtent(layoutRootNode.value)
Expand Down Expand Up @@ -378,6 +382,9 @@ function isNeverExecuted(node: Node): boolean {

watch(
() => {
if (tree.value === undefined) {
return
}
Comment thread
MarionGiusti marked this conversation as resolved.
const data: [number, number][] = []
data.concat(
tree.value
Expand Down
4 changes: 2 additions & 2 deletions src/d3-flextree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ declare module "d3-flextree" {
*
* @param root The specified root hierarchy.
*/
(root: FlexHierarchiePointNode<Datum>): FlexHierarchyPointNode<Datum>
(root: FlexHierarchyPointNode<Datum>): FlexHierarchyPointNode<Datum>

hierarchy<Datum>(
data: Datum,
children?: (d: Datum) => Iterable<Datum> | null | undefined,
): FlexHierarchiePointNode<Datum>
): FlexHierarchyPointNode<Datum>
}
}
Loading