Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export DOT #6

Merged
merged 3 commits into from Mar 9, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+23 −2
Diff settings

Always

Just for now

Copy path View file
@@ -2,6 +2,7 @@ port module Main exposing (main)

import Algorithms.Dijkstra.API
import Algorithms.TopologicalSorting.API
import Base64
import BoundingBox2d exposing (BoundingBox2d)
import Browser exposing (Document)
import Browser.Dom as Dom
@@ -20,6 +21,7 @@ import Element.Keyed
import Files exposing (Files)
import Generators.ElmDep as ElmDep
import Geometry.Svg
import Graph.DOT
import Graph.Force as Force exposing (Force)
import GraphFile as GF exposing (BagId, BagProperties, EdgeId, EdgeProperties, GraphFile, LabelPosition(..), VertexId, VertexProperties)
import Html as H exposing (Html, div)
@@ -2971,6 +2973,12 @@ leftBarContentForGraphGenerators m =
listOfFileNames l =
El.column [ El.padding 10 ]
(List.map (\n -> El.el [] (El.text ("- " ++ n))) l)

dotFile : String
dotFile =
Graph.DOT.output .label
.label
(GF.getGraph (Tuple.second (Files.present m.files)))
in
El.column [ El.width El.fill ]
[ -- menu
@@ -3027,8 +3035,6 @@ leftBarContentForGraphGenerators m =
{ labelText = "Access token (optional)"
, labelWidth = 110
, inputWidth = 100

--, text = m.elmDep.repoNameInput
, text = m.elmDep.token
, onChange = ElmDep.ChangeToken >> FromElmDep
}
@@ -3080,6 +3086,21 @@ leftBarContentForGraphGenerators m =
(El.text str)
]
]
, menu
{ headerText = "Export"
, isOn = True
, headerItems = []
, toggleMsg = NoOp
, contentItems =
[ El.column [ El.width El.fill, El.spacing 16, El.padding 16 ]
[ El.el [] <|
El.newTabLink []
{ url = "data:text/plain;base64," ++ Base64.encode dotFile
, label = El.text "DOT"
}
]
]
}
]
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.