Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Custom binding Dash and Dotted line

$
0
0

@Alpheus wrote:

Hi There,

Is there a way to bind Dash to custom values on the inspector dropdown? I am trying to disply my chosen values and bind the to valid values for the dash property on the link. Please see below. Thanks in advance.

function makeInspector() {

    var inspector = new Inspector('myInspectorDiv', myDiagram,
        {
            properties: {
                "dash": {
                    show: Inspector.showIfLink, type: 'select',
                    choices: ["Dotted Line", "Dash Line"]
                }
            }
        });

    window.inspector = inspector;
}

var genericLinkTemplate =
    $(go.Link,

        $(go.Shape,
            new go.Binding("strokeDashArray", "dash", function (d) { return d == "Dotted Line" ? { dash: [3.3] } : d == "Dash Line" ? { dash: [5.5] } : { dash: []}; }).ofObject(),

);

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles