@@ -85,8 +85,8 @@ $dataset = new Dataset([
85
85
results:
86
86
87
87
~ ~~bash
88
- A [------------------------------------------------------------------------------ )
89
- B [----------------- -------------------------)
88
+ A [----------------------------------------------)
89
+ B [ -------------------------)
90
90
~ ~~
91
91
92
92
# ## Appending items to display
@@ -115,9 +115,9 @@ $dataset->append('GAPS', $sequence->gaps());
115
115
results:
116
116
117
117
~ ~~bash
118
- A [--------------------- )
119
- B [----------------- ----------------)
120
- GAPS [---------- ------------)
118
+ A [-------------)
119
+ B [ ----------------)
120
+ GAPS [ ------------)
121
121
~ ~~
122
122
123
123
The ` Dataset` implements the ` Countable` and the ` IteratorAggregate` interface. It also exposes the following methods:
@@ -172,8 +172,8 @@ $dataset = Dataset::fromSequence(
172
172
results:
173
173
174
174
~ ~~bash
175
- aa [------------------------------------------------------------------------------ )
176
- ab [----------------------------------- )
175
+ aa [-----------------------------------)
176
+ ab [----------)
177
177
~ ~~
178
178
179
179
The ` LatinLetter` also exposes the following methods:
@@ -208,8 +208,8 @@ $dataset = Dataset::fromSequence(
208
208
results:
209
209
210
210
~ ~~bash
211
- 42 [------------------------------------------------------------------------------ )
212
- 43 [----------------------------------- )
211
+ 42 [-----------------------------------)
212
+ 43 [----------)
213
213
~ ~~
214
214
215
215
The ` DecimalNumber` also exposes the following methods:
@@ -247,8 +247,8 @@ $dataset = Dataset::fromSequence(
247
247
results:
248
248
249
249
~ ~~bash
250
- v [------------------------------------------------------------------------------ )
251
- vi [----------------------------------- )
250
+ v [-----------------------------------)
251
+ vi [----------)
252
252
~ ~~
253
253
254
254
The ` RomanNumber` also exposes the following methods:
@@ -294,8 +294,8 @@ $dataset = Dataset::fromSequence(
294
294
results:
295
295
296
296
~ ~~bash
297
- * v .) [---------------------------------------------------------- )
298
- * vi .) [--------------------------)
297
+ * v .) [-----------------------------------)
298
+ * vi .) [----------)
299
299
~ ~~
300
300
301
301
The ` AffixLabel` also exposes the following methods:
@@ -340,8 +340,8 @@ $dataset = Dataset::fromSequence(
340
340
results:
341
341
342
342
~ ~~bash
343
- vi. [------------------------------------------------------------------------------ )
344
- v. [----------------------------------- )
343
+ vi. [-----------------------------------)
344
+ v. [----------)
345
345
~ ~~
346
346
347
347
# ## Custom LabelGenerator
@@ -381,15 +381,15 @@ $dataset = Dataset::fromSequence(
381
381
results:
382
382
383
383
~ ~~bash
384
- foobar. [------------------------------------------------------------------------------)
385
384
foobar. [-----------------------------------)
385
+ foobar. [----------)
386
386
~ ~~
387
387
388
388
# # Displaying the Dataset
389
389
390
390
The ` GanttChart` class is responsible for generating the graph from the ` Dataset` by implementing the ` Graph` interface for the console.
391
391
392
- The ` GanttChart::display ` methods expects a ` Dataset` object as its unique argument.
392
+ The ` GanttChart::stroke ` methods expects a ` Dataset` object as its unique argument.
393
393
394
394
If you wish to present the graph on another medium like a web browser or an image, you will need to implement the interface for your implementation.
395
395
@@ -410,24 +410,23 @@ $graph->stroke(new Dataset([
410
410
results:
411
411
412
412
~ ~~bash
413
- first [---------------------------------------------------- )
414
- last [---------------------- ------------------------------)
413
+ first [---------------------------)
414
+ last [ ------------------------------)
415
415
~ ~~
416
416
417
417
# ## Customized the graph looks
418
418
419
- The ` GanttChart` class can be customized by:
420
-
421
- - providing a ` GanttChartConfig` which defines:
422
- - the graph settings (How the intervals will be created)
423
- - sets single characters to represent the boundary types
424
- - sets single characters to represent the body and space
425
- - the console output settings. (How the intervals will be displayed)
426
- - sets the graph width
427
- - sets the graph colors
428
- - sets the gap between the labels and the rows
429
- - sets the label alignment
430
- - the console output via a ` OutputWriter` implementing class.
419
+ The ` GanttChart` class can be customized by providing a ` GanttChartConfig` which defines:
420
+
421
+ - the output medium via a ` OutputWriter` implementing class.
422
+ - the graph settings. (How the intervals will be stroked)
423
+ - sets the graph width
424
+ - sets the graph colors
425
+ - sets the gap between the labels and the rows
426
+ - sets the label alignment
427
+ - the output settings (How the intervals will be created)
428
+ - sets single characters to represent the boundary types
429
+ - sets single characters to represent the body and space
431
430
432
431
You can easily create a ` OutputWriter` implementing class with libraries like ` League CLImate` or ` Symfony Console`
433
432
to output the resulting graph. If you don' t, the package ships with a minimal `ConsoleOutput` class which is used
@@ -437,6 +436,7 @@ to output the resulting graph. If you don't, the package ships with a minimal `C
437
436
<?php
438
437
439
438
use Bakame\Period\Visualizer\AffixLabel;
439
+ use Bakame\Period\Visualizer\ConsoleOutput;
440
440
use Bakame\Period\Visualizer\Dataset;
441
441
use Bakame\Period\Visualizer\DecimalNumber;
442
442
use Bakame\Period\Visualizer\GanttChart;
@@ -448,6 +448,7 @@ use League\Period\Period;
448
448
use League\Period\Sequence;
449
449
450
450
$config = GanttChartConfig::createFromRainbow()
451
+ ->withOutput(new ConsoleOutput(STDOUT))
451
452
->withStartExcluded(' 🍕' )
452
453
->withStartIncluded(' 🍅' )
453
454
->withEndExcluded(' 🎾' )
0 commit comments