Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Change colors for connections and elements #31

Open
Frozenfire92 opened this issue Oct 8, 2014 · 2 comments
Open

Change colors for connections and elements #31

Frozenfire92 opened this issue Oct 8, 2014 · 2 comments

Comments

@Frozenfire92
Copy link
Contributor

Users may wish to have multiple colors in their diagrams to help distinguish things based on their standards. Being able to easily change colors (or palettes) would add customization with an easy implementation.

@Frozenfire92 Frozenfire92 added this to the Alpha Release milestone Oct 8, 2014
@Glavin001
Copy link
Contributor

Probably easily doable with jsPlumb because they use JSON configuration for the styling and pass that to the jsPlumb instance.

Here's our current:

# this is the paint style for the connecting lines..
    connectorPaintStyle =
      lineWidth: 4
      strokeStyle: "#61B7CF"
      joinstyle: "round"
      outlineColor: "white"
      outlineWidth: 2

    connectorHoverStyle =
      # .. and this is the hover style.
      lineWidth: 4
      strokeStyle: "#216477"
      outlineWidth: 2
      outlineColor: "white"

    endpointHoverStyle =
      fillStyle: "#216477"
      strokeStyle: "#216477"

    sourceEndpoint =
      # the definition of source endpoints (the small blue ones)
      endpoint: "Dot"
      paintStyle:
        strokeStyle: "#7AB02C"
        fillStyle: "transparent"
        radius: 7
        lineWidth: 3
      isSource: true
      connector: [
        "Flowchart"
        {
          stub: [
            40
            60
          ]
          gap: 10
          cornerRadius: 5
          alwaysRespectStubs: true
        }
      ]
      connectorStyle: connectorPaintStyle
      hoverPaintStyle: endpointHoverStyle
      connectorHoverStyle: connectorHoverStyle
      dragOptions: {}
      overlays: [[
        "Label"
        {
          location: [
            0.5
            1.5
          ]
          label: "Drag"
          cssClass: "endpointSourceLabel"
        }
      ]]

    targetEndpoint =
      # the definition of target endpoints (will appear when the user drags a connection)
      endpoint: "Dot"
      paintStyle:
        fillStyle: "#7AB02C"
        radius: 11
      hoverPaintStyle: endpointHoverStyle
      maxConnections: -1
      dropOptions:
        hoverClass: "hover"
        activeClass: "active"
      isTarget: true
      overlays: [[
        "Label"
        {
          location: [
            0.5
            -0.5
          ]
          label: "Drop"
          cssClass: "endpointTargetLabel"
        }
      ]]

@Glavin001
Copy link
Contributor

^ those options are now available here:

sourceEndpoint:
# the definition of source endpoints (the small blue ones)
endpoint: "Dot"
paintStyle:
strokeStyle: "#7AB02C"
fillStyle: "transparent"
radius: 7
lineWidth: 3
isSource: true
connector: [
"Flowchart"
{
stub: [
40
60
]
gap: 10
cornerRadius: 5
alwaysRespectStubs: true
}
]
connectorStyle: @connectorPaintStyle
hoverPaintStyle: @endpointHoverStyle
connectorHoverStyle: @connectorHoverStyle
dragOptions: {}
overlays: [[
"Label"
{
location: [
0.5
1.5
]
# label: "Drag"
cssClass: "endpointSourceLabel"
}
]]
targetEndpoint:
# the definition of target endpoints (will appear when the user drags a connection)
endpoint: "Dot"
paintStyle:
fillStyle: "#7AB02C"
radius: 11
hoverPaintStyle: @endpointHoverStyle
maxConnections: -1
dropOptions:
hoverClass: "hover"
activeClass: "active"
isTarget: true
overlays: [[
"Label"
{
location: [
0.5
-0.5
]
# label: "Drop"
cssClass: "endpointTargetLabel"
}
]]
# this is the paint style for the connecting lines..
connectorPaintStyle:
lineWidth: 4
strokeStyle: "#61B7CF"
joinstyle: "round"
outlineColor: "white"
outlineWidth: 2
connectorHoverStyle:
# .. and this is the hover style.
lineWidth: 4
strokeStyle: "#216477"
outlineWidth: 2
outlineColor: "white"
endpointHoverStyle:
fillStyle: "#216477"
strokeStyle: "#216477"

@Glavin001 Glavin001 removed this from the Alpha Release milestone Jan 7, 2015
@Glavin001 Glavin001 added this to the 0.3.0 - Future Features milestone Jan 21, 2015
@Glavin001 Glavin001 removed their assignment Jan 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants