mmsyn4 0.1.0.0 → 0.1.1.0
raw patch · 4 files changed
+60/−28 lines, 4 filesdep ~mmsyn2
Dependency ranges changed: mmsyn2
Files
- ChangeLog.md +4/−0
- Main.hs +37/−24
- README +15/−0
- mmsyn4.cabal +4/−4
ChangeLog.md view
@@ -3,3 +3,7 @@ ## 0.1.0.0 -- 2019-10-17 * First version. Released on an unsuspecting world.++## 0.1.1.0 -- 2019-10-18++* First version revised A. Some documentation and .cabal file improvements.
Main.hs view
@@ -1,3 +1,14 @@+{-|+Module : Main+Description : The "glue" between electronic tables and GraphViz+Copyright : (c) OleksandrZhabenko, 2013+License : MIT+Maintainer : olexandr543@yahoo.com+Stability : experimental++The program @mmsyn4@ converts a specially formated @.csv@ file with a colon as a field separator obtained from the electronic teble into a visualized by GraphViz graph.+-}+ module Main (main) where import System.Info (os)@@ -7,7 +18,7 @@ import CaseBi (getBFst') import qualified Data.Vector as V import EndOfExe (showE)-import Data.Maybe (isJust)+import Data.Maybe (isJust,fromJust) isSep :: Char -> Bool isSep c = c == ':'@@ -132,21 +143,23 @@ combineCells x = let (y,z) = (x,x) in concat ["strict digraph 1 {", endOfLineGv, "overlap=false", endOfLineGv, processCells z, makeFilledWithColor . findFilledWithColor . fillEmptyCells2 . processCellsA $ y, endOfLineGv, "}", endOfLineGv] --- | Usage--- 1. After installation the executable mmsyn4 is created. Afterwards, it is used to process files. So, open an office spreadsheet program, e. g. LibreOffice Calc.--- 2. Begin to enter the text in the cells.--- 3. Do not use colons, instead when needed switch to the nearest cell to the right.--- 4. To make a text visually highlighted (yellowish), start the cell with an ’@’ sign.--- 5. Lines create different chains in the resulting graph. To produce an arrow to the text in the cell, enter it in the next cell in the row to the right.--- 6. To make several arrows from the cell, switch to the next to the right cell, enter needed new texts there and in the located below cells.--- 7. Usually, you can search the needed text with @Ctrl+F@ if needed.--- 8. Empty lines in the table do not influence the resulting visualization. Above each line, except the first one, there must be at least one filled cell. It must be located above the text on the new line or even further to the right above. Otherwise, the program will produce no reasonably useful output.--- 9. After entering all the text, save the sheet as an 1.csv file in the working directory. Otherwise, the program won’t work.--- 10. Run the apprapriate executable mmsyn4 in the terminal or from the command line while being in the directory with the 1.csv file. Enter a word name of the .csv file to be saved. DO use alphanumeric symbols and dashes if needed. Then specify the needed visualization scheme by specifying the appropriate character in the terminal.--- 11. Your first visualization is then created. --- 12. Save the spreadsheet document as a spreadsheet file.--- 13. Repeat the steps from 2 to 12 as needed to produce more visualizations. --- 14. Afterwards, you have a list of svg files, x12.gv file as a last source file for Graphviz, and a list of csv files, and a saved spreadsheet file. Then you can use the produced visualizations for some other documents.+{-| Usage+1. After installation the executable mmsyn4 is created. Afterwards, it is used to process files. So, open an office spreadsheet program, e. g. LibreOffice Calc.+2. Begin to enter the text in the cells. You can use Unicode characters. No quotation marks should be used, instead use some special delimiter except '@' sign.+3. Do not use colons, instead when needed switch to the nearest cell to the right. +4. To make a text visually highlighted (yellowish), start the cell with an ’@’ sign.+5. Lines in the table create different chains in the resulting graph. To produce an arrow to the text in the cell, enter it in the next cell in the row to the right.+6. To make several arrows from the cell, switch to the next cell to the right for this parent one (the cell that will be a parent for several other cells), enter needed new texts there and in the located below cells.+7. Usually, you can search the needed text with Ctrl+F if needed.+8. Empty lines in the table do not influence the resulting visualization. Above each line, except the first one, there must be at least one filled cell. It must be located above the text on the new line or even further to the right above. Otherwise, the program will produce no reasonably useful output.+9. After entering all the text, export the sheet as an 1.csv file using colons (':') as separator in the working directory. Otherwise, the program won’t work.+10. Run the apprapriate executable mmsyn4 in the terminal or from the command line while being in the directory with the 1.csv file. Enter a word name of the .csv file to be saved. DO use alphanumeric symbols and dashes if needed. Then specify the needed visualization scheme by specifying the appropriate character in the terminal.+11. Your first visualization is then created. +12. Save the spreadsheet document as a spreadsheet file.+13. Repeat the steps from 2 to 12 as needed to produce more visualizations. +14. Afterwards, you have a list of svg files, x12.gv file as a last source file for Graphviz, and a list of csv files, and a saved spreadsheet file. Then you can use the produced visualizations for some other documents.++-} main :: IO () main = do xs <- readFile "1.csv"@@ -157,12 +170,12 @@ let ys = combineCells xs in writeFile "x12.gv" ys ts <- getCPUTime renameFile "1.csv" (show ts ++ "." ++ zs ++ ".csv")- x1 <- findExecutable $ showE "fdp"- x2 <- findExecutable $ showE "twopi"- x3 <- findExecutable $ showE "circo"- x4 <- findExecutable $ showE "neato"- x5 <- findExecutable $ showE "sfdp"- if all isJust [x1,x2,x3,x4,x5]+ let x1 = showE "fdp"+ x2 = showE "twopi"+ x3 = showE "circo"+ x4 = showE "neato"+ x5 = showE "sfdp"+ if foldl1 (&&) (map isJust [x1,x2,x3,x4,x5]) then do putStrLn "Please, specify the GraphViz command: " putStrLn "\'f\' -- for fdp"@@ -172,8 +185,8 @@ putStrLn "\'s\' -- for sfdp" putStrLn "otherwise there will be used the default neato" u <- getChar- let temp r = getBFst' (showE "neato", V.fromList [('c', showE "circo"), ('f', showE "fdp"), ('n', showE "neato"), ('s', showE "sfdp"), ('t', showE "twopi")]) r- callCommand $ temp u ++ " -Tsvg x12.gv > " ++ show ts ++ zs ++ ".svg"+ let temp r = getBFst' (fromJust (showE "neato"), V.fromList (map (\(x, y) -> (x, fromJust y)) [('c', showE "circo"), ('f', showE "fdp"), ('n', showE "neato"), ('s', showE "sfdp"), ('t', showE "twopi")])) r+ callCommand $ temp u ++ " -Tsvg x12.gv > " ++ show ts ++ "." ++ zs ++ ".svg" else error "Please, install the GraphViz so that its executables are in the directories mentioned in the variable PATH!" else error "Epmty file 1.csv!"
+ README view
@@ -0,0 +1,15 @@+Usage+1. After installation the executable mmsyn4 is created. Afterwards, it is used to process files. So, open an office spreadsheet program, e. g. LibreOffice Calc.+2. Begin to enter the text in the cells. You can use Unicode characters. No quotation marks should be used, instead use some special delimiter except '@' sign.+3. Do not use colons, instead when needed switch to the nearest cell to the right. +4. To make a text visually highlighted (yellowish), start the cell with an ’@’ sign.+5. Lines in the table create different chains in the resulting graph. To produce an arrow to the text in the cell, enter it in the next cell in the row to the right.+6. To make several arrows from the cell, switch to the next cell to the right for this parent one (the cell that will be a parent for several other cells), enter needed new texts there and in the located below cells.+7. Usually, you can search the needed text with Ctrl+F if needed.+8. Empty lines in the table do not influence the resulting visualization. Above each line, except the first one, there must be at least one filled cell. It must be located above the text on the new line or even further to the right above. Otherwise, the program will produce no reasonably useful output.+9. After entering all the text, export the sheet as an 1.csv file using colons (':') as separator in the working directory. Otherwise, the program won’t work.+10. Run the apprapriate executable mmsyn4 in the terminal or from the command line while being in the directory with the 1.csv file. Enter a word name of the .csv file to be saved. DO use alphanumeric symbols and dashes if needed. Then specify the needed visualization scheme by specifying the appropriate character in the terminal.+11. Your first visualization is then created. +12. Save the spreadsheet document as a spreadsheet file.+13. Repeat the steps from 2 to 12 as needed to produce more visualizations. +14. Afterwards, you have a list of svg files, x12.gv file as a last source file for Graphviz, and a list of csv files, and a saved spreadsheet file. Then you can use the produced visualizations for some other documents.
mmsyn4.cabal view
@@ -2,9 +2,9 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: mmsyn4-version: 0.1.0.0+version: 0.1.1.0 synopsis: The "glue" between electronic tables and GraphViz--- description:+description: The program mmsyn4 converts a specially formated .csv file with a colon as a field separator obtained from the electronic teble into a visualized by GraphViz graph. homepage: http://hackage.haskell.org/package/mmsyn4 license: MIT license-file: LICENSE@@ -13,13 +13,13 @@ -- copyright: category: Graphics build-type: Simple-extra-source-files: ChangeLog.md+extra-source-files: ChangeLog.md, README cabal-version: >=1.10 executable mmsyn4 main-is: Main.hs -- other-modules: -- other-extensions:- build-depends: base >=4.11 && <4.13, directory >=1.3 && <1.4, process >=1.6 && <1.7, mmsyn2 >=0.1 && <0.2, vector >=0.12 && <0.13, mmsyn3 >=0.1 && <0.2+ build-depends: base >=4.11 && <4.13, directory >=1.3 && <1.4, process >=1.6 && <1.7, mmsyn2 >=0.1.6.0 && <0.2, vector >=0.12 && <0.13, mmsyn3 >=0.1 && <0.2 -- hs-source-dirs: default-language: Haskell2010