@osfarm/itineraire-technique 1.0.1 → 1.0.2

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.
package/README.md CHANGED
@@ -15,7 +15,7 @@ Le rendu peut se faire au format frise, avec un zoom temporel, et la possibilit
15
15
  L'utilisateur peut passer au format rotation pour voir l'ensemble de la rotation sur un cercle
16
16
 
17
17
  ### Rendu démo
18
- [Cliquez ici](https://osfarm.github.io/itineraire-technique/rendu_statique_1.html) pour accéder à la démo !
18
+ [Cliquez ici](https://osfarm.github.io/itineraire-technique/visualisateur.html) pour accéder à la démo !
19
19
 
20
20
  ### Editeur
21
21
  Le visualisateur est fourni avec un éditeur qui permet de créer son propre itinéraire technique et l'intégrer facilement dans n'importe quel contexte. [Cliquez ici](https://www.osfarm.org/itineraire-technique/editor.html) pour accéder à l'éditeur.
package/editor.html CHANGED
@@ -166,15 +166,11 @@
166
166
  </div>
167
167
  </div>
168
168
 
169
- <div class="col col-12 col-lg-3">
170
- <div id="itk_text">
171
- <div id="itk_text_content"></div>
172
- </div>
169
+ <!-- Rendering zone -->
170
+ <div class="col col-12 col-lg-9">
171
+ <div id="itk"></div>
173
172
  </div>
174
173
 
175
- <div class="col col-12 col-lg-6">
176
- <div id="itk_chart" class="charts"></div>
177
- </div>
178
174
  </div>
179
175
  </div>
180
176
 
@@ -552,7 +548,7 @@
552
548
  }
553
549
 
554
550
  function renderChart() {
555
- let renderer = new RotationRenderer('itk_chart', 'itk_text', crops);
551
+ let renderer = new RotationRenderer('itk', crops);
556
552
  renderer.render();
557
553
 
558
554
  $('.step-edit').click(function (event) {
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RotationRenderer {
3
- constructor(divID, transcriptDivID, rotationData) {
3
+ constructor(divID, rotationData) {
4
4
  this.barHeight = 100;
5
5
 
6
6
  this.currentFocusIndex = null;
@@ -27,8 +27,13 @@ class RotationRenderer {
27
27
 
28
28
  this.data = rotationData;
29
29
 
30
- this.divID = divID;
31
- this.transcriptDivID = transcriptDivID;
30
+ this.itk_container = $("#" + divID).css({ 'width': '100%' });
31
+
32
+ this.itk_container.append(`<div class="row">
33
+ <div class="col d-none d-lg-block col-lg-4"><div class="transcript"></div></div>
34
+ <div class="col col-12 col-lg-8"><div class="charts"></div></div>
35
+ <div class="col col-12 d-block d-lg-none"><div class="transcript"></div></div>
36
+ </div>`);
32
37
  }
33
38
 
34
39
  fixRotationData(rotationData) {
@@ -57,30 +62,30 @@ class RotationRenderer {
57
62
  let self = this;
58
63
 
59
64
  // Initialize the echarts instance based on the prepared dom
60
- self.chart = echarts.init(document.getElementById(self.divID));
65
+ self.chart = echarts.init(this.itk_container.find('.charts')[0]);
61
66
 
62
67
  self.renderChart();
63
68
 
64
69
  if (self.data.options.show_transcript) {
65
70
  var html = this.buildHTML();
66
- $('#' + self.transcriptDivID).html(html);
67
- $('#' + self.transcriptDivID).show();
68
- $('#' + self.transcriptDivID + " .rotation_item").on("click", function () {
71
+ this.itk_container.find('.transcript').html(html);
72
+ this.itk_container.find('.transcript').show();
73
+ this.itk_container.find('.transcript .rotation_item').on("click", function () {
69
74
  $(this).toggleClass('show-all');
70
75
  });
71
76
 
72
- $('#' + self.transcriptDivID + " .rotation_item").on("mouseover", function () {
77
+ this.itk_container.find('.transcript .rotation_item').on("mouseover", function () {
73
78
  self.highlightItem(this.id);
74
79
  });
75
80
 
76
81
  // Add a click event on the transcript to scroll to the corresponding item in the chart
77
- $('#' + self.transcriptDivID + " .intervention").on('mouseover', function (e) {
82
+ this.itk_container.find('.transcript .intervention').on('mouseover', function (e) {
78
83
  self.highlightItem(this.id);
79
84
  e.stopPropagation();
80
85
  });
81
86
  }
82
87
  else
83
- $('#' + self.transcriptDivID).hide();
88
+ this.itk_container.find('.transcript').hide();
84
89
 
85
90
  // resize all charts when the windows is resized
86
91
  if (typeof _ !== 'undefined' && typeof _.debounce === 'function') {
@@ -289,7 +294,7 @@ class RotationRenderer {
289
294
  intervention.type == 'intervention_top' ? 2 : 0, // Interventions en haut ou en bas (index de la série)
290
295
  item.startDate.valueOf() + Number(intervention.day) * 86400000, // Date de début (ms)
291
296
  item.startDate.valueOf() + (Number(intervention.day) + 1) * 86400000, // Date de début (ms)
292
- intervention.important === true ? intervention.name + ' 🛈' : intervention.name, // Nom
297
+ intervention.important === true ? intervention.name + ' ⚠️' : intervention.name, // Nom
293
298
  intervention.type == 'intervention_top' ? 'intervention_top' : 'intervention_bottom' // Type
294
299
  ],
295
300
  divId: 'Intervention_' + index + '_' + interventionIndex,
@@ -586,11 +591,11 @@ class RotationRenderer {
586
591
  let title = intervention.name;
587
592
 
588
593
  if (intervention.important === true)
589
- title = '<i class="fa fa-exclamation-circle" aria-hidden="true" style="color: #ff9a1c"></i> ' + title;
594
+ title = title + '⚠️';
590
595
 
591
596
  html += '<div id="Intervention_' + index + '_' + interventionIndex + '" class="intervention"><span class="intervention_title">' + title + '</span>'
592
- + '<span class="intervention_date badge rounded-pill">' + intDate + '</span>'
593
- + '<div class="intervention_description">' + intervention.description + '</div></div>';
597
+ + '<span class="intervention_date badge rounded-pill">' + intDate + '</span>'
598
+ + '<div class="intervention_description">' + intervention.description + '</div></div>';
594
599
  });
595
600
  }
596
601
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osfarm/itineraire-technique",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "A visualisation tool to show agricultural technical itineraries based on Echarts",
5
5
  "main": "editor.html",
6
6
  "scripts": {
@@ -13,651 +13,44 @@
13
13
  <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.js"></script>
14
14
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
15
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 -->
16
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: -->
17
21
  <link href="./css/styles-rendering.css" rel="stylesheet">
18
22
  <script src="./js/chart-render.js"></script>
19
23
  </head>
20
24
 
21
25
  <body>
22
- <div class="container_fluid">
23
- <h2>Test simple</h2>
24
- <div class="row">
25
- <div class="col col-12 col-md-8 mx-auto"><div id="itk_chart" class="charts"></div></div>
26
- <div class="col col-12 col-md-8 mx-auto"><div id="itk_text" class="transcript"></div></div>
27
- </div>
26
+ <div class="container_fluid text-center">
27
+ <h2 class="m-5">Test simple</h2>
28
+
29
+ <div id="itk"></div>
28
30
 
29
- <h2>Test avec un ITK en comparaison avant / après</h2>
30
- <div class="row">
31
- <div class="col col-12 col-md-8 mx-auto"><div id="itk_chart_2" class="charts"></div></div>
32
- <div class="col col-12 col-md-8 mx-auto"><div id="itk_text_2" class="transcript"></div></div>
33
- </div>
34
31
  </div>
35
32
 
36
33
  <script type="text/javascript">
37
34
 
38
- var rotationTest = {
39
- "title": "Itinéraire technique de ma ferme",
40
- "timelineTitle": "Avant",
41
- "options": {
42
- "view" : "horizontal",
43
- "show_transcript": true,
44
- "title_top_interventions": "Contrôle adventices",
45
- "title_bottom_interventions": "Autres interventions",
46
- "title_steps": "Étapes de la rotation dans la parcelle",
47
- },
48
- "steps": [
49
- {
50
- "name": "Betterave",
51
- "color": "#ff96b0",
52
- "description": "Tête de rotation",
53
- "attributes": [
54
- {
55
- "name": "Pré-semis",
56
- "value": "Possibilité d'un couvert multi-espèces en aout n-1"
57
- },
58
- {
59
- "name": "Travail du sol",
60
- "value": "déchaumage pour niveler le terrain et un binage en Juin à 1cm"
61
- },
62
- {
63
- "name": "Type de semoir",
64
- "value": "trois passages de strip-till"
65
- },
66
- {
67
- "name": "Date de semis",
68
- "value": "22/03"
69
- },
70
- {
71
- "name": "Densité de semis",
72
- "value": "125mil graines/ha"
73
- },
74
- {
75
- "name": "Plantes compagnes",
76
- "value": "avoine/orge fermière, 20kg/ha"
77
- }
78
- ],
79
- "interventions": [
80
- {
81
- "day": 0,
82
- "name": "Semis",
83
- "type": "intervention_bottom",
84
- "description": "Semis des betteraves à J + 5"
85
- }
86
- ],
87
- "startDate": "2022-03-15",
88
- "endDate": "2022-11-01"
89
- },
90
- {
91
- "name": "Blé tendre",
92
- "color": "#edcc7d",
93
- "duration": 11,
94
- "attributes": [
95
- {
96
- "name": "Pré-semis",
97
- "value": "désinfection du grain au vinaigre (1L/100kg)"
98
- },
99
- {
100
- "name": "Travail du sol",
101
- "value": "aucun, semis direct pur"
102
- },
103
- {
104
- "name": "Type de semoir",
105
- "value": "semoir à dents"
106
- },
107
- {
108
- "name": "Date de semis",
109
- "value": "11/10"
110
- },
111
- {
112
- "name": "Densité de semis",
113
- "value": "125kg/ha"
114
- },
115
- {
116
- "name": "Plantes compagnes",
117
- "value": "orge fermière, 20kg/ha (implantation semoir à disque)"
118
- }
119
- ],
120
- "startDate": "2022-11-15",
121
- "endDate": "2023-10-15"
122
- },
123
- {
124
- "name": "Colza",
125
- "color": "#ebe733",
126
- "duration": 12,
127
- "description": "Travail du sol: aucun, semis direct pur, fissuration après récolte, avant le blé",
128
- "attributes": [
129
- {
130
- "name": "Type de semoir",
131
- "value": "semoir à dents"
132
- },
133
- {
134
- "name": "Date de semis",
135
- "value": "26/08"
136
- },
137
- {
138
- "name": "Densité de semis",
139
- "value": "2kg/ha"
140
- },
141
- {
142
- "name": "Plantes compagnes",
143
- "value": "feverole fermière, 60 pieds au m2"
144
- }
145
- ],
146
- "interventions": [
147
- {
148
- "day": -20,
149
- "name": "Labour",
150
- "type": "intervention_bottom",
151
- "description": ""
152
- },
153
- {
154
- "day": -15,
155
- "name": "Travail superficiel",
156
- "type": "intervention_bottom",
157
- "description": ""
158
- },
159
- {
160
- "day": -10,
161
- "name": "Fertilisation",
162
- "type": "intervention_bottom",
163
- "description": "Fertilisation - tsp_45 (180 kg)"
164
- },
165
- {
166
- "day": -10,
167
- "name": "Fertilisation",
168
- "type": "intervention_bottom",
169
- "description": "Fertilisation - potassium_chloride (125 kg)"
170
- },
171
- {
172
- "day": -5,
173
- "name": "Pulverisation",
174
- "type": "intervention_top",
175
- "description": "intervention_top - Proplus (0,4 l)"
176
- },
177
- {
178
- "day": 0,
179
- "name": "Semis",
180
- "type": "intervention_bottom",
181
- "description": "Semence - Capello (2 kg)"
182
- },
183
- {
184
- "day": 0,
185
- "name": "Semis",
186
- "type": "intervention_top",
187
- "description": "intervention_top - Anti-limaces (4 kg)"
188
- },
189
- {
190
- "day": 30,
191
- "name": "Pulverisation",
192
- "type": "intervention_top",
193
- "description": "intervention_top - Sweet Home (0,3 l)"
194
- },
195
- {
196
- "day": 120,
197
- "name": "Fertilisation",
198
- "type": "intervention_bottom",
199
- "description": "Fertilisation - ammonitrate_33 (178 kg)"
200
- },
201
- {
202
- "day": 150,
203
- "name": "Fertilisation",
204
- "type": "intervention_bottom",
205
- "description": "Fertilisation - ammonium_sulphate (90 kg)",
206
- "important": true
207
- },
208
- {
209
- "day": 165,
210
- "name": "Pulverisation",
211
- "type": "intervention_top",
212
- "description": "intervention_top - Boravi Wg (1 kg)"
213
- },
214
- {
215
- "day": 180,
216
- "name": "Fertilisation",
217
- "type": "intervention_bottom",
218
- "description": "Fertilisation - ammonitrate_33 (178 kg)"
219
- },
220
- {
221
- "day": 210,
222
- "name": "Pulverisation",
223
- "type": "intervention_top",
224
- "description": "intervention_top - Elifor (0,5 l)"
225
- },
226
- {
227
- "day": 225,
228
- "name": "Pulverisation",
229
- "type": "intervention_top",
230
- "description": "intervention_top - Karakas (0,05 l)"
231
- },
232
- {
233
- "day": 240,
234
- "name": "Pulverisation",
235
- "type": "intervention_top",
236
- "description": "intervention_top - Sunorg Pro (0,4 l)"
237
- },
238
- {
239
- "day": 255,
240
- "name": "Pulverisation",
241
- "type": "intervention_top",
242
- "description": "intervention_top - Boravi Wg (1 kg)"
243
- },
244
- {
245
- "day": 300,
246
- "name": "Récolte",
247
- "type": "intervention_bottom",
248
- "description": "Récolte - Rendement (30 q)"
249
- },
250
- {
251
- "day": 300,
252
- "name": "Transport",
253
- "type": "intervention_bottom",
254
- "description": ""
255
- }
256
- ],
257
- "startDate": "2023-10-01",
258
- "endDate": "2024-10-01"
259
- },
260
- {
261
- "name": "Repousses",
262
- "color": "#fff2cc",
263
- "duration": 1,
264
- "description": "",
265
- "startDate": "2024-10-01",
266
- "endDate": "2024-11-01"
267
- },
268
- {
269
- "name": "Blé tendre",
270
- "color": "#edcc7d",
271
- "duration": 11,
272
- "description": "",
273
- "startDate": "2024-11-01",
274
- "endDate": "2025-10-01"
275
- },
276
- {
277
- "name": "Couvert",
278
- "color": "#93c47d",
279
- "duration": 6,
280
- "description": "Couvert d'interculture longue pour casser le cycle des graminées",
281
- "attributes": [
282
- {
283
- "name": "Composition",
284
- "value": "trefle facscelie vesce, feverple,pois, lupin tournessol, avoine"
285
- },
286
- {
287
- "name": "Destruction",
288
- "value": "rouleau faca + gel"
289
- },
290
- {
291
- "name": "Densité",
292
- "value": "250 pieds/m²"
293
- }
294
- ],
295
- "startDate": "2025-10-01",
296
- "endDate": "2026-04-01"
297
- },
298
- {
299
- "name": "Lin textile",
300
- "color": "#efefef",
301
- "duration": 7,
302
- "attributes": [
303
- {
304
- "name": "Semis",
305
- "value": "Mars"
306
- },
307
- {
308
- "name": "Type de semoir",
309
- "value": "semoir à disques"
310
- },
311
- {
312
- "name": "Note",
313
- "value": "Très sensible à la compaction donc éloigné le plus possible de la récolte de betterave"
314
- },
315
- {
316
- "name": "Autre",
317
- "value": "Apport de BRF après lin, environ 10t/ha"
318
- }
319
- ],
320
- "startDate": "2026-04-01",
321
- "endDate": "2026-11-01"
322
- },
323
- {
324
- "name": "Blé tendre",
325
- "color": "#edcc7d",
326
- "duration": 11,
327
- "description": "",
328
- "startDate": "2026-11-01",
329
- "endDate": "2027-10-01"
330
- },
331
- {
332
- "name": "Couvert",
333
- "color": "#93c47d",
334
- "duration": 4,
335
- "description": "Couvert d'interculture court",
336
- "attributes": [
337
- {
338
- "name": "Date de semis",
339
- "value": "28/09 ou plus tôt"
340
- },
341
- {
342
- "name": "Composition",
343
- "value": "avoine/pois/feverole/vesce/fascelie/radis/lupin/tournessol"
344
- },
345
- {
346
- "name": "Densité",
347
- "value": "85 kg/ha"
348
- },
349
- {
350
- "name": "Destruction",
351
- "value": "26/01"
352
- },
353
- {
354
- "name": "Reliquats azotés",
355
- "value": "apporteront entre 20 et 40 u d'azote mobilisable"
356
- }
357
- ],
358
- "startDate": "2027-10-01",
359
- "endDate": "2028-02-25"
360
- }
361
- ]
362
- };
363
-
364
- // let renderer = new RotationRenderer('itk_chart', 'itk_text', rotationTest);
365
- // renderer.render();
366
-
367
- const rotationTest2 = {
368
- "title": "Itinéraire technique de ma ferme après modification",
369
- "timelineTitle": "Après",
370
- "options": {
371
- "view" : "horizontal",
372
- "show_transcript": true,
373
- "title_top_interventions": "Contrôle adventices",
374
- "title_bottom_interventions": "Autres interventions",
375
- "title_steps": "Étapes de la rotation dans la parcelle",
376
- },
377
- "steps": [
378
- {
379
- "name": "Féverole / Pois / Lin",
380
- "color": "#ff96b0",
381
- "description": "Tête de rotation avec un mélange de légumineuses",
382
- "startDate": "2022-03-15",
383
- "endDate": "2023-03-01"
384
- },
385
- {
386
- "name": "Blé tendre",
387
- "color": "#edcc7d",
388
- "duration": 11,
389
- "attributes": [
390
- {
391
- "name": "Pré-semis",
392
- "value": "désinfection du grain au vinaigre (1L/100kg)"
393
- },
394
- {
395
- "name": "Travail du sol",
396
- "value": "aucun, semis direct pur"
397
- },
398
- {
399
- "name": "Type de semoir",
400
- "value": "semoir à dents"
401
- },
402
- {
403
- "name": "Date de semis",
404
- "value": "11/10"
405
- },
406
- {
407
- "name": "Densité de semis",
408
- "value": "125kg/ha"
409
- },
410
- {
411
- "name": "Plantes compagnes",
412
- "value": "orge fermière, 20kg/ha (implantation semoir à disque)"
413
- }
414
- ],
415
- "startDate": "2023-03-15",
416
- "endDate": "2023-10-15"
417
- },
418
- {
419
- "name": "Colza",
420
- "color": "#ebe733",
421
- "duration": 12,
422
- "description": "Travail du sol: aucun, semis direct pur, fissuration après récolte, avant le blé",
423
- "attributes": [
424
- {
425
- "name": "Type de semoir",
426
- "value": "semoir à dents"
427
- },
428
- {
429
- "name": "Date de semis",
430
- "value": "26/08"
431
- },
432
- {
433
- "name": "Densité de semis",
434
- "value": "2kg/ha"
435
- },
436
- {
437
- "name": "Plantes compagnes",
438
- "value": "feverole fermière, 60 pieds au m2"
439
- }
440
- ],
441
- "interventions": [
442
- {
443
- "day": -20,
444
- "name": "Labour",
445
- "type": "intervention_bottom",
446
- "description": ""
447
- },
448
- {
449
- "day": -15,
450
- "name": "Travail superficiel",
451
- "type": "intervention_bottom",
452
- "description": ""
453
- },
454
- {
455
- "day": -10,
456
- "name": "Fertilisation",
457
- "type": "intervention_bottom",
458
- "description": "Fertilisation - tsp_45 (180 kg)"
459
- },
460
- {
461
- "day": -10,
462
- "name": "Fertilisation",
463
- "type": "intervention_bottom",
464
- "description": "Fertilisation - potassium_chloride (125 kg)"
465
- },
466
- {
467
- "day": -5,
468
- "name": "Pulverisation",
469
- "type": "intervention_top",
470
- "description": "intervention_top - Proplus (0,4 l)"
471
- },
472
- {
473
- "day": 0,
474
- "name": "Semis",
475
- "type": "intervention_bottom",
476
- "description": "Semence - Capello (2 kg)"
477
- },
478
- {
479
- "day": 0,
480
- "name": "Semis",
481
- "type": "intervention_top",
482
- "description": "intervention_top - Anti-limaces (4 kg)"
483
- },
484
- {
485
- "day": 30,
486
- "name": "Pulverisation",
487
- "type": "intervention_top",
488
- "description": "intervention_top - Sweet Home (0,3 l)"
489
- },
490
- {
491
- "day": 120,
492
- "name": "Fertilisation",
493
- "type": "intervention_bottom",
494
- "description": "Fertilisation - ammonitrate_33 (178 kg)"
495
- },
496
- {
497
- "day": 150,
498
- "name": "Fertilisation",
499
- "type": "intervention_bottom",
500
- "description": "Fertilisation - ammonium_sulphate (90 kg)",
501
- "important": true
502
- },
503
- {
504
- "day": 165,
505
- "name": "Pulverisation",
506
- "type": "intervention_top",
507
- "description": "intervention_top - Boravi Wg (1 kg)"
508
- },
509
- {
510
- "day": 180,
511
- "name": "Fertilisation",
512
- "type": "intervention_bottom",
513
- "description": "Fertilisation - ammonitrate_33 (178 kg)"
514
- },
515
- {
516
- "day": 210,
517
- "name": "Pulverisation",
518
- "type": "intervention_top",
519
- "description": "intervention_top - Elifor (0,5 l)"
520
- },
521
- {
522
- "day": 225,
523
- "name": "Pulverisation",
524
- "type": "intervention_top",
525
- "description": "intervention_top - Karakas (0,05 l)"
526
- },
527
- {
528
- "day": 240,
529
- "name": "Pulverisation",
530
- "type": "intervention_top",
531
- "description": "intervention_top - Sunorg Pro (0,4 l)"
532
- },
533
- {
534
- "day": 255,
535
- "name": "Pulverisation",
536
- "type": "intervention_top",
537
- "description": "intervention_top - Boravi Wg (1 kg)"
538
- },
539
- {
540
- "day": 300,
541
- "name": "Récolte",
542
- "type": "intervention_bottom",
543
- "description": "Récolte - Rendement (30 q)"
544
- },
545
- {
546
- "day": 300,
547
- "name": "Transport",
548
- "type": "intervention_bottom",
549
- "description": ""
550
- }
551
- ],
552
- "startDate": "2023-10-01",
553
- "endDate": "2024-10-01"
554
- },
555
- {
556
- "name": "Repousses",
557
- "color": "#fff2cc",
558
- "duration": 1,
559
- "description": "",
560
- "startDate": "2024-10-01",
561
- "endDate": "2024-11-01"
562
- },
563
- {
564
- "name": "Blé tendre",
565
- "color": "#edcc7d",
566
- "duration": 11,
567
- "description": "",
568
- "startDate": "2024-11-01",
569
- "endDate": "2025-10-01"
570
- },
571
- {
572
- "name": "Couvert",
573
- "color": "#93c47d",
574
- "duration": 6,
575
- "description": "Couvert d'interculture longue pour casser le cycle des graminées",
576
- "attributes": [
577
- {
578
- "name": "Composition",
579
- "value": "trefle facscelie vesce, feverple,pois, lupin tournessol, avoine"
580
- },
581
- {
582
- "name": "Destruction",
583
- "value": "rouleau faca + gel"
584
- },
585
- {
586
- "name": "Densité",
587
- "value": "250 pieds/m²"
588
- }
589
- ],
590
- "startDate": "2025-10-01",
591
- "endDate": "2026-04-01"
592
- },
593
- {
594
- "name": "Lin textile",
595
- "color": "#efefef",
596
- "duration": 7,
597
- "attributes": [
598
- {
599
- "name": "Semis",
600
- "value": "Mars"
601
- },
602
- {
603
- "name": "Type de semoir",
604
- "value": "semoir à disques"
605
- },
606
- {
607
- "name": "Note",
608
- "value": "Très sensible à la compaction donc éloigné le plus possible de la récolte de betterave"
609
- },
610
- {
611
- "name": "Autre",
612
- "value": "Apport de BRF après lin, environ 10t/ha"
613
- }
614
- ],
615
- "startDate": "2026-04-01",
616
- "endDate": "2026-11-01"
617
- },
618
- {
619
- "name": "Blé tendre",
620
- "color": "#edcc7d",
621
- "duration": 11,
622
- "description": "",
623
- "startDate": "2026-11-01",
624
- "endDate": "2027-10-01"
625
- },
626
- {
627
- "name": "Couvert",
628
- "color": "#93c47d",
629
- "duration": 4,
630
- "description": "Couvert d'interculture court",
631
- "attributes": [
632
- {
633
- "name": "Date de semis",
634
- "value": "28/09 ou plus tôt"
635
- },
636
- {
637
- "name": "Composition",
638
- "value": "avoine/pois/feverole/vesce/fascelie/radis/lupin/tournessol"
639
- },
640
- {
641
- "name": "Densité",
642
- "value": "85 kg/ha"
643
- },
644
- {
645
- "name": "Destruction",
646
- "value": "26/01"
647
- },
648
- {
649
- "name": "Reliquats azotés",
650
- "value": "apporteront entre 20 et 40 u d'azote mobilisable"
651
- }
652
- ],
653
- "startDate": "2027-10-01",
654
- "endDate": "2028-02-25"
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);
655
40
  }
656
- ]
657
- };
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
+ });
658
53
 
659
- let renderer2 = new RotationRenderer('itk_chart_2', 'itk_text_2', [rotationTest, rotationTest2]);
660
- renderer2.render();
661
54
  </script>
662
55
  </body>
663
56
 
@@ -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>