Difference between revisions of "Documentation:The Editor and data format"

Jump to navigation Jump to search
no edit summary
Line 35: Line 35:
:and instantaneous events, represented by cards.
:and instantaneous events, represented by cards.


===Event format===
There are 7 data fields for each event:
There are 7 data fields for each event:


Line 69: Line 70:


''Start date'' and ''End date'' - Instantaneous events have only start date, while time intervals have both start and end dates. The date format is this: MM.DD.YYYY. This is an example of an event with a full date <code>some event with a full date;;;;05.25.1965;;</code>. Also, you can specify only month, without a date: <code>05.1965</code>. Or you can specify only year: <code>1965</code>. When you specify only year, the event will point to a moment between June and July of that year. If you specify month without a date, the event will point roughly to the middle of that month, a moment between 15th and 16th day of that month. In general, when event is pointing to a moment between days, that shows that we don't know the date precisely, and the positions of events on the timeline should not be taken literally in such cases.
''Start date'' and ''End date'' - Instantaneous events have only start date, while time intervals have both start and end dates. The date format is this: MM.DD.YYYY. This is an example of an event with a full date <code>some event with a full date;;;;05.25.1965;;</code>. Also, you can specify only month, without a date: <code>05.1965</code>. Or you can specify only year: <code>1965</code>. When you specify only year, the event will point to a moment between June and July of that year. If you specify month without a date, the event will point roughly to the middle of that month, a moment between 15th and 16th day of that month. In general, when event is pointing to a moment between days, that shows that we don't know the date precisely, and the positions of events on the timeline should not be taken literally in such cases.
''Color'' - All events of a layer have the default color. So usually you don’t need to put anything in this field. However, if you need to give some events different color, you put color index in this field. For this to work you need to have the needed color in the list of colours. More on that later. Also you can make the background of the time interval transparent by putting letter ’t’ into the Color field instead of an index.
===Layer metadata===
Before the list of events you should put metadata, including the colours used by the events and sources (links to pages you get the information for the layer from).
The layer with metadata may look something like this:
[[File:ColoredEventsSourceCode.png|500px]]
Here is the text version that you can copy:
<code>
colors:<br />
<nowiki>#2683a9</nowiki><br />
<nowiki>#ee9c42</nowiki><br />
sources:<br />
Hannibal<br />
<nowiki>https://google.com|google</nowiki><br />
events:<br />
event or default color;;;;05.18.1978;;<br />
another event or default color;;;;1978;1982;<br />
orange event;;;;1978;1982;1<br />
</code>
This code produces these events on the timeline:
[[File:ColoredEvents.png|400px]]
To pick colors use the color picker:
[[File:ColorPicker.png|400px]]
After selecting the color in the picker copy the hex code of that color and paste it in the list of colors in the Editor.
''Colors'' in the list have implicit indices that start with 0. The 0th color (the first color in the list) is the default color of the layer. Once you have specified it, all the events will have that color. To use other colours in the list you specify their indices in the Color field of the event you want to apply that color to. Notice in the example how I use index 1 in the orange event: <code>orange event;;;;1978;1982;1</code>
''Sources'' are just page names (if you link to Wikipedia pages) or full urls starting with http or https. When there is only one source page specified, you get a button ‘Source’ in the Library next to the name of the layer. Clicking this button will open a source page in the new tab. If there are more than one page specified, you get a button ‘Sources’ instead. Clicking this button opens a popup with a list of links to the pages.
If you want the text in links to differ from the title of the page on Wikipedia or url for pages on other sites, specify the text after vertical line. This syntax can be seen in the example.
Notice, that once you have sources and or colors specified, you have to put ‘events:’  before the list of events.

Navigation menu