Commit 589d9c64 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

update readme

parent a1fc48dd
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -4,20 +4,20 @@ PlotFX
[![Build status](https://ci.appveyor.com/api/projects/status/8h07x0erafnxsumi/branch/master?svg=true)](https://ci.appveyor.com/project/plotfx/plotfx/branch/master)
![BSD-License](https://img.shields.io/badge/license-BSD-blue.svg?style=flat-square)

`plotfx` is a standalone tool for creating charts and other data-driven graphics.
`plotfx` is a tool for creating data-driven graphics. The primary use case for it
is creating custom charts ("graphs"), dashboards and other highly parametric
illustrations.

Drawings are defined using a lightweight syntax that is very similar to CSS.
One of the main goals for PlotFX is that using it should be quick, simple and fun.

Charts can be customized using a lightweight syntax that is very similar to CSS.
You can run PlotFX from the command line, where it generates SVG, PNG and PDF
output files. Additionally, you can embed it into your own application using the
C API.

PlotFX is partially based on ideas from the "Grammar of Graphics" [0].
One of the main goals for PlotFX is that creating charts should be quick, simple
and fun.

**WARNING**: The project is currently a work-in-progress. I'm currently working
on removing the old SQL chart specification language and replacing it with the
new CSS-like syntax. This might take a while...
**WARNING**: The master branch recently underwent a large refactoring and the
stability is currently beta/experimental. Maybe not even that. Polishing everything
up will take a few more weeks...

[Examples](https://plotfx.org/examples) |
[Documentation](https://plotfx.org/reference)
@@ -26,7 +26,7 @@ new CSS-like syntax. This might take a while...
Getting Started
---------------

Here is how to create a simple line chart using plotfx:
Here is how to draw a simple scatter plot using plotfx:

    $ plotfx --in example_chart.ptx --out example_chart.svg

+6 −0
Original line number Diff line number Diff line
@@ -172,3 +172,9 @@ you two options:
    similar in spirit to an HTML 'table' element and also similar to the approach
    taken by many GUI frameworks



Units & Unit Conversion
-----------------------

+45 −0
Original line number Diff line number Diff line
Frequently Asked Questions
==========================

### What are some differences between PlotFX and other chart generators?

While PlotFX's primary usecase *is* creating charts, it is at the core not a
chart generator, but a parametric drawing application that happens to be very
well suited to drawing charts.

When building charts, this approach does not always result in the shortest possible
configuration files, but it gives you a lof of flexibility for customizing your
illustrations in ways that were unforseen by the PlotFX authors.

Other things that differentiate PlotFX from other chart generators are its license,
the fact that it is written in C++ and can be embedded into any application and
its CSS-like configuration language.


### How does PlotFX compare to HTML/CSS?

Most readers will know CSS so it might be useful to point out the similarities
and differences between PlotFX and HTML/CSS, since both lay out elements as a
nested tree of boxes and have very similar syntax.

However, that is pretty much where the similarities end. A CSS file contains a
list of rules that are later applied to a tree of elements defined elsewhere. A
PlotFX files contains a list of definitions. Each definition corresponds 1:1
to an element which is implicitly created.

Also, since CSS is (also) intended for creating text documents, it is based around a 
concept of universal "page flow", i.e. by default block elements in CSS will be
stacked vertically from top to bottom, similar to the way rows of text are placed
one after another other in a page.

This concept of page flow, or page layout does not exit in PlotFX.
PlotFX is a tool for creating illustrations, not a document publishin system, so
it does make sense to assume "row by row" as a default element placement strategy.
Most of the rest of CSS's layout features build from this core assumption so they
are equally unapplicable to PlotFX.

Instead of being stacked horizontally within the parent box, like in CSS, boxes
in PlotFX will, by default, simply be drawn on top of each other with each one
filling up the entirety of the parent box. This is a much more useful default
behaviour for creating illustrations where in many cases an element more closely
resembles the concept of a 'layer' as found in graphics editing software such as
Photoshop or Illustrator than that of a row of text.


### I'm getting build errors when compiling the code

PlotFX needs a reasonably modern C++ compiler and standard library. In most
+33 −2
Original line number Diff line number Diff line
This page will guide you through creating a simple first plot and then give you
pointers to more detailed documentation.

Unlike a classical chart generator, a PlotFX file initially starts out as a blank
slate.

### The first image

A minimal example file for PlotFX is this one:

    width: 1200px;
    height: 600px;

    points {
      xs: 10px 40px;
      ys: 20px 400px;
      colors: #06c #c06;
    }

Save this to `example.ptx` and run it using the command line below:

    plotfx --in example.ptx --out example.svg

If you do that, PlotFX will produce a white 1200x600 pixel image with two coloured
dots:

    [ image ]

It's not the most useful example in the world, but it shows how to run files
through PlotFX and illustrates that PlotFX is in a way more similar to a drawing
tool like Inkscape than to a chart generator.

### Parametric drawing


### Adding a scale, title and legend


### Diving deeper