Code Monkey home page Code Monkey logo

Comments (5)

stefanloerwald avatar stefanloerwald commented on August 16, 2024

Hi @CliveBennett,

yes, this is possible! Just disable AllowFreeFloatingLinks on Links:

<Diagram>
   <Nodes>
      ...
   </Nodes>
   <Links AllowFreeFloatingLinks="false">
      ...
   </Links>
</Diagram>

Hope that helps,
Stefan

from blazor.diagrams.

Clive321A avatar Clive321A commented on August 16, 2024

Thanks, yes I did try that option before, but it still lets me click and draw lines,

    My whole Diagram is this
    
    <Diagram @ref="masterDiagram">
    <Nodes>
        @{double nodex = 0;}
        @{double nodey = 0;}


        @foreach (var node in FamilyDiagramNode.RectangleNodes)
        {
           
            <RectangleNode Id="@node.NodeId" >
                @foreach (var q in node.Data)
                {
                    <div>@((MarkupString)q)</div>
                }
            </RectangleNode>

        }

    </Nodes>

    <Links AllowFreeFloatingLinks="false">
        @foreach (var lnk in FamilyDiagramNode.DiagramLinks)
        {
            <Link Source="lnk.Source" Target="lnk.Target" Arrow="Arrow.Target" Type="link_type" />

        }
    </Links>
    <NavigationSettings DisableZooming="false" />
    <AutoLayoutSettings Algorithm="SelectAutoScale.AutoScaleAlgorithm" @ref="autoLayout" />
    <OverviewSettings Position="Position.BottomRight" />

</Diagram>

from blazor.diagrams.

stefanloerwald avatar stefanloerwald commented on August 16, 2024

I'm surprised it wouldn't disallow free-floating links, because the code looks fine to me:

if (node == null && !link.Links.AllowFreeFloatingLinks)

Could you please clarify which clicks are performed by the user and where your expectation of the behavior differs from the observed behavior?

from blazor.diagrams.

stefanloerwald avatar stefanloerwald commented on August 16, 2024

Not sure whether I understood your question right in the first place. If you want to disable user-generated links entirely, see here: #79 (comment)

from blazor.diagrams.

Clive321A avatar Clive321A commented on August 16, 2024

Ah perfect, yes thats the exactly what I was after, thanks for your help.

from blazor.diagrams.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.