demo/graph_to_eps_demo.cc
changeset 2178 0d7c0f96a5ee
parent 2172 4b25e7003868
child 2207 75a29ac69c19
     1.1 --- a/demo/graph_to_eps_demo.cc	Fri Aug 11 14:55:33 2006 +0000
     1.2 +++ b/demo/graph_to_eps_demo.cc	Mon Aug 14 15:15:57 2006 +0000
     1.3 @@ -42,6 +42,7 @@
     1.4  int main()
     1.5  {
     1.6    Palette palette;
     1.7 +  Palette paletteW(true);
     1.8  
     1.9    ListGraph g;
    1.10    typedef ListGraph::Node Node;
    1.11 @@ -80,12 +81,21 @@
    1.12    
    1.13    IdMap<ListGraph,Node> id(g);
    1.14  
    1.15 +  cout << "Create 'graph_to_eps_demo_out_pure.eps'" << endl;
    1.16 +  graphToEps(g,"graph_to_eps_demo_out_pure.eps").
    1.17 +    //scale(10).
    1.18 +    coords(coords).
    1.19 +    title("Sample .eps figure").
    1.20 +    copyright("(C) 2006 LEMON Project").
    1.21 +    run();
    1.22 +
    1.23    cout << "Create 'graph_to_eps_demo_out.eps'" << endl;
    1.24    graphToEps(g,"graph_to_eps_demo_out.eps").
    1.25      //scale(10).
    1.26      coords(coords).
    1.27      title("Sample .eps figure").
    1.28      copyright("(C) 2006 LEMON Project").
    1.29 +    absoluteNodeSizes().absoluteEdgeWidths().
    1.30      nodeScale(2).nodeSizes(sizes).
    1.31      nodeShapes(shapes).
    1.32      nodeColors(composeMap(palette,colors)).
    1.33 @@ -100,6 +110,7 @@
    1.34      //scale(10).
    1.35      title("Sample .eps figure (with arrowheads)").
    1.36      copyright("(C) 2006 LEMON Project").
    1.37 +    absoluteNodeSizes().absoluteEdgeWidths().
    1.38      nodeColors(composeMap(palette,colors)).
    1.39      coords(coords).
    1.40      nodeScale(2).nodeSizes(sizes).
    1.41 @@ -126,6 +137,7 @@
    1.42      //scale(10).
    1.43      title("Sample .eps figure (parallel edges)").
    1.44      copyright("(C) 2006 LEMON Project").
    1.45 +    absoluteNodeSizes().absoluteEdgeWidths().
    1.46      nodeShapes(shapes).
    1.47      coords(coords).
    1.48      nodeScale(2).nodeSizes(sizes).
    1.49 @@ -141,6 +153,7 @@
    1.50      //scale(10).
    1.51      title("Sample .eps figure (parallel edges and arrowheads)").
    1.52      copyright("(C) 2006 LEMON Project").
    1.53 +    absoluteNodeSizes().absoluteEdgeWidths().
    1.54      nodeScale(2).nodeSizes(sizes).
    1.55      coords(coords).
    1.56      nodeShapes(shapes).
    1.57 @@ -156,6 +169,7 @@
    1.58    graphToEps(g,"graph_to_eps_demo_out_a4.eps").scaleToA4().
    1.59      title("Sample .eps figure (fits to A4)").
    1.60      copyright("(C) 2006 LEMON Project").
    1.61 +    absoluteNodeSizes().absoluteEdgeWidths().
    1.62      nodeScale(2).nodeSizes(sizes).
    1.63      coords(coords).
    1.64      nodeShapes(shapes).
    1.65 @@ -172,7 +186,7 @@
    1.66    ListGraph::NodeMap<Xy> hcoords(h);
    1.67    
    1.68    int cols=int(sqrt(double(palette.size())));
    1.69 -  for(int i=0;i<int(palette.size());i++) {
    1.70 +  for(int i=0;i<int(paletteW.size());i++) {
    1.71      Node n=h.addNode();
    1.72      hcoords[n]=Xy(i%cols,i/cols);
    1.73      hcolors[n]=i;
    1.74 @@ -184,12 +198,11 @@
    1.75      title("Sample .eps figure (Palette demo)").
    1.76      copyright("(C) 2006 LEMON Project").
    1.77      coords(hcoords).
    1.78 -    nodeScale(.45).
    1.79 +    absoluteNodeSizes().absoluteEdgeWidths().
    1.80 +    nodeScale(45).
    1.81      distantColorNodeTexts().
    1.82      //    distantBWNodeTexts().
    1.83      nodeTexts(hcolors).nodeTextSize(.6).
    1.84 -    nodeColors(composeMap(palette,hcolors)).
    1.85 +    nodeColors(composeMap(paletteW,hcolors)).
    1.86      run();
    1.87 -
    1.88 -
    1.89  }