1
1
module SpeasyMakieExt
2
2
using Makie
3
+ using Dates
3
4
import Makie: convert_arguments
4
5
import Makie. SpecApi as S
5
6
import Speasy: SpeasyVariable
6
7
import Speasy: speasyplot, speasyplot!
7
8
9
+ """ Compatibility with Makie"""
10
+ _times (obj:: SpeasyVariable ) = DateTime .(obj. time)
11
+
8
12
convert_arguments (P:: PointBased , obj:: SpeasyVariable , i:: Integer ) =
9
- convert_arguments (P, obj. time , obj. values[:, i])
13
+ convert_arguments (P, _times ( obj) , obj. values[:, i])
10
14
convert_arguments (P:: Type{<:Series} , obj:: SpeasyVariable ) =
11
- convert_arguments (P, obj. time , obj. values' )
15
+ convert_arguments (P, _times ( obj) , obj. values' )
12
16
13
17
@recipe (SpeasyPlot, var) do scene
14
18
Theme ()
@@ -18,9 +22,9 @@ function Makie.plot!(p::SpeasyPlot)
18
22
var = p[1 ][]
19
23
if length (var. columns) > 1
20
24
labels = string .(var. columns)
21
- series! (p, var. time , var. values' ; labels)
25
+ series! (p, _times ( var) , var. values' ; labels)
22
26
else
23
- lines! (p, var. time , var. values)
27
+ lines! (p, _times ( var) , var. values)
24
28
end
25
29
return p
26
30
end
0 commit comments