@@ -32,14 +32,15 @@ Usage
32
32
Add to page teleperiod.min.js and teleperiod.min.css
33
33
34
34
create a svg placeholder in page:
35
-
35
+ ``` html
36
36
<div class =" row" >
37
37
<svg id =" teleperiod_placeholder" ></svg >
38
38
</div >
39
+ ```
39
40
40
41
Initialize teleperiod object with options:
41
-
42
- var teleperiod = new teleperiod ({
42
+ ``` javascript
43
+ var teleperiod = new Teleperiod ({
43
44
object: d3 .select (' #teleperiod_placeholder' ),
44
45
workingtimes : function (interval ) {
45
46
@@ -51,26 +52,41 @@ Initialize teleperiod object with options:
51
52
52
53
}
53
54
});
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
54
68
55
69
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 ) {
58
72
59
73
});
60
74
61
75
teleperiod .addTimeLine (timeline);
76
+ ```
62
77
63
78
Draw the widget:
64
-
79
+ ``` javascript
65
80
teleperiod .draw ();
81
+ ```
66
82
67
83
Set a selected period for modifications:
68
-
84
+ ``` javascript
69
85
teleperiod .setSelection (
70
86
new Date (2015 , 1 , 10 , 0 , 0 , 0 ),
71
87
new Date (2015 , 1 , 11 , 0 , 0 , 0 )
72
88
);
73
-
89
+ ```
74
90
75
91
76
92
Usage exemples
0 commit comments