Khipu/Manual/DotKhipuFiles

From KDE UserBase Wiki
Revision as of 08:53, 3 December 2013 by MinSik CHO (talk | contribs) (New entry)

Under Construction

This is a new page, currently under construction!


About .khipu Files

.khipu files are the files that are generated when you save your khipu workspace. The basic syntax of this file is introduced in this document.

Sample .khipu File

{ “dimension” : 2, “image” :

[Codes, with some lines starting with + sign]

, “name” : “Space 1”, “plots” : “[ { \”arg1max\” : \”5\”, \"arg1min\" : \"-5\", \"color\" : \"#00ff15\", \"expression\" : \"x->tan(x)\", \"name\" : \"PLOT NAME\" } ]" } ]

This is a sample .khipu file, with 2D Space of 'Space 1', and a tan(x) graph drawn in green color, from -5 to +5, and a name of 'PLOT NAME'. The details of this syntax will be explained one by one.

Space

The information about the space comes first. If there are multiple spaces, these information come multiple times, discriminated by {} and comma (,).

Dimension

The first argument that is in .khipu file is 'dimension'.

If your space is in 2D format, the dimension is saved as '2'. If your space is in 3D format, the dimension is saved as '4'.

Image

The image part is the biggest chunk in .khipu format. This part essentially contains the information about the thumbnail picture of your space.

Name

The name of space is listed after "name".

Graphs

The graphs are listed after the information about the spaces. All graphs are listed in "plots" category. If there are multiple plots, it is listed in the same “plots” argument, using different brackets []. Note that the properties of the graphs itself have \"something\" structure, to discern from space properties.

Intervals

Inside plots, “arg1max” and “arg1min” define the interval the graph is defined. So, for example, if I want to plot between -5 and +5, It would be \”arg1max\” : \”5\”, \"arg1min\" : \"-5\"

Color

The “color” defines what color the graph is plotted. As you might have noticed, it is shown in simple HTML color code.

Expression

“expression” defines what expression is being plotted. It uses grammar of 'analitza', which is our backend library. The syntax of this is quite intuitive: x->sin(x) for example corresponds y=sin(x) graph. It is essentially similar to modern calculators, or math languages.

Name

Finally, "name" defines the name of the graph. Note that the name of graph is specified after \"name\", and the name of space is defined after "name", to avoid confusion.

Brackets

Each hierarchy is discerned by different brackets. The first hierarchy (contains info about spaces) uses curly brackets {}. The second hierarchy (contains information about individual graphs - plots) also uses curly brackets {}, but are in all encompassed with square brackets [].

That is, if there are two plots, it is like this:

"plots" : "[ { \"color\" : \"#00ffe6\", \"expression\" : \"(x, y, z)->(x^5+y+z)-8\", \"plot1\" : \"\" } , { \"color\" : \"#00abe8\", \"expression\" : \"(x, y, z)->(x^2+y^2+z^2)-64\", \"plot2\" : \"\" }]"