fix: mistake graph on scroll
This commit is contained in:
parent
6482598841
commit
e2adbbb25e
@ -348,7 +348,6 @@ function CsComponent({
|
||||
|
||||
|
||||
const readyLO = (e) => {
|
||||
console.log('REAdy')
|
||||
if (e.cy.data('firstNode') === 'nonroot') {
|
||||
e.cy.data('firstNode', 'root')
|
||||
e.cy.nodes().sort((a, b) => (a.data('root') ? 1 : -1)).layout(lyopts).run()
|
||||
@ -433,7 +432,6 @@ function CsComponent({
|
||||
task.task.forEach(n => {
|
||||
const width = n.data('subtreeWidth')
|
||||
|
||||
console.log('ORORORORO', n.data(), yoffset, width, oldPos, task.parent.data('subtreeWidth'))
|
||||
n.data('oldPos', { x: 250 * n.data('layer'), y: yoffset + width / 2 })
|
||||
yoffset += width
|
||||
queue.push({ task: n.cy().edges(`[source="${n.id()}"]`).targets(), parent: n })
|
||||
@ -462,7 +460,6 @@ function CsComponent({
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log('KEKEKE')
|
||||
document.querySelector("#root")?.addEventListener("mouseup", cleardragQuestionContentId);
|
||||
const cy = cyRef.current;
|
||||
const eles = cy?.add(storeToNodes(questions.filter((question: AnyTypedQuizQuestion) => (question.type !== "result" && question.type !== null))))
|
||||
@ -510,7 +507,6 @@ function CsComponent({
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
console.log('POP')
|
||||
|
||||
container.style.overflow = "hidden";
|
||||
|
||||
@ -540,7 +536,6 @@ function CsComponent({
|
||||
const bb = n.boundingBox()
|
||||
return bb.x2 > ext.x1 && bb.x1 < ext.x2 && bb.y2 > ext.y1 && bb.y1 < ext.y2
|
||||
})
|
||||
console.log('POPE')
|
||||
|
||||
nodesInView
|
||||
.toArray()
|
||||
@ -553,7 +548,6 @@ function CsComponent({
|
||||
modifiers: [{ name: "flip", options: { boundary: node } }],
|
||||
},
|
||||
content: ([item]) => {
|
||||
console.log('POPPER', item.id())
|
||||
const itemId = item.id();
|
||||
const itemElement = layoutsContainer.current?.querySelector(
|
||||
`.popper-layout[data-id='${itemId}']`
|
||||
@ -583,7 +577,6 @@ function CsComponent({
|
||||
modifiers: [{ name: "flip", options: { boundary: node } }],
|
||||
},
|
||||
content: ([item]) => {
|
||||
console.log('POPPER+', item.id())
|
||||
const itemId = item.id();
|
||||
const itemElement = plusesContainer.current?.querySelector(
|
||||
`.popper-plus[data-id='${itemId}']`
|
||||
@ -612,7 +605,6 @@ function CsComponent({
|
||||
modifiers: [{ name: "flip", options: { boundary: node } }],
|
||||
},
|
||||
content: ([item]) => {
|
||||
console.log('POPPERx', item.id())
|
||||
const itemId = item.id();
|
||||
const itemElement = crossesContainer.current?.querySelector(
|
||||
`.popper-cross[data-id='${itemId}']`
|
||||
@ -643,11 +635,7 @@ function CsComponent({
|
||||
modifiers: [{ name: "flip", options: { boundary: node } }],
|
||||
},
|
||||
content: ([item]) => {
|
||||
console.log('POPPERg', item.id())
|
||||
const itemId = item.id();
|
||||
if (item.cy().edges(`[target="${itemId}"]`).sources().length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const itemElement = gearsContainer.current?.querySelector(
|
||||
`.popper-gear[data-id='${itemId}']`
|
||||
@ -670,7 +658,6 @@ function CsComponent({
|
||||
});
|
||||
|
||||
const update = async () => {
|
||||
console.log('POPPERi=u', item.id())
|
||||
await plusesPopper.update();
|
||||
await crossesPopper.update();
|
||||
await gearsPopper.update();
|
||||
@ -696,6 +683,18 @@ function CsComponent({
|
||||
{ name: "offset", options: { offset: [0, -130 * zoom] } },
|
||||
],
|
||||
});
|
||||
plusesPopper.setOptions({
|
||||
modifiers: [
|
||||
{ name: "flip", options: { boundary: node } },
|
||||
{ name: "offset", options: { offset: [0, 0 * zoom] } },
|
||||
],
|
||||
});
|
||||
gearsPopper.setOptions({
|
||||
modifiers: [
|
||||
{ name: "flip", options: { boundary: node } },
|
||||
{ name: "offset", options: { offset: [0, 0] } },
|
||||
],
|
||||
});
|
||||
|
||||
layoutsContainer.current
|
||||
?.querySelectorAll("#popper-layouts > .popper-layout")
|
||||
@ -785,7 +784,7 @@ let pressed = false
|
||||
variant="text"
|
||||
onClick={() => {
|
||||
|
||||
//код сюда
|
||||
cyRef.current?.fit()
|
||||
|
||||
}}
|
||||
>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user