Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002508graphvizDotpublic2015-01-17 14:572015-01-20 16:50
Reporterthangalin 
Assigned To 
PrioritylowSeverityfeatureReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Summary0002508: Import external file
DescriptionGraphViz currently has no pre-processor for imports. See: http://www.malloc47.com/preprocessors-and-graphviz/ [^]

It would be great if such a feature existed so that styles, for example, could be externalized and reused.
Steps To Reproduce1. Create two graphs.
2. Create a common style for both graphs.
3. Change the style for both graphs by editing only one file.
Additional InformationFor example...

--

#!/bin/bash

# Replace "// IMPORT" with the contents of the style file.
sed -e '/\/\/ IMPORT/ {
   r style.dot
   d
}' < $1 | dot -Tsvg > $(basename $1 .dot).svg

--

digraph CL {
  // IMPORT

  rankdir="LR";
  // ... etc.
}

--

TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSIONdot - graphviz version 2.36.0 (20140111.2315)
Attached Files

- Relationships

-  Notes
User avatar (0000863)
erg (administrator)
2015-01-19 09:47
edited on: 2015-01-19 09:48

Similar requests have been made in the past. We've always considered DOT to be a fairly low-level language, though I know there is some thought now of providing property classes similar to CSS. Meanwhile, we usually recommend using cpp:

digraph CL {
#include <style.gv>
  a -> b
}

and then the pipeline

cpp -I. graph.gv | dot -Tsvg > out.svg

or equivalent preprocessing steps like the one you mention.

User avatar (0000866)
thangalin (reporter)
2015-01-20 16:50

FAQ-worthy?

http://www.graphviz.org/content/faq [^]

- Issue History
Date Modified Username Field Change
2015-01-17 14:57 thangalin New Issue
2015-01-19 09:47 erg Note Added: 0000863
2015-01-19 09:48 erg Note Edited: 0000863 View Revisions
2015-01-20 16:50 thangalin Note Added: 0000866


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker