gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Scale the node sizes and arc widths in a more sensible way
0 2 0
default
2 files changed with 5 insertions and 5 deletions:
↑ Collapse diff ↑
Ignore white space 24 line context
... ...
@@ -190,19 +190,19 @@
190 190
    Node n=h.addNode();
191 191
    hcoords[n]=Point(i%cols,i/cols);
192 192
    hcolors[n]=i;
193 193
  }
194 194
  
195 195
  cout << "Create 'graph_to_eps_demo_out_colors.eps'" << endl;
196 196
  graphToEps(h,"graph_to_eps_demo_out_colors.eps").
197 197
    //scale(60).
198 198
    title("Sample .eps figure (Palette demo)").
199 199
    copyright("(C) 2003-2007 LEMON Project").
200 200
    coords(hcoords).
201 201
    absoluteNodeSizes().absoluteArcWidths().
202
    nodeScale(45).
202
    nodeScale(.45).
203 203
    distantColorNodeTexts().
204 204
    //    distantBWNodeTexts().
205 205
    nodeTexts(hcolors).nodeTextSize(.6).
206 206
    nodeColors(composeMap(paletteW,hcolors)).
207 207
    run();
208 208
}
Ignore white space 24 line context
... ...
@@ -141,28 +141,28 @@
141 141
  ///Constructor
142 142

	
143 143
  ///Constructor
144 144
  ///\param _g is a reference to the graph to be printed
145 145
  ///\param _os is a reference to the output stream.
146 146
  ///\param _os is a reference to the output stream.
147 147
  ///\param _pros If it is \c true, then the \c ostream referenced by \c _os
148 148
  ///will be explicitly deallocated by the destructor.
149 149
  ///By default it is <tt>std::cout</tt>
150 150
  DefaultGraphToEpsTraits(const G &_g,std::ostream& _os=std::cout,
151 151
			  bool _pros=false) :
152 152
    g(_g), os(_os),
153
    _coords(dim2::Point<double>(1,1)), _nodeSizes(.01), _nodeShapes(0),
153
    _coords(dim2::Point<double>(1,1)), _nodeSizes(1), _nodeShapes(0),
154 154
    _nodeColors(WHITE), _arcColors(BLACK),
155 155
    _arcWidths(1.0), _arcWidthScale(0.003),
156
    _nodeScale(1.0), _xBorder(10), _yBorder(10), _scale(1.0),
156
    _nodeScale(.01), _xBorder(10), _yBorder(10), _scale(1.0),
157 157
    _nodeBorderQuotient(.1),
158 158
    _drawArrows(false), _arrowLength(1), _arrowWidth(0.3),
159 159
    _showNodes(true), _showArcs(true),
160 160
    _enableParallel(false), _parArcDist(1),
161 161
    _showNodeText(false), _nodeTexts(false), _nodeTextSize(1),
162 162
    _showNodePsText(false), _nodePsTexts(false), _nodePsTextsPreamble(0),
163 163
    _undirected(lemon::UndirectedTagIndicator<G>::value),
164 164
    _pleaseRemoveOsStream(_pros), _scaleToA4(false),
165 165
    _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK),
166 166
    _autoNodeScale(false),
167 167
    _autoArcWidthScale(false),
168 168
    _absoluteNodeSizes(false),
... ...
@@ -487,25 +487,25 @@
487 487

	
488 488
  ///Sets a global scale factor for node sizes.
489 489
  /// 
490 490
  /// If nodeSizes() is not given, this function simply sets the node
491 491
  /// sizes to \c d.  If nodeSizes() is given, but
492 492
  /// autoNodeScale() is not, then the node size given by
493 493
  /// nodeSizes() will be multiplied by the value \c d.
494 494
  /// If both nodeSizes() and autoNodeScale() are used, then the
495 495
  /// node sizes will be scaled in such a way that the greatest size will be
496 496
  /// equal to \c d.
497 497
  /// \sa nodeSizes()
498 498
  /// \sa autoNodeScale()
499
  GraphToEps<T> &nodeScale(double d) {_nodeScale=d;return *this;}
499
  GraphToEps<T> &nodeScale(double d=.01) {_nodeScale=d;return *this;}
500 500
  ///Turns on/off the automatic node width scaling.
501 501

	
502 502
  ///Turns on/off the automatic node width scaling.
503 503
  ///
504 504
  ///\sa nodeScale()
505 505
  ///
506 506
  GraphToEps<T> &autoNodeScale(bool b=true) {
507 507
    _autoNodeScale=b;return *this;
508 508
  }
509 509

	
510 510
  ///Turns on/off the absolutematic node width scaling.
511 511

	
... ...
@@ -540,25 +540,25 @@
540 540

	
541 541
  ///Sets a global scale factor for arc widths
542 542

	
543 543
  /// Sets a global scale factor for arc widths.
544 544
  ///
545 545
  /// If arcWidths() is not given, this function simply sets the arc
546 546
  /// widths to \c d.  If arcWidths() is given, but
547 547
  /// autoArcWidthScale() is not, then the arc withs given by
548 548
  /// arcWidths() will be multiplied by the value \c d.
549 549
  /// If both arcWidths() and autoArcWidthScale() are used, then the
550 550
  /// arc withs will be scaled in such a way that the greatest width will be
551 551
  /// equal to \c d.
552
  GraphToEps<T> &arcWidthScale(double d) {_arcWidthScale=d;return *this;}
552
  GraphToEps<T> &arcWidthScale(double d=.003) {_arcWidthScale=d;return *this;}
553 553
  ///Turns on/off the automatic arc width scaling.
554 554

	
555 555
  ///Turns on/off the automatic arc width scaling.
556 556
  ///
557 557
  ///\sa arcWidthScale()
558 558
  ///
559 559
  GraphToEps<T> &autoArcWidthScale(bool b=true) {
560 560
    _autoArcWidthScale=b;return *this;
561 561
  }
562 562
  ///Turns on/off the absolutematic arc width scaling.
563 563

	
564 564
  ///Turns on/off the absolutematic arc width scaling.
0 comments (0 inline)