Skip to content

Commit 0c8852c

Browse files
committed
Doc
1 parent 51290b4 commit 0c8852c

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

README.md

+24-8
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ Usage
3232
Add to page teleperiod.min.js and teleperiod.min.css
3333

3434
create a svg placeholder in page:
35-
35+
```html
3636
<div class="row">
3737
<svg id="teleperiod_placeholder"></svg>
3838
</div>
39+
```
3940

4041
Initialize teleperiod object with options:
41-
42-
var teleperiod = new teleperiod({
42+
```javascript
43+
var teleperiod = new Teleperiod({
4344
object: d3.select('#teleperiod_placeholder'),
4445
workingtimes: function(interval) {
4546

@@ -51,26 +52,41 @@ Initialize teleperiod object with options:
5152

5253
}
5354
});
55+
```
56+
57+
Availables options:
58+
59+
Property | Description
60+
------------- | -------------
61+
object | a D3 html element, it will be used as placeholder to load the graph. This option is mandatory
62+
workingtimes | A function called to load the working times on the specified interval. The function must return a Q promise. This option is mandatory
63+
events | A function called to load some events on the specified interval. The function must return a Q promise. This option is mandatory
64+
onUpdated | A function called when the selection is modified, the selection is given as a parameter. This option is mandatory
65+
focusDate | A Date object, the graph will be open at this date, if not set, the default value is the current date
66+
dateLocale | A string to represent the locale used in dates functions, default is 'FR_fr'
67+
width | An integer for the graph width, default is the size of parent container
5468

5569
Add some bottom timeline references using the timeline object:
56-
57-
var timeline = new timeline('My timeline', function(interval) {
70+
```javascript
71+
var timeline = new Timeline('My timeline', function(interval) {
5872

5973
});
6074

6175
teleperiod.addTimeLine(timeline);
76+
```
6277

6378
Draw the widget:
64-
79+
```javascript
6580
teleperiod.draw();
81+
```
6682

6783
Set a selected period for modifications:
68-
84+
```javascript
6985
teleperiod.setSelection(
7086
new Date(2015, 1, 10, 0, 0, 0),
7187
new Date(2015, 1, 11, 0, 0, 0)
7288
);
73-
89+
```
7490

7591

7692
Usage exemples

0 commit comments

Comments
 (0)