@osfarm/itineraire-technique 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ div.rotation_item {
5
5
  padding : 13px;
6
6
  margin : 12px 0;
7
7
  overflow-x : hidden;
8
+ position : relative;
8
9
 
9
10
  &.highlighted {
10
11
  box-shadow: 0px 4px 4px 0px var(--UI-Shadow, rgba(17, 36, 69, 0.16)),
@@ -18,27 +19,28 @@ div.rotation_item {
18
19
 
19
20
  div.step_dates {
20
21
  font-size : 11px;
21
- float : right;
22
22
  background-color: #cdcccc;
23
23
  color : #ffffff;
24
- margin-right : 45px;
24
+ margin : 5px;
25
25
  padding : 2px 5px;
26
26
  border-radius : 5px;
27
- margin-top: 7px;
27
+ height : 20px;
28
+ right : 33px;
29
+ top : 12px;
30
+ position : absolute;
28
31
  }
29
32
 
30
33
  div.collapse-button {
31
- float : right;
32
34
  border-radius: 50%;
33
35
  width : 30px;
34
36
  height : 30px;
35
37
  text-align : center;
36
- padding-top : 5px;
38
+ padding : 5px 0px;
39
+ margin-right : 0 5px 3px 0;
37
40
  cursor : pointer;
38
41
  background : #dfe6f7;
39
42
  color : #7a8bad;
40
43
  transition : transform 0.3s ease-in-out;
41
- margin-top : -26px;
42
44
  }
43
45
 
44
46
  &.show-all {
@@ -0,0 +1,291 @@
1
+ {
2
+ "title": "Itinéraire technique de ma ferme après modification",
3
+ "timelineTitle": "Après",
4
+ "options": {
5
+ "view" : "horizontal",
6
+ "show_transcript": true,
7
+ "title_top_interventions": "Contrôle adventices",
8
+ "title_bottom_interventions": "Autres interventions",
9
+ "title_steps": "Étapes de la rotation dans la parcelle"
10
+ },
11
+ "steps": [
12
+ {
13
+ "name": "Féverole / Pois / Lin",
14
+ "color": "#ff96b0",
15
+ "description": "Tête de rotation avec un mélange de légumineuses",
16
+ "startDate": "2022-03-15",
17
+ "endDate": "2023-03-01"
18
+ },
19
+ {
20
+ "name": "Blé tendre",
21
+ "color": "#edcc7d",
22
+ "duration": 11,
23
+ "attributes": [
24
+ {
25
+ "name": "Pré-semis",
26
+ "value": "désinfection du grain au vinaigre (1L/100kg)"
27
+ },
28
+ {
29
+ "name": "Travail du sol",
30
+ "value": "aucun, semis direct pur"
31
+ },
32
+ {
33
+ "name": "Type de semoir",
34
+ "value": "semoir à dents"
35
+ },
36
+ {
37
+ "name": "Date de semis",
38
+ "value": "11/10"
39
+ },
40
+ {
41
+ "name": "Densité de semis",
42
+ "value": "125kg/ha"
43
+ },
44
+ {
45
+ "name": "Plantes compagnes",
46
+ "value": "orge fermière, 20kg/ha (implantation semoir à disque)"
47
+ }
48
+ ],
49
+ "startDate": "2023-03-15",
50
+ "endDate": "2023-10-15"
51
+ },
52
+ {
53
+ "name": "Colza",
54
+ "color": "#ebe733",
55
+ "duration": 12,
56
+ "description": "Travail du sol: aucun, semis direct pur, fissuration après récolte, avant le blé",
57
+ "attributes": [
58
+ {
59
+ "name": "Type de semoir",
60
+ "value": "semoir à dents"
61
+ },
62
+ {
63
+ "name": "Date de semis",
64
+ "value": "26/08"
65
+ },
66
+ {
67
+ "name": "Densité de semis",
68
+ "value": "2kg/ha"
69
+ },
70
+ {
71
+ "name": "Plantes compagnes",
72
+ "value": "feverole fermière, 60 pieds au m2"
73
+ }
74
+ ],
75
+ "interventions": [
76
+ {
77
+ "day": -20,
78
+ "name": "Labour",
79
+ "type": "intervention_bottom",
80
+ "description": ""
81
+ },
82
+ {
83
+ "day": -15,
84
+ "name": "Travail superficiel",
85
+ "type": "intervention_bottom",
86
+ "description": ""
87
+ },
88
+ {
89
+ "day": -10,
90
+ "name": "Fertilisation",
91
+ "type": "intervention_bottom",
92
+ "description": "Fertilisation - tsp_45 (180 kg)"
93
+ },
94
+ {
95
+ "day": -10,
96
+ "name": "Fertilisation",
97
+ "type": "intervention_bottom",
98
+ "description": "Fertilisation - potassium_chloride (125 kg)"
99
+ },
100
+ {
101
+ "day": -5,
102
+ "name": "Pulverisation",
103
+ "type": "intervention_top",
104
+ "description": "intervention_top - Proplus (0,4 l)"
105
+ },
106
+ {
107
+ "day": 0,
108
+ "name": "Semis",
109
+ "type": "intervention_bottom",
110
+ "description": "Semence - Capello (2 kg)"
111
+ },
112
+ {
113
+ "day": 0,
114
+ "name": "Semis",
115
+ "type": "intervention_top",
116
+ "description": "intervention_top - Anti-limaces (4 kg)"
117
+ },
118
+ {
119
+ "day": 30,
120
+ "name": "Pulverisation",
121
+ "type": "intervention_top",
122
+ "description": "intervention_top - Sweet Home (0,3 l)"
123
+ },
124
+ {
125
+ "day": 120,
126
+ "name": "Fertilisation",
127
+ "type": "intervention_bottom",
128
+ "description": "Fertilisation - ammonitrate_33 (178 kg)"
129
+ },
130
+ {
131
+ "day": 150,
132
+ "name": "Fertilisation",
133
+ "type": "intervention_bottom",
134
+ "description": "Fertilisation - ammonium_sulphate (90 kg)",
135
+ "important": true
136
+ },
137
+ {
138
+ "day": 165,
139
+ "name": "Pulverisation",
140
+ "type": "intervention_top",
141
+ "description": "intervention_top - Boravi Wg (1 kg)"
142
+ },
143
+ {
144
+ "day": 180,
145
+ "name": "Fertilisation",
146
+ "type": "intervention_bottom",
147
+ "description": "Fertilisation - ammonitrate_33 (178 kg)"
148
+ },
149
+ {
150
+ "day": 210,
151
+ "name": "Pulverisation",
152
+ "type": "intervention_top",
153
+ "description": "intervention_top - Elifor (0,5 l)"
154
+ },
155
+ {
156
+ "day": 225,
157
+ "name": "Pulverisation",
158
+ "type": "intervention_top",
159
+ "description": "intervention_top - Karakas (0,05 l)"
160
+ },
161
+ {
162
+ "day": 240,
163
+ "name": "Pulverisation",
164
+ "type": "intervention_top",
165
+ "description": "intervention_top - Sunorg Pro (0,4 l)"
166
+ },
167
+ {
168
+ "day": 255,
169
+ "name": "Pulverisation",
170
+ "type": "intervention_top",
171
+ "description": "intervention_top - Boravi Wg (1 kg)"
172
+ },
173
+ {
174
+ "day": 300,
175
+ "name": "Récolte",
176
+ "type": "intervention_bottom",
177
+ "description": "Récolte - Rendement (30 q)"
178
+ },
179
+ {
180
+ "day": 300,
181
+ "name": "Transport",
182
+ "type": "intervention_bottom",
183
+ "description": ""
184
+ }
185
+ ],
186
+ "startDate": "2023-10-01",
187
+ "endDate": "2024-10-01"
188
+ },
189
+ {
190
+ "name": "Repousses",
191
+ "color": "#fff2cc",
192
+ "duration": 1,
193
+ "description": "",
194
+ "startDate": "2024-10-01",
195
+ "endDate": "2024-11-01"
196
+ },
197
+ {
198
+ "name": "Blé tendre",
199
+ "color": "#edcc7d",
200
+ "duration": 11,
201
+ "description": "",
202
+ "startDate": "2024-11-01",
203
+ "endDate": "2025-10-01"
204
+ },
205
+ {
206
+ "name": "Couvert",
207
+ "color": "#93c47d",
208
+ "duration": 6,
209
+ "description": "Couvert d'interculture longue pour casser le cycle des graminées",
210
+ "attributes": [
211
+ {
212
+ "name": "Composition",
213
+ "value": "trefle facscelie vesce, feverple,pois, lupin tournessol, avoine"
214
+ },
215
+ {
216
+ "name": "Destruction",
217
+ "value": "rouleau faca + gel"
218
+ },
219
+ {
220
+ "name": "Densité",
221
+ "value": "250 pieds/m²"
222
+ }
223
+ ],
224
+ "startDate": "2025-10-01",
225
+ "endDate": "2026-04-01"
226
+ },
227
+ {
228
+ "name": "Lin textile",
229
+ "color": "#efefef",
230
+ "duration": 7,
231
+ "attributes": [
232
+ {
233
+ "name": "Semis",
234
+ "value": "Mars"
235
+ },
236
+ {
237
+ "name": "Type de semoir",
238
+ "value": "semoir à disques"
239
+ },
240
+ {
241
+ "name": "Note",
242
+ "value": "Très sensible à la compaction donc éloigné le plus possible de la récolte de betterave"
243
+ },
244
+ {
245
+ "name": "Autre",
246
+ "value": "Apport de BRF après lin, environ 10t/ha"
247
+ }
248
+ ],
249
+ "startDate": "2026-04-01",
250
+ "endDate": "2026-11-01"
251
+ },
252
+ {
253
+ "name": "Blé tendre",
254
+ "color": "#edcc7d",
255
+ "duration": 11,
256
+ "description": "",
257
+ "startDate": "2026-11-01",
258
+ "endDate": "2027-10-01"
259
+ },
260
+ {
261
+ "name": "Couvert",
262
+ "color": "#93c47d",
263
+ "duration": 4,
264
+ "description": "Couvert d'interculture court",
265
+ "attributes": [
266
+ {
267
+ "name": "Date de semis",
268
+ "value": "28/09 ou plus tôt"
269
+ },
270
+ {
271
+ "name": "Composition",
272
+ "value": "avoine/pois/feverole/vesce/fascelie/radis/lupin/tournessol"
273
+ },
274
+ {
275
+ "name": "Densité",
276
+ "value": "85 kg/ha"
277
+ },
278
+ {
279
+ "name": "Destruction",
280
+ "value": "26/01"
281
+ },
282
+ {
283
+ "name": "Reliquats azotés",
284
+ "value": "apporteront entre 20 et 40 u d'azote mobilisable"
285
+ }
286
+ ],
287
+ "startDate": "2027-10-01",
288
+ "endDate": "2028-02-25"
289
+ }
290
+ ]
291
+ }
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+
8
+ <title>Itinéraire technique TIKA</title>
9
+
10
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
11
+ integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
12
+
13
+ <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.js"></script>
14
+ <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
15
+ <script src="https://cdn.jsdelivr.net/npm/underscore@1.13.7/underscore-umd-min.js"></script>
16
+
17
+ <!-- Nous avons besoin de fontawesome pour l'éditeur en particulier -->
18
+ <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
19
+
20
+ <!-- Itineraire technique scripts: -->
21
+ <link href="./css/styles-rendering.css" rel="stylesheet">
22
+ <script src="./js/chart-render.js"></script>
23
+ </head>
24
+
25
+ <body>
26
+ <div class="container_fluid text-center">
27
+ <h2 class="m-5">Test simple</h2>
28
+
29
+ <div id="itk"></div>
30
+
31
+ </div>
32
+
33
+ <script type="text/javascript">
34
+
35
+ // Load the JSON data (from a test file for this test):
36
+ fetch('test/test.json')
37
+ .then(response => {
38
+ if (!response.ok) {
39
+ throw new Error("Erreur HTTP " + response.status);
40
+ }
41
+ return response.json();
42
+ })
43
+ .then(data => {
44
+ console.log("Données JSON :", data);
45
+
46
+ // Now render the chart and text:
47
+ let renderer = new RotationRenderer('itk', data);
48
+ renderer.render();
49
+ })
50
+ .catch(error => {
51
+ console.error("Impossible de charger le JSON :", error);
52
+ });
53
+
54
+ </script>
55
+ </body>
56
+
57
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+
8
+ <title>Itinéraire technique TIKA</title>
9
+
10
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
11
+ integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
12
+
13
+ <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.js"></script>
14
+ <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
15
+ <script src="https://cdn.jsdelivr.net/npm/underscore@1.13.7/underscore-umd-min.js"></script>
16
+ <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
17
+ <link href="./css/styles-rendering.css" rel="stylesheet">
18
+ <script src="./js/chart-render.js"></script>
19
+ </head>
20
+
21
+ <body>
22
+ <div class="container_fluid text-center">
23
+ <h2 class="m-5">Test avant-après</h2>
24
+
25
+ <div id="itk"></div>
26
+ </div>
27
+
28
+ <script type="text/javascript">
29
+
30
+ async function getData() {
31
+ let rotationBefore = {}, rotationAfter = {};
32
+
33
+ try {
34
+ const response = await fetch('test/test.json');
35
+ if (!response.ok) {
36
+ throw new Error(`Response status: ${response.status}`);
37
+ }
38
+
39
+ rotationBefore = await response.json();
40
+ console.log(rotationBefore);
41
+ } catch (error) {
42
+ console.error(error.message);
43
+ }
44
+
45
+ try {
46
+ const response = await fetch('test/test.after.json');
47
+ if (!response.ok) {
48
+ throw new Error(`Response status: ${response.status}`);
49
+ }
50
+
51
+ rotationAfter = await response.json();
52
+ console.log(rotationAfter);
53
+ } catch (error) {
54
+ console.error(error.message);
55
+ }
56
+
57
+ // Now render the chart and text:
58
+ let renderer = new RotationRenderer('itk', [rotationBefore, rotationAfter]);
59
+ renderer.render();
60
+ }
61
+
62
+ getData();
63
+ </script>
64
+ </body>
65
+
66
+ </html>