anseki / leader-line

Draw a leader line in your web page.
http://anseki.github.io/leader-line/
MIT License
3.03k stars 425 forks source link

How to combine two points with one point #375

Closed yuleiQ closed 2 years ago

yuleiQ commented 2 years ago

image

Look at the picture,how to combine two points with one point? thanks

yuleiQ commented 2 years ago

@anseki My data structure is

list: [
        {
          name: '1',
          isParent: true,
          children: [
            {
              name: '2',
              steps: ['check'],
              children: [
                {
                  name: '3',
                  steps: ['clone', 'cache'],
                  children: [
                    {
                      name: '4',
                      steps: ['uncache', 'sonar-properties-create', 'sonar-scan', 'collect-result'],
                      children: [
                        {
                          name: '51,
                          steps: ['uncache', 'build-and-push', 'write-url'],
                          children: [{
                              name: '6',
                              steps: ['deploy'],
                          }],
                        },
                        {
                          name: '52',
                          steps: ['uncache', 'build-and-push2',  'write-url'],
                          children: [{
                              name: '6',
                              steps: ['deploy'],
                          }],
                        },
                      ],
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],

I want to name: 51 and 52 two group with one point name: 6, please help me

anseki commented 2 years ago

Hi @yuleiQ, thank you for the comment. This may help you. https://jsfiddle.net/nocgpv8y/

yuleiQ commented 2 years ago

Hi @yuleiQ, thank you for the comment. This may help you. https://jsfiddle.net/nocgpv8y/


First of all, thank you for your reply. My English is poor. I want to ask how to converge two points into one under my data structure?How to merge 51 and 52 groups at 6。

In addition,I want a dom to scroll when pipeline exceeds length. But the lines overlap. I have called the position () method according to issue54。 The situation is as follows 企业微信截图_1668150717950

anseki commented 2 years ago

Sorry, I couldn't understand your question well. The example that I showed seems to be merging two elements as you said. That looks like the your red lines in https://github.com/anseki/leader-line/issues/375#issue-1443781527 . What is problem? Do you mean that you want to make new element (object)? Could you explain result you want?

yuleiQ commented 2 years ago

Sorry, I couldn't understand your question well. The example that I showed seems to be merging two elements as you said. That looks like the your red lines in #375 (comment) . What is problem? Do you mean that you want to make new element (object)? Could you explain result you want?

thanks~The first question is my question~

call position() , the lines overlap how to fix?

anseki commented 2 years ago

Do you mean that the issue (https://github.com/anseki/leader-line/issues/375#issue-1443781527) was solved? Could you make new issue if you have another issue?

anseki commented 2 years ago

Also, could you close this issue if it was solved?

yuleiQ commented 2 years ago

Also, could you close this issue if it was solved?

yes,thank your help

anseki commented 2 years ago

Could you close this issue?

yuleiQ commented 2 years ago

thanks

anseki commented 2 years ago

:smile: