What I want to do: click the link style in the right Palette to draw different styles of link in the Diagram.
The literal answer to your question is “yes”.
But I believe that most user interfaces would rather have some radio buttons to allow the user to select the style of newly drawn links, rather than forcing users to drag and drop specific links from a palette. Those radio buttons would just change a property or two on the LinkingTool.archetypeLinkData and the LinkingTool.temporaryLink in order to change the appearance of newly drawn links via data bindings.
Using radio buttons to allow the user to select the style of newly drawn links?Could you recommend a similar example to me?Because I can’t understand it very well.It would be even better if the user could draw the nodes and links themselves.
I’ve seen examples of using linkTemplateMap，but the way to call link is not what I want.（view-source:Page Not Found -- Northwoods Software
If you want to allow users to change the styling of selected Links, set up the choices in HTML (perhaps radio buttons). Make sure there are data Bindings in your Link template(s) that control how each Link appears.
Register a “ChangedSelection” DiagramEvent listener that updates your HTML based on any Links that are selected. You will need to decide what to show when there are multiple selected Links with different styles. Perhaps you should hide or disable the HTML when no Links are selected.
When the user changes the selection, within a transaction, change the data properties of all selected Links.
Alternatively, if you merely want users to control the style/appearance of the next new Link that the user will draw, have the HTML modify LinkingTool | GoJS API. Search for samples that modify archetypeLinkData.
Yes,I want users to control the style/appearance of the next new Link that the user will draw.Thank you very much. The problem has been solved with your help.